Vous êtes sur la page 1sur 12

MME 3350b Laboratory #2: Position Servo

Page

DEPARTMENT OF MECHANICAL AND MATERIALS ENGINEERING


MME 3350b System Modeling and Control
Laboratory #2: Position Servo

1. OBJECTIVE
To obtain experience with the design and behaviour of a DC servo position control system and to
develop an understanding of control principles as well as real-time control implementation
software and hardware.
2. APPARATUS
DC motor, cradle, linear bearings, Gearbox and drive pinion
PC equipped with National Instrument data card and LabView software for data
acquisition and implementation of controller
Resistance based linear position sensor
Fixed rack
The system to be controlled consists of a DC servo motor mounted on a cradle and linear
bearings that is able to move along a horizontal bar. The motor connects to the pinion through a
gearbox with a gear ratio of 3.71 which can adjust the position of the motor on a fixed rack. A
LabView script controls the motor either manually by controlling the input voltage to the motor
or via a controller (Three term PID or a Lead Compensator).

Figure 1: Position Servo experimental setup

MME 3350b Laboratory #2: Position Servo

Page

3. MODELING
The system can be modeled as shown in Figure 2:

Figure 2: Representation of System

In general, the torque generated by a DC motor is proportional to the armature current and the
strength of the magnetic field. In this example it is assumed that the magnetic field is constant
and, therefore, the motor torque is proportional to only the armature current i by a constant factor
Kt as shown in the equation below. This is referred to as an armature-controlled motor.

The back emf, e, is proportional to the angular velocity of the shaft by a constant factor Kg.

In SI units, the electrical power loss via armature resistance R is considered negligible and hence
the motor torque and back emf constants become equal, ie. Kt = Kg.
The equations of motion can be derived at the pinion end using Newtons 2nd law for the
mechanical system and Kirchoffs Law for the DC motor as follows:
(1)
(2)
Here,
is the angular displacement at the pinion and therefore Jtotal corresponds to the total
equivalent rotational inertia of the system at the pinion end. The motor torque at the pinion is
represented by Tp which due to the Gear ratio N ( >1) at the gear box becomes NTm or N times
the motor torque Tm. The damping coefficient b of the system and the armature inductance
are neglected for simplicity. If the interaction force between the pinion teeth and the rack is
denoted by F, a simple free body analysis of the system yields:

MME 3350b Laboratory #2: Position Servo

Page

(3)

where m is the total mass of the carriage and the translational displacement
.

(4)

In order to calculate the total inertia Jtotal at the pinion, we need to find the equivalent inertia of
the motor
at the pinion end. Considering that the kinetic energy of the motor is the same at
the motor position and at the pinion end and since
,

(5)

Kinetic energy of the motor can be written as:


,
where
(6)
The total inertia of the system at the pinion becomes:
(7)
The inertia of the pinion
can be calculated by approximating the pinion as a cylinder with
radius r (equal to pitch circle radius), height h and density :
(8)
Substituting Equations (3) to (8) into Equations (1) and (2) and taking Laplace transform we get:
(9)
(10)
Eliminating I(s) from the above equations yields the transfer function of the system
(11)
which is of the form:
where

Since X
, transfer function between the output X(s) and the input Va(s) is obtained
by multiplying both sides of Equation (11) by r.

MME 3350b Laboratory #2: Position Servo

Page

The system parameters for the current system are shown in Table 1 and are employed for
constructing the transfer function in MATLAB for the purposes of performing a simulation
study.

0.00001933941
0.0065 m
3.71
0.022
5.3
0.731 kg
Table 1: System parameters

Block diagram representation of the feedback control system for the position servo is shown in
Figure 3.

Figure 3: Block diagram representation of feedback control system

The system can be simulated using Simulink utilizing the feedback loop presented in Figure 3.
Further, a controller can be implemented by adding a PID controller block and the reference
input can be incorporated by adding a step reference position block as shown in Figure 4. The

MME 3350b Laboratory #2: Position Servo

system transfer function now represents

Page

and was obtained by multiplying the transfer

function tf2 calculated within MATLAB by a factor of 100 to convert the linear displacement
from meters to centimeters. The reference position in the experiment is to be measured in
centimeters.

Figure 4: Simulink representation of feedback control system


4. PID AND LEAD COMPENSATION CONTROL
4.1. Proportional Control
When the feedback control signal is made to be linearly proportional to the error, the result is
called proportional feedback. The general form of this feedback is
.

(12)

Here the controller is defined by a constant , called the proportional gain. Increasing this gain
results in shorter rise time (faster response) and increased overshoot.
4.2. Derivative Control
Derivative feedback has the form
.

(13)

Here the constant


can be used in conjunction with proportional and/or integral feedback to
increase the damping and the overall stability of a system. It does this by providing anticipatory
action based on linear extrapolation of the error at some time ahead, since the correction supplied
depends on the rate of change of the error.
4.3. Integral Control
Integral control is used to reduce or eliminate constant steady-state errors. It has the form:

MME 3350b Laboratory #2: Position Servo

Page

(14)
The idea is that control action is taken even if the error is very small provided that the average of
the error has the same sign over a long period. In addition, this form of controller also provides
better disturbance rejection.
4.4. Proportional-Integral-Derivative (PID) Controller
All three of the above controllers can be combined to give PID control. This allows control over
the steady-state and transient errors of the system. All three gain constants may be adjusted to
obtain an acceptable degree of error reduction along with acceptable stability and damping.
In Laplace form, the controller transfer function is given by:
(15)
Here each of the constants can be adjusted (tuned) to obtain an acceptable performance.
4.5. Phase Lead Compensator
Lead compensator can be considered as a modified form of the PD controller and primarily
provides noise attenuation at high frequencies. In order understand the design a lead
compensator, consider a transfer function for the open loop system as:
(16)

This transfer function has poles at 0 and at


forward path as:

. A lead compensator

can be added to the


(17)

where T1 is chosen close to T such that the compensator zero at


is located left of the
system pole
while T2 is chosen such that the compensator pole at
is located further
to the left of the compensator zero. The purpose of adding a lead compensator is to increase
system stability by increasing damping and time coefficients are chosen to satisfy the required
system damping. For the derived model for the current position control system, T is found to be
0.04 by substituting the parameters from Table 1 in Equation (11). Therefore, for the purposes of
computer simulation, T1 is set to 0.0137 seconds and 0.00084746 seconds is chosen for T2.
However, for real-time control, Labview accepts the lead/lag compensation parameters in

MME 3350b Laboratory #2: Position Servo

Page

minutes. For this case, 0.00023 minutes and 0.00001 minutes are chosen for T1 and T2,
respectively.

4.6. Disturbance Rejection


Control systems can be subjected to external disturbances. A requirement of these systems is that
they recover quickly from disturbances with minimal residual error. One of the principal
advantages of feedback is that system error can be made less sensitive to disturbances when
compared to the open-loop counterpart. Generally speaking, PI controllers perform more
efficient in rejecting external disturbance than P controllers.
5. SIMULATION AND PRELAB
5.1. Proportional Controller
1. Download the Matlab m-file MME3350Lab2_Constants.m and the Simulink file
MME3350Lab2.slx from OWL (Extract from Lab2_Prelab.zip)
2. Run the m-file MME3350Lab2_Constants.m. This code initializes the system
transfer function and the corresponding values.
3. Open the Simulink file MME3350Lab2.slx.
4. Double click on the PID controller block to open the tuning dialogue.
5. Select P controller, set proportional gain to 8, click Apply and OK.
6. Double click on Step block to apply a step input to the system and modify the set point
by setting Final Value to 10 and click OK.
7. On the main Simulink toolbar (next to the Run button), change the Simulation Stop
Time to 0.8 seconds.
8. Run the simulation and double click on Scope to see the system response
Hint: In order to better visualize the effects of controllers on system response, right
click on the y-axis and select axes properties and set Y-min to 0 and Y-max to 20.
Make sure the same scales are used for each plot.
Save a screenshot of the plot which is needed for Prelab submission.
Repeat steps 2 to 8 using proportional gains of 1, 2 and 4. Comment on the effects of
proportional gain on system behavior, rise time, settling time and steady state error. Also,
comment whether the system steady state error match with the values that may be predicted
from the transfer function (i.e. system type).
Submit the plot and the discussion as Prelab document 1.

