You are on page 1of 23

# UNIVERSITI TUN HUSSEIN ONN MALAYSIA

## Faculty of Mechanical and Manufacturing Engineering

__________________________________________________________________

## DEPARTMENT OF ENGINEERING MECHANICS

CONTROL LABORATORY
LAPORAN MAKMAL/LABORATORY REPORT
Kod M/Pelajaran/
Subject Code
Kod & Tajuk Ujikaji/
Code & Title of Experiment
Kod Kursus/
Course Code

ENGINEERING
LABORATORY VI

Seksyen /Section
No. K.P / I.C No.

Kumpulan/Group
Nama Pelajar/Name of
Student
Lecturer/Instructor/Tutors
Name
Nama Ahli Kumpulan/
Group Members

BDA 37101

No. Matrik
1.
2.
No.
Matrik

1.

Penilaian / Assesment
Teori / Theory

2.
3.
4.
5.
Tarikh Ujikaji /
Date of Experiment
Tarikh Hantar /
Date of Submission

Keputusan /
Results
Pemerhatian
/Observation
Pengiraan /
Calculation
Perbincangan /
Discussions
Kesimpulan /
Conclusion
Rujukan /
References
JUMLAH / TOTAL

10 %
15 %
20 %
10 %
25 %
15 %
5%
100%

COP DITERIMA/APPROVED
STAMP

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________
COURSE INFORMATION
COURSE TITLE: ENGINEERING LABORATORY VI (BDA 37101)
TOPIC 1: PV POSITION CONTROL
(INVERTED PENDULUM SYSTEM)
1.

INTRODUCTION

The IP02 consist of a precisely machined solid aluminium cart driven by a high
quality DC Motor equipped with a planetary gearbox. The cart slides along a
stainless steel shaft using linear bearings. The cart is driven via rack and pinion
mechanism. In the case of IP02, the cart position is sensed by a ten-turn
potentiometer. This cart is also equipped with rotary joint with ball bearings to
which a free turning erected rod can be attached and it can acts as an inverted
pendulum.

2.

OBJECTIVES

The objective of this experiment is to control the position of IP02 linear motion
servo plant. At the end of the session, student should know the following;
i) To simulate with a Simulink the IP02 model and to close the servo loop by
implementing a Proportional-plus-Velocity (PV) position controller.
ii) To change, during the simulation, the two gains, Kp and Kv, of the PV
controller and observe the effect on the position response.
iii) To implement with Wincon the previously designed PV position controller
in order to command your IP02 servo plant.
iv) To run the simulation simultaneously at every sampling period in order to
compare the actual and simulated response.
BDA37101-Edition III/2011

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________
3.

LEARNING OUTCOMES

At the end of this experiment, students should be able to understand the modeling
of the IP02 control system plant, simulate the system and control it using PV
controller scheme by simulation and in real time mode.

4.

THEORY

The IP02 plant system input is the commanded voltage to the DC Motor. Since we
want to control the carts position, the plant output is selected to be the carts
linear position on the rack as in Figure 1;

## Figure 1: The IP01 / IP02 Plant Input and Output

Thus the open loop transfer function for the IP02 system which is called G(s), can
be written as;
Head could be defined as :

G ( s)

x( s)
.(1)
Vm ( s)

Where
Vm : Motor voltage
x : Carts position
The mathematical modeling of the IP02 servo plant will provide the above
mentioned open loop transfer function, which in turns will be used to design an
appropriate controller. The simplified mathematical modeling is given in Equation
2 below. Complete derivation of the transfer function of the IP02 servo plant is
given in Reference [1].

G( s)

rmp G K G m K t
2
( Rm Mr s G K G2 m K t K m Beq Rm rmp
)s

BDA37101-Edition III/2011

2
mp

(2)

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________
Where
rmp

## : Planetary gearbox efficiency

force (EMF) constant
: Planetary gearbox gear ratio
damping coefficient
: motor efficiency
resistance
: motor torque constant

