Author Topic: Measuring the speed of a brushed motor with back EMF  (Read 9889 times)

0 Members and 1 Guest are viewing this topic.

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Measuring the speed of a brushed motor with back EMF
« on: October 13, 2017, 03:42:14 pm »
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.
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 5871
  • Country: de
Re: Measuring the speed of a brushed motor with back EMF
« Reply #1 on: October 13, 2017, 03:55:46 pm »
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.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Measuring the speed of a brushed motor with back EMF
« Reply #2 on: October 13, 2017, 03:59:02 pm »
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.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Measuring the speed of a brushed motor with back EMF
« Reply #3 on: October 13, 2017, 04:55:28 pm »
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

 

Offline fourtytwo42

  • Super Contributor
  • ***
  • Posts: 1185
  • Country: gb
  • Interested in all things green/ECO NOT political
Re: Measuring the speed of a brushed motor with back EMF
« Reply #4 on: October 13, 2017, 04:58:32 pm »
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 :)

 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Measuring the speed of a brushed motor with back EMF
« Reply #5 on: October 13, 2017, 05:17:20 pm »
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
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Measuring the speed of a brushed motor with back EMF
« Reply #6 on: October 13, 2017, 05:22:37 pm »
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.
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 5871
  • Country: de
Re: Measuring the speed of a brushed motor with back EMF
« Reply #7 on: October 13, 2017, 05:56:10 pm »
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.


 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Measuring the speed of a brushed motor with back EMF
« Reply #8 on: October 13, 2017, 06:17:49 pm »
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
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 5871
  • Country: de
Re: Measuring the speed of a brushed motor with back EMF
« Reply #9 on: October 13, 2017, 07:24:31 pm »
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.

 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Measuring the speed of a brushed motor with back EMF
« Reply #10 on: October 13, 2017, 07:26:53 pm »
Yes that is what I was thinking.
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 5871
  • Country: de
Re: Measuring the speed of a brushed motor with back EMF
« Reply #11 on: October 13, 2017, 07:30:27 pm »
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 * KV) volts.
« Last Edit: October 13, 2017, 07:32:15 pm by Benta »
 

Offline ggchab

  • Frequent Contributor
  • **
  • Posts: 276
  • Country: be
Re: Measuring the speed of a brushed motor with back EMF
« Reply #12 on: October 13, 2017, 08:16:46 pm »
Quote
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.
 

Offline max_torque

  • Super Contributor
  • ***
  • Posts: 1280
  • Country: gb
    • bitdynamics
Re: Measuring the speed of a brushed motor with back EMF
« Reply #13 on: October 13, 2017, 09:27:01 pm »
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.
« Last Edit: October 13, 2017, 09:31:35 pm by max_torque »
 

Offline max_torque

  • Super Contributor
  • ***
  • Posts: 1280
  • Country: gb
    • bitdynamics
Re: Measuring the speed of a brushed motor with back EMF
« Reply #14 on: October 13, 2017, 09:29:18 pm »
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
« Last Edit: October 13, 2017, 09:30:50 pm by max_torque »
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Measuring the speed of a brushed motor with back EMF
« Reply #15 on: October 13, 2017, 09:40:29 pm »
Well this is 12V 20A so less than 0.6 ohms if most of that 12V is to counteract back emf
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Measuring the speed of a brushed motor with back EMF
« Reply #16 on: October 13, 2017, 11:18:14 pm »
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.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8269
Re: Measuring the speed of a brushed motor with back EMF
« Reply #17 on: October 14, 2017, 02:06:00 am »
Brushed motors have current draw that fluctuates x times per cycle (depends on how many brushes are present and the number of commutator segments) --- you could probably get the speed far more accurately with that --- in fact, here's an interesting article and reference design about getting the position that way:

https://e2e.ti.com/blogs_/b/behind_the_wheel/archive/2017/08/16/the-seat-remembers-brushed-dc-motor-ripple-counting-drives-innovation-in-full-featured-memory-seats
http://www.ti.com/tool/TIDA-01421
 

Offline Circlotron

  • Super Contributor
  • ***
  • Posts: 3180
  • Country: au
Re: Measuring the speed of a brushed motor with back EMF
« Reply #18 on: October 14, 2017, 04:06:44 am »
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?
 

Offline oldway

  • Super Contributor
  • ***
  • !
  • Posts: 2172
Re: Measuring the speed of a brushed motor with back EMF
« Reply #19 on: October 14, 2017, 06:09:26 am »
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.
« Last Edit: October 14, 2017, 06:49:18 am by oldway »
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Measuring the speed of a brushed motor with back EMF
« Reply #20 on: October 14, 2017, 06:56:30 am »
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 ;)
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Measuring the speed of a brushed motor with back EMF
« Reply #21 on: October 14, 2017, 06:57:41 am »
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.
 

Offline max_torque

  • Super Contributor
  • ***
  • Posts: 1280
  • Country: gb
    • bitdynamics
Re: Measuring the speed of a brushed motor with back EMF
« Reply #22 on: October 14, 2017, 02:51:15 pm »
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.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Measuring the speed of a brushed motor with back EMF
« Reply #23 on: October 14, 2017, 02:56:00 pm »
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.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8269
Re: Measuring the speed of a brushed motor with back EMF
« Reply #24 on: October 14, 2017, 03:53:27 pm »
Measuring the ripple of the supply current is probably the easiest and most accurate, since it's basically using the commutator as a rotary encoder.

https://www.romanblack.com/encoder.htm
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf