Control Systems
Control Systems
Nalan Karunanayake 1
RE-RUN the model and observe the output current and comment on it.
Nalan Karunanayake 2
Produce translational motion as follows,
Introduction
∅ �
� � = = 2
� � � �+� �+� +
The structure of the control system has the form shown in the figure below.
Nalan Karunanayake 3
Transfer function for a PID controller has the following form.
2
� �� + �� + �
� � = � + + �� =
� �
A proportional controller ( ) will have the effect of reducing the rise time and will reduce but
never eliminate the steady-state error. An integral control ( ) will have the effect of eliminating
the steady-state error for a constant or step input, but it may make the transient response slower.
A derivative control ( ) will have the effect of increasing the stability of the system, reducing the
overshoot, and improving the transient response.
The structure of the control system has the form shown in the figure below.
Nalan Karunanayake 4
Transfer function for a PID controller has the following form.
2
� �� + �� + �
� � = � + + �� =
� �
Use below coding to directly define a PID controller in MATLAB using the transfer function:
Kp = 1;
Ki = 1;
Kd = 1;
s = tf('s');
C = Kp + Ki/s + Kd*s
Alternatively MATLAB's pid controller object can be used to generate an equivalent continuous time
controller as follows:
1. Proportional control
The closed-loop transfer function of a system with a proportional controller is shown below
Nalan Karunanayake 5
Questions
1.1 Draw a rough sketch of the response of the system to a step reference with different
values of Kp
1.2 Comment on the effect of increasing proportional gain on overshoot and settle time?
2. PD control
The closed-loop transfer function of the given system with a PD controller is shown below
Initially set the value of Kp = 300 and test derivative gain Kd value set to 10. Change your m-file to obtain
the step response of the above system with PD control.
Questions
2.1 Draw a rough sketch of the response of the system to a step reference with different
values of Kd.
3. PI control
The closed-loop transfer function of the given system with a PI controller is shown below
Initially set the value of Kp = 30 and test integral gain Ki value set to 70. Change your m-file to obtain the
step response of the above system with PI control.
Questions
3.1 Draw a rough sketch of the response of the system to a step reference with different
values of Ki.
Nalan Karunanayake 6
4. PID control
The closed-loop transfer function of the given system with a PID controller is shown below
Now modify the above m file as = 350, = 300, and = 50 to obtain the step response of the above
system with PID control.
Questions
4.1 Draw a rough sketch of the response of the system to a step reference with different
values of Kp, Ki and Kd?
Use the Matlab command “stepinfo” to obtain the precise characteristics of the step response.
Nalan Karunanayake 7
>> pidtool(sys)
Change the controller type P, PI, PID and obtain the Step Plot and comment.
From the Show Parameters, obtain the PID gains and characteristics of the system.
Change the Response Time and Phase Margin and see what happened to the Step Plot.
Consider an example of designing a PID controller for a dc motor. The model of a closed loop system
uses the new PID Controller block. This block generates a voltage signal driving the dc motor to track
desired shaft rotation speed. In addition to voltage, the dc motor subsystem takes torque disturbance as
an input, allowing us to simulate how well the controller rejects disturbances.
Nalan Karunanayake 8
The PID controller is a discrete-time controller running at 0.02 seconds (the red color shows the sampling
ti e i the odel). Let’s ow look at the dialog of the PID Co troller lo k. I the upper half of the dialog
we specified basic configuration of the PID controller: type (PID, PI, PD, P, or I), time-domain, integration
methods, and sample time. In the lower part, we specified PID controller form and gains (shown at default
values).
Block documentation provides detailed information about the block and all its parameters.
Nalan Karunanayake 9
Check the scope of the PID block
PID Tuning
Our first task is to tu e the PID o troller. Pressi g the Tu e… utto i the PID Co troller lo k
dialog, we launch PID Tuner, which linearizes the model at the default operating point and automatically
determines PID controller gains to achieve reasonable performance and robustness based on linearized
plant model.
Nalan Karunanayake 10
Update the PID Tuner
Nalan Karunanayake 11
Then again RE-RUN the Simulink model and observe the PID scope and comment on it.
Nalan Karunanayake 12