KG

m
Kt

4.1

## M : Total mass of the

carts system (i.e moving
parts)
K m : back electro-motive
B eq : equivalent viscous

R m : motor armature

## POSITION CONTROLLER DESIGN

The PV controller design in this laboratory for the IP02 servo plant is based on
corrective terms actions done by this controller. The PV controller scheme
introduces two corrective terms ; one is proportional (by K p ) to the position error
and the other is proportional (by K V ) to the velocity (or the derivative of the
actual position) of the plant. Equation 3 below expresses the PV control law,
where xd is the reference signal (i.e the desired position to track).

dxt
Vm (t ) K p x d (t ) xt K V
..(3)
dt
Figure 2 below depicts the block diagram of the PV control scheme as it will be
implemented in this lab session.

## Figure 2: Block diagram of the PV Control scheme

BDA37101-Edition III/2011

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________
4.1

BDA37101-Edition III/2011

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________

BDA37101-Edition III/2011

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________
5.

EQUIPMENTS

To setup this experiment, the following hardware and software are required:
i.
ii.
iii.
iv.

## Power Module: Quanser UPM 1503/2405, or equivalent.

Data Acquisition Board: Quanser MultiQ PCI / MQ3, or equivalent.
Linear Motion Servo Plant: Quanser IP02.
Real-Time Control Software:The WinCon-Simulink-RTX configuration,
as detailed in the Reference [5], or equivalent.
v. PC equipped with licensed MATLAB Simulink connected to item (i), (ii),
(iii) and (iv).
For a complete and detailed description of the main components comprising this
setup, please refer to the manuals corresponding to available configuration.

6.

PROCEDURES

6.1

## CONTROLLER DESIGN SPECIFICATIONS

In the present laboratory (i.e. the pre-lab and in-lab sessions), student will design
and implement a control strategy based on the Proportional-Velocity (PV) control
scheme, in order for the IP02 closed-loop system to satisfy the following
performance requirements (which are time-domain specifications):
The Percent Overshoot (i.e. PO) should be less than 10% (PO 10 %), i.e.
= 0.59
ii. The time to first peak (tp) should be 150 ms, i.e ; tp = 0.15 s
i.

From these specifications, the corresponding gains for proportional (Kp) and
velocity (Kv) controller are as follows ;
Kp = 274.62 V/m
Kv = 5.53 Vs/m

6.2

IP02 CONFIGURATION

This experiment is designed for an IP02 cart without the extra weight on it.
However, once a working controller has been tested, the additional mass can be
mounted on top the cart in order to see its effect on the response of the system. As
an extension to the lab, the first PV controller design could be modified in order to
account for the additional weight.
In this lab, it requires student to design a Proportional-plus-Velocity (PV)
controller to control the position of IP02 cart with the performance specifications
as stated in Section 6.0
BDA37101-Edition III/2011

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________
6.3

## CHECK WIRING AND CONNECTION

The first task upon entering the lab is to ensure that the complete system is wired
as fully describe in Reference [2]. You should be familiar with the complete
wiring and connections of the IP02 system during the preparatory session
described in Reference [1].
If still unsure of the wiring, please ask for assistance from the Teaching Assistant
assigned to the lab. When you are confident with your connections, you can power
up the UPM. You are now ready to begin the lab.

6.4

CONTROLLER

Step1.

Step 2.

Step 3.

Step 4.

Step 5.

Step 6.

## In Simulink, open a model called s_position_pv_ip01_2.mdl. This

