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.

[ARM] AC current regulation in BLDC controller

Status
Not open for further replies.

surendran_raj

Junior Member level 2
Joined
Aug 8, 2022
Messages
23
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
235
Hi,
I need to know about the AC current measurement for the BLDC motor. I tried to measure phase current for only one phase for two commutation state. I use the STM32F103C8 controller for controlling the BLDC motor. I need some clarification on measuring phase current for the BLDC motor. I use Timmer 1 to generate PWM and Timmer 4 for changes that occur in the commutation state (ie Step change occurs using XOR operation) and I am using the MOSFET Rdson method to measure the phase current (AC current) and ADC2 injected method for measuring the voltage drop on Rdson.

I tried to measure the phase current for only one phase (phase - B) for two commutation states(state1,state3). since the value, I get from ADC2 is varying So I tried to make an average of that ADC2 reading. I used TIM1 interrupt for PWM generation (15KHz) and for some calculation and that include summing up, the ADC2 reading, and the average part is done in TIM4. But it does isn't work again there is a variation in the reading. So is there any method for measuring phase current so that it helps me to measure the current.

The MOSFET Rdson method is that when the current is passed through the MOSFET there will be a voltage drop across the source to drain. the voltage drop is amplified by the OP-amp and the output is read in ADC2

Scope Image of the amplified signal

ac_b_1.png
ac_b_2.png
 

Hi,

there are differnt methods for AC measurement (current, voltage) .... and they have different results.
Different results does not generally mean the one is better than the other.

You need to choose the correct method for your application:
Let´s say you have a LED and a resistor in series, driven by PWM.
You want to measure current to calculate the power for
* the LED: --> use averaging current method (LED voltage is about independent of current)
* the resistor: --> use RMS current method (R voltage is proportional to current)

(for a 50% square wave 0mA/20mA
1) the average current is 10mA, while
2) the RMS current is 7.07mA)

Klaus
 
Last edited:

Hi,

there are differnt methods for AC measurement (current, voltage) .... and they have different results.
Different results does not generally mean the one is better than the other.

You need to choose the correct method for your application:
Let´s say you have a LED and a resistor in series, driven by PWM.
You want to measure current to calculate the power for
* the LED: --> use averaging current method (LED voltage is about independent of current)
* the resistor: --> use RMS current method (R voltage is proportional to current)

(for a 50% square wave 0mA/20mA the average current is 10mA, while the RMS current is 7.07mA)

Klaus
Hi,

Thanks for your response. I am using the resistor method to measure the AC current. I face some difficulties so the result obtain is not what I expected
I will say the step that I have done and please correct me if I was wrong or any other methods for controlling AC current in BLDC motor.
I am using STM32F103C8 controller. i have used two timers TIM1 , TIM4, and ADC2
TIM1 to generate PWM for 16KHz and i generate PWM in center align mode 1.
TIM4_IRQHandller is called whenever there is a change in steps or state of bldc motor. (ie 6 commutation states)
ADC2 is to measure the voltage drop across the source to drain of MOSFET. which is amplified by op-amp and read by ADC2. I have used ADC2 in the injected method so that I can read the voltage drop across the resistor at the center of the pulse.
I tried to measure the AC current in one phase (phase B). for that need to measure the voltage drop at the two-step (commutation steps).

But the value read in ADC2 is varying so I tried to take the average of it by summing the ADC2 value in TIM1 for two states and the average of that sum is taken in TIM4. But still, I found some variations so that I can't able to control the AC current in the BLDC motor.

Is any other steps or method to control the AC current.

Thank you.
 

Hi,

I guess you misunderstood my post.
With different methods I meant different mathematical methods to calculate different types of AC current.

With all AC calcuation methods you are free to choose the voltage drop of a MOSFET, a shunt, a current transformer, a hall sensor....

When I just wrote you are free to choose .... then a gain need to clarify:
When you measure then current in the MOSFET ... you can calculate the (RMS, average, or whatever) AC current in your MOSFET .. but I´m not sure if this represents the current of the motor.
--> Thus we need to see your schematic.

Now that you talk about motor current, I guess you need to use the "RMS" method.
In either case you need a constant and known sampling frequnecy and you need a suitable analog low pass filter in front of the ADC.

***********
Again:
for a 50% square wave 0mA/20mA
1) the average current is 10mA, while
2) the RMS current is 7.07mA

Both methods are on the same schematic on the same devices with the same voltages, the same currents and the same timing.
Both situations are absolutely identical.
Just the mathematical method ... and the results are different. But both results are valid! No method ist better than the other. You need to choose which result (method) is valid for your application.

Klaus
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top