You are on page 1of 15

Control

UFMFV7-15-2
2016
Kenshow Large 13016784

Control

1.1

Introduction

Throughout this report I will write about the design and development of a classical control
system (I-PD) for a single axis camera using MATLABs Simulink feature. Designing control
systems allow us to optimise how we want a system to behave.
For this report specifically I will be designing the control system for a gimballed surveillance
camera controlled by a servo motor allowing it to use on one axis. For the camera to be effective,
we need to be able to control the gimbals angular position (symbolised by ) and the velocity
and dampening necessary in order to achieve the desired position. This can be done using
control algorithms. The torque from the motor ( ) will drive the inertia of the rotor and other
related parts which includes the surveillance camera which, in this report, will be symbolised
by J.

1.2

System Modelling

We can represent the system model mathematically as a differential equation relating input
Torque, and output angle Theta representing the angular position of the gimbal.
=J

d
d2
+D
2
dt
dt

Where:
= Input torque provided by the servo (N m)
J = Combined Inertia of the moving parts (Kgm2 /s)
D = Combined viscous damping (Kgm2 /s)
= Camera directional angle (in radians)
From this differential equation representation of the systems behaviour, we can derive the
First Order differential equation to make future calculations easier. Because we know speed =
distance / time, and = angular velocity we can say that
=

d
dt

Therefore:
d
d2
= 2
dt
dt
Now by using substitution we can derive:

=J

d
+ D
dt

Now we have derived this equation, we can convert it into the Laplace(s) domain from the
time domain using the Laplace Transform formula tables.
Applying the Laplace Transform:
(s) = JS(s) (0) + D(s)
By then taking out the common factor, assuming the initial value of (0) = 0 and rearranging the equation, we end up with:
G(s) =

1.3

1
(s)
=
(s)
JS + D

Controller Design

A Proportional Integral Derivative (PID) controller is a common close loop feedback control
method. By using feedback to correct the error difference from the wanted output to the current
output, the system can adjust appropriately to the control equation representation being used.
I will be using a modified version of the PID controller known as the I-PD controller. I-PD
still allows the same amount of control as a closed loop system, but avoids adding unwanted
(s) terms into our numerator.
1.3.1

Block Diagrams

Closed Loop Systems can be depicted in Block Diagrams.

Figure 1: Example Block Diagram

Where:
Plant provides the system output
Controller takes the control input and provides a control output
Sensor takes the output and feeds it into the subtractor / comparator that compares the
demand with the output of the sensor that produces an error
2

Arrows connect each of the entities within the diagram together


Below is the full block diagram of our overall gimbal surveillance camera system

Figure 2: Full Block Diagram

1.3.2

System Closed Loop Equivalent Form

We can manipulate these block diagrams in order to simplify the system processes to create
a single Close Loop Transfer Function (CLTF) that allows the wanted orientation and angle
set by the user to be applied to the output of our gimbal system.
I will do the merging and cancellation of blocks in my block diagram in stages to show the
process more clearly. The blocks I intend to simplify in any specific step will be shown using a
red dotted outline.
As worked out previously, we know what G(s) equals. Therefore we can substitute that
number in when simplifying the diagram. For future reference, I will be showing the diagram
of what I intend to simply, followed by the calculations I did to create the simplification. I also
intent to label my simplified results as:
Gn+1 (s)
Where n = stepnumber. I have decided to increment n in order to avoid confusion between
our original G(s), and what could have been the result of our first step G1 (s).

Figure 3: Block Diagram simplification : Step 1


G2 (s) = G(s)
=

1
s

1
1
1
= 2
JS + D s
Js + Ds

Figure 4: Block Diagram simplification : Step 2


G3 (s) =

G2 (s)
1+

Kp +Kd s
Js2 +Ds

Js2

1
+ Ds + Kp + Kd s

Figure 5: Block Diagram simplification : Step 3


G4 (s) =
=

Ki
G3 (s)
s

1
Ki
Ki
2
=
2
s Js + Ds + Kp + Kd s
s(Js + Ds + Kp + Kd s)

Figure 6: Block Diagram simplification : Step 4


G5 (s) =

s(Js2

G4 (s)
1+

Kt
s(Js2 +Ds+Kp +Kd s)

Ki
+ Ds + Kp + Kd s) + Ki Kt

Figure 7: Block Diagram simplification : Step 5


G6 (s) = Kt G5 (s)
5

= Kt

s(Js2

Ki
Ki Kt
=
2
+ Ds + Kp + Kd s) + Ki Kt
s(Js + Ds + Kp + Kd s) + Ki Kt

