Tuesday, December 25, 2018

How to estimate the torque of a BLDC (PMSM) electric motor using only its Kv and current draw

There exists a fundamental relationship between an electric motors velocity constant `(K_{V}),` armature* current `(I_{A})` and torque `(\tau)`This relationship is as follows:

`\tau \approx  \frac{8.3 \times I_{A} }{K_{V}}`

were `\tau` is in N.m, `I_{A}` is in A and  `K_{V}` is in RPM/V. This relationship is extremely useful since most 'hobby grade' BLDC/PMSM manufacturers do not publish the usual motor constants you would expect from an industrial product while `K_{V}` and peak `I_{A}` is normally specified on sites like hobbyking.com.

The above relationship works for two reasons:
  1.  A motors `K_{V}` and its torque constant `(K_{\tau})` are fundamentally the same thing.
  2.  The torque generated by a motor for a given current is governed by `K_{\tau}`.
Of course, there are limitations to this approach. If a motor is close to saturation or if the current waveform supplied by a motor controller does not exactly match a motors back EMF waveform (i.e. the current is not exactly on the q-axis at all times) then your torque will be less than that suggested above. However, my own testing shows that this approximation is quite accurate when a 'hobby grade' PMSM motor is driven using field oriented control (FOC). Even when not using FOC or a PMSM this approach should still provide a good starting point.

Read on if you are interested in a more detailed understanding of why this relationship works and the limitations of this approach.

Fundamental torque production

Electric motors do useful work by producing torque and rotation. The amount of steady state torque produced by a well optimised and non-salient machine** with a specific volume (specific torque density) is ultimately dependent upon three factors:
  • The average flux density acting upon the armature. For a BLDC/PMSM motor this 'flux' is provided by the rotor's permanent magnets.
  • The average current that can be maintained by the armature without overheating**. For a BLDC/PMSM motor the armature consists of the copper windings in the stator.
  • The total length of the armature windings which has 'flux' acting upon it. For a BLDC/PMSM motor this length represents the number of turns of wire in the stator armature which interact with the 'flux' provided by the rotor.
In other words, all the complexity of an electric motor ultimately boils down to the "BIL" Lorentz force law:

Force = Magnetic field `\times`Current`\times` Conductor length

Increase one of the above terms without negatively impacting another and you have increased the torque output of your system. When discussing motor constants I find it useful to keep this simple relationship in mind.

Velocity constant  = Torque constant

In the 'hobby' community most people seem comfortable with the concept of a motors velocity constant `(K_{V})`. `K_{V}` is easily measured and is given by half the peak to peak back EMF generated line to line (across any two motor leads) for a given mechanical frequency with a unit RPM/V. 

What seems less well understood is that an electric motors torque constant `(K_{\tau})` is equal to `K_{V}` so that
`K_{\tau}^* = K_{V}^*`

where here `K_{\tau}^*` is a motors per-phase torque constant and `K_{V}^*` is a motors per-phase velocity constant given by half the peak to peak back EMF generated line to neutral (from the centre tap point on a star wound motor) for a given electrical frequency (Elec. Freq. = Mech. Freq. / No. Pole Pairs) with the units `\frac{V \cdot S}{rad}`.


When first learning about electric motors it took me a while to accept that `K_{\tau}^*` does indeed equal to `K_{V}^*`. The mathematics is clear and their SI units are equivalent but something about it just didn't feel right. To overcome this I find it helps to keep in mind that all aspects of an electric motor which impact its `K_{V}^*` (e.g. flux gap size, magnet strength, winding turn number, rotor length etc.) also impact the amount of torque a motor can produce for a given current.

 `K_{V}^*` is not especially useful since we are normally interested in a motors 'total torque constant' produced by all three phases and not that of a single phase. The 'total torque constant' of a 3 phase PMSM as estimated using its line-line `K_{V}` (RPM/V) is instead given by

`K_{\tau} = \frac{3}{2} \times \frac{1}{\sqrt{3}}\times \frac{60}{2\pi} \times \frac{1}{K_{V}}`

As is discussed by Oskar Weigl here, the factor `\frac{3}{2}` is derived from eq. 3.2 in this paper, the `\frac{1}{\sqrt{3}}` is for converting the line-line voltage (which is what is commonly used by hobby motor manufacturers in the determination of the `K_{V}`) to phase voltage (example here) and `\frac{60}{2\p}` is to convert from rpm to rad/s, which is needed to estimate the torque constant from the voltage constant, due to the voltage constant being specified in units of RPM/V. 

Torque constant determines torque output for a given current

`K_{\tau}` is also defined as