MME 3350b Laboratory #2: Position Servo

Page

5.2. Proportional + Integral Controller


1. Double click on the PID controller block to open the tuning dialogue, select PI
controller, set proportional gain to 8 and integral gain to 10.
2. Run the simulation and double click on Scope to see the system response
Save a screenshot of the plot which is needed for Prelab submission.
Comment on the effects of adding an integral controller on system behavior, rise time, settling
time and steady state error in your pre-lab report using integral gains of 5, 20 and 40.
Submit the plot and the discussion as Prelab document 2.

5.3. Proportional + Integral + Derivative Controller


1. Double click on the PID controller block to open the tuning dialogue, select PID
controller and set proportional gain to 8, integral gain to 10, derivative gain to 0.32
and filter coefficient to 61.5.
Comment on the need for using the filter coefficient that is embedded in the PID controller
block.
2. Run the simulation and double click on Scope to visualize the system response
Save a screenshot of the plot which is needed for Prelab submission.
Comment on the effects of adding a derivative controller on system behavior, rise time, settling
time and steady state error using derivative gains of 0.001, 0.1 and 0.8.
Submit the plot and the discussion as Prelab document 3.
5.4. Lead Compensator
1. Double click on the PID controller block and select P Controller. Set the
proportional gain to ten times the first gain value used in section 5.1 (set proportional
gain to 80).
2. Run the simulation and double click on Scope to visualize the system response
Save a screenshot of the plot which is needed for Prelab submission.
3. Download and open the Simulink file MME3350Lab2Lead.slx from OWL.
4. Double click on the PID controller block to open the tuning dialogue.
5. Select P controller, set proportional gain to 80, click Apply and OK.

MME 3350b Laboratory #2: Position Servo

Page

6. Double click on the Lead-Lag Filter block and set the time constants T1 to 0.0137 and
T2 to 0.00084746 and click OK.
7. Double click on Step block to apply a step input to the system and modify the set point
by setting Final Value to 10 and click OK.
8. Run the simulation and double click on Scope to see the system response
Save a screenshot of the plot which is needed for Prelab submission.
Comment on the effects of adding a lead compensator on system behavior i.e. overshoot, rise
time and settling time.
Submit the plots and the discussion as Prelab document 4.
6. EXPERIMENTAL PROCEDURE
6.1. Start-up
1. Load the LabView script PositionServoPID.vi
2. Ensure that the system is initially UNLOADED.
3. Turn on the power box.
4. Run the LabView script
5. Set position to 30 cm
6. Set the control mode to auto
7. Set all controller gains to zero.
6.2. Manual Control
1. Set control mode to manual
2. Use the DAC1OUT slider to control the motor voltage to change the motor position.
Comment on which dynamic parameter of the system (position, velocity or acceleration) seems
to correspond to voltage.
6.3. Closed Loop Control
1. Reinitialize the motor position.
2. Set Kc=0.3.
3. Plot the system response for a reference input of +10 cm displacement to move the
position from 30 cm to 40 cm.
Hint: In order to extract data from Labview, you can adjust the x (time) axis of the
Waveform Chart block as desired to get the best perspective, click on the Plot ON
button when ready to start plotting, collect data, click on the Plot ON button again to
stop plotting, then right click on the chart and use the export to clipboard function and

MME 3350b Laboratory #2: Position Servo

Page

10