Figure 8: Block Diagram simplification : Final Result

As you can see from Figure 8, we have successfully simplified our initial block diagram down to
a single process. This will make the following considerably easier as numbers would not have
to be calculated multiple times through multiple processes.

1.4

Controller Requirements

For our I-PD controller, it is required to meet or exceed the following response characteristics
for a step change in demand position.
Overshoot 10%
95% settling time 2:5 seconds
Rise time 1 second
Given the system specification is:
J = 0.2Kgm2
D = 0.7Kgm2 /s
Kt = 1.6V /rad
To calculate what the output to my system will be, I have to go through several stages of
finding Ki , Kd , andKp .
1.4.1

Gains Calculation

Since I have been given the known values of Kt, D and J, I can substitute these values into
my previously calculated equation of the total system G(s),
1.6Ki
Ki Kt
=
s(Js2 + Ds + Kp + Kd s) + Ki Kt
s(0.2s2 + 0.7s + Kp + Kd s) + 1.6Ki

Using the following equations, I can calculate n and . Once these have been found I will
be able to tell what the output of our system is like.
Second order step response equation:
D = n

p
1 2

D
n = p
1 2
Calculating for an overshoot of 10% as given in my specification. Since we are dealing
in percentages, 10% will have a value of 0.1.
s
[ln(0.1)]2
=
2 + [ln(0.1)]2
Thus:
= 0.5911550338
Now that we have this number I put these into my Rise Time equations, where tr = 1, and
my Second order step response equations to find D and n
p

1 2
1

( tan 1
)
tr = 1 =
D

