Sei sulla pagina 1di 13

SERVOMECHANISMS AND SYSTEM IDENTIFICATION

Introduction.
This laboratory looks at the evaluation and use of transfer functions in order to predict the response of a system. The
open-loop response of a small rotary servo system is measured and approximated with the use of a Step response.
The transfer function is then used to determine the undamped natural frequency and the damping ratio of the closed-
loop system. This is compared with the actual measured step response and with that predicted by a simple computer
simulation.

NOTE: The zip files for the labs can be downloaded from http://www.ncl.ac.uk/eee/current-students/stage2/labs/.

Quanser QUBE-Servo System


The Quanser QUBE-Servo is a direct-drive rotary servo system. Its motor armature circuit schematic is shown in
Figure 1 and the electrical and mechanical parameters are given in Table 1. The DC motor shaft is connected to
the load hub. The hub is a metal disk used to mount the disk or rotary pendulum and has a moment of inertia of Jh .
A red disk load is attached to the output shaft with a moment of inertia of Jd .

Figure 1: QUBE-Servo DC motor and load

The back-emf (electromotive) voltage eb (t) depends on the speed of the motor shaft, ωm , and the back-emf constant
of the motor, km . It opposes the current flow. The back emf voltage is given by:

𝑒𝑏 (𝑡) = 𝑘𝑚 𝜔𝑚 (𝑡) (1.1)

Symbol Description Value


DC Motor
Rm Terminal resistance 6.3 Ω
kt Torque constant 0.036 N-m/A
km Motor back-emf constant 0.036 V/(rad/s)
Jm Rotor inertia 4.0 × 10−6 kg-m2
Lm Rotor inductance 0.85 mH
mh Load hub mass 0.0087 kg
rh Radius of disk load 0.0111 m
Jh Load hub inertia 1.07 × 10−6 kg-m2
Load Disk
md Mass of disk load 0.054 kg
rd Radius of disk load 0.0248 m

Table 1: QUBE-Servo system parameters

SSI v1.0 (Dec 2015) MA


Part 1: First-Order Step Response
Theory
Consider the time-domain system in figure 2. Here an input signal, r(t), is applied to a system, h(t), and this results in
an output signal, y(t).

r(t) y(t)

Figure 2: Time-domain system

This time-domain system can be converted to the continuous frequency domain using the Laplace Transform (L); the
resulting system is shown in Figure 3.

R(s) Y(s)

Figure 3: Time-domain system

Here, R(s), H(s) and Y(s) are the Laplace transforms of the input, system, and output respectively. ‘s’ is the Laplace
operator (s = jω, where ω = frequency [rad/s] ). By definition, H(s) is the transfer function of the system:

𝑌(𝑠)
𝐻(𝑠) = 𝑅(𝑠) …… or; 𝑌(𝑠) = 𝑅(𝑠)𝐻(𝑠) (1.2)

The step response test is a very common test in control systems. This test is very simple; a step input signal is
applied to a stable system and the output response is recorded. Consider a first order system that can be
represented by the following transfer function:
𝑌(𝑠) 𝐾
= 𝜏𝑠+1 (1.3)
𝑅(𝑠)

Here, K = steady state gain (DC gain) of the system, and τ = time constant of the system. The output response of
the system, as a result of applying a step input signal, is shown in Figure 4. The step input begins at time t0 . The input
signal has a minimum value of umin and a maximum value of umax . The resulting output signal is initially at y0 . Once
the step is applied, the output tries to follow it and eventually settles at its steady-state value yss .

From the output and input signals, the steady-state gain is:
∆𝑦
𝐾 = ∆𝑢 (1.5)

where ∆y = yss − y0 and ∆u = umax − umin . The time constant of a system τ is defined as the time it takes the
system to reach 1 − 1/e ≈ 63.2% of its steady-state value. Therefore, we define;

𝑦(𝑡1 ) = 𝑦0 + 0.632∆𝑦 where 𝑡1 = 𝑡0 + 𝜏 (1.6)

From a practical perspective, identify point y(t1 ) from the response. The time constant can then be found as:

𝜏 = 𝑡1 − 𝑡0 (1.7)

SSI v1.0 (Dec 2015) MA


Figure 4: Input and output signal used in the step response test
Task 1
 1.1 For the system shown in Figure 4, determine the steady state gain and time constant of the system
under test. Hence, derive the Laplace Transfer Function for the system.

The s-domain representation of a step input voltage with a time delay t0 is given by:

𝑅0 𝑒 (−𝑠𝑡0 )
𝑉𝑖 (𝑠) = (1.8)
𝑠

where R0 is the amplitude of the step and t0 is the step time (i.e. the delay is represented by the exponential term).
If we assume no time delay, then;

𝑅0
𝑉𝑖 (𝑠) = (1.9)
𝑠

Application
Consider the QUBE-Servo system. Conveniently, the voltage-to-speed transfer function of the QUBE-Servo system
is:

Ω𝑚 (𝑠) 𝐾
= 𝜏𝑠+1 (1.10)
𝑉𝑖 (𝑠)

Where;
Ωm (s) = L[ωm (t)] is the speed of the load gear.
Vm (s) = L[vm (t)] is the applied motor voltage.
K is the model steady-state gain, τ is the time constant, of the system,

If we substitute input 1.8 into the system transfer function 1.10, we get:

𝑅0 𝑒 (−𝑠𝑡0 ) 𝐾 𝐾𝑅0 𝑒 (−𝑠𝑡0 )


Ω𝑚 (𝑠) = . 𝜏𝑠+1 = (1.11)
𝑠 𝑠(𝜏𝑠+1)

SSI v1.0 (Dec 2015) MA


Task 2
NOTE: The zip files for the labs can be downloaded from http://www.ncl.ac.uk/eee/current-students/stage2/labs/.

 2.1 Open Labview, and load the project ‘QUBE-Servo Bumptest’. This project has a pre-prepared Virtual
Instrument (VI) that applies a 2V step to the motor and reads the servo velocity using the encoder. (The VI
comprises of two windows; a Front Panel and a Control and Simulation Block Diagram, as shown in Figure
5. It is possible to switch between both windows by pressing Ctrl + E). To apply the step input for 2.5
seconds, set the Final Time of the Simulation Loop to 2.5 (instead of Inf ).

 2.2 Run the VI to apply a 2 V step to the servo (click on the white arrow on the toolbar). As shown in Figure
4 (or see the Control and Simulation Block Diagram on your computer), the step response test is "saved"
using the Collector block (from the Labview Control Design & Simulation | Simulation | Utilities palette) and
displayed in an XY Graph. LabVIEW graphs (as opposed to charts) have cursors that can be used to take
measurements.

 2.3 From the recorded response, determine the model parameters and thus the transfer function for the
system (same method as Task 1). To do this accurately, use the Cursor palette in the XY Graph to measure
the necessary points off the plot.

(a) Front Panel

(b) Block Diagram

Figure 5: Virtual Instrument; showing step response test of the QUBE Servo motor
SSI v1.0 (Dec 2015) MA
 2.4 Record the motor speed response and the input voltage signal. Note: You can use Export | Export
Simplified Image to save the measured load/disk speed and motor voltage to a picture file for use in your final
report.
 2..5 To check if your derived model parameters K and τ are correct, modify the VI to include a Transfer Function
block with the first-order model determined in Task 2.3, as shown in Figure 6. Display both the measured
and simulated QUBE-Servo responses in one scope (using the Build Array block from the Array category).

HINT: To add new elements to the model, open the Controls Pallette (from the menubar at the top, go to:
View/Controls Pallette). You can then browse the various libraries to find the parts required, or you can you use
the ‘Search’ tab  ‘Functions’ sub-tab menu and simply type in the name of the part; if all is well Labview will
instantly locate the required part from the libraries. Drag and drop this into the simulation model.

 2.6 Run the VI. Record the figure displaying both the measured and simulated response in one plot, as well as
the input voltage signal. Stop the VI.

 2.7 Did you derive the model parameters K and τ correctly? Explain your results.

Figure 6: Validating step response model

Part 2: Second-Order Step Response

Theory
So, far we have only looked at the step response of a first order system. Here, we will consider second order
systems. The transfer function for a classic second order system, H(s) is of the following form;
𝜔2
𝐻(𝑠) = 𝑠2 +2𝜁𝜔𝑛 𝑠+𝜔2 (1.12)
𝑛 𝑛

where ωn is the natural frequency and ζ is the damping ratio. Therefore, if an input signal is applied to a second
order system, the output response will depend on the input signal itself and the values of the parameters ωn and ζ .

Figure 7 shows the characteristic time domain output response of a second order system, as a consequence of
applying a step input signal to the input at time t = t0. Recall the Laplace transform for a step input voltage from
Equation 1.8.

SSI v1.0 (Dec 2015) MA


Figure 7: Characteristic second-order step response
output response y(t) = red trace; step input r(t) = blue trace

