Motor Controller Theory - How Does It Work?

mclovin

100 W
Joined
Apr 4, 2009
Messages
184
Location
Seattle
Hi All,
As the subject title states this is an open question. How exactly do DC motor controllers use PWM "signals" to control motor speed?

Let me state that I do understand DC motor theory. I know that Torque is proportional to applied current and that RPMs are porportional to applied voltage etc. I get all that. But what I don't get is why my WE 20A controller for a brushed DC motor always has a voltage of 36V accross the motor supply leads even when the thumb throttle is not engaged. What am I missing?
 
This might be a good start:

http://www.4qdtec.com/pwm-01.html

Edit: in that document, the term "flywheel" is used where "freewheel" might be seen in other documents; referring to diodes or mosfets that manage inductance related current.
 
mclovin said:
But what I don't get is why my WE 20A controller for a brushed DC motor always has a voltage of 36V accross the motor supply leads even when the thumb throttle is not engaged. What am I missing?

Your voltmeter does not put any 'load' on the output like a motor would. If you measured with the motor connected, it might look closer to reality. If you attached even a household light bulb to where the motor goes, the load of the bulb would give a fairly accurate reading. The transistor switches in the controller have some 'leakage' that is apparently enough to make your meter read full voltage. Even the slightest load resistance will cause this to drop. Many digital meters will not give an accurate reading with a PWM signal, so take readings with a grain of salt.
 
Ahah! Now I get it. The "leakage" voltage idea explains a lot.....And the tech publication fills in a lot of gaps. Thanks guys!

So, then the "command" voltage applied to the motor is proportional to the throttle signal going to the controller (in general). What physically limits the current at the controller? Of course the motor windings and motor speed "limit/establish" current needed by the motor but what phyically limits the controller - in my case - to 20A?
 
mclovin said:
So, then the "command" voltage applied to the motor is proportional to the throttle signal going to the controller (in general). What physically limits the current at the controller? Of course the motor windings and motor speed "limit/establish" current needed by the motor but what phyically limits the controller - in my case - to 20A?

No, the voltage is constant, but it's pulsed on and off, giving an effective voltage of roughly the average between the on time and the off time of the pulse. the part that is proportional to the throttle is the pulse width.

The current is limited by a sensor detecting the voltage drop across a shunt, when the current is high enough, that voltage(in mili to micro volts) triggers a gate on the controll circuit that will reducethe "on" pulses of the controller.
The pulses are happening at 16KHZ or higher depending on the controller, so the reaction time is very fast.
 
Drunkskunk said:
No, the voltage is constant, but it's pulsed on and off, giving an effective voltage of roughly the average between the on time and the off time of the pulse. the part that is proportional to the throttle is the pulse width.

I see. So if I look at the voltage of the motor pusles they will be 36V (in my case) but when the pulse on and off-time is "averaged" (RMS value or something like that I suppose) it will be some averaged voltage value = X? And my throttle action is changing the pulse rate (or maybe the "on" duration)? If yes then that it makes sense to me.

So let me expand on my question. When the motor pulse switches to off I think there are a couple things that happen: 1) the current in the windings induce a voltage spike in the controller and 2) additional heat is generated by the MOSFETS (or whatever) during the shutting-off - and I guess during the turning on as well?
 
Yes, the pulses will be 36v. When the controller switches off, the magnetic field in the motor windings collapses and generates a voltage spike. This spike is circulated by the diode(s) in the controller to maintain current in the windings during the off period. Most brushless controllers use the diode that's built into the FET. Brushed controllers usually have a separate diode. The "freewheel diode" will dissipate some heat.
 
Thanks Fechter. I suspect that when you say that, when the pulse is off, the motor current circulates in the controller that's where the capacitors come into play? Or is that more for managing the voltage spike.....or both?

Another area that is fuzzy for me is the "delivery" of the current to the motor. I'm sure that the current only flows when the PWM signal is on but when it is on what is the value of the current? Let me explain.