diagram should be similar to the one shown in Fig.3. It includes a
subsystem containing IP02 modeled plant, as well as the PV controller
two feedback loops. In order to be conveniently changed on-the-fly,
the two controller gains Kp and Kv are both set by slider gains. Check
that the signal generator block properties are properly set to output a
square wave signal, of amplitude 1 and of frequency 2/3 Hz.
Before begin, student must run the Matlab script called
setup_lab_ip01_2_position_pv.m.This file initializes all the IP02
system parameters and configuration variables used by the Simulink
diagrams.
Ensure that the Simulink simulation mode is set to Normal. Click on
Simulation |Start from the Simulink menu bar, and bring up the
Position Response (m) scope. As student monitor the position
response, adjust Kqqp and Kv using the slider gains, as depicted in
Fig.4 and Fig.5. Try a variety of combinations, and note the effects of
varying each gain (one at a time) on the system response. Also bring
up the Position Error (m) as well as the Vm (V): Control Signal
scopes.
To specifically include in the laComplete the Table 1 which describe
the changes in the system response, characteristics tp and PO with
respect to changes in Kp and Kv. *Note: Hold one gain constant while
changing the other within the preset range. Provide at least 3 suitable
plots of the response described in Table 1.
Now that student is familiar with the effects of each one of the two
controller gains, enter in the designed Kp and Kv as provided in
Section 3.0 to meet the system requirements.
*Note: the values should fall within the slider limits.
After running the simulation with the gains set to their calculated
values, complete the Observation questions on Section 8.0.

BDA37101-Edition III/2011

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________
Step 7

If the simulated response is as expected, you can move to the next part
in order to implementa real time controller. If your response is close to
meeting the set requirements, try fine- tuning the controller gains to
achieve the desired response. If the system response is far from the
specifications, then re-iterate your design process and recalculate your
controller gains Kp and Kv.

Figure 3 Simulink Diagram used for the simulation of the PV control system

6.5

## PART 2: REAL TIME IMPLEMENTATION OF THE PV

CONTROLLER

After having designed the PV Controller, calculated its two gains satisfying the
desired time requirements, and checked the position response of the obtained
closed loop system through simulation, students are now ready to implement the
designed controller in real time and observe its effect on the actual IP02 Plant.

BDA37101-Edition III/2011

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________
Step 1: Open
only
one
of
the
following
models:
q_position_pv_mqpci_ip02.mdl. The student should obtain a similar
diagram as shown in Figure 6. The model has two parallel and
independents control loops: one runs a pure simulations of PV controller
connected to the same plant model as the one developed in the previous
lab experiment on the simulation part. The other loop directly interfaces
with the hardware and runs the actual IP02 plant.Open both subsystems
to familiarize with their composing blocks and take note the I/O
connections. Check that the model manual switch for the position set
point generation correctly selects the signal coming from the signal
generator block, called Square Wave. Also check that the signal
generator block properties are properly set to output a square wave
signal, of amplitude 1 and of frequency 2/3 Hz. Moreover, the sampling
time should be set to 1ms.
Step2:

Before compiling the diagram and running it in real time with WinCon,
student must enter the previously designed values of Kp and Kv in the
MATLAB Workspace. To assign Kp and Kv, type their value in the
MATLAB command window. Now students are ready to build the real
time code corresponding to the diagram by using the Wincon | Build
option from the Simulink menu bar. This command will generate the real
time code and will be compiled to the Wincon server. Manually move
the IP02 Cart to the middle of the track and make sure that it is free to
move on both sides. To start the real time controller, click on the
START/STOP button of the Wincon server window. The cart should be
tracking the desired setpoint.

Step3:

Open the sink Meas.(0) and Sim.(2) Resp. in a Wincon scope. Students
can now be able to monitor on-line, as the cart moves, the actual position
as it tracks the predefined reference input and compare it to the
simulation result produced by IP02 model. Click on the scope button of
the Wincon server to open the scope and choose the display that students
want to open (e.g Meas.(1) and Sim.(2) resp.) from the selection list.

Step4:

Once the results are in agreement with the desired design requirements
and the response looks similar to the one displayed in Figure 7, students
can move and begin writing report for this experiment. Remember there
is no such things as a perfect model, and that the calculated controller
gains Kp and Kv, were based on a theoretical and ideal plant model.

Step5:

## However, in order to perfectly meet the chosen design requirements of

