Author Topic: Incorrect current measusrement of BLDC motor using ADC  (Read 413 times)

0 Members and 1 Guest are viewing this topic.

Offline jeet55Topic starter

  • Contributor
  • Posts: 19
Incorrect current measusrement of BLDC motor using ADC
« on: April 24, 2024, 12:58:14 pm »
I am controlling a BLDC motor using drv8301 and stm32, using trapezoidal control,
and taking position feedback using backemf using 3 opamps and current feedback using the drv's built in opamp.

Currently I am not measuring current by cycle by cycle basis of pwm but taking the average of the rectangle of pwm's as a whole.

I have configured adc sampling rate high enough to take multiple sample per cycle of pwm so we don't have to worry about that.

what problem I am facing is I assumed the current average to give me the phase current but the reading is off by a lot, when duty cycle is close to 100% the current reading is close to the actual but its incorrect and larger than actual current when duty cycle is low.

so I have to multiply the current average to the duty cycle to get a correct value. this doesn't make sense to me.
What I am missing here? maybe its obvious help me out here!



 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8184
  • Country: fi
Re: Incorrect current measusrement of BLDC motor using ADC
« Reply #1 on: April 27, 2024, 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.
« Last Edit: April 27, 2024, 04:43:50 pm by Siwastaja »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf