You are on page 1of 6


#2 r 00

Lab. 2 DC-Motor Position Control and PID Controller OBJECT - to study the basic concepts of negative feedback through a DC-motor position control system. The derivation of the system's transfer function and the principles of a PID controller are also studied. REFERENCES - Modern Control Systems by R.C. Dorf, Modern Control Engineering by Ogata and EE 410 class notes. APPARATUS This experiment requires the following components from the modular servo system MS150 MkII (Feedback Instruments Limited): Pre-Amp Unit (PA15OC) DC Motor-Tacho Unit (MT150F) Power Supply (PS150E)

OP-Amp Unit (OU150A) Servo Amplifier (SA1500) Output Pot Unit (OP150K)

A function generator, an oscilloscope and printer, a DC voltage source, and a handheld digital tachometer are also required. A PC with an ADC (Analog to Digital Converter) and a DAC (Digital to Analog Converter) is provided as a digital PID controller. PART A - OPEN-LOOP TRANSFER FUNCTION Connect all the modular components as illustrated in Fig. 1 except the feedback from the output potentiometer should be disconnected from the op-amp module input. Make sure that the negative side of the tachometer output is connected to the tachometer input of the preamplifier module and that the positive side is connected to the ground. Check that the connection between the preamplifier module and the servo-amp is made with 2 wires (push-pull amplifier connection) as indicated in Fig. 1. Ensure that the preamplifier switch is in the Normal position and that the op-amp module switch is in the resistive-feedback position.

1 100 k Input 100 k -Av 100 k + C D + + 3 4 1 2 Servo-Amp +15v 0v gnd


Tacho DC Motor


-15v 1 3 2

Fig. 1. Servo System Block Diagram.

By comparing Fig. 1 and the block diagram shown in Fig. 2, the transfer function from the op-amp to the motor shaft (not to the gear shaft) can be determined. The step-down gear ratio is 30 to 1. As long as the velocity feedback is present the model based on the 1st order approximation is sufficient for subsequent experiments. Note that the unit of angular measure is revolutions. Note also that the tachometer feedback signal is multiplied by a factor of 0.15 in the preamplifier module.
volts -

+ 0.15 volts

K Ts + 1 -A



1 30






velocity to angle

potentiometer volts


Fig 2. Transfer Function Block Diagram

INSTRUCTIONS: 1.Adjust the zero-adjust potentiometers on the op-amp and preamplifier modules to remove any offset from the module outputs when the op-amp inputs are grounded. The preamplifier module has push-pull outputs so it is the voltage between the output terminals that must be nulled. Never connect either of the preamplifier module output terminals to ground.

2.Feed 1 volt DC into one of the inputs of the op-amp to turn the motor at a constant speed. Unused op-amp inputs should always remain grounded. Using

a handheld digital tachometer, measure the angular velocity of the motor in rpm, then convert this value to rps. Remember that "rps" are the units of angular velocity and "number of revolutions" are the units of angular position. The measured angular velocity divided by the input voltage (1 volt) is the gain K' shown in Fig. 3. Also measure the output voltage from the built-in tachometer. The ratio of this voltage to the digital tachometer reading is the feedback gain A. Try two other input voltages (0.5 volts and 1.5 volts) to verify that K' and A are reasonably constant. 3.Change the input to a square wave of 1 Vp-p amplitude (±0.5V) and approximately 0.2 Hz frequency. Observe the tachometer output voltage with the oscilloscope. Using the exponential curve representing the transient change of speed calculate the time constant T'. 4.Calculate the gain K and the time constant T according to the equivalence shown in Fig. 3. Confirm that velocity feedback has decreased the time constant of the DC motor. The simplified equivalent block should be used for the calculations and derivations in the remainder of this lab.
+ + 0.15

K Ts + 1 -A K' = K

K' T' s + 1 T T' = 0.15KA + 1

0.15KA + 1

Fig 3. Equivalent which includes Velocity Feedback

PART B - CLOSED-LOOP FEEDBACK CONTROL Connect the output of the position sensing potentiometer to one of the opamp module inputs to form a closed outer loop. Apply a square wave that swings from +1.0 volts to -1.0 volts as a position setting reference input (R(s)). Since the total supply voltage to the position sensing potentiometer is 30 volts for the total rotation of 360 degrees the dial attached to the output shaft should show a total excursion of ±12 degrees. An overshoot greater than 30% is expected. 1.Display the output of the position feedback potentiometer on the oscilloscope. Find the system damping factor and natural frequency from the observed step response (see Figure 5.8, page 224 in Dorf). For greater accuracy in