The maximum value of the response is denoted by the variable ymax and it occurs at time tmax . For a response
similar to Figure 7, the percentage peak overshoot, Mp, is determined as follows:
(𝑦𝑚𝑎𝑥 −𝑅𝑜 )
𝑀𝑝 (%) = 100 (1.13)
𝑅𝑜

The peak time of the system, tp, is the time it takes for the response to reach the peak value, following the application
of a step input signal at time, t0 . Hence:

𝑡𝑝 = 𝑡𝑚𝑎𝑥 − 𝑡0 (1.14)
As mentioned previously, in a second-order system, the output response depends on the values of the parameters
ωn and ζ . The amount of overshoot depends solely on the damping ratio parameter and it can be calculated using
the equation:
−𝜋𝜁

√1−𝜁2
𝑀𝑝 = 100𝑒 (1.15)
The peak time depends on both the damping ratio and natural frequency of the system and it can be determined by:
𝜋
𝑡𝑝 = 𝜔 (1−𝜁 2)
(1.16)
𝑛

Task 3
 3.1 For the system shown in Figure 7, determine the damping ratio and natural frequency of the system of
the second order system under test. Hence, derive the Laplace Transfer Function for the system.

SSI v1.0 (Dec 2015) MA


Application

To demonstrate the principles of a second order step response, let’s consider the closed loop rotary position
control of the QUBE-Servo. The block diagram of such a control system is shown in Figure 8.

Figure 8: Unity feedback loop

Here, the QUBE-Servo voltage-to-position transfer function is:

𝜃𝑚 (𝑠) 𝐾
𝑃(𝑠) = 𝑉𝑚 (𝑠)
= 𝑠(𝜏𝑠+1) (1.17)

Where:

K = is the motor model steady-state gain (refer to your answer to task 2.3)
τ = is the model time constant (refer to your answer to task 2.3)
Θm (s) = L[θm (t)] is the motor / disk position (L = Laplac e Transform )
Vm (s) = L[vm (t)] is the applied motor voltage (L = Laplace Transform )

The controller is denoted by C (s).Here, we are only going to use a unity gain proportional controller. Therefore;

𝐶(𝑠) = 1 (1.18)

The closed loop transfer function, H(s), of the overall system is defined as:

𝜃𝑚 (𝑠) 𝐶(𝑠)𝑃(𝑠)
𝐻(𝑠) = 𝑅(𝑠)
= 1+𝐶(𝑠)𝑃(𝑠) (1.19)

Task 4
 4.1 Using equation 1.19, determine the general closed-loop transfer function for the QUBE-Servo position
controller shown in Figure 8. Hint: Your final result should be of the same form as that shown in Equation
1.12

 4.2. Substitute the motor model parameters into the general transfer function (as determined in Task 2.3).
From this, find the natural frequency, ωn , and damping ratio, ζ , of the system.

 4.3. Based on the calculated values of ωn and ζ , what is the expected peak time and percentage overshoot
of the QUBE-Servo system if a step response is applied to the input of the closed loop position controller?

SSI v1.0 (Dec 2015) MA


Task 5
NOTE: The zip files for the labs can be downloaded from http://www.ncl.ac.uk/eee/current-students/stage2/labs/.

 5.1 Open Labview, and load the project ‘QUBE-Servo Second Order’. This project has a pre-prepared
Virtual Instrument (VI) as shown in Figure 9. This implements the unity feedback control introduced in
Figure 8. A step reference of 1 rad is applied at 1 second and the controller runs for 2.5 seconds. This is
the desired position or setpoint signal.

 5.2 Run the VI. Record the QUBE-Servo position response - showing both the setpoint and measured
positions in one scope - as well as the motor voltage. To do this, you can use the Export | Export Simplified
Image to save the measured load/disk speed and motor voltage to a picture file.

 5.3 Using the ‘saved’ response in the Front Panel, measure the peak time and percentage overshoot from
the response and compare that with your expect results. Hint: Use the cursor palette in the XY Graph to
measure points off the plot. Explain your results.

(a) Front Panel

(b) Block Diagram


Figure 9: Unity feedback position control of QUBE-Servo
 5.4. Finally, consider the impact of the proportional gain on the control system response. Set the value of
proportional gain to 5. Re-run the VI and observe the response. Record the plots for your report. Explain
your results, linking to theory. HINT: you may wish to re-calculate the closed loop transfer function – see

SSI v1.0 (Dec 2015) MA


Part 3: PID CONTROL
Theory
Recall, as originally defined in Task 3, the QUBE-Servo voltage-to-position transfer function is:

