c++ - 电力电子数据中显示滤波的要求
问题描述
我正在尝试使用编译器 V.6.0.2 调试复杂的固件 CCS V.5 程序。我的控制代码可以通过 PC 程序访问。我的应用程序的所有寄存器都是定制的。我的目标是显示特定的通道电压,但逻辑上的数学代码应该是可以理解的。开始了
void DispFiltering1(void)
{
float k;
float in_data;
///////////////////////////////////////////////////////////////////
in_data = Register[CH1_VOLTAGE] * 1000 - Vfilt_16;
dVfilt_16 = in_data + (dVfilt_16 * 0.5f);
idvfilt_16 += dVfilt_16;
k = (int)(idvfilt_16 * timeconst_inverse_16);
idvfilt_16 -= k * timeconst_16;
if(k < -slewrate_16) Vfilt_16 -= slewrate_16;
else if(k > slewrate_16) Vfilt_16 += slewrate_16;
else Vfilt_16 += k;
Register[DISP_CH1_VOLTAGE] = Vfilt_16 * 0.001;
///////////////////////////////////////////////////////////////////
in_data = Register[CH1_CURRENT] * 1000 - Vfilt_17;
dVfilt_17= in_data + (dVfilt_17 * 0.5f);
idvfilt_17 += dVfilt_17;
k = (int)(idvfilt_17 * timeconst_inverse_17);
idvfilt_17 -= k * timeconst_17;
if(k < -slewrate_17) Vfilt_17 -= slewrate_17;
else if(k > slewrate_17) Vfilt_17 += slewrate_17;
else Vfilt_17 += k;
Register[DISP_CH1_CURRENT] = Vfilt_17 * 0.001;
}
如果您能解释为什么在这里需要过滤、转换率和时间常数,我会很高兴?
解决方案
推荐阅读
- html - 可以在粘贴事件中检测剪贴板数据,但不能在剪切或复制事件中检测
- java - 如何修复循环以获取我传递的值作为参数?
- excel - Excel VBA 复制过滤并粘贴到另一个选项卡
- javascript - JavaScript 的 Fetch 可以用来更新 Rails 控制器中的参数值吗?
- php - 饼干罐 。排队返回空 - Laravel
- heroku - Heroku 上的 Socket.IO / Express / Nuxt?
- javascript - javascript - 如何使这个数组工作?
- python - 如何在 python 中将我的文本文件分割成段落?
- numpy-ndarray - 用 (-1,1) 重塑 numpy 中的数据。这是什么意思?
- c# - 有没有办法在 Uri 中为 HttpClient 发送转义句点字符