|
|
For this example, we will assume the following values for the physical parameters:
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.
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:
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:
J=0.01; b=0.1; K=0.01; R=1; L=0.5; A=[-b/J K/J -K/L -R/L]; B=[0 1/L]; C=[1 0]; D=0;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:
step(A, B, C, D)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.
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:
[num,den]=ss2tf(A, B, C, D)Type this command at the Matlab prompt, you should get the result:
num =
0 0 2
den =
1.0000 12.0000 20.2000
num=num(3);
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.