the closed loop system, any controller design will usually involve someform of fine tuning. At this point student should be manually fine-tuning
the Kp and Kv based on the previous experimental observations in order
to ensure the response matches perfectly the system requirements.

BDA37101-Edition III/2011

10

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________

## Figure 7: Actual and Simulated Position Responses to a Square Wave Set

point

BDA37101-Edition III/2011

11

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________
7.

RESULTS
a. Complete the Table 1 which describe the changes in the system response,
characteristics tp and PO with respect to changes in Kp and Kv

Kv.

Kp (V/m) =
Kv
(Vs/m)

tp (s)

Kp (V/m)=
PO
(%)

Kv (Vs/m) =
Kp
(V/m)

tp (s)

Kv
(Vs/m)

Kp (V/m)=
tp (s)

PO
(%)

Kv (Vs/m)=
PO
(%)

Kp
(V/m)

Kv
(Vs/m)

tp (s)

PO
(%)

Kv (Vs/m) =

tp (s)

PO
(%)

Kp
(V/m)

tp (s)

PO
(%)

## b. Show the calculation.(if any)

c. Provide at least 3 suitable plots of the response described in Table 1 for
Part 1 of this experiment.
d. Provide at least 3 best plots of the response as in Figure 7 for Part 2 of this
experiment

BDA37101-Edition III/2011

12

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________
7.1

CALCULATION

BDA37101-Edition III/2011

13

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________

BDA37101-Edition III/2011

14

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________
8.

OBSERVATIONS

8.1

## PART 1 : SIMULATION OF THE SERVO PLANT WITH PV

CONTROLLER

After running the simulation with the gains set to their calculated values, specify
in your lab reports the following observations;
i)

In simulation mode, does the system response looks like what you had
expected?

ii)

## Do they match the design requirements?

BDA37101-Edition III/2011

15

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________
8.2

## PART 2 : REAL TIME IMPLEMENTATION OF THE PV

CONTROLLER

i)

How does the IP02 carts actual position compare to the simulated
response?

ii)

Is there any discrepancy in the results? If so, find some of the possible
reasons.

BDA37101-Edition III/2011

16

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________
9.

DISCUSSIONS

9.1

## PART 1: SIMULATION OF THE SERVO PLANT WITH PV

CONTROLLER

i)

Based on the simplified dynamic modeling of the IP02 servo plant, derive
a block diagram to represent such a transfer function as in equation 10.
Represents it in the form of basic mechanical and electrical equations that
is being used to determine G(s). The resulting block diagram should have
an overall closed loop transfer as in Equation 2.

BDA37101-Edition III/2011

17

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________
ii)

Finally, using the IP02 model parameter values listed in Reference [2],
evaluate the IP02s open loop transfer function, G(s) that is supplied in this
experiment. Determine the plants pole(s), zero(s) and DC gain

BDA37101-Edition III/2011

18

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________
9.2

## PART 2 : REAL TIME IMPLEMENTATION OF THE PV

CONTROLLER

i)

From the plot of the actual cart position, measure the final system peak
time and percent overshoot. Are the values in agreement with the design
specifications? You must calculate for each of the plot.

BDA37101-Edition III/2011

19

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________
ii)

## During the course of this experiment, were there any problems or

limitations encountered? If so, what were they and how were you be able
to overcome them?

BDA37101-Edition III/2011

20

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________
iii)

Most controllers of this form also introduce integral action into the system
(PID). Do you see any benefits to introducing an integral gain in this
experiment?

BDA37101-Edition III/2011

21

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________
10.

CONCLUSION

## Deduce conclusions from the experiment. Please comment on your experimental

work in terms of achievement, problems faced throughout the experiment and
suggest recommendation for improvements.

BDA37101-Edition III/2011

22

## UNIVERSITI TUN HUSSEIN ONN MALAYSIA

Faculty of Mechanical and Manufacturing Engineering
__________________________________________________________________
11.

REFERENCES

BDA37101-Edition III/2011

23