Showing posts with label Km. Show all posts
Showing posts with label Km. Show all posts

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.

Saturday, December 8, 2018

How to select the right power source for a hobby BLDC (PMSM) motor

If you have a '90 A, 2000 W, 6 to 10S' rated BLDC* motor such as this, do you then need a 90 A, 2000 W, 22 to 37 V power source?

The short(er) answer:


In most cases, no, not even close. Select your power source (battery or mains power supply) based on your own specific requirements using the following three steps:

1. Required Current: The current supplied to a motor controller does not equal the current supplied to a BLDC motor. Motor controllers ('ESC') take a relatively high voltage and low current power source and, though pulse width modulation (PWM), converts it into a low voltage and a high current for use with a motor. This single phase simulation (thanks to Oskar Weigl) demonstrates how a controlled current is supplied to a motor and has typical values for the resistance, inductance and capacitance seen in each part of the circuit. In short, most motors have a very low resistance (i.e. <  0.1 Ohm) and so a high current can be supplied with relatively little power. Therefore, you only need to consider the voltage and total power output of your power source and your motor controller will take care of the rest.

2. Required Voltage: The voltage required from your power source will depend on your motors velocity constant (`K_{V}`) and the the top speed you require. For example, if you required 3000 RPM from a 190 `K_{V}` motor then the power source voltage needed (`V_{PSU}`) is give by
`V_{PSU} = \frac{RPM_{max}}{K_{V}} \times 1.25 = 19.7 V`

The value of 1.25 is a safety margin since `K_{V}` is always measured with no load. Most fixed voltage mains power supplies come in voltage steps of 12, 15, 24, 36 and 48V. Therefore, provided it did not exceed the voltage limit of your motor controller, you would select a 24 V power supply.

3. Required Power: As a rough rule of thumb the peak power (`P_{max}`)  required from your power source will depend on the maximum motor current (`I_{max}`) needed at your maximum RPM as given by:

`P_{max} = I_{max} \times (\frac{RPM_{max}}{K_{V}}) \times 1.25`

were the value of 1.25 is again a safety margin is to account for inefficiencies in the motor and motor controller. Once you know the peak power required you can then select a power supply which meets your needs. At the end of this post I recommend a few different mains powered fixed voltage power supplies.

The remainder of this post will develop a more detailed understanding of when and why BLDC motors draw power.

Estimating power draw

The mechanical power produced by a motor is given by

`P = \tau \times \omega = \tau \times \pi \times \frac{RPM}{30}`

where `\tau` is the motor torque in N.m and `\omega` is its rotational velocity in radians per second. If we assuming for the moment that a motor is 100% efficient then its power consumption can  be mapped as follows

where the values labelling each contour line are the motors power draw. Of course, real BLDC hobby motors have an efficiency far lower than 100%. An electric motor is least efficient at low speeds and at high torque where the winding loss is largest with respect to the mechanical power output. We can estimate the winding losses for a  motor using the following equation:

`P_{loss} = I^{2}R`

Using the 190Kv motor mentioned above as an example, the current required to produce a given torque can be estimated using the motors known torque constant and its winding resistance which I have measured to be 0.0447 Ohm. Combining this power loss with the power output of the motor we can produce a slightly more realistic power map.

All of the contour lines are now moved closer to the left at high torque levels. Its clear that even a relatively small 450 W PSU can produce full torque up to ~1000 RPM or reduced torque up to 5000 RPM.  Note that this ignores any power loss in the motor controller and core losses, which will dominate at higher speeds. However, at these speed ranges and currents both of these losses will be fairly small relative to winding losses and so can be ignored.

If this motor is powered with a 24 V power supply voltage then its not possible to reach all regions of the power map due to the back EMF created by the motor as it spins. The motor can no longer reach a required torque when the back EMF plus the voltage drop across the motor exceeds the supply voltage. Using this cutoff the achievable torque and speed is shown below.
In reality the drop off in torque will be a smooth curve but here it has a 'saw tooth' pattern due to the speed only being plotted at 100 RPM intervals.

It is important to note here that the peak torque in the above power map would require a current of more than 70 A and a loss in the motor windings of more than 200 W. Testing has shown that this is enough to permanently damage the motor windings in about 30 seconds. The steady state torque output of the motor will depend on the cooling provided but for this motor a safe assumption is about 30 A, or one third of its 'peak power' value. This is equal to about 1.3 N.m and is shown by the dashed line in the power map above. The reason that this line is fixed at a constant torque and not at a constant power is that almost all the heat is generated by the previously mentioned winding losses. These losses are dependent upon the winding current which in turn determines the torque.

It can also be seen from the power contour lines that a 450 W power supply is able to provide enough power for any speed and torque up to 4000 RPM at 1 N.m. Rather than simply limiting the motor current for all speeds, and therefore the motor torque, motor controllers with active power management could instead actively limit the current depending on the motor speed, keeping the power draw always below a set limit. This is a planned feature for Odrive Robotics motor controllers.

In order to operate this motor at higher speeds we need a higher supply voltage. The power map for a 48 V supply voltage is shown below.



With a 48 V power supply you would now need to limit your peak torque to less than 0.6 N.m to in order to not exceed the 450 W power rating previously used. Therefore, if you are planning on operating at higher speeds and voltages you will generally need a more powerful power supply.

A few suggestions for power supplies

If you are uncomfortable working with mains voltages then a high current, low voltage mains laboratory bench power supply from a reputable supplier (Manson is a good choice) is the way to go.

If you are comfortable with having semi-exposed mains wiring and in adding your own plug, then any fixed voltage power supply will be much cheaper. I recommend a well known brand, such as the Mean Well SE series. You can find cheaper copies but they tend have lower real world outputs, have noisy always-on fans, poorly implemented protection and lower quality components that may fail sooner or even be a fire risk.

If you are more adventurous and want the absolute highest kW/$ then consider picking up a new-old-stock or used server power supply off ebay. For example, I picked up this 6.5kW 42V server power supply for less than $100 USD delivered. 





These power supplies are commonly used in the RC community to charge batteries but will also work fine with a motor controller in most situations. See this thread for more details. These power supplies can be modified to output slightly different voltage ranges if needed (~ 35 to 50V). The downside of using these power supplies is that the server fan can be quite noisy, and so may need replacing, and that its not always easy to get access to the output. An approach suggested by Macaba on the Odrive Robotics discord server was to drill holes in the case and attach cables to the internal binding posts. 

Image credit Macaba


Also, its worth remember that these power supplies can easily draw enough power to trip your mains breaker and so make sure you have the capacity to run them before buying. 

Provided you have the mains capacity, one of these power supplies should be able to meet even the highest peak power draws of any hobby BLDC motor.

* I'm told that most hobby motors produce a back EMF wave form that is closer to a pure sine wave than that of a traditional brushed motors trapezoidal wave form. Therefore most hobby 'BLDC' motors should more correctly be called permanent magnet synchronous motors (PMSM). This topic will receive more attention in the future.

The spreadsheet used to create the figures in this post can be found here. The contour figures were produced in Origin. If you have noticed any errors in the above article then please let me know.