Lab11 - Autotuning

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

University of Sana’a Analog Control System

MT311
Faculty of Engineering

Mechatronics Department

Lab11:
PID Controller and Auto-Tuning
Eng Mohammed Daba
Quiz-3
Questions:
For the transfer function that shown in the figure, using root-
locus method, design the controller with the following design
criteria:
- Overshoot less than 10%
- Rise time less than 2 seconds
- Settling time less than 10 seconds
- Steady-state error less than 2%

Note:
- Use a lead-lag Compensator
- Or use PID Controller (pole , two zeros)
PID Controller and Auto-Tuning
PID Control

 A PID controller continuously calculates an error value e(t) as the difference between a
desired setpoint (SP) and a measured process variable (PV) and applies a correction
based on proportional, integral, and derivative terms (denoted P, I, and D respectively)
which give the controller its name.
 A PID controller is a control loop feedback mechanism widely used in industrial control
systems and a variety of other applications requiring continuously modulated control.
PID Control in MATLAB

 PID Controller implement a continuous- or discrete-time controller (PID, PI, PD, P, or I)


in your Simulink model.
 PID controller gains are tunable either manually or automatically.
 Automatic tuning requires Simulink Control Design software (PID Tuner or Control
System Designer).
PID Control in LABVIEW
 PID VIs Implements a PID controller using a PID algorithm for simple PID applications
or high speed control applications that require an efficient algorithm.
PID Control in LABVIEW
 A PID model in transfer function form.
PID Tuning
PID Tuning
 The process of selecting the controller parameters to meet given
performance specifications is known as controller tuning.
 If a mathematical model of the plant can be derived, then it is possible to
apply various analytical techniques for determining parameters of the
controller that will meet the transient and steady-state specifications of the
closed-loop system.
 However, if the plant is so complicated that its mathematical model cannot
be easily obtained, Then we must resort to experimental approaches to the
tuning of PID controllers.
Analytical Techniques
 Control Systems Design by the Root-Locus Method
 Control Systems Design by Frequency Response
Experimental Approaches for The Tuning of PID Controllers
 Ziegler-Nichols Rules for Tuning PID Controllers
 Cohen-Coon tuning rules
 Relay and Augmented Relay methods
Ziegler-Nichols Rules for Tuning PID Controllers
 Ziegler and Nichols proposed rules for determining values of the proportional
gain K, integral time Ti and derivative time Td, based on the transient
response characteristics of a given plant.
 Such determination of the parameters of PID controllers or tuning of PID
controllers can be made by engineers on-site by experiments on the plant.
 There are two methods called Ziegler-Nichols tuning rules.
Ziegler-Nichols Rules for Tuning PID Controllers
First Method
 In the first method, we obtain experimentally the response of the plant to a unit-step input.

 This method applies if the response to a step input exhibits an S-shaped curve.
 The S-shaped curve may be characterized by two constants, delay time (L) and time
constant (T).
Ziegler-Nichols Rules for Tuning PID Controllers
First Method
 The delay time and time constant are determined by drawing a tangent line at the
inflection point of the S-shaped curve and determining the intersections of the tangent line
with the time axis and line c(t)=K
Ziegler-Nichols Rules for Tuning PID Controllers - MATLAB

First Method
- Example
Ziegler-Nichols Rules for Tuning PID Controllers
Second Method
 In the second method, we first set Ti = oo and Td = 0. Using the proportional control action
only increase K, from 0 to a critical value Kcr at which the output first exhibits sustained
oscillations.
 If the output does not exhibit sustained oscillations for whatever value K, may take, then this
method does not apply.
Ziegler-Nichols Rules for Tuning PID Controllers
Second Method
 The critical gain Kcr, and the corresponding period Pcr, are experimentally determined.
 Ziegler and Nichols suggested that we set the values of the parameters K,Ti and Td
according to the formula shown in Table.
Ziegler-Nichols Rules for Tuning PID Controllers - MATLAB
Second Method
- Example
Control System Designer App

 Other auto-tuning methods.


 Computational Approach To Obtain Optimal Sets of Parameter Values.
 Design controllers using numerical optimization techniques.
PID Auto-tuning using LABVIEW
 Built-in examples.
Hardware Implementation
Hardware in Loop - MATLAB
 One of the options is Serial Library
 ARDUINO library in Simulink “ARDUINO IO”
 This package allows using an ARDUINO connected to the computer to perform
Analog and Digital Input and Output, (and command motors) from MATLAB.
 For more details go to:
http://ctms.engin.umich.edu/CTMS/index.php?aux=Activities_IOpack

 PWM output.
 Low pass filter.
Hardware in Loop - LABVIEW
 ARDUINO library in LABVIEW
Arduino
 PID library in Arduino
 Arduino PID Autotune Library
References

File associated with lab:


- ARDUINO library in Simulink “ARDUINO IO”
- Control Tutorials for MATLAB and Simulink - Simulink ArduinoIO Package.pdf

References:
- https://www.mathworks.com/help/index.html
- http://ctms.engin.umich.edu/CTMS/index.php
- Modern Control Engineering, Katsuhiko Ogata
Any Questions ?!

By: Mohammed Daba


fb.com/mnb.doba

You might also like