Example: Root Locus Design for Digital DC Motor Position Control

Continuous to Discrete Conversion
Root Locus Design

In this digital DC motor control version of a DC motor, the controller will be designed by a Root Locus method. A digital DC motor model can obtain from conversion of analog DC motor model, as we will describe. According to the Modeling a DC Motor, the open-loop transfer function for DC motor's position was derived by Laplace Transform as shown.

where:

*electric resistance (R) = 4 ohm
*electric inductance (L) = 2.75E-6 H
*electromotive force constant (K=Ke=Kt) = 0.0274 Nm/Amp
*moment of inertia of the rotor (J) = 3.2284E-6 kg*m^2/s^2
*damping ratio of the mechanical system (b) = 3.5077E-6 Nms
*input (V): Source Voltage
*output (sigma dot): Rotating speed
*The rotor and shaft are assumed to be rigid

The design requirements are:

Continuous to Discrete Conversion

The first step in the design of a discrete-time system is to convert a continuous transfer function to a discrete transfer function. Matlab can be used to convert the above transfer function to discrete transfer function by using the c2dm command. The c2dm command requires four arguments: the numerator polynomial (num), the denominator polynomial (den), a sampling time (T) and a type of hold circuit. In this example we will use the zero-order hold (zoh). Refer to the Digital Control Tutorials page for more information.

From the design requirement, let the sampling time, T equal to 0.001 seconds, which is 1/100 of the required time constant or 1/40 of the required settling time. Let's create a new m-file and add the following Matlab code:

Matlab should return the following: As noticed in above results, both numerator and denominator of discrete transfer function have one extra root at z = 0. Also, we have to get rid of the leading zero coefficient in the numerator. To do this add the following code to cancel out these extra pole and zero to avoid numerical problem in Matlab. Otherwise it will consider both numerator and denominator to be fourth-order polynomial.

Therefore, the discrete-time transfer function from the motor position output to the voltage input is:

We would like to see what the closed-loop response of the system looks like when no controller is added. First, we have to close the loop of the transfer function by using the cloop command. After closing the loop, let's see how the closed-loop stairstep response performs by using the dstep and the stairs commands. The dstep command will provide the vector of discrete step signals and stairs command will connect these discrete signals (click here for more information). Add the following Matlab code at the end of previous m-file and rerun it.

You should see the following plot:

Root Locus Design

The main idea of root locus design is to obtain the closed-loop response from the open-loop root locus plot. By adding zeroes and poles to the original system, the root locus will be modified that leads to a new closed-loop response. First let's see the root-locus for the system itself imposed with an unit circle. In your m-file, add the following commands and rerun it. You should get the root-locus plot as shown below.

To get the zero steady-state error from the closed-loop response, we have to add an integral control. Recall that the integral control in the continuous- time is 1/s. If we use the backward difference approximation for mapping from the s-plane to the z-plane as described by s = 1/(z-1), one pole will be added at 1 on the root locus plot. After adding extra pole at 1, root locus will have three poles near 1, therefore the root locus will move out in the right half. The closed-loop response will be more unstable. Then we must add one zero near 1 and inside the unit circle to cancel out with one pole to pull the root locus in. We will add a pole at z = 0.95. In general, we must at least add as many poles as zeroes for the controller to be causal. Now add the following Matlab commands in to your m-file.

Recall from the Digital Control Tutorial page, the zgrid command should be used to find the desired region, which satisfies the design requirement, on the discrete root locus plot. The zgrid command requires two arguments: the natural frequency (Wn) and the damping ratio (zeta). From the design requirement, the settling time is less than 0.04 seconds and the percent overshoot is less than 16%. We know the formulas for finding the damping ratio and natural frequency as shown:


where:

OS: the percent overshoot
Ts: the settling time

The required damping ratio is 0.5 and the natural frequency is 200 rad/sec, but the zgrid command requires a non-dimensional natural frequency. Therefore Wn = 200*T = 0.2 rad/sample. Add the following Matlab code into the end of your m-file and rerun it.

You should get the following plot:

From the above root locus plot, we can see that system is unstable at all gains because the root locus is outside the unit circle. Moreover, the root locus should be in the region where the damping ratio line and natural frequency cross each other to satisfy the design requirements. Thus we have to pull the root locus in more by first canceling the zero at approximately -0.98, since this zero will add overshoot to the step response. Then we have to add one more pole and two zeroes near the desired poles. After going through some trial and error to yield the root locus in the desired region, one more pole is added at 0.61 and two zeroes are added at 0.76. Add the following command in your m-file and rerun it in Matlab window.

The denoc will have a pole at 0.61 instead of -0.98. You should get the following root locus plot:

From the above root locus plot, the root locus is drawn in the desired region. Let's find a gain, K, on the root locus plot by using the rlocfind command and obtain the stairstep response with the selected gain. Enter the following commands at the end of your m-file and rerun it.

In the Matlab window, you should see the command asking you to select the point on the root-locus plot. You should click on the plot as the following:

The selected gain should be around 330, and it will plot the closed-loop compensated response as follows.

From the above closed-loop response, the settling time is about 0.05 seconds which is satisfy the requirement, but the percent overshoot is 22% which is too large due to the zeroes. If we select the gain to be larger, the requirements will be satisfied. On the other hand, the problem will be unrealistic and a huge actuator is needed, you can try this yourself by picking a larger gain on the previous root locus plot which will yield an unrealistically sudden step response. So we have to move both one pole and two zeroes a little further to the right to pull root locus in a little bit more, new pole will be put at 0.7 and two zeroes should be at 0.85. Go back to your m-file and change only numc and denc as shown below and rerun it in Matlab window.

Then you should see the following root locus plot.

On the new root locus, you should click on the plot to select a new gain as the following:

The selected gain should be around 450, and then it will plot the closed-loop compensated response as follows:

Now we see that the settling time and percent overshoot meet the design require ments of the system. The settling time is 0.04 seconds and the percent overshoot is about 10%.

Then let's take a look at a disturbance response of the closed-loop system by canceling the selected gain, the integral transfer function and controller's transfer function from the closed-loop transfer function. So add the following code into your m-file and rerun it.

Matlab should return the following plot:

We can see that a response to the disturbance is small (3.3% of the disturbance ) and settles within 2% of the disturbance after 0.04 seconds and eventually reaches zero.


User Feedback

We would like to hear about difficulties you had with the tutorials, suggestions you have for improvement, errors that you found, or any other comments that you have. This feedback is anonymous; include your email address if you want a reply.


Digital Control Examples
Cruise Control:RL | Motor Speed: PID | Motor Position: RL | Bus Suspension: SS | Inverted Pendulum: SS | Pitch Controller: SS | Ball and Beam: PID

Motor Position Examples
Modeling | PID | Root Locus | Frequency Response | State Space | Digital Control: RL

Tutorials

Basics | Modeling | PID | Root Locus | Frequency Response | State Space | Digital Control | Examples

HOME INDEX COMMANDS

8/21/97 PP 8/24/97 WM