-
Measuring the speed of a brushed motor with back EMF
Posted by
Simon
on 13 Oct, 2017 15:42
-
I have need to drive a brushed motor at varying speeds. I also need to know roughly what that speed is. I gather this can be done by knowing the motors resistance and its maximum speed and current draw at that speed. As anybody have any details on how I will go about calculating this?
One method I have found explained measures the voltage across the switch transistor whilst it is off so in effect measuring the voltage that the motor is self generating. I've also been told that I can do this by measuring the current draw I presume during the on period and knowing my PWM duty as this is proportional to the supply voltage and therefore gives me the voltage I am putting into the motor on average.
I'm slightly confused as you can probably see I can sort of see how it works but I could do with some practical pointers.
-
#1 Reply
Posted by
Benta
on 13 Oct, 2017 15:55
-
Do you have the possibility of spinning the motor at a known speed? Eg, a power drill or something like that, where you know the speed?
If so, just do it and measure the voltage generated by the motor. From this, you can compute KV, which is measured in rpm/V.
Internal resistance: ohmmeter across the terminals (move the shaft a bit back and forth to get the lowest reading).
Current draw is load dependent, but open-shaft (idle) current draw is of interest.
Go from there.
-
#2 Reply
Posted by
Simon
on 13 Oct, 2017 15:59
-
So how do I need to relate that speed, voltage generated and motor winding resistance? Would the voltage be proportional to speed? If so simply reading it back should tell me the speed of the motor whilst the PWM signal is low. I suppose otherwise knowing the PWM duty and measuring the current draw during the high side of the signal does give a better chance of taking a reading at high duty cycles.
-
#3 Reply
Posted by
rstofer
on 13 Oct, 2017 16:55
-
For a brushed DC motor, RPM varies with voltage by a proportional constant Kv in units of rpm/volt. The torque varies with the armature current. This is dependent on two things: The winding resistance and the applied voltage minus the back EMF (Kv) which is a function of RPM.
https://en.wikipedia.org/wiki/Motor_constants
-
-
Hi Simon, there is both an analogue and PWM way of doing this.
The PWM method relies upon measuring the back EMF during the PWM off period however this is beset with noise, commutation spikes being the worst and as you say the available sampling period can get very short so not easy to implement.
The analogue method attempts to model the motor resistance in the power source so that the effective motor emf is constant, meaning the power source voltage rises with rising output current (to compensate for the IR loss).
Some people have also tried measuring the frequency of the commutation spikes but I don't recall seeing this suggestion recently.
By far the simplest method IMOP is mechanical feedback, this could be a tacho or slotted wheel and opto-sensor for example. Of course there are some situations such as model railways where this is impossible due to the limitation of 2 wires from controller to motor
-
#5 Reply
Posted by
Simon
on 13 Oct, 2017 17:17
-
Unfortunately sensors won't be an option. At low frequencies I'd guess that even at 99% 1% of the 10mS period is 0.1mS. Like you say, beset with noise though, I guess a low pass filter and a short delay to let it get to nominal back emf should allow for a decent measurement, but this will all need to be done in 0.1mS, I could of course use a lower frequency like 50Hz but that still only gives me 200uS
-
#6 Reply
Posted by
Simon
on 13 Oct, 2017 17:22
-
I would appear that one suggestion is to run the motor at whatever PWM and then just cut the PWM for some mS and take the measurement. This is an option as speed checking does not need to be done that often.
-
#7 Reply
Posted by
Benta
on 13 Oct, 2017 17:56
-
There are basically two strategies if you can't have sensor feedback.
1: Apply the voltage fitting the desired speed (KV will tell you this) and measure the current. Use this measurement to compensate for losses which are mechanical (you know this loss from the idle motor consumption you measured) and resistive (you know the motor resistance as well). Compensation is of course raising the supplied voltage accordingly.
This works well, but requires that you know all the motor parameters. Plus, it works for both DC and PWM control.
2: Insert "dead times" to measure the back EMF. You still need to know KV, but the other parameters are no longer necessary. Downside is a more complicated drive /measuring scheme. Upside is, you can interchange different motors with the same KV and still have the correct operation. Your "dead time" will normally need to be several milliseconds.
-
#8 Reply
Posted by
Simon
on 13 Oct, 2017 18:17
-
The second method seems the easiest, if I make a measurement once a second lasting 10mS that is still 99% power input in what never really wants to make it to 100% anyway, 20mS will still be ok. I could also take a measurement every 2 or 3 seconds. I am controlling a fan so running the motor no load is a bit hard. What might be more relevant is to block the fan which enables maximum speed (no air flow no load) and take back emf readings and speed readings to get the Kv
-
#9 Reply
Posted by
Benta
on 13 Oct, 2017 19:24
-
You don't need to run the motor at no load to get KV. Just spin the fan at a known speed and measure the motor terminal voltage.
-
#10 Reply
Posted by
Simon
on 13 Oct, 2017 19:26
-
Yes that is what I was thinking.
-
#11 Reply
Posted by
Benta
on 13 Oct, 2017 19:30
-
Yes that is what I was thinking.
I'm not a 100% sure.
What I mean is, spin the fan using
an other motor at a known speed. Don't apply power to the fan motor at all, just put a voltmeter across it.
The fan PMDC motor will act as a generator supplying (rpm * K
V) volts.
-
#12 Reply
Posted by
ggchab
on 13 Oct, 2017 20:16
-
I would appear that one suggestion is to run the motor at whatever PWM and then just cut the PWM for some mS and take the measurement. This is an option as speed checking does not need to be done that often.
This is what I am doing to control the speed of the motor of my BF20 milling machine. It's a 220VDC motor.
In my case, this has no noticeable effect on the power of the machine. I bought a cheap tachometer to measure the rotation speed of the spindle and calibrate the system.
-
#13 Reply
Posted by
max_torque
on 13 Oct, 2017 21:27
-
How accurately do you need to know the speed of the motor?
For a motor, the Forward Voltage (applied voltage) is the sum of the BackEmf and (Current x Resistance). Where the BackEMF is of course linearly proportional to the motors rotational speed. So, if your controller measures it's DC supply voltage, then you know the forward voltage (Vsupply x PWM duty) and if it measures the current it is supplying to the motor, then you have everything you need to calculate the motors speed! It's not highly accurate, because the DC resistance changes with motor temperature, but i've found it to be perfectly adequate for low precision requirements.
I do a fuel pump controller that estimates the fuel delivery quanity from the pump by estimating the motors speed via this method.
E.g.
Say with a 24v supply, and a PWM at 50% duty cycle, that means you have a 12V forward voltage (24 x 0.5). iF you measure 1 amp of current flowing to the motor, and you know the motor has a 1 ohm resistance, then you know the backEMF must be 11 Volts. (12 - (1 x1) = 11.
On my pump controller, because the pump has a lot of friction, when the pump is stationary (at power up for example) i apply a small PWM, not sufficient to create enough torque to start the motor spinning, and measure the current, and this provides me with an adaptive DC resistance value to use in subsequent calcs.
Of course this technique works better with small motors that tend to be quite resistive rather than mainly inductive.
-
#14 Reply
Posted by
max_torque
on 13 Oct, 2017 21:29
-
I should add that this assumes your PWM frequency is significantly faster than the fundamental frequency response of the motor, so the current you measure is effectively a DC value. (For a brushed motor, that would usually be the case in order to avoid torque oscilations and noise etc). This means you don't need to coherently (ie not aligned to PWM phase) measure the motor current, and in fact, a low pass filter will be advantageous to remove signal edge noise and other fluctuations
-
#15 Reply
Posted by
Simon
on 13 Oct, 2017 21:40
-
Well this is 12V 20A so less than 0.6 ohms if most of that 12V is to counteract back emf
-
#16 Reply
Posted by
Simon
on 13 Oct, 2017 23:18
-
Do i need to calculate with the average current per cycle or the instantaneous current when switched on? it will have to be as accurate as i can make it or they can use the right tool for the job: a brushless one.
-
#17 Reply
Posted by
amyk
on 14 Oct, 2017 02:06
-
-
#18 Reply
Posted by
Circlotron
on 14 Oct, 2017 04:06
-
Seeing you are driving a fan, for a rough and ready rpm sensor could you not shine an LED or other light source through the fan blades and measure the chopping frequency of the blades? Or use a photoreflective sensor?
-
#19 Reply
Posted by
oldway
on 14 Oct, 2017 06:09
-
There are several types of brush motors, I assume it is a permanent magnet motor.
U = E + RxI
U is the average voltage across the motor. With PWM, it can easily be obtained by filtering (low pass filter) the voltage at the terminals of the motor.
E is the electromotive force
R is the internal resistance of the motor.
If it is necessary to be able to estimate the speed of the motor for a simple indication, it would be sufficient to use the voltage U as an approximate indication of the speed.
If one wants a more precise indication, it is necessary to correct U by subtracting RI to obtain E
It is therefore necessary to have the information of the value of the current I.
Since it is a low voltage (12V) and a high current (20A), the best way to obtain this information is through a Hall effect sensor.
It is sufficient to subtract in an operational amplifier a fraction of the current information of the value of U to obtain E.
By having Kv and E, we have RPM information.
To calibrate the system, it is not necessary to measure the internal resistance of the motor.
It is enough to test the system in 2 different conditions (full load and closed output, without flow) by measuring in each case the speeds, currents and voltages at the terminals.
Based on the measurements, the value of R can be calculated (2 equations with 1 unknown R) and the correct gain of the information I can be adjusted to obtain the correct value of E in both cases.
To measure the RPM to calibrate the system, a stroboscope method can be used by painting a white line on one of the blades and using a high-brightness LED controlled by a function generator.
-
#20 Reply
Posted by
Simon
on 14 Oct, 2017 06:56
-
I'm still trying to figure out the best of the 3 ways:
1) As max_torque suggested measure the current and know the effective supply voltage by multiplying V supply by the duty factor. If I have to measure the current only during the on time this will need timing (I assume with an interupt that fires on an event on the PWM counter), if it is the average current over the period then a low pass filter on the sense resistor or output of a current sensor will make life easy.
2) measure the back EMF voltage during a few mS of off period, I don't expect any rapid change in the system (it's a fan not a traction application) so I don't need to do it too often.
3) characterise the motor speed versus PWM drive input for the expected working conditions, this would of course give a very approximate value of speed, I have played around with fans before and found that the motors are wound in such a way that a completely blocked fan and a completely free fan go at the same speed on full supply voltage. If this is the case then this method would be not too bad and I'd simply have to characterise the fan although it would be nice to have something more robust for applications where the motor is not wound appropriately for this.
4) refuse to do so if anyone asks and tell them to man up and use a brush-less fan with precise speed control but I'd rather not have that as an option
-
#21 Reply
Posted by
Simon
on 14 Oct, 2017 06:57
-
Sensors are not an option, it's just fraught with potential problems, difficult to install (I don't make the fan) and liable to failure.
-
#22 Reply
Posted by
max_torque
on 14 Oct, 2017 14:51
-
no requirement to measure current coherently. Just just a hall effect or shunt type sensor, low pass filter the output. Assuming you are not driving the load motor over a massively dynamic speed profile, then you can low pass filter down in hardware into the single Hz without issue.
-
#23 Reply
Posted by
Simon
on 14 Oct, 2017 14:56
-
Rightho, no fan control does not require fast reaction times so yea sounds simple enough but you think it will become hard to use your method with high inductance low resistance motors? I'll have to measure some see what they are like.
-
#24 Reply
Posted by
amyk
on 14 Oct, 2017 15:53
-