𝜃𝑚 (𝑠) 𝐾
𝑃(𝑠) = 𝑉𝑚 (𝑠)
= 𝑠(𝜏𝑠+1) (1.20)

where K = is the model steady-state gain, τ = is the model time constant, Θm (s) = L[θm (t)] is the motor / disk
position, and Vm (s) = L[vm (t)] is the applied motor voltage. Based on Task 3, you should have precise numerical
values for the model parameters for your particular servo kit.

PID Control
The proportional, integral, and derivative control can be expressed mathematically as follows:

𝑡 𝑑
𝑢(𝑡) = 𝑘𝑝 𝑒(𝑡) + 𝑘𝑖 ∫0 𝑒(𝑡) 𝑑𝑡 + 𝑘𝑑 𝑑𝑡 𝑒(𝑡) (1.21)

The corresponding block diagram is given in Figure 10. The control action is a sum of three terms referred to as
proportional (P), integral (I) and derivative (D) control gain. The controller Equation 1.21 can also be described by the
transfer function

𝑘𝑖
𝐶(𝑠) = 𝑘𝑝 + 𝑠
+ 𝑘𝑑 𝑠 (1.22)

Figure 10: Block diagram of PID control

The functionality of the PID controller can be summarized as follows. The proportional term is based on the present
error, the integral term depends on past errors, and the derivative term is a prediction of future errors. The PID
controller described by Equation 1.21 or Equation 1.22 is an ideal PID controller. However, attempts to implement
such a controller may not lead to a good system response for real-world system. The main reason for this is that
measured signals always include measurement noise. Therefore, differentiating a measured (noisy) signal will result
in large fluctuations, thus will result in large fluctuations in the control signal.

SSI v1.0 (Dec 2015) MA


PD Position Control
The integral term will not be used to control the servo position. A variation of the classic PD control will be used:
the proportional-velocity control illustrated in Figure 11. Unlike the standard PD, only the negative velocity is fed
back (i.e. not the velocity of the error ) and a low-pass filter will be used in-line with the derivative term to suppress
measurement noise. The combination of a first order low-pass filter and the derivative term results in a high-pass
filter, H (s), which will be used instead of a direct derivative.

Figure 11: Block diagram of PV control

The proportional-velocity (PV) control has the following structure:

𝑢(𝑡) = 𝑘𝑝 (𝑟(𝑡) − 𝑦(𝑡)) − 𝑘𝑑 𝑦̇ (𝑡) (1.23)

where kp is the proportional gain, kd is the derivative (velocity) gain, r = θd (t) is the setpoint or reference
motor / load angle, y = θm (t) is the measured load shaft angle, and u = Vm (t) is the control input (applied
motor voltage). The closed-loop transfer function of the QUBE-Servo is denoted Y (s)/R(s) = Θm (s)/Θd (s).
Assume all initial conditions are zero, i.e., θm (0− ) = 0 and θm˙ (0− ) = 0, taking the Laplace transform of
Equation 1.23 yields

𝑈(𝑠) = 𝑘𝑝 (𝑅(𝑠) − 𝑌(𝑠)) − 𝑘𝑑 𝑠𝑌(𝑠) (1.24)

which can be substituted into Equation 1.20 to result in:


𝐾
𝑌(𝑠) = 𝑠(𝜏𝑠+1) (𝑘𝑝 (𝑅(𝑠) − 𝑌(𝑠)) − 𝑘𝑑 𝑠𝑌(𝑠)) (1.25)

Solving for Y (s)/R(s), we obtain the closed-loop expression:

𝑌(𝑠) 𝐾𝑘𝑝
= 𝜏𝑠2 +(1+𝐾𝑘 (1.26)
𝑅(𝑠) 𝑑 )𝑠+𝐾𝑘𝑝

This is a second-order transfer function. Recall, and compare to, the standard second-order transfer function

𝜔2
𝐻(𝑠) = 𝑠2 +2𝜁𝜔𝑛 𝑠+𝜔2 (1.27)
𝑛 𝑛
SSI v1.0 (Dec 2015) MA
Task 6

NOTE: The zip files for the labs can be downloaded from http://www.ncl.ac.uk/eee/current-students/stage2/labs/.

 6.1 Open Labview, and load the project ‘QUBE-Servo PV Control’. This implements the PV controller
previously outlined with a low-pass filter of 150/(s + 150) in-line with the derivative branch of the
controller resulting in a high-pass filter of 150s/(s + 150). (see figure 12)

 6.2 Set the Signal Generator block such that the servo command (i.e. reference angle) is a square wave