`K_{\tau} = \frac{\tau}{I_{A}}`

where  `I_{A}` was the armature current. Therefore the 'overall torque' output of a 3 phase PMSM is given by

`\tau = \frac{3}{2} \times \frac{1}{\sqrt{3}}\times \frac{60}{2\pi} \times \frac{1}{K_{V}}\times I_{A}`


This finally leads us to our 'conversion constant' of approximately 8.3 mentioned in the introduction

`\tau \approx 8.3 \times \frac{1}{K_{V}}  \times I_{A} \approx \frac{8.3 \times I_{A} }{K_{V}}`

and so the 'conversion constant' of 8.3 is just a simplified approximation for converting `K_{V}` to `K_{V}^*`.

It is important to point out here that this relationship is true for any three PMSM. Star, delta, big, small, high `K_{V}`,  low `K_{V}`in-runner, out-runner, cored or core-less, 'weak' or 'strong' magnets, it doesn't make any difference. Equally important, the torque referenced above is the 'electromagnetic' torque produced by the motor. This torque represents a 100% efficient conversion from electrical energy to mechanical energy. The 'shaft' torque, which is the usable output torque of the motor, will always be less than the electromagnetic torque due losses in the system. If you would like to go deeper into all the topics described above than this then I highly recommend James Mevey's Master's thesis from Kansas State which which was recommended and summarised by Shane Colton in his blog.

All this theory is great, but lets see if it actually works in practice.

Measuring the motor constants of some real motors

In order to put all this theory to the test I have measured the motor constants for the following collection of 'hobby grade' out-runner motors.



`K_{V}` was first measured using the method described here. I took a photo of my oscilloscope at around 500 RPM for each motor as shown below.
1000 Kv Racerstar BR2212
190 Kv Keda 6364
150 Kv Odrive 6374

280 kV Turnigy SK3 5055

270 Kv Odrive N5065

All of these motors are 12N14P and of a similar construction. Its clear that the shape of the back EMF is sinusoidal and not trapezoidal. Therefore, these motors are technically permanent magnet synchronous motors (PMSM) and not brushless DC motorsOverall, the measured `K_{V}` of each motor was quite close to their labelled values as will be shown in a table later.

To estimate `K_{\tau}` the output torque of each motor was measured with respect to the armature current. This was done by winding a string around the rotor of each motor, attaching that string to a lever arm that then pulled down onto a laboratory balance. This balance then measured the weight, and therefore force, produced by the motor. This method is only possible thanks to the use of a high resolution encoder (8192 counts per rotation) and an Odrive motor controller which uses field oriented control (FOC) to place all current on the motors q-axis for maximum torque, even when stationary. 

The setup is crude and would have been much cleaner if I had just attach an arm to each motors rotor. However, by using a string I didn't need to make a new arm adaptor for each motor and could instead just consider the diameter of the rotor in the final calculations. This was enough to get the job done.

Using this setup and a simple script I slowly stepped up the commanded current for each motor  while manually recording the weight on the scale. After some back calculations the torque output for each motor with commanded current was found.



No surprises so far with the bigger motors producing more torque per amp and the torque increasing linearly with current. 

A summary of the motor parameters can be seen below and the raw data can be found here

Racerstar BR2212 Turnigy SK3 5055 Odrive D5065 Keda 6364 Odrive D6374
Rated kV rpm/V 1000 280 270 190 150
Measured kV rpm/V 1058 276 259 182 151
Phase Resistance Ohm 0.128 0.032 0.039 0.039 0.039
Phase Inductance H 1.84E-05 1.33E-05 2.02E-05 2.13E-05 2.81E-05
Weight kg 0.045 0.389 0.411 0.647 0.885
Price $ USD 6 52 69 47 99
Torque constant (Kt) N·m/A 0.008 0.029 0.030 0.042 0.053
Kt/kg N·m/A/kg 0.172 0.073 0.073 0.065 0.060
Kt/$ USD N·m/A/$ USD 0.00129 0.00055 0.00043 0.00090 0.00054
Motor constant (Km) N⋅m/sqrt(W) 0.02 0.16 0.15 0.21 0.27
Km/kg N⋅m/sqrt(W)/kg 0.485 0.417 0.369 0.329 0.308
Conversion constant 8.1 8.2 8.2 8.2 8.2


I have calculated the 'conversion constant' based on an average of a few different current vs torque measurements. The calculated 'conversion constant'  is actually very close to the theoretical value, with measured values between 8.1 and 8.2. Any error is likely due to the friction in the system and my less than ideal measurement setup. Also note that these values are based on the manufacture rated `K_{V}` of the motors and they are little lower if my own `K_{V}` is used instead. I'm not sure why this is the case but it may have something to do with the 'fudge factor' each manufacture assumes when estimating `K_{V}`.