In general terms in a "standard" DC motor the current is determined by the resistance of the windings and the voltage (V=IR) minus the effects of the back EMF. So at any given motor speed and torque the current will be at some value Xamps. But if the PWM signal delivers an "average" value that would mean the current draw during the FET on cycle is higher than Xamps needed by the motor. If this is correct then how does the motor draw a higher PWM current?
 
mclovin said:
I see. So if I look at the voltage of the motor pusles they will be 36V (in my case) but when the pulse on and off-time is "averaged" (RMS value or something like that I suppose) it will be some averaged voltage value = X? And my throttle action is changing the pulse rate (or maybe the "on" duration)? If yes then that it makes sense to me.

Exactly, but I should point out that No Digital Volt meter can actualy measure PWM. DVM measure voltage by sampling it, at the rate of1/4 second to once every 2 seconds, depending on the meter. its entirly possable for the sample to be taken in the off phase of the PWM and you read no voltage. or to catch the back EMF spike and read way over voltage.
you also can't measure accuratly across just 2 wires, since at any point the wire is either hot or ground for one of the 3 coil sets.

You can get a rough average measurement with an analog meter, but its not accurrate. Only an Osyliscope can give you a true reading of the voltage on the output
 
mclovin said:
In general terms in a "standard" DC motor the current is determined by the resistance of the windings and the voltage (V=IR) minus the effects of the back EMF. So at any given motor speed and torque the current will be at some value Xamps. But if the PWM signal delivers an "average" value that would mean the current draw during the FET on cycle is higher than Xamps needed by the motor. If this is correct then how does the motor draw a higher PWM current?

The resistance formula really only applies at full speed (100% duty cycle). During PWM, when the FET just turns on, the current starts low and climbs steadily due to the inductance of the motor windings. When the FET turns off, there is no more current draw from the battery, but the freewheel diode will continue to circulate current in the motor. At low duty cycles, the average motor current may be several times what the average battery current is. I measured around 4x higher at the peak with my BMC motor. At very low duty cycles, the freewheel diode 'runs out of flux' and the motor current drops to zero for a time. This is called discontinuous operation and results in less heating under those conditions. Somewhere in that 4QD tutorial, it expains this fairly well.

With most controller configurations, when the FET switches off, the circulating current from the motor wants to go back to the battery in the form of a high voltage spike. This is where the capacitors come in. The capacitors absorb this spike and keep the peak voltage close to the average voltage. Without adequate capacitors, the peak voltage can exceed the FET rating and cause self-destruction. The capacitors also supply some current during the on cycle, reducing the battery current. The amount supplied equals the amount absorbed, minus heat losses.

If you do a google search on "buck converter" you will find better explainations of how this works. A motor controller with PWM works the same as a buck converter.
 
when the duty cycle is low, the flyback current should still be present, but can be blocked by the body diode and stored in the capacitance alongside? which is the no flux idea?

on the infineon controllers, i have noticed that the hiside or flyback FETs can be fewer in number than the driver side FETs. from that i have assumed that the flyback currents are substantially smaller, but how much are they and is that a function of the duty cycle too?

flyback current should be highest when the driver current is highest. seems logical, and follows the duty cycle up. but on the hiside fewer FETs are needed to carry it, when turned on after the drivers are turned off, because that current is dropping off for the remainder of the cycle?

i recommend the 4QDtek.uk tutorial on pwm controllers too.

the big pictures that doc used in the 18FET infineon thread make it easier to follow the layout of the circuits for the drivers on the pcb, plus jeremy and wayne analyzing the circuit.

and knuckles' tutorials on the infineon are sooooo educational too. and richard analyzed the shenzen ecrazyman controller until the need for overclocking led to the infineon intro. and there is the old C'lyte controller thread too.

good stuff because you can get out your controller, take it apart, and actually see the stuff, with a magnifying glass usually.
 
