Showing posts with label kv. Show all posts
Showing posts with label kv. Show all posts

Saturday, May 11, 2019

Understanding BLDC (PMSM) electric motors: Base speed, no load speed and torque vs speed

Search for the keywords "electric motor speed vs torque" and you will find many hundreds of images, with each looking different to the next.


A selection of 'electric motor speed vs torque' charts
This has, understandably, lead to considerable confusion (myself included) when discussing 'hobbyist' grade BLDC (PMSM) motors and the topics of:
  • no-load speed
  • base speed
  • torque vs speed
where 'speed' is referring to how fast a motor is spinning (i.e. it's angular velocity). Therefore, this post will explore these three topics. For those wanting a quick summary see the brief overview below.

1.0 Brief overview

1.1 Voltage constraints

When a brushless motor is rotating the motion of the rotor magnets relative to the stationary stator produces a voltage in the windings. This is a brushless motor's back electromotive force (back EMF). When using a hobbyist grade motor controllers the maximum speed of an unloaded motor (i.e. nothing connected to its shaft) is reached when the motor's back EMF is about equal to the supply voltage, such as from a battery. This is the no-load speed of the motor. 

If you have ever adjusted the speed of an unloaded brushed DC motor by adjusting its supply voltage then you have already seen the effect of supply voltage on a motors no-load speed. The situation is no different with a brushless motor, just that it is now electronically commutated. 

At the no-load speed, the voltage difference between the motor and its power supply approaches zero and so very little current can flow through the motor. With near-zero current flowing through the motor there is near zero torque produced and so it can not spin any faster. 

The speed at which you can do useful work with a hobbyist motor and motor controller is always going to be smaller than its no-load speed. As a motors speed is reduced so too is it's back EMF. Therefore, more of the supply voltage is available to deliver current to the motor and so the capability of a motor to produce torque will increase as you move further away from its no-load speed. 

The amount of torque that the motor can produce continues to increase as you approach zero speed. At zero speed (i.e. shaft is stopped) the current flowing through the motor will be about equal to the supply voltage divided by the motor winding resistance. This is the 'stall current' of the motor and will typically be a very large value due to the low resistance of most brushless motors (i.e. < 0.1 Ohm) as is described below.


1.2 Thermal constraints


When in normal use, the torque output of a hobbyist brushless motor increases roughly in line with the current supplied to its windings. Therefore, if you double the current to the motor you also double the torque output. However, the resistive losses in the copper windings increase with the square of the current and so if you double the current and torque you are also producing four times as much waste heat. 

Since most brushless motors have a very low winding resistance (i.e. 0.1 Ohm) it is possible to deliver extremely large currents to a motor even with a modest supply voltage. This is of course provided you have a big enough motor controller and power source to deliver the required current. However, the use of extremely large currents will quickly overheat and destroy a motor. Therefore, most hobbyist brushless motors are not limited by how much current you can deliver to the motor, but rather by how much current you can deliver before the motor overheats. That is to say, the torque output of most hobbyist brushless motors is thermally constrained.

Similarly, when a brushless motor is rotating it also produces waste heat due to core losses which are the losses generated in the iron and magnets. The faster you spin a motor, the larger these losses. Therefore your motor will overheat more quickly at higher speeds than at lower speeds for the same torque output.

This thermally constrained torque output of a motor is also often referred to as a motors rated torque. The maximum speed at which a motor can operate forever at its rated torque is known as a motors base speed.



It is possible to exceed a motors rated torque for short periods of time. The true maximum torque output of a motor is its peak torque. The peak torque output is usually defined as the maximum torque that can be sustained for some fixed period of time (i.e. 30, 60 or 180 seconds) without overheating (starting with a cold motor) or without damaging the magnets or mechanical components. The peak torque of a motor can be estimated from its peak current value. The peak current value is what is most commonly quoted by sellers of hobbyist brushless motors. Unfortunately, how the peak current is measured is usually not clear. As a rule of thumb, the rated current, and therefore torque output, of a hobbyist motor will be around one third that of the peak torque value, or around two thirds with aggressive forced air cooling.

In summary:
  • The no-load speed of a motor is voltage constrained.
  • Useful work can only be done below a motors no-load speed.
  • The constant torque output of a motor is thermally constrained.
  • The maximum speed which a constant torque can be produced is the base speed.
  • A motor can operate above its constant torque value for short periods of time
For a more in-depth discussion read on.

2.0 In-depth analysis 

2.1 Theoretical no-load speed

As mentioned above, the no-load speed (`\omega_{NL}`) of a motor is the maximum rotational speed that a motor can achieve without any external load (i.e. no torque output) placed on it. The theoretical no-load speed is given by:

$$\omega_{NL} = K_{V} \times V_{supply} $$
where `\omega_{NL}` is the theoretical no-load speed in RPM, `K_{V}` is the motor's velocity constant in RPM/V and `V_{\s\u\p\p\l\y}` is the voltage supplied at the terminals of your power source such as a battery. 

`\omega_{NL}` can be visualised as a single point on  a plot of speed vs torque



2.2 Achievable no-load speed

In practice, the theoretical no-load speed can never be reached. This is due to:
  • Friction and windage: All motors experience frictional and windage losses. Frictional losses originate from the bearings while windage losses originate from the relative movement of the rotor to the stationary air surrounding it. These losses require torque to overcome and so the motor can never reach its true zero torque no-load speed. High rotational speed in-runner motors or out-runners with built-in cooling fans will experience larger frictional and windage losses.
  • Core losses: The relative movement of the rotor magnets past the stator generates hysteresis and eddy current losses within the stator, even if there is no current being delivered to the motor windings. Similarly, differences in inductance seen by the rotor magnets as they move past a slotted stator also generated eddy currents within the magnets themselves. These losses must also be overcome by the generation of torque by the motor.
  • Resistive voltage drop: As some small amount of torque is still required to overcome friction, windage and core losses at the no-load speed there will also be a corresponding current supplied to the motor. This current will result in a voltage drop across the motor and the motor controller, reducing the supply voltage available to overcome the motors back EMF.
  • Motor controller dead time insertion: Most motor controllers have some level of dead time when switching their MOSFETs off and on so as to prevent a short between the high side and the low side of the DC bus. This dead time means that even if the motor controller is commanded to output a 100% PWM duty cycle the motor controller MOSFETs will still be off for some fraction of the time, preventing 100% utilisation of the supply voltage. It's also likely that there are other issues on the motor controller side at high electrical frequencies that may also reduce the top speed but which I don't understand at this time.
  • Motor controller PWM frequency and control loop frequency. If you are using a motor controller that supports FOC (also called vector control) then it will be producing a sine wave via PWM. Theoretically, if the frequency of this sine wave (the motors electrical frequency) surpasses approximately 1/20th the PWM frequency (the exact value will depend on the capacitance and inductance of the system) then the quality of the sine wave will start to degrade. This will cause a fall-off in motor efficiency and if taken to the extreme, loss of motor control as commutation falls out of step with the rotor position. Also, if the electrical frequency of the motor approaches the control loop frequency then control will also be lost. 
Note that those losses which are internal to the motor (frictional, windage and core losses) produce no net force outside of the motor and so are not something that can be measured directly with a torque sensor. This is because the stator is both applying the torque to turn the rotor and the braking torque (losses) to stop the rotor. In general, core losses are going to be far greater than those losses due to windage and bearing losses.

The no-load speed which is realistically achievable (`\omega'_{NL}`) can, therefore, be approximated by:

$$\omega'_{NL} = K_{V} \times (V_{supply}  - V_{drop}) \times Modulation_{max} - \frac{P_{loss}}{\tau _{loss}}$$

where `V_{drop}` is the combined resistive voltage drop in the system, `\M\o\d\u\l\a\t\i\o\n_{max}` is the maximum PWM modulation achievable by the motor controller after accounting for dead time insertion and `\frac{P_{loss}}{\tau _{loss}}` is the speed reduction brought about by the power and subsequent torque required to be produced by a motor to overcome friction, windage and core losses.



The size of the difference between `\omega_{NL}` and `\omega'_{NL}` will depend greatly on the type of motor used, its associated losses and the supply voltage. In general, it would be reasonable to expect that a typical hobbyist motor and motor controller (ESC) can reach 85% of its theoretical no-load speed. This is provided that it is operated within its 'rated' voltage. 


2.3 Thermal constraints and no-load speed


Beyond voltage constraints, there are also thermal and mechanical constraints. If you try to run a '6s' (~24V motor) off a 240V motor controller then don't expect to come anywhere near its theoretical base speed before you run into thermal or mechanical (i.e. exploding rotor) limitations.

Core losses generated within a motor at its base speed can be significant. For example, an unloaded 12n14p HobbyKing SK3 280 Kv motor produced over 100 W of losses at 10,000 RPM.
Power draw as measured from the power supply for an SK3 280 Kv motor
The peak speed of 10,000 RPM only represents 75% of the maximum speed available with the 48V power source used. Despite this, the 100 W of losses within the motor at this speed is more than enough to heat the motor to the point of being damaged if operated for an extended period. Also note that the generation of core losses has nothing to do with the motor Kv and is instead determined by the pole and slot combination, with lower pole numbers, in general, producing lower losses. This is one of the reasons why a 4 pole in-runner can operate at much higher speeds than a 14 pole outrunner. 

Due to the no-load losses within a brushless motor, the maximum continuous no-load speed `\omega''_{NL}` may be far lower than the maximum achievable no-load speed. 


This could be an important consideration in some applications which require high speed but very little torque such as an engraving tool or mirror galvo optical assembly.


2.4 Base speed


Also mentioned above, the base speed (also called the rated or nominal speed) is the top speed at which a brushless motor can achieve at it's 'rated torque'. The 'rated torque' is the torque that a motor can output indefinitely without overheating. This speed is different to that of the achievable no-load speed because there will be a larger voltage drop across the motor and motor controller when the motor is producing its rated torque due to the requirement that a larger current be supplied to the windings.

In all other ways the base speed of the motor (`\omega_{BS}`) can be defined in the same way as the maximum achievable no-load speed:

$$\omega_{BS} = K_{V} \times (V_{supply}  - V_{drop}) \times Modulation_{max} - \frac{P_{loss}}{\tau _{loss}}$$
with the exception that `V_{drop}` is now dependent upon the current required to produce the motors rated torque. Therefore, the base speed of a motor will fall off as the 'rated torque' is increased due to the additional voltage drop incurred at higher currents.

In the figure below `\omega_{BS}` represents the maximum speed at which a motor could produce a set level of torque. However, if less torque was required from the motor then a higher speed (following the light blue line) could be achieved.





The gradient of the light blue line will depend on the resistance of your motor and motor controller. Higher resistance will produce a shallower gradient.

2.5 Base speed and temperature rise


So far we have assumed a fixed motor and motor controller temperature, and therefore a fixed voltage drop per amp. However, as the temperature of a motor is increased so too does its winding resistance. For example, a 50C temperature increases the winding resistance by 20% and a 135C rise by 53% [1]. Therefore, a hot motor will have a larger voltage drop across the motor and a lower base and no-load speed.

Note that the above diagram is not to scale and the actual reduction in base speed for a 'hot' motor may be much smaller in reality.

While it's important to keep this point in mind, for simplicity the rest of this post will assume a constant motor and motor controller temperature.

2.6 Base speed and additional cooling


Adding additional cooling to a motor will allow you to increase the 'rated torque' that a motor can produce without overheating. Counterintuitively, adding additional cooling to a motor and raising its rated torque, and therefore current, will actually decrease its base speed since a larger voltage drop will produce over the motor and motor controller.


2.7 Momentary peak torque


Momentary peak torque is important for many applications. For example, rapidly reversing the direction of an axis on a CNC machine or jumping a quadruped robot into the air. The ability to produce a large momentary peak torque is one of the largest selling points for a brushless motor over stepper motors.

The peak torque output of a motor is generally limited by four factors:

  1. Voltage constraints: As mentioned above, the maximum torque produced by a motor is reached at zero RPM (stall torque), where the current is equal to the supply voltage divided by the total resistance in the system. Therefore, a larger supply voltage will allow for a larger current to flow at zero RPM and greater peak torque. 
  2. Current constraints: If using a small power source then it may not be possible to deliver the stall current demanded by the motor without the supply voltage 'sagging' under the load.
  3. Thermal constraints: Supplying a motor with a momentary large current will result in a small temperature rise. Supplying a 'momentary' large current repeatedly, or if the motor is already hot, and this temperature rise will accumulate to the point of damaging the motor. If you demand 100 A from a 10 A motor controller, then even a 'momentary' peak current and torque will likely cause it to overheat.
  4. Material constraints: Ultimately, even if all other constraints are overcome, the peak torque output of a motor is limited by the materials used in its construction as described in more detail below.

  • Material constraints: Stator saturation

The magnetically soft materials used to construct the stator, typically laminated Fe-Si steel, can only be magnetised (polarised) so far before it reaches magnetic saturation. As magnetic saturation is approached there is a loss of linearity between the current supplied to the motor and the torque it produces. i.e. a 1 A increase in current may produce a 0.1 N.m increase in torque when the motor is far from saturation, but only a 0.05 N.m increase in torque close to saturation.

The image below is taken from Ben Katz thesis and nicely shows a subtle ~12% fall off in the torque constant of a motor as its current is increased due to the stator approaching saturation.

All credit to Ben Katz [2]. Click to enlarge


  • Material constraints: Magnet demagnetisation
Supplying a motor with a very large current produces an equally large magnetic field. If the size of this magnetic field exposed to the rotor magnets starts to approach the coercivity of the magnets then there is a risk of demagnetisation. If the rotor magnets are significantly demagnetised then the motor is permanently ruined unless the magnets can be replaced. Thankfully, modern rare earth magnets have a very large coercivity. My own simulations suggest that supplying a current large enough to saturate a motor still does not produce a demagnetise risk for a typical grade N35 Nd-Fe-B magnets at room temperature.

However, the situation changes if the magnets become hot. Increase their temperature to 80C and their coercivity is about one half that at 20C. At this point, it becomes possible to demagnetise the magnets with a current approximately three times a typical brushless motor rated peak current.

The magnet coercivity (x-axis crossing point) falls significantly with temperature.

  • Material constraints: Mechanical limitations
Lastly, the shaft and fixings of a motor are all designed with its rated torque in mind. Exceed this value by too large a margin and you risk damaging the motor. i.e. slipping shaft where it connects to the rotor, twisting the frame etc.

2.8 Torque vs speed


From the discussion above it should now be clear why searching for a 'torque vs speed' plot yields so many results. The output torque of a brushless motor at a given speed depends on many different factors. However, these factors can be simplified by only considering a single situation which should apply to most hobbyist brushless motors and motor controllers. The assumptions are as follows:

  • A powerful power source, such as a Lipo battery, is used which can supply current to the motor when peak torque is demanded without much in the way of voltage sag.
  • Peak torque is infrequently and only momentary required from the motor so that the motor and motor controller is maintained at a reasonable temperature of around 60C at all times.
  • The supply voltage is matched to a motor so that the motor will not overheat if run at its no-load speed indefinitely.
  • The peak torque, and therefore peak current, supplied to the motor is still well below magnetic saturation of the stator and within the safe mechanical limits of the motor.
A typical setup
In this scenario, the torque output of a motor below its base speed is thermally constrained while the maximum speed is voltage constrained. The peak torque that can be supplied to the motor, therefore, depends on the temperature of the motor and the length of time that torque is requied. If the motor starts at room temperature then a very large torque can be produced for a short period. Alternatively, more moderate peak torque can be supplied for a longer period. 
However, if the motor was already at its safe upper limit of 60C then only the motors rated torque could be supplied without heating it to the point of damage. Therefore, the available speed vs torque curve of a brushless motor also depends on its thermal history. For this reason, industrial brushless motors will typically include a temperature sensor embedded in the windings so that the motor controller can actively limit the current if the motor becomes too hot. This is also why the brushless motors supplied by Odrive robotics come with an embedded thermistor. 

Note that the power consumption of a motor producing its 'rated torque' at its base speed will be significantly higher than the same motor producing its 'rate torque' at the stall speed (zero RPM). Therefore, unless you have a powerful power supply or battery you may be unable to reach the base speed at rated torque of a motor. See this post for more details.

3.0 Conclusion

In summary, the torque that a motor can produce at a given speed depends on the motor used, how the motor is cooled, the thermal history of the motor and the power source used. For this reason, there is no single universal 'speed vs torque' plot for any given motor type, or even for two identical motors used under different conditions.

However, it is a safe assumption that any given brushless motor will have a flat constant torque output vs speed due to thermal constraints. Similarly, the peak torque output will, in general, be around 2 to 3 times the constant torque output for a short period (i.e. 30 s) when starting cold. Lastly, the base speed of a motor can be approximated as roughly 0.85 times the supply voltage multiplied by the motors Kv.

In the next few posts, I will be using a low-cost DIY motor dynamometer to characterise these torque vs speed curves, along with motor efficiency, for serval of hobbyist grade brushless motors.

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.

  • [1] From  Design of Brushless Permanent Magnet Motors by Hendershot and J. R., Miller, T. J. E.
  • [2] Katz, Benjamin G. A low-cost modular actuator for dynamic robots. Diss. Massachusetts Institute of Technology, 2018.

Saturday, February 9, 2019

How to model a BLDC (PMSM) motors Kv (velocity constant) and Kt (torque constant) in FEMM

In a previous post, the velocity constant (Kv) and torque constant (Kt) was estimated for a number of different 'hobbyist level' BLDC (PMSM) out-runner motors. In this post, I will be using FEMM to model one of these motors as accurately as possible. In the process, you will see how to use FEMM to model such a motor and how accurately its results compare to the real thing.

Measuring key parameters prior to modelling

Before the motor can be simulated in FEMM we first need to determine its key parameters. The motor to be simulated is an Odrive Robotics N5065 motor which has previously been characterised in this post. Note that this motor is a pre-production unit that was sent to me for testing by Oskar of Odrive Robotics and differs slightly (5mm shorter stator, different winding number) from that offered in his shop today.

The key motor parameters are:
  • The number of slots in the stator and the number of poles in the rotor
In order to make this, and the following steps, easier the motor was first disassembled. Disassembly was achieved by the removal of a single circlip from the shaft and pulling the rotor bell away from the stator. Some force is required due to the attraction of the magnets to the stator iron. 


With the rotor bell removed it was simply a matter of counting the number of slots/teeth on the stator and the number of magnets on the rotor. This motor has 12 slots and 14 poles (12n14p). The likely reason that the manufacturer chose this number of slots and poles is explored in detail here.
  • The stator lamination dimensions and tooth profile
The stator lamination dimensions and tooth profile can be difficult to measure directly. If you don't mind destroying your motor then you can remove all the windings and separate a single stator lamination (or just section the entire motor with a slow speed saw) and use a flatbed scanner to capture the dimensions of the lamination without any perspective errors. Including a ruler when scanning will allow you to set a correct scale. Then you could use a software package with edge detection (such as Inkscape, which is free) to produce a DXF file without the need for any other CAD software.

In my case, I didn't want to destroy or unwind the motor and so I instead opted to model it as best I could in F360 (free for hobby/student use) and then export the sketch as a DXF file for FEMM. By doing this in with parametric design software like F360 it also allows me to play around with motor parameters in future without the need to start from scratch.

The sketch was started with the inner and outer diameters and then a single tooth and its windings were added. This tooth was then copied using the 'circular pattern tool' to make a full stator. 

F360 sketch of the stator
While this method is far from ideal it does give a good approximation as we shall see.
  • The rotor magnet dimensions and grade
The magnets are glued to the rotor bell with epoxy and are also held at the correct separation by segments machined into the end cap and also into an aluminium retaining ring at the open end of the rotor bell.

The silver magnets are retained in the black rotor bell with the grey epoxy and the silver coloured aluminium ring in the open end
This approach gives good retention of the magnets but does make it difficult to estimate the actual thickness of these magnets. I made my best approximation by taking the outer bell diameter and the inner flat-to-flat measurement of the magnets and assuming the rotor bell thickness (the black walled region in the image above) is constant. Using this data, and the assumption that the magnets are flat and not curved the rotor was also modelled in F360.

F360 sketch of the rotor
Since the magnets are assumed to be perfectly flat and are glued to the inside of a cylinder there is a small 'air space' (actually filled with epoxy) below the magnets. When I imported this sketch as a DXF into FEMM later these small gaps were removed by FEMM. If you wish to maintain them for accuracy then you can force FEMM to recognise them by including a small line segment between the rotor bell and the magnet that crosses the thin air gap region.

 The magnet grade specified by the motor manufactures is N42. If you don't know the magnet grade of your motor then you can make a fairly safe guess by assuming N35 if its a cheaper model or N42 if its a higher end model. As there was in no material option in FEMM for N42, I went with N40 instead. In my case, FEMM suggests that using over N40 over N35 grade magnets leads to a ~7% increase in torque.

The rotor and stator sketches were exported as DXF files ready for importing into FEMM. You can find a copy of DXF files here. Note that FEMM doesn't know the difference between 'construction' geometry generated by F360 and normal sketch lines and so you may want to remove them before exporting as a DXF file.
  • The diameter of the wire used, the turn number per tooth and the number of parallel strands
Since I didn't want to unwind the motor it was difficult to determine the number of strands and turns per tooth used. Isolating a single strand and measuring it with a calliper suggested the diameter to be around 0.35 mm and so the diameter of the wire without copper insulation was assumed to be 0.34 mm.

The number of parallel strands was estimated by isolating a segment of wire running from tooth to tooth and poking it with a pen until most of the individual strands were visible. 


I count a total of 8 strands. Luckily for me, the number of turns per tooth (ten) was written right on the side of the stator stack.


However, it should be possible to estimate the number of turns with a reasonable margin of error from the winding resistance of the motor and the wire diameter if needed.
  • The method of winding (i.e. star or delta)
In my previous post, I had assumed that this motor is star wound. This turns out not to be the case. As can be seen in the image above one of the leads coming from the motor has 16 parallel strands. This suggests that the motor is delta wound, with the ends of each phase winding (8 parallel strands) grouped together with the next phase for termination to give a total of 16 strands. This was further supported by the fact that that I can't see any region in the motor where a required join would be made for the natural point of a start wound motor. It is likely that all of the motors I previously look at are delta and not star wound.

Other motor parameters include the lamination thickness, the lamination hysteresis loss, skin and proximity effect of the windings, friction of the bearings etc. can be ignored here as we are only considering the motor under static conditions.

Modelling a motor in FEMM

Getting started with FEMM is fairly straight forward if you can look past its outdated interface. Before starting the motor simulation below I would highly recommend following this quick tutorial so that you are familiar with the interface first.

When ready to model your motor, start a new magnetics problem. From the menu bar select 'problem' and check that you are using the correct units with respect to your DXF file and that have set up a planar simulation. You will also want to check that the 'depth' of your simulation matches the length of your rotor. In this case, my rotor was 30 mm long.



The next step is to import your DXF file(s) using the file -> import DXF option. This can take some time depending on the amount of geometry. If you have any 'construction' lines left over from your CAD model now is also time to remove those. Note that it is also important that the centre of your model be located at point (0,0) for torque estimation to be conducted later.



With your geometry imported its now time to assign material properties. In my case, the rotor bell was assumed to be M-22 Fe-Si steel which is inaccurate. I should have used hot rolled low carbon steel or similar. However, this is unlikely to have had a large impact on the results. The shaft was selected as hot rolled low-carbon steel. The laminations were chosen as M-22 Fe-Si steel which is a common grade used for electric motors.

Magnet placement was done using the Lua scripting language, which is natively supported by FEMM. You can find a copy of the script I used here. Simply enter the number of poles, the radius at which the magnets can be found and the angle (0 degrees being horizontal) that the first magnet can be found. The script will then place each material assignment at the correct orientation. If you wish to change the magnet grade just change the name of the block property in the script (i.e. "NdFeB 40 MGOe")  to that of the magnet you wish to use from the list in FEMM.

The windings were then assigned based on the number of turns and the number of strands. In my case, I created a new 'block property' using the property definition dialogue box. In this case, I selected plain stranded wire with a 0.34 mm diameter and 8 strands and then assigned the same properties used by the other copper conductors.


The actual order which the windings were placed was determined using this handy winding layout tool. By selecting 12 slots, 14 poles, two-layer winding (single winding per tooth as opposed to a single winding for every second tooth) the following is seen.



Using this as a template the winding phase and direction (either into or out of the page) was assigned. This was the most tedious process of creating the motor in FEMM. With all the materials properties assigned we see the following.
The regions filled by air were assigned (one for the air gap region inside the rotor bell and one for outside the motor) and the open boundary builder (circle within a circle button) was used to set the boundary conditions and default settings are fine here.


Finally, we need to set how much current is supplied to each winding. Since this motor is driven using field oriented control (FOC) we need only supply a current to one phase and a current opposite in sign, and twice as small, for the other two phases as per the figure below.


In addition, this motor is delta wound and so the current supplied to the phase will be equal to square root(3) of the line current as described here. In my previous post a phase current of 40 A produced a torque of 1.2 N.m. However, this value of 40 A is the line current (or phase current for a star wound motor) and so we need to divide that value by sqrt(3) to get the phase current that our delta wound motor saw. This gives a value of + 23.1 A for phase A, and - 11.55 A for phase B and C. These values are set in the circuit dialogue box with a series connection.

With this, the motor is now ready for simulating. The complete FEMM file used can also be found here. Note that in order to run this script the minimum angle setting (Problem -> Min. Angle.) needs to be set to 20.

Torque constant estimation

The torque constant (Kt) of an electric motor can be estimated using FEMM with only a single simulation. However, you will want to make sure that your rotor is rotated so that it will produce its maximum torque per amp. In this case, peak motor torque is given when the rotors d-axis is 90 electrical degrees (360 electrical degrees is equal to 360 mechanical degrees divided by the number of pole pairs, which in this case is 7) ahead of the q-axis. A simpler 6n8p motor schematic below for illustration purposes.


Simulating the 12n14p N5065 motor with the rotor 90 elec. degrees ahead of the d-axis looks like the following.



To determine the torque produced the rotor needs to be selected using the area selection tool (green box inside four points) by clicking on each of the magnets and the back iron as shown below.


With rotor selected we can find the torque around point 0.0 using the integrate option and 'Torque via Weighted Stress Tensor' selection from the drop-down menu as recommended in the FEMM manual.


The result is a torque of 1.37 N.m.


For reference, the real motor measured 1.2 N.m. Therefore the FEMM value is an overestimation of about 15%. Considering the number of assumptions made with this model I was actually surprised that the FEMM estimation is as close as it is.

Kv, back EMF estimation

The back EMF constant (Kv) can be estimated using only the torque constant and the motor current as described in this post. In this case, our line current of 40 A and FEMM modelled torque of 1.37 N.m gives

$$K_{V} \approx \frac{8.3 \times 40 }{\tau } \approx 242$$

The listed Kv of this motor was 270 Kv and so once again we are only off around 15 %.

In order to estimate the shape of the back EMF we need to do a series of simulations at different rotor angles and plot the torque output. This torque output can then be converted to Kv in the same way as shown in the equation above. In order to automate the rotor incrementing process, I used a Lua script which can be found here.  In short, it rotates group one by x degrees around point 0,0 and solves. At the completion of solving it prints the torque around point 0,0 to the console and takes a screenshot of the resulting output. Thefeore the use of this script means that you need to assign each line segment and materials property of the rotor to group one as is shown in this video. Don't forget to copy the contents of the console output into another file and the completion of your simulation or otherwise modify the script to output data to a file. To use this script, place it in the same folder as your motor's .femm script so that your file is listed in line 8 "open(mydir .. "Your file name here.FEM")". You can also set how many steps you wish to make and how many degrees of rotation you desire.

Note that solving for each position may take up to 30 seconds and so running hundreds of steps will take many hours to complete. Doing this for the D5065 motor model we see the sinusoidal torque output with rotor angle below.

This sinusoidal torque with rotor angle, and therefore back EMF as they are the same thing, agree well with the back EMF seen for this motor.




Using the excellent, and free, OBS studio in 'slide show' mode was also able to stitch all the separate solutions .bmp files that my script outputted and create this clip of the flux distribution for different rotor angles.


Cogging torque estimation

The cogging torque (torque due to the attraction of the rotor magnets to the salient teeth of the stator) was estimated using the same method as the Kv estimation. The key difference being that the armature current was set to zero and a much finer step was used. The figure below shows the raw output data in black which is quite noisy and an FFT smoothed fit of the data in red.


As discussed in the last post, the number of cogging steps per rotation is given by the least common multiple (LCM) of the number of stator slots and rotor poles. The LCM of this 12n14p motor is therefore 84. A quick count of the peaks in the smoothed data above and extrapolated out to 1 rotation (360 mechanical degrees) and a cogging frequency of 84 is confirmed. As will be discussed in more detail in a future post, the cogging torque amplitude depends strongly on magnet placement, magnet shape, stator tooth shape etc. and so the magnitude and shape of your cogging torque estimated be FEMM will only be accurate if you have modelled your motor exactly.

Modelling motors with symmetry

While it is not shown here, it is important to point out that it is often not necessary to model an entire motor to determine its properties. For motors with symmetry you may only need to model a small segment of the motor and from that, you can extrapolate the results of a full-size motor. There are also a few different tools available in FEMM that may be worth exploring.

Alternatives to FEMM

As can be seen from the results above FEMM is capable of approximating some properties of an electric motor. However, there are many alternatives that are also worth considering. If you would like to use FEMM on platforms other than windows then take a look at the xFEMM project. While xFEMM does away with the user interface it is also considerably faster (up to 80x in some instances) and is still a free open source.

If you require simulations of 3D bodies or more complicated AC loss analysis etc. then you will need to move on to an expensive commercial FEA package such as the Maxwell from Ansys or Comsol Multiphysics. 

Conclusion

Modelling an electric motor in FEMM is no easy undertaking. However, by carefully replicating all of the required components it is possible to get a reasonably accurate estimation of a motors Kt, Kv, back EMF shape and cogging torque parameters. Kt and Kv was shown to be within about 15% of that measured for a real motor and so FEMM can act as a nice starting point for verifying ideas when designing an electric motor.

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 motors. Overall, 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.