paste the data in a text file. Please note that the sampling frequency of the DAQ is set
at 100Hz.
4. Repeat the process with Kc=0.1, 0.6 and 0.9.
Plot the three responses on one chart and include it in your report.
Comment on the effects of proportional gain on system behavior, steady state error, settling
time and rise time. Based on observations, comment on the effects of increasing Kc further
and whether higher Kc always better. Based on the derived transfer function for the system,
comment on the order of the system and the expected and actual steady state error to a step
input for the derived model.
5. Set Kc=0.1 and repeat step 3; then, add the integral controller by setting Ti=0.01 and
repeat step 3.
Plot the responses from P and PI controllers on one chart and include it in your report.
Comment on the effects of adding an integral controller to the system on system behavior,
steady state error, settling time and rise time.
6. Ti corresponds to integral time which is proportional to the inverse of integral gain.
This means that lowering Ti increases Ki. It should be noted that Ti in LabView is in
minutes. Repeat step 3 with Ti set to 0.05 and 0.005.
Comment on the effects of smaller values of Ti (larger Ki)
6.4. Disturbance Rejection
1. Reinitialize the motor position.
2. Set Kc=0.1 and other gains to zero.
3. Apply a disturbance to the system by clicking on the Apply Disturbance button. This
button applies 2 volts to the motor for a period of 0.1 seconds. Plot the system output.
4. Add the integral controller by setting Ti=0.005 and repeat step 3.
Plot the responses from P and PI controllers on one chart and include it in your report.
Comment on system stiffness, steady state error, responsiveness and other disturbance
rejection characteristics of the system such as settling time and amplitude using each
controller and also, which controller is preferred for this purpose.

MME 3350b Laboratory #2: Position Servo

Page

11

6.5. Loaded System


1. Reinitialize the motor position.
2. Set Kc=0.6 and Ti=Td=0.
3. Mount four 100 gram weights on the bolt.
4. Plot the system response for a reference input of +10 cm displacement to move the
position from 30 cm to 40 cm.
5. Compare with results obtained for the unloaded system with Kc=0.6
Plot the loaded and previously obtained unloaded responses in a single plot and include them
in your report.
Comment on the effects of increasing mass on rise time and settling time. Compare theoretical
and experimental calculations. Hint: Considering that the initial system mass is 731 grams
and the mass is increased by 400 grams, calculate relative change in rise time and settling time
after adding the mass. Use a standard second order and Equation (11) for your calculations.

6.6. Lead Compensator


1. Open Labview script PositionServoLead.vi
2. Reinitialize the motor position.
3. Consult the TA to get a suitable sampling frequency that can accommodate the lead
compensator implementation. A value of 1 kHz should be appropriate.
4. Set Kc=2 and Ti=Td=0 .
5. Set the lead compensator parameters to gain:1, lag time: 0 and lead time: 0 (ie. without
compensation)
6. Run the script
7. Plot the system response for a reference input of +10 cm displacement to move the
position from 30 cm to 40 cm.
8. Set the lead compensator parameters to gain:1, lag time: 0.00001 and lead time: 0.00023
(ie. with compensation)
9. Run the script
10. Plot the system response for a reference input of +10 cm displacement to move the
position from 30 cm to 40 cm.
Plot the responses from the P controlled system and with added lead compensation on one
chart and include it in your report.
Comment on system behavior after adding the lead compensator. Compare system behavior
with just a P controller by setting lead compensator lead and lag times to zero and gain to 1.

MME 3350b Laboratory #2: Position Servo

Page

12

Question: Which type of P, PI or PID controller is the behavior similar to? What happens if
the lead and lag values are changed? How is the delay in system behavior explained? What
are the benefits of a lead compensator?
7. Discussion of Reports and Formal Report
ONLY one formal group report is required. Make sure that names ALL group members are written on
the cover page with signatures to indicate the participation of each member.
Report must include answers to the posed questions in all of the experimental sections together with
discussion of results. In addition to the use of generated plots, populate the response details in Table 2 and
use this information as a basis for your discussion on system response behavior. You must submit all
plots used in your discussion.

Gain
Kc
P

Tracking
Ti

tr

Mp

Disturbance Rejection
ts

s.s.e

2nd OS
Magnitude

0.1

Control
0.3
0.6
0.9
For Dist
Rejection

0.1
0.1

0.01

0.1

0.05

0.1

0.005

Rejection

0.1

0.005

Loaded

0.6

PI
Control

For Dist

Lead
Comp.

2
Table 2: Experimental Response Summary

ts

s.s.e

Vous aimerez peut-être aussi