determining the system damped frequency you may wish to use the second or third peak rather than the first. 2.Change input waveform from a square to a 8V p-p (±4V) triangular wave of around 0.125 Hz, and observe the output of the op-amp module (the error signal). Since the open-loop system is a Type I system, the error, sometimes called the "velocity offset" remains without being removed by the feedback. Measure this offset and the rate of change (Volts/sec) of the reference triangular waveform. 3.Using the block diagram of the system, derive the closed-loop transfer functions Y(s)/R(s) and E(s)/R(s). Using these transfer functions derive expressions for the closed-loop system damping factor and natural frequency in terms of K' and T'. Use these expressions to calculate the theoretical values of the damping factor and natural frequency. Compare these values with the experimentallydetermined values from step 1. 4.Use the E(s)/R(s) transfer function to determine the theoretical value for the system steady-state error. Compare with the value measured in step 2. PART C - DIGITAL PID CONTROLLER Start the PID controller program from the supplied bootable floppy disk. The program will prompt for the proportional (Gp), integral (Gi) and derivative (Gd) controller gains. Press <Return> to leave a parameter unchanged. Once all three parameters have been chosen the PID controller algorithm will operate until the button on the controller Input/Output box is pressed. A PID controller, sometimes referred to as a three-mode controller, is expressed by the Laplace transform: G(s) = Gp + Gi/s + Gds Since a device which provides ideal derivative action is physically unrealizable the derivative term is approximated by Gds/(ατds +1), where τd is the derivative time constant (Gd/Gp) and α is typically between 0.05 and 0.2. The digital PID controller uses the following algorithm, where T is the sampling interval, to generate the output Y(k) from the input samples X(k).

Proportional action: Integral action: Derivative action: Output:

Yp(k) = Gp X(k) Yi(k) = Yi(k-1) + Gi X(k) T Yd(k) = Gd {X(k) - X(k-1)} /T Y(k) = Yp(k) + Yi(k) + Yd(k)

To avoid saturating the controller output as a result of small sampling times the input samples are filtered before applying them to the derivative calculation. This is analogous to the extra pole that had to be added to the continuous-time derivative section to make it realizable. Although the controller is digital, you should use the continuous-time equivalent (Laplace transform) model for this lab. Disconnect the wire joining points C and D and connect point C to Analog Input 0 on the I/O box and point D to I/O box Analog Output 0. 1.Set Gp=1.0, Gi=0.0, and Gd=0.0. Apply the same square wave as used in part B, display the feedback potentiometer signal on the oscilloscope, and verify that the closed-loop step response is not significantly different from the closed-loop step response obtained in part B. 2.Display the voltage at point D (Analog Output 0) on the oscilloscope and expand the horizontal time scale to show the small stepwise segments that make up the controller output. Use these steps to determine the sampling interval of the PID controller. 3.Add a proportional controller gain (Gp) term to the expressions derived in part B, step 3 for the closed-loop damping factor and natural frequency. 4.Display the feedback potentiometer signal on the oscilloscope. Press the button on the controller Input/Output box and change the proportional gain to Gp=2.0. Other gains remain 0.0. Verify that this change has the expected effect on the closed-loop damping factor and natural frequency. 5.Using the same triangle wave input as used in part B, test a PI controller with proportional gain Gp=1.0 and integral gain Gi=1.0. The PI controller adds a pole at the origin and a zero on the negative real axis to the system, so the openloop system is now of Type II. The velocity offset seen previously in part B should be eliminated. Confirm that there is no velocity offset in the error signal (E(s)) at point C.

6.Display the feedback potentiometer signal on the oscilloscope and display the system response using the square wave input from part B. In your opinion, is the response more or less damped than with simple proportional control (Gp=1.0)? Increase the integral gain to Gi=2.0 while keeping Gp=1.0. Does increasing Gi further increase or decrease the damping factor? Sketch some pole-zero diagrams showing the positions of the open-loop poles and zeros to explain the observed results. 7.Test the square-wave response of the system including a PD controller with proportional gain Gp=1.0, Gi=0.0 and derivative gain Gd=0.1. Derive the closed loop transfer function Y(s)/R(s) and expressions for the closed-loop system damping factor and natural frequency in terms of K', T', Gp and Gd. Calculate the theoretical damping factor and natural frequency for the system. What would you expect the step response of such a system to look like? In your opinion, does the observed response resemble the expected response? 8.Disconnect the PID controller entirely and turn off the servo system. Run the PID controller alone. Set a proportional gain of Gp=1.0, an integral gain of Gi=1.0, and a derivative gain of Gd=0.1. Feed a square wave of ?0.5 volts into the controller Analog Input and observe the Analog Output. Explain the waveform by relating prominent features to each of the 3 actions in the PID controller. Any DC offset in the signal generator output or in the analog to digital converters will be integrated so you should display the waveform fairly quickly after starting the controller, before the output integrates all the way to the positive or negative limit of the digital to analog converter.

Im PI x x Re x

Im PD Re x





s + Gi/Gp s

Gd (s+Gp/Gd)

Fig 4. Root locus plots for P, PI and PD control