All,
Thanks for the spot-on technical insights and reasearch suggestions! I trully appreciate you all taking the time and having patience to explain this stuff.

I will dig into these research topics for a while and post questions here after I'm properly studied-up.
 
OK. So I read most of the informational links. (For some reason I can't get all the 4QD stuff to download from the website). But I still question how the motor controller can deliver the "theoretical" current demand to the more.....or does it?

I mean, if you you plug a battery directly into a motor on an ebike (no controller) the bike will increase in speed until it reaches some steady state speed. At that steady state speed the motor will draw some steady state current. But if you throw in a PWM controller into the mix it seems like the average curent supplied will be less than the with no controller. I suspect that any torque loss is "minimal" depending on the switching speed of the FETs, the power disipation of the freewheel diodes (which can be mitigated by the FET diodes) and heat loss in the motor windings. If my understanding is correct then a PWM based controller naturally introduces a loss of torque when compared to mathematical (non-PWM) model.

One thing that I did not garner from my reading assignment was how the current sensing shunt affects the current. Maybe I just missed but does it change the pules (i.e. alters the off time period)? Does the shunt's behavior increase heat in the FETs?
 
mclovin said:
.....

I mean, if you you plug a battery directly into a motor on an ebike (no controller) the bike will increase in speed until it reaches some steady state speed. At that steady state speed the motor will draw some steady state current. But if you throw in a PWM controller into the mix it seems like the average curent supplied will be less than the with no controller. I suspect that any torque loss is "minimal" depending on the switching speed of the FETs, the power disipation of the freewheel diodes (which can be mitigated by the FET diodes) and heat loss in the motor windings. If my understanding is correct then a PWM based controller naturally introduces a loss of torque when compared to mathematical (non-PWM) model.


2 things to remember here. The first is that a conventional 2 pole motor is generating it's own form of PWM by means of the brushes. As each contact pad moves to the brush, and then away, the power is switched on and off. Sometimes this switches the power completely off, sometimes the design allows for the next contact to be powering up while the first pad still has power, but the effect is such that no conventional 2 pole motor has constant voltage and current internaly.
The other point here is the over all efficiency. A 3 pole brushless motor is more efficient at turning watts into work, and so even though the PWM has periods of time when no power is supplied, more work is done per watt,

mclovin said:
One thing that I did not garner from my reading assignment was how the current sensing shunt affects the current. Maybe I just missed but does it change the pules (i.e. alters the off time period)? Does the shunt's behavior increase heat in the FETs?

The shunt its self does nothing. its only use is as a passive sensor. It is a fixed and constant resistance so the voltage drop across it can be used to calculate the total amperage used in the system.
The controller uses that information to adjust the PWM only if the current goes above a threshold.
The Shunt is an extra feature of Ebikes and other vehicles, and isn't needed for the motor to work. There is no such device in R/C brushless controllers.
 
Thanks Drunkskunk. It sounds like a brushless motor is a more elegant design than brushed.

All,
Do you have any suggestions for books or research materials for gaining deeper understanding of the technology of electric motors and their controllers? I've read "Electric Motors and Drives" by Austin Hughes. It was very informative but was only an introductory technical book. I'm looking for the "next step" to further my understanding. At this point I'm trying to unserstand electric motors to the point where I can create a performance graph (torque, speed, current etc.). FYI My background is in mechanical engineering (with an emphasis on automated controls) so I can handle fairly technical stuff as long as it isn't too esoteric. Ultimately I want to be able model a complete ebike system that includes all relavant dynamic and static inputs like rolling resistance, wind resistance, gearing, road grade, performace parameters etc.

Thanks for your help.
 
The "next step" would be a step backwards. To realy go further into the design of electromotors, you need to be an electrical engineer. An electric motor is a simple end to a vast array of specalized fields of study.

Start with the basics, Volts, Ohms, Amps. Then Watts, Farads, and Henreys. Study Ohm's law, Coulomb's law, and Lenz's law.
when you have an accidemic grasp on those, move on to Basic AC and DC theory. After understanding the math behind both AC and DC you will be ready to start reading the various works on Tesla and the way frequancy affects electricity.

you will also need a good knowledge of:
Electromagnets
Perminate magnets
metalurgy
theromdynamics
IC componant theory
IC circuit design
Mechanical engineering
 
Well, I certainly have the mechanical engineering and thermodynamics down...heat transfer too though it's been a while. And I guess I'll need to crack open my circuit analysis book from 20 years ago.

Short of all this I would expect that there is an equivelant circuit that can be used for modeling a control system and for predicting the actual current demand on the battery pack.

I can model the mechanical system, determine the energy needed for a desired performance (i.e. 250 lbsf up a 5% hill at 20 mph with a 5 mph head wind) but I fall flat when it comes to modeling the electrical system (with any degree of certainty that is). I could approximate a circuit with an inductor, resistor and negative EMF but, after diving into this topic here, I strongly suspect that is not accurate enough for my purposes. If I can figure out a mathematical model of a motor that is reasonably accurate I'll be able to do some predictive engineering in regards to performance for bike set ups (a complete electro-mechanical system model). Hopefully it will be useful to the community to have some predictive methods for performance rather than relying upon tribal knowledge and gut feel (that can get expensive).

So, that's where I'm headed. Maybe I'm just re-inventing the wheel as I have seen plenty or motor performance graphs here. Or, perhaps this is a topic for another thread.

Let me know what you think.
 
Hello All,
I'm starting this thread back up because I have more questions. :)

I've been digging further into controllers and ...wel I'm a little confused about what happens to the current once the battery pack suplies it to the ESC.

Until recently I thought that the batts. supply current equal to I=V/R during the FET on-duty cycle and that when the duty cycle is off the current in the armature freewheels through the coils (slowly decaying in accordance with V=L*di/dt). But I have read a few strings that would suggest that the current is somehow multiplied in the ESC and that the armature current can exceed the supply current.

Am I getting this right? If so WTF? :roll:

Cheers.
 
actually you are right on. the impedance of the motor windings is very low compared to the impedance presented by the controller FETs. so voltage stays high on the supply side, and drops when it makes it through the FETs.
 
mclovin said:
But I have read a few strings that would suggest that the current is somehow multiplied in the ESC and that the armature current can exceed the supply current.Am I getting this right? If so WTF?
From the 4qd document:
"You should see from the above that, if the drive MOSFET is on for a 50% duty cycle, motor voltage is 50% of battery voltage and, because battery current only flows when the MOSFET is on, battery current is only flowing for 50% of the time so the average battery current is only 50% of the motor current!"
 
TylerDurden said:
mclovin said:
But I have read a few strings that would suggest that the current is somehow multiplied in the ESC and that the armature current can exceed the supply current.Am I getting this right? If so WTF?
From the 4qd document:
"You should see from the above that, if the drive MOSFET is on for a 50% duty cycle, motor voltage is 50% of battery voltage and, because battery current only flows when the MOSFET is on, battery current is only flowing for 50% of the time so the average battery current is only 50% of the motor current!"

Ok, that makes sense when I consider that the energy stored in the armature is discharging during the FET off cycle.

Please check my logic:
1) At 100% duty cycle the system is governed by V=I*R and so forth.
2) At D<100% things change. When the drive FETs are "on" the current flowing from the battery will equal (more or less) the current flowing through the motor. And the current rises a bit as the armature coils store energy.
3) Then when the FETs are "off" the battery current ceases (and the voltage spike is "absorbed" by the battery caps) and the armature coils discharge and freewheel through the diode (or FET). At this state I can say that I(battery)=0, I(load)=(insert appropriate discharge equation here).

So, if I have it right, this behavior is more pronounce at low duty-cycle/high-load situations and could result in some pretty high instantaneous batt. currents?
 
Back
Top