1
Microcontrollers / Re: Incorrect current measusrement of BLDC motor using ADC
« Last post by Siwastaja on Today at 04:38:33 pm »Without seeing a schematic, I would guess it's the usual case: current is only flowing through the shunt resistor during the PWM ON-time. If you synchronize the measurement during on-time and assume the current stays constant during the whole switching period (which is fair assumption given high enough f_sw compared to motor inductance), then you know the true motor current; because it is also flowing during OFF-time, you are just not measuring it.
But if you sample randomly (and remember to take enough samples for correct average, at least tens of samples per period!), you are also reading zero during OFF time, when in reality current is flowing in the motor. In such case, you need to multiple by the reciprocal of duty cycle.
But the best idea is to synchronize the ADC, take many samples during on-time, and average them. Assuming enough load so that motor runs in CCM, then the same average is very closely true also during OFF-time. If you can only have one sample, take it at exactly the midpoint of ON-time, and you - theoretically - again have true average motor current, in CCM.
But if you sample randomly (and remember to take enough samples for correct average, at least tens of samples per period!), you are also reading zero during OFF time, when in reality current is flowing in the motor. In such case, you need to multiple by the reciprocal of duty cycle.
But the best idea is to synchronize the ADC, take many samples during on-time, and average them. Assuming enough load so that motor runs in CCM, then the same average is very closely true also during OFF-time. If you can only have one sample, take it at exactly the midpoint of ON-time, and you - theoretically - again have true average motor current, in CCM.