Labels

[motor]

 

Contents

Introduction

Back-EMF refers to using the voltage generated by a spinning motor (EMF) to conclude the speed of the motor's rotation.  This can be used in motion control algorithms to modulate the velocity or to compute the angular distance the motor has traveled over time.  This article attempts to describe this form of motion control feedback in more detail. 

Typically a motor takes power in the form of voltage and current and converts the energy into mechanical energy in the form of rotation.  With a generator, this process is simply reversed.  A generator takes mechanical energy and converts it into both electrical energy with a voltage and current.  Most motors can be generators by just spinning the motor and looking for a voltage/current on the motor windings. 

Note

A very simple demonstration of this is to wire two LEGO motors together.  If you spin one, the other spins based on the current you create when turning the windings of the first motor.  If you have them around, give this a try, it is fascinating. 

When doing Back-EMF measurements for motion control, this fact that a motor can also be a generator is exploited.  The motor is run almost continually as a motor with current being supplied to turn the windings.  Occasionally, and for a very short period of time, the process is reversed.  The windings are allowed to float and the inertia in the motor keeps it spinning while a measurement of the voltage from the spinning motor/generator is taken. 

The voltage observed when the motor is spinning is directly proportional to the speed the motor is running.  This fact can be used to "peek" at the motor's speed with no optical encoders or other forms of active feedback. 

The Process

Reading the velocity from a motor using Back-EMF requires two alternating steps.  First, the motor is run for some period of time by providing current to the windings.  This current can be supplied as a constant voltage or a PWM motor input to vary the speed.  The second step is to remove the current from the windings and "float" them.  This means that there is no active circuit between the windings and any other source/sink.  This allows the inertia in the motor and mechanical system to spin the motor long enough to measure the voltage produced by the motor.  Typically these two steps are alternated roughly 50Hz (times per second). 

The time required for the motor to flip from a motor to a generator depends on the inherent capacitance or stored charge in the induction of the motor windings.  This time is typically in the order of a millisecond or two, depending on the conditions.  Watching the process on a scope can give you some idea of the timing. 

Below we walk through some simulated scope pictures to show these various steps and introduce some terminology used in the BrainStem Moto 1.0 Application to control a motor using Back-EMF. 

Simulated scope running at 25% duty cycle.

Above we see how a scope might look when running a motor at 1/4 speed.  Notice how the Back-EMF rises up to roughly 1/4 of the PWM maximum voltage and stabilizes.  If the Back-EMF measurement gap is too long, the motor will begin to slow down and the feedback will drop accordingly. 

Simulated scope running at 3/4% duty cycle.

Next, we see what the scope might look like when running the motor at 3/4 speed.  Notice how most everything remains the same but now the stable Back-EMF signal is roughly 3/4 of the maximum motor winding voltage. 

Simulated scope with induced load running at 75% duty cycle.

Finally, we see what the 3/4 speed case might look like when the motor is under load.  Since the motor has a great deal of current developing a large induction in the windings when it is under load, the inductive spike is bigger and the stable Back-EMF region takes longer to achieve as this larger induction must be dumped from the windings first before the Back-EMF region stabilizes.  Proper tuning of the latency before taking the measurement is important to minimize the measurement gap while allowing enough time for stable Back-EMF measurement. 

The Moto 1.0 and Back-EMF

The BrainStem Moto 1.0 module is a very flexible motion control board.  It has the built in parameters to handle timing required for Back-EMF feedback control using a PID loop to manage the motor outputs based on the velocity feedback provided by the Back-EMF measurement. 

Below is a diagram of the flow of information in the closed-loop control when using the Moto 1.0 module in A/D velocity mode (Back-EMF mode).  This loop repeats at an adjustable frequency with typical values ranging from 10-200 Hz.  to effect speed control without encoders. 

Brainstem Moto internal Back-EMF control loop.
Brainstem Moto internal Back-EMF control loop.

The settings (the orange inputs on the left) are all adjustable through a simple User Interface that runs on a variety of platforms.  Here is the interface used to adjust these settings. 

Brainstem Moto user interface for Back-EMF control.
Brainstem Moto user interface for Back-EMF control.

Back-EMF Measurement Circuits

The Back-EMF measurement circuit can be a bit challenging.  The circuit needs to handle the (possibly large) voltages of the motor and convert them into a range that the A/D inputs of a microcontroller can handle.  In addition, the windings of the motor invert when the motor direction changes so the circuit needs to both adjust the voltage range and create an input offset so that the neutral (not spinning) voltage output of the measurement circuit centers around a known value. 

If you are only running the motor in one direction, this circuit can be as simple as a resistor ladder to scale the voltage to the A/D range.  If the motor is running bi-directionally, a more sophisticated circuit is required.  The Acroname 3A Back-EMF H-Bridge uses a two-stage operational amplifier to manage this voltage scaling and offset.  This circuit also must have the brake turned ON for floating the windings during the Back-EMF measurement gap due to the characteristics of the LMD 18200 H-Bridge employed for the motor outputs on the 3A Back-EMF H-Bridge.  This activation of the brake circuit is referred to as "auto braking" in the Moto 1.0 module. 

There are probably as many ways to measure the voltage in a Back-EMF circuit as there are potential motor, direction, and voltage combinations.  The key is to ensure that the measurement is passive so it doesn't affect the motor and that it is fast so that the motor can spend most of the time running. 

Limitations

Back-EMF velocity measurement is novel and great if you don't have an encoder on your motor.  Good quadrature encoders like those used in the Garcia robot will typically out perform the Back-EMF measurement method described here.  In addition, encoders can give absolute position information whereas Back-EMF can only report velocity.  Position must be computed through integrating the velocity over time which has significant limitations. 

One other limitation of Back-EMF velocity control is that it effectively reduces the maximal duty cycle that can be obtained from the motor as it requires the motor to be turned off at times during the operation to facilitate the measurements. 

Credit and Attribution

Back-EMF motion control has been around for decades finding use in model trains, audio tape transport mechanisms, and other special purpose uses.  Acroname first learned of this approach to speed control while talking with Randy Sargent about work he and Bill Bailey were doing with velocity measurement for robotics.  Thanks to Randy and Bill for sharing this information with the robotics community. 

 

Related Links:

NASA/CMU Summer Robot Course featuring the Acroname-powered Trikebot

Concepts: Description of Pulse Width Modulation (PWM)

Moto 1.0 Module A/D Velocity PID Mode Description

BrainStem Moto 1.0 Module PWM A/D Mode Description

[PIC] PIC reference

www.piclist.com

www.microchipc.com

www.htsoft.com

www.microchip.com.tw