with an amplitude of 0.5 rad and at a frequency of 0.4 Hz.

 6.3.Set kp = 2.5 V/rad and k d = 0. Run the VI. Using the ‘saved’ response in the Front Panel, measure
the peak time and percentage overshoot from the response.

 6.4 Keep the derivative gain at 0 and vary k p between 1 and 4. What does the proportional gain do
when controlling servo position?

Hint: It will make it easier to adjust the gain if you set the Increment property of the numeric control to
0.1, or some other value.
 6.5 Set kp = 2.5 V/rad and vary the derivative gain kd between 0 and 0.15 V/(rad/s). What is its
effect on the position response?
 Stop the VI.

Task 7
 7.1 Find the proportional and derivative gains required for the QUBE-Servo closed-loop transfer
function given in Equation 1.27 to match the standard second-order system in Equation 1.26. Your
gain equations will be a function of ωn and ζ .

 7.2 For the response to have a peak time of 0.15 s and a percentage overshoot of 2.5%, the natural
frequency and damping ratio needed are ωn = 32.3 rad/s and ζ = 0.76. Using the calculated QUBE-
Servo model parameters, K and τ , calculate the control gains needed to satisfy these requirements.
 7.3 Run the PV controller with the newly designed gains on the QUBE-Servo. Attach the position
response as well as the motor voltage used. For example, you can use the Export | Export Simplified
Image to save the measured load/disk speed and motor voltage to a picture file and attach that to your
report.
 7.4 Measure the percent overshoot and peak time of the response. Do they match the desired percent
overshoot and peak time specifications given in Step 6 without saturating the motor, i.e., going beyond
± 10 V?

 7.5 If your response did not match the above overshoot and peak time specification, try tuning your
control gains until your response does satisfy them. Attach the resulting response, measurements,
and comment on how you modified your controller to arrive at those results.
(a) Front Panel

(b) Block Diagram

Figure 12: PV control on QUBE-Servo

Figure 13: QUBE-Servo PV control with kp = 2.5 and kd = 0.05.


PI Speed Control
The derivative term will not be used to control the servo speed. Y ou will develop a Proportional-Integral (PI)
speed controller to regulate the speed of the Qube dc motor. The controller you will design takes the actual
speed of the Qube motor as the derivative of the encoder measurements, and the commanded speed will vary
with time. The PI controller is one of the most common control algorithms. It combines the error reduction of
proportional control, with the offset elimination of integral control. The proportional term tracks the instantaneous
error, while the integral term controls the offset by tracking the total error over time. The longer there is error in the
system, the more the integral term tries to compensate. Though the lack of a derivative term can cause overshoot
and a longer settling time, for systems with simple dynamics the algorithm can provide near-optimal performance
with no steady-state error. In the time-domain, the linear behavior of a PI controller can be described by:

𝑡
𝑢(𝑡) = 𝑘𝑝 (𝑟(𝑡) − 𝑦(𝑡)) + 𝑘𝑖 ∫0 (𝑟(𝑡) − 𝑦(𝑡)) 𝑑𝑡 (1.28)

where u(t) is the control signal, r(t) is the reference, and y(t) is the measured process output.

Task 8
 8.1 From Equation 1.28, determine the PI controller transfer function in the Laplace domain.

 8.2 Using your answer to 8.1, determine closed loop transfer function of the system transfer function in the
Laplace domain.

 8.3. What is the steady-state error of the closed-loop system?

 8.4 Reconsider the Labview project ‘QUBE-Servo PV Control’ from Task 6.This implemented a velocity
feedback PD controller. Using this project as a template, re-design the control structure to be a closed
loop PI speed controller. Save your new project as ‘Qube-Servo Speed Control’

 Think carefully when implementing your controller; and remember; you need to measure the
motor speed not position!

 When testing the PI control system initially set the PI gains as follows: kp = 0.2 and ki = 0

 Run the VI. Observe the performance of the PI controller, and comment on the dynamic and steady
state performance of the system. Record your results.

 8.5 Carefully adjust the values of kp and ki to improve the performance of the closed system. Start by
increasing the value of kp and comment on the overall impact on the motor speed response. Then, gradually
increase the value of ki and again observe and record the overall impact on the motor speed response.

 8.6 Tune the controller to achieve a speed response with minimum overshoot. Record the values of kp and ki
applied and record the output response.

 8.7 Tune the controller to achieve a speed response with minimum settling time. Record the values of kp and
ki applied and record the output response.