Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] 3 phase BLDC motor current measurement

Status
Not open for further replies.

moro

Member level 3
Joined
Jul 12, 2009
Messages
65
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
2,013
Hello,

i am working on a school project for controling a 3 phase bldc motor using a microcontroler ( stm32f429)

The motor characteristics can be found in the attached datasheet.

- 6 pole motor
- phase-phase resistance 0.24 Ohm
- PWM frequency is 25 KHZ
- rotor position is read with via hall sensors

For current measurement i use a 1 miliOhm shunt, buffed by a opamp with a gain of 33.33, and a reference offset of 1.65V

This is how the current voltage at the input of ADC looks like, and the 6 PWMs signals,

6pwm and phase current.PNG

Here is a bit zoomed in where you can see the ADC EOC end of conversion flag. Since there is no start of conversion flag, i presume the value is captured right after the rising edge of 1H pwm

logicEOCcaptureZoomed.png

I am attaching the current measurement circuit


currentMeas.PNG


For the tests i used a dutycycle of 10%.

The ADC capture is triggered by the PWM from the high side transitor.
Using the ADC end of conversion interrupt flag, i store the measured value and send it to the pc where i plot it to matlab

You can see the waveform ploted in matlab from the ADC readout
currentMatlab20duty.png



In the schematic attached i have placed a 0.22 ohm resistor, when the motor is running at 10% duty, i measure around 47mV (0.047V/0.22R = 0.2136A)

So the inverter circuit is drawing arround 213mA from the +24V supply.

Since the motor is having only 2 phases energized at a time, i presume the current trough each commutation period should be the same as on the +24V rail?

Suposing the same current is flowing trough the phase shunt, i should have a voltage of 0.001R x 0.213 A = 213 uV,

Amplified by a Gain of 33.33 i should have a 7.12 mV + 1.650V offset, thus i should read arround 1.657V.

From the matlab plot i can see i have a Peak voltage 1.86V, how can i scale down to get thouse 213mA from the measured voltage?

I tried to get the offset out, so 1.86 - 1.65 = 0.21 V

So in my shunt i theoretically read 0.21V/33.33 = 6.3mV, but if i divide this according to ohms law, i get 6.3mV/1mohm = 6.3 Amps!!

I also tried to see if the rms value fits, so ( 6.3mV x 0.707) / 1mOhm, but stil i get 4.45Amps, which is far away from the 210mA

I have very little experience with motors, but maybe you can share some light. My fear is that i am missing some thing in the maths
 

Attachments

  • DB59M024035-A.pdf
    120.5 KB · Views: 258

Two points to consider:
- the low side transistor current can't be directly related to DC bus current. There's a large recirculating current in the low side due to motor pwm.

- you may be picking up the shunt voltage incorrectly. 1 mOhm shunt needs separate source and sense connection.
 

Hello,

thank you for your remarks, regarding the sensing conection.

By this i hope you mean to sense the resistor voltage via separate trace from the "power ground" Or?

I have attached a schematic where you can see the actual routing of the GND on the pcb. What do you think?

gnd path.PNG
 

My idea of 4-wire connection is more like below

gnd path.PNG
 
  • Like
Reactions: moro

    moro

    Points: 2
    Helpful Answer Positive Rating
Hello FvM,

i modified the circuit acording to your schematic, now i come with the 3k resistors directly onto the shunt pins.

I measure almost the same values, as with the original circuit.


values2.PNG
 

Hi,

You don't measure the motor wiring current..you measure the low side source current.
It will be difficult to calculate the motor current from the measured value, because it depends on
* bridge drive mode
* motor parameters
* motor load (torque)
* motor RPM.

If you need motor winding current, then I recommend to measure it at the motor wires.

Klaus
 
  • Like
Reactions: moro

    moro

    Points: 2
    Helpful Answer Positive Rating
Hello Klaus,
The motor rpm is known from the hall sensor transition times
There is no load applied to the motor
In the datasheet there is a torque constant
(Nm/A)/Back-EMF (Vrms/kRPM) 0.046/3.8

Is there a mathematical link between these parameters and the voltage measured acorss the low side leg?

Concerning measurement direct on the motor wires, it is a bit dificult for me, because i have to redesign the entire pcb
 

You can basically estimate the winding current based on the low side measurement and known switching pattern.

Having an obviously very high phase current without load suggests a wrong phase commutation scheme.
 

Hello,

i am starting to think the same, that maybe the comutation sequence is not ok. Even though a movie which i uploaded here the motor seems fine, at least the FETs are not hot :)



In my setup the motor is connected as following:

W phase - FETs 1H & 1L
U phase - FETs 2H & 2L
V phase - FETs 3H & 3L


i have attached the comutation logic based on a table provided in the motors datasheet

Capture3.PNG

Before we discuss more details i want to clarify something, i have marked with 1,2,3 the voltages, now i presume i need to switch the transistors so those voltage levels in respect with the hall signals.

So i am a bit confused now, which phase is 1,2,3 from the datasheet? W,U,V?
 

Hello, i have crosschecked the commutation sequence with Microchip AN1083 pdf, and it is ok.

I wil modify the design to sense the phase current like Klaus suggested. I will use a INA240 from Texas Instruments, each channel will be buffered by OPAMP before feding the signal to the MCU's adc channel
 

Since i am working on the new hardware design for this motor control setup, i was wondering to add the feature for measuring the back emf voltage, only to measure it.

Is it enough to place some resistive divider between each phase and ground, and a smal rc filter, before feding direct to the ADC input?

Is this variant feasible, or i need virtual ground network also?
 

your op-amp may not be good enough to buffer a 1 milli ohm shunt, 1mV = 1A, if your op amp has a gain of 50, and an input offset of 5mV, then the output can contain an error of up to 250mV, make the shunt R bigger and/or use a much better op-amp, in reality the Vio of the op-amp would need to be in the 10uV region to give you accurate readings ...
 
  • Like
Reactions: moro

    moro

    Points: 2
    Helpful Answer Positive Rating
This aspect i missed , i didn't thought about the input/output offset of the opamp.

The original design is using MCP6004 opamp, and i have checked the datasheet, its input offset can vary from -4.5mV to 5mV which in my case is huge.

I have studied the OPA4317 opamp, this one seems more suitable, its input offset is in the range of 0.02 - 0.1mV

I try this OPA for the current design, and increase the shunt resistor from 1 to 10 miliohms, and check again the behaviour
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top