Use a motor as a generator, you say? Surely those are completely different things. Turns out, they aren’t. If the motor is driving the load, it’s a motor. If the load is driving the motor, it’s a generator. Most of the motor applications I work with involve point to point position control: in getting from Point A to Point B, the motor must accelerate to some speed, then decelerate such that the motor speed reaches zero just as we arrive at Point B. During acceleration, energy is supplied to the motor as it drives the load. This energy is transferred into the load where it resides as kinetic energy per the formula:

Where E is the kinetic energy in the load, J is the load inertia and V is the rotating speed of the load. When we enter the deceleration stage, this kinetic energy gets transferred out of the load and through the motor – at which point the motor becomes a generator. This process is called regeneration and is an important consideration in motor driver design. For details, consider this Q&A article on motor regeneration from Control Design Magazine.

That’s enough background – on to the story. On a recent walk through the motion control laboratory at Applied Motion Products I happened upon Application Engineer Jim Amos. Jim was performing an experiment with a servo motor driving a step motor. He explained that a customer had contacted him about the feasibility of connecting a step motor to a small gas engine for use in recharging a 12 volt battery.

The theory of operation is actually straightforward, explained our resident PhD, Don Macleod. Viewed as an AC electrical circuit, the system looks like this:

Ke is the back emf of the motor, Lm is the inductance of the motor coil, Rm is the resistance of the motor coil and RL represents the load resistor to which Jim connected the motor coil. What we want to know is how much current the motor can produce at a given speed. That’s easy: just divide the electromotive force produced by the total impedance. System impedance is determined by the sum of the motor and load resistance (they’re in series, so just add them up), then add in the reactance of the inductor. Yes, reactance, a calculation that involves complex arithmetic, where you have a real axis and an imaginary axis. Fear not, this excellent WikiHow.com tutorial on How To Calculate Impedance explains that all you need is the Pythagorean Theorem:

R is total resistance and X is inductive reactance (2πfL). Thus:

When computing electrical frequency f, don’t forget that 1.8 degree step motors have 50 pole pairs, so the electrical frequency is 50X the shaft speed. For Ke, the speed is mechanical (ω is shaft speed in rad/sec). All that remains to complete our model is to determine the values of the parameters.

Jim selected an HW23-601 IP65 rated step motor because it was the most powerful motor that fit the customer’s budget and could survive the typical environment of a generator. If we use one coil, the resistance should be 2 ohms and the inductance is 1.7 mH. Ke is not listed, so we measured it by spinning the motor with nothing connected to the windings.

Interestingly, Ke drops about 16% as the speed increases from 500 rpm to 2500 rpm, most likely due to motor eddy current losses. Finally, our load resistor for this experiment will be 50 ohms. Having indentified the equivalent circuit for our motor and load and with the parameters in hand, we built a simple spreadsheet model of our generator.

The model predicts that the current will rise with speed and still be increasing fairly linearly at a speed of 2500 rpm and current of 1.1 amps. Let’s see how that compares with Jim’s lab results:

Our model was overly optimistic: the real output current leveled off at slightly less than 0.8 A. Did Don lead us astray or did we just get one of the parameters wrong? In computer modeling, like most endeavors, experience pays. You know what’s gone wrong before and when it happens again, we have a good idea “where the bodies are buried”. In this case, we suspected the inductance value. The easiest way to measure step motor inductance is with an inductance bridge, the same way you might measure a small signal inductor used in an electrical circuit. But those bridges typically use a small amount of current to excite the device under test. Putting a tiny current through a step motor winding doesn’t operate the stator steel at the same place on the BH curve that you would reach when the rated current is applied to the coils, so the inductance you measure will be lower than it is under normal operating conditions. We decided to measure the large signal inductance using a technique known as the “shorted turn method”, as described on page 154 of Bert Leenhouts’ classic The Art and Practice of Step Motor Control:

Now, as can be seen below, the calculated data more closely resemble the lab results, and equally important, the shape of the curve is much improved.

But we still don’t have a perfect match. Step motors are known to be non-linear. Just as large signal inductance differs from its small signal counterpart, it is reasonable to assume that Ke is reduced when the windings are energized. If it were reduced by 13%, we’d have a model that perfectly matches the test results.

We went to a lot of effort to build and confirm our model. Yet it yielded no more or better information than the lab test, so why bother? There are two reasons for model based design. First, building the model can give us insight into how the system works that we wouldn’t get from running lab tests. Simply staring at the equations can make that light go on in your head. Also, we want to optimize the system so we can deliver to our customers the best performance per dollar, because that’s what responsible business people do and it’s what we do every day at Applied Motion Products. In the lab, if we want to try a different motor winding, we’ll have to build a motor with the right number of turns and correct wire gauge, then spin it up and collect the data. With a model, that’s just a number on a spreadsheet. We can model 10 different windings, or combinations of winding turns and load resistance in five minutes.

**Originally posted in the motion control blog StepperGuru.com.**