Also listed is `K_{\tau}` with respect to motor weight and motor cost. Surprisingly, the smallest motor (1000 `K_{V}` BR2212) came out on top by a considerable margin in both cases, with a `K_{\tau}` more than double that of the other motors. This suggests that the electrical loading (current density in the copper windings) is much higher in the smallest motor when compared to the others. This same result could be achieved for the other motors by re-winding them to have a lower `K_{V}`. However, since the 'torque efficiency' (torque produced per Watt) is the same no matter how a motor is wound provided the amount of copper remains the same, and that the mass fraction of copper is likely to be about the same for these motors, the smallest motor will produce no more torque per unit weight than the rest when thermally limited. This assumption is backed up by the fact that the motor constant `(K_{M})` per weight is about the same for all motors tested. Its likely that the motor manufacture decided to wind the smallest motor this way so that its base speed matched that required by an appropriately sized prop and the typical battery voltage used on model aircraft and drones.

Limitations of this approach

Using `K_{V}` and a motors current draw to estimate its torque output only works provided that: 
  • A motor does not produce any useful reluctance torque (i.e. its a  non-salient machine**). This is true for essentially all 'hobby grade' electric motors. 
  • A motors torque increase linearly with current. This is not true if your motor is close to saturation. However, most 'hobby grade' electric motors are designed to operate with a current limit well below that needed to saturate them and so this is generally a safe assumption for stead state use.
  • A motor is operated below its base speed. Operating a motor above its base speed by field weakening effectively lowers a motors `K_{V}` in that region and so unless you know by how much `K_{V}` is reduced you can not calculate the torque output. However, since no 'hobby grade' motor controllers (ESC's) that I know of utilise field weakening this is also not an issue.
  • The current waveform supplied by a motor controller exactly matches a motors back EMF waveform (i.e. the current is not exactly on the q-axis at all times). This is generally true when using field oriented control (FOC) on a PMSM motor that has inbuilt position sensors (hall effect, encoder etc.). Operating a motor with 'six step 120 degree' commutation at low speed without a position sensor will result in less torque being produced than that predicted using the 'conversion constant' while high speed operation should be pretty close.

Conclusion

The torque produced by brushless permanent magnet synchronous motor can be easily estimated so long as its `K_{V}` and armature current is known. This relationship works because a motors `K_{V}` is fundamentally the same thing as its motor torque constant provided the right units are used, which is where a 'conversion constant' of ~8.3 is required.

* The armature is considered the winding in which a rotational 'back emf' would be generated if the motor were used as a generator. In some motor designs the armature is on the rotor (e.g. brushed DC motor) or in the stator (e.g. brushless DC motor).

** A non-salient machine in this context is any motor which does not derive useful torque from reluctance torque. A motor can have salient poles on the rotor or stator and still be considered a non-salient machine with this definition.

Equations were produced in this post with the help of arachnoid.com. If you have noticed any errors in the above article then please let me know.

13 comments:

  1. Trying to figure out this BLDC thing for a hobby project and your website has been of great help! Found it through the Odrive website. Thanks a lot!

    ReplyDelete
  2. Thank you for this very useful formula and explanation! But I do have one question... how can a BLDC motor ever achieve >87% efficiency when the torque is calculated this way?

    Conversion from RPM and Newton-meters to Watts is RPM * Nm / 9.55, so if RPM = Volts x Kv and Nm = Amps x 8.3 / Kv, then Watts = Volts x Amps x 8.3 / 9.55, therefore output power = input power * 0.87. And since motors spin slower under load, that means the real efficiency will be even lower. And is this even accounting for resistive heat loss yet? So how is it that some motors like this http://nt-power.eu/motor_m.html claim 93% peak efficiency?

    ReplyDelete
  3. Hi Dekutree64

    Thanks for your comment.

    Electric motors can indeed have an efficiency >95%.
    I think I can see the problem with your assumptions. Kv x Supply voltage = maximum no load speed that a motor can achieve and not the motor speed at a given power output. Refer to this post for more details: https://things-in-motion.blogspot.com/2019/05/understanding-bldc-pmsm-electric-motors.html
    Assuming a power factor of 1, the electrical power supplied to a motor is given by the voltage drop across the motor multiplied by the current supplied to the motor (P = VI). The easiest way to measure this power is before the motor controller where the current is still DC and the voltage is near constant. However, keep in mind you will also be measuring the motor controller losses.
    As you mentioned, the power output is the angular velocity multiplied by the torque and from that you can find the efficiency.
    The source of electric motor inefficiencies is a deep topic but one which I plan on exploring in this blog in more detail soon.

    ReplyDelete
    Replies
    1. Oh, I think I see where I went wrong. In my example I was using the voltage and current measured before the controller, but this torque formula uses the current after the controller. So this implies that the armature current must be 1.15x the input current, to cancel out that 0.87 factor.

      I'm still a little fuzzy on exactly how armature current works, so that would be another very useful article if you ever feel like writing about it.

      Delete
  4. Hi Richard,

    Thanks very much for your detailed experimentation and explanation. I have been puzzling over exactly this problem - nobody seems to test or report their peak BLDC motor torques. I am trying to design a paramotor and have found some Chinese motors that look promising (http://www.freerchobby.cc/e_productshow/?17-620usdpcs-17.html) but they don't have any test data for torque, just thrust using a fairly arbitrary propeller (and their other measurements seem suspect). But it seems I can use your equation with the maximum motor current to get a good estimate.

    The reason is I have read that BLDCs are most efficient below 50% of their stall torque, backed up by the graphs I've found on Google. The prop I'm basing on requires a maximum torque of 35Nm for thrust of around 50kg at 2700rpm, so I was hoping for 60-70Nm peak in the motor. Any thoughts?

    I'm also part-way through the paper you reference - a great overview!
    Thanks again,
    Richard (yes another one!)

    ReplyDelete
  5. Hi Richard

    The numbers listed for that motor seem very high to me. For comparison, take a look at this spread sheet from Odrive robotics.
    https://docs.google.com/spreadsheets/d/12vzz7XVEK6YNIOqH0jAz51F5VUpc-lJEs3mmkWP1H4Y/edit#gid=0

    You will notice in the lower most chart that peak torque (calculated from peak current) roughly scales with motor weight. At 3.5 kg, you would expect a peak torque of roughly 15 N.m, far lower than the 75 N.m value listed. Keep in mind that this ‘peak’ torque value can typically only be sustained for about 30 seconds before the motor will overheat. Therefore, a constant torque value for your motor may be closer to 5 N.m, which feels about right for that size motor.

    If you would like to talk more motors you can always stop by the Odrive robotics discord channel and say hello.
    https://discord.gg/kPHsE3G

    ReplyDelete
  6. Hello,

    thanks for this really helpful explanation! I was wondering how you measured phase resistance and phase inductance since especially the latter one is relatively small?

    Thanks a lot!

    ReplyDelete
    Replies
    1. I'll second that I'd love to know how you measured the inductance and resistance.

      Delete
  7. Hi

    Thanks for your interest.

    The inductance and resistance was measured using an Odrive Robotics motor controller. On startup calibration this motor controller measures both values and they can be reported over USB. I have also measured these values using a the 4 wire resistance method and using an LCR meter and found them to be in reasonable agreement with the Odrive reported values.

    https://cdn.discordapp.com/attachments/369678848972816385/542520157734567937/IMG_20190206_114338.jpg

    https://docs.google.com/spreadsheets/d/1PSouoWgJehHNp1qXCOlDxKy1EBEjcYT4PGaZ5Kw-zIo/edit?usp=sharing

    Cheers,

    Richard

    ReplyDelete
  8. Thank you for the information! Here is a link to the code that does these measurements:
    https://github.com/madcowswe/ODrive/blob/fec0fe6a952272f1a683e755b841a44a06df6150/Firmware/MotorControl/motor.cpp#L212

    ReplyDelete
  9. Thank you for a good article. The theoretical data is clearly explained and experimental part is conducted perfectly.

    But there is a question: is armature current value Ia - an amplitude of phase-to-phase current sinusoid or is it an RMS value?

    ReplyDelete
  10. Hello. Nice write up. Thanks for posting it. I have a question with regards to BLDC motor namely the Bafang BBSHD for e-bikes. My friends and I are running ASI BAC855 controllers on them and we have a disagreement you could maybe help me with. With the controller limited to 3250w and 90 phase amps which voltage will provide more torque or real world power? He thinks that since running 52v the controller is pulling about 60 amps from the battery it’s faster then running at 72v which only pulls about 45 amps. I know for a fact the bike is faster with more of the line power at 72v since I have used both set ups but I am having trouble explaining to him why this is the case. Can you help clear up this confusion please? Thanks!

    ReplyDelete
  11. I find that this sentence is incorrect or a bit misleading:
    No surprises so far with the bigger motors producing more torque per amp and the torque increasing linearly with current.

    The motors with higher torque constant produces more torque, (which happens to be the larger motors in this test)

    ReplyDelete