CMU
UM


Example: Modeling a DC Motor
Physical setup and system equations
Design requirements
Matlab representation and open-loop response
Transfer function

Physical setup and system equations

A common actuator in control systems is the DC motor. It directly provides rotary motion and, coupled with wheels or drums and cables, can provide transitional motion. The electric circuit of the armature and the free body diagram of the rotor are shown in the following figure:

For this example, we will assume the following values for the physical parameters:

* moment of inertia of the rotor (J) = 0.01 kg.m^2/s^2
* damping ratio of the mechanical system (b) = 0.1 Nms
* electromotive force constant (K=Ke=Kt) = 0.01 Nm/Amp
* electric resistance (R) = 1 ohm
* electric inductance (L) = 0.5 H
* input (V): Source Voltage
* output (sigma dot): rotating speed
* The rotor and shift are assumed to be rigid

Note that these parameters are chosen to be simple. The motors in real life may be more complex, and most likely will be running at a higher speed.

The motor torque, T, is related to the armature current, i, by a constant factor Kt. The back emf, e, is related to the rotational velocity by the following equations:

In SI units (which we will use), Kt (armature constant) is equal to Ke (motor constant).

From the figure above we can write the following equations based on Newton's law combined with Kirchhoff's law:

In state-space form, the equations above can be expressed by choosing the rotating speed and electric current as the state variables and the voltage as an input. The output is chosen to be the rotating speed.

Design requirements

First, our un-compensated motor can only rotate at 0.1 rad/sec with an input voltage of 1 Volt (this will be demonstrated later when the open-loop response is simulated). Since the most basic requirement of a motor is that it should rotate at the desired speed, the steady-state error of the motor speed should be smaller than 1%. The other performance requirement is that the motor will accelerate to its steady-state speed quickly after it's turned on. In this case, we want it to have a settling time of 2 seconds. Since a speed faster than the requirement may damage the equipment, we also want to have an overshoot smaller than 5%.

If we simulate the reference input (R) by a unit step input, then the motor speed output should have:

* settling time less than 2 seconds
* overshoot less than 5%
* steady-state error less than 1%

Matlab representation and open-loop response

We can put the above space-space equations into Matlab by defining the four matrices A, B, C, and D:


Create a new m-file and enter the following commands:

Now let's see how the original open-loop system performs. Add the following command onto the end of the m-file and run it in the Matlab command window: You should get the following plot:

From the plot we see that when 1 volt is applied to the system, the motor can only achieve a maximum speed of 0.1 rad/sec, ten times smaller than our desired speed. Also, it takes the motor 3 seconds to reach its steady-state speed; this doesn't satisfy our desired 2 second settling time criteria.

Transfer function

To solve this control problem, we will add a unity feedback controller to the system to improve the performance. The schematic of the closed-loop system is the following:

The transfer function in the plant block can be obtained by the following command: Type this command at the Matlab prompt, you should get the result: Although the first and second digits of the numerator are 0, Matlab will still consider it to be a second order polynomial. As you know, this should be a constant. This numerical limitation can cause trouble after we add the controller into the system. The total open-loop numerator (plant and controller) might be of higher order than the denominator. Matlab can't close the loop for this type of transfer function. To make sure that this is not a problem, we can add the following line to the m-file:
Make sure you only eliminate the zeros when you try this trick. If you choose the wrong index to save, you could end up losing information.
Next, we need to design the controller so that all the criteria can be satisfied. Several examples of designing a controller for the DC motor are available below; you may choose PID, Root locus, Frequency response, or State space.


User Survey
Your anonymous answers to the following questions will help us to improve future versions of these tutorials.
How useful was this example?
Very useful Useful Somewhat useful Not very useful A waste of time
How was the level of the example?
Too simple About right Too difficult
How much time did you spend on it?
Less than 30 mins. 30 - 60 mins. More than 60 mins.
How much of the Matlab code did you run?
None Some Most

We would like to hear about suggestions you have for improvement, difficulties you had with the tutorials, errors that you found, or any other comments that you have. This feedback is anonymous.

If you would like to receive a response, send your comments or questions to ctm-feedback@umich.edu


Modeling Examples
Cruise Control | DC Motor | Bus Suspension | Inverted Pendulum

DC Motor Examples
Modeling | PID | Root Locus | Frequency Response | State Space

Tutorials
Basics | Modeling | PID | Root Locus | Frequency Response | State Space | Examples

HOME INDEX COMMANDS

8/28/96 YS