28335的永磁同步电机控制控制程序中的ILEG2DCBUSMEAS模块,用来输出ADC采集回来的电流值Id,Iq和DC BUS,头文件中有一段注释看不明白,这个gain值为什么这样算啊?
// Note: Assuming the base DC-bus voltage is 24 volt //- ADC input for Vdc_bus range is 24*1/(24.9+1) = 0.927 volt on DMC550 //- Then, Vdc_bus gain = 3.0/0.927 = 3.2375 (or 0x675C in Q13)
typedef struct { int16 ImeasAGain;// Parameter: gain for Ia (Q13)int16 ImeasAOffset;// Parameter: offset for Ia (Q15)int16 ImeasA;// Output: measured Ia (Q15)int16 ImeasBGain;// Parameter: gain for Ib (Q13)int16 ImeasBOffset;// Parameter: offset for Ib (Q15)int16 ImeasB;// Output: measured Ib (Q15)int16 VdcMeasGain;// Parameter: gain for Vdc (Q13)int16 VdcMeasOffset; // Parameter: offset for Vdc (Q15)int16 VdcMeas;// Output: measured Vdc (Q15)int16 Vcontrol;// Output: V control for speed reference (Q15)int16 ImeasC;// Output: computed Ic (Q15)Uint16 ChSelect;// Parameter: ADC channel selectionvoid (*init)();// Pointer to the init functionvoid (*read)();// Pointer to the read function} ILEG2DCBUSMEAS; typedef ILEG2DCBUSMEAS *ILEG2DCBUSMEAS_handle; /*----------------------------------------------------------------------------- Note 1 : It is necessary to call the init function to change the ADCregister settings, for the change in the channel setting forChSelect setting changes to take effect.The read function will not detect or act upon this change. -----------------------------------------------------------------------------*/ // Default Initializer for the ILEG2DCBUSMEAS Object // DMC1500 + eZdsp2808: ChSelect = 0x0710 //这里的DMC1500和DMC500是什么? // DMC550 + eZdsp2808: ChSelect = 0x0610 // Note: Assuming the base DC-bus voltage is 24 volt //- ADC input for Vdc_bus range is 24*1/(24.9+1) = 0.927 volt on DMC550 //- Then, Vdc_bus gain = 3.0/0.927 = 3.2375 (or 0x675C in Q13) #define F28335_ILEG2_DCBUS_MEAS_DEFAULTS { 0x1FFF,0x0000,0x0000,\0x1FFF,0x0000,0x0000,\0x1FFF,0x0000,0x0000,\0x0000,0x0000,0x0710,\(void (*)(Uint32))F28335_ileg2_dcbus_drv_init, \(void (*)(Uint32))F28335_ileg2_dcbus_drv_read \} #define ILEG2DCBUSMEAS_DEFAULTS F28335_ILEG2_DCBUS_MEAS_DEFAULTS
Green Deng:24*1/(24.9+1)应该是计算24v在DMC550上的分压,然后再计算增益,再将增益值转化成Q13格式
28335的永磁同步电机控制控制程序中的ILEG2DCBUSMEAS模块,用来输出ADC采集回来的电流值Id,Iq和DC BUS,头文件中有一段注释看不明白,这个gain值为什么这样算啊?
// Note: Assuming the base DC-bus voltage is 24 volt //- ADC input for Vdc_bus range is 24*1/(24.9+1) = 0.927 volt on DMC550 //- Then, Vdc_bus gain = 3.0/0.927 = 3.2375 (or 0x675C in Q13)
typedef struct { int16 ImeasAGain;// Parameter: gain for Ia (Q13)int16 ImeasAOffset;// Parameter: offset for Ia (Q15)int16 ImeasA;// Output: measured Ia (Q15)int16 ImeasBGain;// Parameter: gain for Ib (Q13)int16 ImeasBOffset;// Parameter: offset for Ib (Q15)int16 ImeasB;// Output: measured Ib (Q15)int16 VdcMeasGain;// Parameter: gain for Vdc (Q13)int16 VdcMeasOffset; // Parameter: offset for Vdc (Q15)int16 VdcMeas;// Output: measured Vdc (Q15)int16 Vcontrol;// Output: V control for speed reference (Q15)int16 ImeasC;// Output: computed Ic (Q15)Uint16 ChSelect;// Parameter: ADC channel selectionvoid (*init)();// Pointer to the init functionvoid (*read)();// Pointer to the read function} ILEG2DCBUSMEAS; typedef ILEG2DCBUSMEAS *ILEG2DCBUSMEAS_handle; /*----------------------------------------------------------------------------- Note 1 : It is necessary to call the init function to change the ADCregister settings, for the change in the channel setting forChSelect setting changes to take effect.The read function will not detect or act upon this change. -----------------------------------------------------------------------------*/ // Default Initializer for the ILEG2DCBUSMEAS Object // DMC1500 + eZdsp2808: ChSelect = 0x0710 //这里的DMC1500和DMC500是什么? // DMC550 + eZdsp2808: ChSelect = 0x0610 // Note: Assuming the base DC-bus voltage is 24 volt //- ADC input for Vdc_bus range is 24*1/(24.9+1) = 0.927 volt on DMC550 //- Then, Vdc_bus gain = 3.0/0.927 = 3.2375 (or 0x675C in Q13) #define F28335_ILEG2_DCBUS_MEAS_DEFAULTS { 0x1FFF,0x0000,0x0000,\0x1FFF,0x0000,0x0000,\0x1FFF,0x0000,0x0000,\0x0000,0x0000,0x0710,\(void (*)(Uint32))F28335_ileg2_dcbus_drv_init, \(void (*)(Uint32))F28335_ileg2_dcbus_drv_read \} #define ILEG2DCBUSMEAS_DEFAULTS F28335_ILEG2_DCBUS_MEAS_DEFAULTS
user6162331:
回复 Green Deng:
Dear Green Deng:
如果是这样的话,我们没有用DMC550,IPM模块是用DRV8353R芯片自己设计的电路,这个增益值gain是不是要根据我们输入到ADC端的Vdc-bus电压值的范围来算啊?就是说,假如我们的ADC端Vdc-bus电压的最大值就是3V,那么我的增益值就设成1(Q13格式下为0x1FFF)就好了是吗?