This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28379D: Some problem about SDFM scale factor in IDDK_PM_Servo_F2837x-2v code.

Part Number: TMS320F28379D


Hello. This is Chen.

I am using Industrial Drive Dev Kit - IDDK - R 2.2.1. I have a question about the SDFM scale factor.

I ran the system in Level 4 and used oscilloscope to check the waveform of "current_sensor[SD_CURRENT_SENSE-1].As" and "current_sensor[LEM_CURRENT_SENSE-1].As" at the same time. Theoretically, the amplitudes of these two variable should be the same, but I found that the amplitude of SDFM output is 4 times of that of LEM output. So do you know what causes the phenomenon? Thanks.

The followings are the code I used, I didn't change anything in current_sensor. The attached is the waveform of these two variables, channel 1 is output of LEM and channel 3 is output of SDFM.

#define ADC_PU_SCALE_FACTOR 0.000244140625 //1/2^12
#define ADC_PU_PPB_SCALE_FACTOR 0.000488281250 //1/2^11
#define SD_PU_SCALE_FACTOR 0.000030517578125 // 1/2^15

current_sensor[SD_CURRENT_SENSE-1].As = ((temp=SDFM1_READ_FILTER1_DATA_16BIT)*SD_PU_SCALE_FACTOR -
offset_SDFM1) * SDFM_TO_SHUNT;
current_sensor[SD_CURRENT_SENSE-1].Bs = ((temp=SDFM1_READ_FILTER2_DATA_16BIT)*SD_PU_SCALE_FACTOR -
offset_SDFM2) * SDFM_TO_SHUNT;
current_sensor[SD_CURRENT_SENSE-1].Cs = -current_sensor[SD_CURRENT_SENSE-1].As
-current_sensor[SD_CURRENT_SENSE-1].Bs;

DacbRegs.DACVALS.bit.DACVALS = (current_sensor[LEM_CURRENT_SENSE-1].As*0.5+0.5)*4096;
DaccRegs.DACVALS.bit.DACVALS = (current_sensor[SD_CURRENT_SENSE-1].As*0.5+0.5)*4096;