p
1 2
)
D = tan 1(

Therefore, I can calculate that D = 2.20328647, and that n = 2.731715026.


Now I have all these values, I can substitute them into my beginning equation to deduce:
Ki =

n2
= 4.663916865
1.6

In order to calculate the two unknown values Kp and Kd , I must figure out a third order
transfer function. I can do this by multiplying the standard forms for a first and a second order
system.
Standard form for a first order system:
a
s+a
Standard form for a second order system:
n2
s2 + 2n2 + n2

Where n = undamped natural frequency, and = damping ratio.


Calculated standard form for a third order system:
a
n2
an2
2
=
s + a s + 2n2 + n2
s3 + (2n + a)s2 + (2an + n2 )s + an2
The third order standard form comes in one real pole (First Order), and two complex conjugate poles (Second Order). Generally, third order systems and higher will have either a
dominant first or second order response depending on each poles location. By using the time
response of our system given in the requirements, we can calculate the second order part of our
system.
The denominator of our Closed Loop Transfer Function after substituting the given values
in do not give us an easy denominator to work with, therefore I will multiply by 55 in order to
allow for my s3 to be a whole number. Doing this will also make my a = 5.
1.6Ki
5
8Ki

=
s(0.2s2 + 0.7s + Kp + Kd s) + 1.6Ki 5
s3 + 5s2 (0.7 + Kd ) + 5Kp s + 8Ki
In order to compare my systems third order function against my derived third order standard form, I must apply the fact that a = 5.
5
a
=
s+a
s+5
Therefore:
5n2
s3 + (2n + 5)s2 + (25n + n2 )s + 5n2
I can calculate Kd by comparing the second order coefficients
5(0.7 + Kd ) = 2n + 5
3.5 + 5Kd = 2n + 5
Kd =

2n + 1.5
5

Kd = 0.9459468354
and Kp by comparing the first order coefficients
5Kp = 10n + n2
Kp =

10n + n2
5

Kp = 4.722187574
To summerise, my final three gains are as follows.
Ki = 4.663916865

Kd = 0.9459468354
8

Kp = 4.722187574

Gain Verification with Simulink


I used MATLABs Simulink feature to simulate my system and its results.

Figure 9: Simulink Block Diagram

As you may notice, the above block diagram looks similar to the block diagram I simplified
towards the start of this report. Simulink allows for this form of block representation in their
program in order to simulate the gains and processes of the system, as well as feedback.
As you can see from the zoomed in printscreen of my initial results, the response characteristics are within the specification.

Figure 10: Simulink Results


Rise Time (s): 0.78 , Overshoot: 8.1 , Settling time (s): 2.29
Although Figure 9 shows an accurate representation of the system and its processes, it
does not include real world constraints. By using a Saturation Block I can simulate physical
constraints of the system such as the maximum speed that servo motor can travel at. By adding
in these imitation physical constraints, it creates a more accurate real-world representation of
the system, which is important if this was a system model we were planning on creating in real
life.
Since we know that the maximum angular velocity of the servo is 2 , I can input this as my
Saturation maximum level, with a negated equivalent as my minimum for if it is rotating the
opposite direction at top speed.

10

Figure 11: Simulink Block Diagram with physical limitations

Figure 12: Simulink Graph with physical limitations

When tested with saturation, the results of my system with physical limitations still falls
within the boundaries states in the specification as it never reaches the angular velocity of the
11

servo motor. This tells me that if this system were to be implemented in real life with the
correct servo that this system was modelled on, it would work with little issue, assuming the
turn rate is that of the stated speed in reality.
In order to test the system and to see how it would react when reaching saturation, I
purposely assigned values that would cause large overshoot. The printscreen shown below
shows my result.

Figure 13: Simulink Graph with physical limitations

As you can see from the first section of this test, the system reaches saturation at around
1.57 where it stays until the value drops below 1.57 again.

Manual Tuning Methods

The primary purpose of feedback is to allow the system to be able to adjust on its own as
it gets close to its goal. If the system is not well optimised for the task it can cause issues. The
time response could cause the system to overshoot its goal back and forth until it eventually
settles. The opposite of this would be the system taking too long to achieve its desired goal as
it approaches slowly.

12

3.1

Ziegler-Nichols

The Ziegler-Nichols control method is a method of tuning a PID gains using a closed loop
tuning where a characteristic known as the Ultimate Gain, Ku needs to be found.
By first converting out system into a classic PID block diagram configuration. This is done
by eliminating the block containing the following.
Ki
+ Kp + Kd s
s
The Ziegler-Nichols and Tyreus-Luyben tuning techniques are experimentally used to determine the ultimate gain, Ku, and period of oscillation, Pu. It starts with a low value of controller
gain, Kc, and then increased incrementally and till the oscillation from the system output is
stable. Ku is the smallest possible value that Kc can be while still causing a stable oscillation
output. (Microstar Laboratories, 2009).
The steps necessary to derive Ku :
Removing the effect the derivative and integral gain have by setting them all to zero.
This will in essence allow us to only have a P controller.
Incrementally increasing Kp until the controller starts to show sustained oscillations (measured as Tu ).
Once Ku and Tu have been found, we can use a table to locate the proportional gain, integral
gain, and the derivative gain.
Controller Type

Kp

Classic PID

0.6Ku

No Overshoot

0.2Ku

Ki
Kp
2
Tu
Kp
2
Tu

Kd
Kp Tu
8
Tu
Kp
3

In comparison to other experimental control methods, Ziegler-Nichols may take more trials,
but needs less raw data and need for analysis overall.

Conclusion & Discussion

Throughout this report I have gone into detail in ways in which control and controller
design are necessary and useful, including talking of repercussions if a control system is flawed
or unsuitable. Through the use of Block Diagram manipulation methods, I have thoroughly
calculated my workings on simplifying block diagrams, as well as explanations of first, second
and third order algorithms that apply to this system. By using these calculations to find the
gains of the system I could then go onto MATLAB in order to simulate my findings to make
sure they are all accurate and fall within the boundaries of the specification. However, these
did not necessarily include physical constraints of the gimbal system, and so a saturation block
was necessary to be added in order to simulate real-world constraints and physics that had not
been previously considered. From these findings we could test and push the system to show
us what would happen if saturation was reached, as well as other potential methods in which
control is still growing.
13

Overall, an I-PD control system that was asked for in this project has been built and
successfully created that meets the requirements. If this work were to be repeated or carried
on, there would have been considerable more research into other control methods out of I-PD
and PID. It would also be an idea to include other constraints onto the system that could make
the system model more interesting, such as a faster servo motor. I would also have done more
MATLAB implementation to go along with the Ziegler-Nichols research, although I feel I have
shown my understanding of the method.

References
Ziegler, J.G and Nichols, N. B. (1942). Optimum settings for automatic controllers

14

Code

Ki = 4 . 6 6 3 9 1 6 8 6 5 ;
Kd = 0 . 9 4 6 0 2 ;
Kp = 4 . 7 2 2 6 ;
A = 8 Ki ;
B = 5 ( 0 . 7 + Kd ) ;
C = 5Kp ;
t = 0:0.1:10;
s = tf ( s );
output = A/ ( s 3 + B s 2 + C s + A ) ;
s y s c l = f e e d b a c k ( output , 0 ) ;
step ( sys cl , t )
i s s t a b l e ( output )

15

You might also like