131 views

Uploaded by org25gr

Module 3: Classical Loopshaping Design
This article is contained in Scilab Control Engineering Basics study module, which is used as course material
for International Undergraduate Program in Electrical-Mechanical Manufacturing Engineering.

- PID regulatori
- WATLOW pmpmintegrated
- Practical Digital Signal Processing by Dogan Ibrahim
- The Future of PID Control
- Module 5.Scilab
- HA026933_9_2704Eng
- Controller Tuning
- The Future of PID Control
- el07-106
- PDF v f Using PID and Encoder En
- Control Systems III Course Guide 2016(1).doc
- visioli2005.pdf
- p4.1-4.10.docx
- 03-System Identification and Control of an Electro-Hydraulic Actuator System
- 2014ACC_0831_MS
- Lecture Note Chapter 11 PID Controller Design Tuning and Troubleshooting 2016 (1)
- PDPIPIDComp
- 5.pdf
- 04-BeyondFuzzyPIDctrl
- c

You are on page 1of 13

1 13

Scilab Ninja

Control Engineering with Scilab

Tweet

Like

Share

Share

This article is contained in Scilab Control Engineering Basics study module, which is used as course material

for International Undergraduate Program in Electrical-Mechanical Manufacturing Engineering, Department of

Mechanical Engineering, Kasetsart University.

understand the basics of PID control

learn the effects of 3 parameters to system response

learn how response is degraded by integrator windup

How to tune PID parameters by Ziegler-Nichols Frequency Domain method

PID stands for Proportional, Integral, and Derivative. It is a standard control structure used successfully in

many industrial applications. Commercial PID controllers can be bought off the shelf and installed in the

system. After some setup and tuning the three PID gains, and perhaps some additional parameters, the system

is up and running in no time. Of course, this means the control engineer is certain the plant can be handled by

the PID controller and understand how to adjust the control parameters. Without such knowledge, it could be

a frustrating experience to her.

So, in this module we discuss some basics of PID control and focus on how to analyze a feedback sysem, with

Scilab, build an Xcos diagram and simulate. For a detailed study, we recommend [1]. For those interested in

digital PID implementation, document [3] on this site might be helpful. The e-book [4] provides more

information on independent robot joint control using PID.

The so-called textbook form of PID controller is described as follows

(1)

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

2 13

and plant output. We see that the control variable is a function of 3 terms: P (proportional to error), I (time

integral of error), and D (derivative of error), with corresponding control parameters

(integral time), and

(proportional gain),

(2)

with the transfer function of PID controller

(3)

(4)

In this form, the controller gains are distributed to each of the PID terms separately, with its transfer function

(5)

For our discussion of PID controller, we focus on the form (4) and (5). Nevertheless, it is easy to convert

between parameters of (1) and (4) by the relations

(6)

Ex. 1: To get started with Xcos simulation of a PID feedback system, download file pid_feedback.zcos . This

launches an Xcos diagram in Figure 1. This diagram can easily be constructed using Xcos standard palettes. It

requires only a step_function, clock_c (from Sources palette), PID and CLR blocks (from Continuous time

systems palette), SUMMATION (from Mathematical operations palette), MUX (from Signal Routing palette),

and CSCOPE (from Sinks palette). The plant transfer function is a robot joint driven by DC motor model

from module 1, with

and

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

3 13

Click on the Simulation Start button to see the step response. Try adjusting the PID gains and plant

parameters to see their effects on the closed-loop system.

PID parameter tuning is well studied in control engineering. Here we give a brief guideline. The proportional

gain

is a dominant quantity that normally has some nonzero value. The integral gain

helps eliminate

steady state error but too high value could introduce overshoot and oscillation. The derivative gain

could

help the response to reach steady state faster but could amplify high frequency noise, and could affect stability

if set too high.

When the plant model is not known, adjusting these 3 gains to achieve good response could be problematic

for an inexperienced user. Later we discuss a tuning procedure. Commercial PID controller products usually

have auto-tuning functions for user convenience.

Ex. 2: To experiment with the tracking and disturbance attenuation performance of PID control, we setup a

feedback diagram in Figure 2.

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

4 13

which can be constructed as an Xcos model pid_dist.zcos in Figure 3. The joint inertia and friction are set to

and

, respectively. The step disturbance at the plant input is active at t = 2 sec, with step

value of 80.

Note that in this example, we have the luxury of knowing the exact plant model. So it is possible to solve for a

good set of PID gains. An approach used in [2] turns off the

and

that

error.

To elaborate, it is shown in [2] that when

polynomial is described by

(7)

which gives

(8)

For example, suppose we select a critical-damped closed loop system

. From (8), this yields

and

160

80

640

160

12

1440

240

Table 1

and

Using these 3 sets of gain values, we simulate the step responses. The results are shown in Figure 4. As

expected, the higher the natural frequency, the faster the response. We also see that the steady-state error from

step disturbance cannot be eliminated with the PD controller.

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

5 13

To fix this problem, we need to turn on the

(9)

(10)

Applying Routh-Hurwitz criteria to (10), it can be concluded that, given all positive PID gains, the feedback

system is stable if

(11)

The same Xcos diagram in Figure 3 can be used by putting some positive integral gain in the PID block. Let

us fix

and

is eliminated by increasing

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

6 13

Applying the bound (11) to this example yields

Analysis of PID feedback control is often performed under the assumption that the system is purely linear. In

real devices, nonlinear elements emerge at certain points in the feedback loop. Saturation is one of them that

could cause undesirable system response. This nonlinear effect normally results from physical limits of

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

7 13

signals and system parameters, say, maximum motor torque and current. Another common saturation is the

input limit of servo amplifier. An industrial servo amp might allow input voltage command in the range

volts, for example.

Effect from saturation is more pronounced when integral term is used in PID. The response could have

excessive overshoot due to error accumulation in the integral term. This is known as integrator windup. See

[1] for more detail.

Ex. 3: To see an effect from input saturation, construct an Xcos model as in Figure 7, or download

pid_ilim.zcos. It represents a comparison of two closed-loop systems, which are basically the same except

that the lower one has its input bounded between

units.

The controller gains are set at

the step responses in Figure 8, and the control variables (controller output) in Figure 9. We see that input

saturation causes significantly larger overshoot and also worsens disturbance response.

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

8 13

As stated before, adjusting the PID gains from scratch to achieve a good response may not be trivial. As a

result, most commercial PID controllers have functions to tune the 3 parameters automatically. This is

normally called autotuning feature. One of autotuning methods suggested in the literature makes use of

some relay feedback mechanisms, which is closely related to a manual tuning scheme known as ZieglerNichols Frequency Domain (ZNFD) method. Hence we discuss this ZNFD scheme in the last part of this

module.

Note: The original ZNFD method applies the textbook PID equation (1). But since (1) and (4) are closelyrelated by (6), here we make a conversion so that standard PID block in Xcos, which assumes the form (4),

can be conveniently used.

To tune a PID controller manually by ZNFD method, follow this procedure

turn off both the integral and derivative terms; i.e., setting

with the proportional gain

. We crank

At this point, the plant output will swing in a constant sinusoid motion, not growing and not dying out.

Write this value down on a paper as

.

Measure the period of oscillation. Write it down as

Controller

Form

P

PI

PID

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

9 13

From the above procedure, we could observe a drawback of the basic ZNFD method: the system must

oscillate at some point of gain setting before it becomes unstable. This implies the Nyquist plot must cross the

negative real axis at some point. For the DC motor model we are using, the gain margin is infinity. Hence it is

difficult to find the oscillating point and the

value.

There is some trick to get around such limitation, but this is beyond the scope of this module. For our basic

study, we simply modify the DC motor robot joint by adding some dynamics to it, so that the Nyquis plot of

crosses the negative real axis.

Ex. 4: Let us assume that the PID output is passed through a LPF with cutoff frequency 500 Hz before

feeding the plant input. Using the filter design guide from module 1, we have the LPF transfer function as

(12)

To simulate, construct an Xcos model in Figure 10, or download pid_znfd.zcos. With this model, we are

ready to perform the ZNFD tuning procedure described above. Click on the PID block to set the I and D gains

to zero. Then start increasing the P gain until the output oscillates. This is what you must do in a real

application when the plant model is not known.

Well, in this example we do know the plant model, dont we? So, to save us some time, the

value that

causes output oscillation can be found, for example, using the method from Module 2. First from the loop

transfer function containing the plant, LPF, and PID controller with

-->kp = 1;

-->ki = 0;

-->kd = 0;

-->s=poly(0,'s');

-->P=syslin('c',1/(10*s^2+0.1*s));

-->H = syslin('c',1/(1+0.0003*s));

-->C=syslin('c',kp + ki/s + kd*s);

-->L = C*H*P; // loop t.f

// plant

// filter

// controller

Then find the gain where the closed-loop pole touches the

axis.

->[kmax,s]=kpure(L)

s =

5.7735027i

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

10 13

kmax =

333.33433

resulting in

Verify this by setting the P gain to 333 in PID block. This yields the desired oscillatory response as shown in

Figure 11. The oscillation period can be roughly measured from the plot to yield

sec.

So from the last row of Table 2, ZNFD method suggests the three PID parameters as

Note that the overshoot is quite excessive (70%). In a sense, ZNFD just gives us some good values to start

with. We may want to fine-tune the PID gains to improve the response further. For example, decreasing the

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

11 13

Ki gain would bring the overshoot down. Figure 13 shows the response from original PID gains (green),

compared with the case when Ki is reduced to 300 (blue), and 200 (magenta).

The ZNFD method could be explained using a Nyquist diagram in Figure 14. The diagram shows how a point

on the curve is moved related to the P, I , and D terms. Using the P term alone, x could be moved in radial

direction only. The I and D terms help provide more freedom to move perpendicular to the radius. It can be

shown that by using ZNFD method, the critical point

The distance of this point to the critical point is 0.5. So the sensitivity peak is at least 2. This explains the high

overshoot in the step response.

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

12 13

Summary

PID is a simple control structure that is still used widely in various industrial applications. It is a close relative

to the lead-lag compensator explained in module 2, except that its functionality may be more user-friendly.

With some knowledge and practice, an engineer or technician would be able to tune and operate a plant

equipped with PID control.

In this module we discuss the basics of PID feedback systems, with emphasis on Xcos simulations to show

how the responses are related to three control parameters, as well as effect from input saturation that could

worsen the response. Without some good starting values, tuning the PID gains can be cumbersome for a

novice. So at the end, we mention a manual tuning procedure known as the Ziegler-Nichols frequency domain

method. Some auto-tuning scheme of a commercial PID controller, such as the relay feedback method, is

based on the ZNFD manual tuning.

References

1. K.J. Astrom and T.Hagglund. PID Controllers, 2nd ed., Instrument Society of America, 1995.

2. M.W.Spong, S. Hutchinson and M. Vidyasagar, Robot Modeling and Control. John Wiley & Sons. 2006.

3. V. Toochinda. Digital PID Controllers, a previous online document available at controlsystemslab.com.

2009.

4. V.Toochinda. Robot Analysis and Control with Scilab and RTSX. Mushin Dynamics, 2014.

Comments

Module 4: PID Control 2 Comments

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

13 13

http://scilab.ninja/study-modules/scilab-control-engineering-basics/mod... 11/11/2016

- PID regulatoriUploaded byMahmutović Edin
- WATLOW pmpmintegratedUploaded byjulianaugusto
- Practical Digital Signal Processing by Dogan IbrahimUploaded byAriana Ribeiro Lameirinhas
- The Future of PID ControlUploaded byManoj Choudhary
- Module 5.ScilabUploaded byorg25gr
- HA026933_9_2704EngUploaded bynvdung0311
- Controller TuningUploaded bytrshaaa
- The Future of PID ControlUploaded byMarcelo Andrade Santiago
- el07-106Uploaded bySenthil Kumar
- PDF v f Using PID and Encoder EnUploaded byacount.br
- Control Systems III Course Guide 2016(1).docUploaded byJohn Lionel
- visioli2005.pdfUploaded byShyam Sundar
- p4.1-4.10.docxUploaded bySyed Ali Haider
- 03-System Identification and Control of an Electro-Hydraulic Actuator SystemUploaded byDaniel Infante
- 2014ACC_0831_MSUploaded byShamsMohd
- Lecture Note Chapter 11 PID Controller Design Tuning and Troubleshooting 2016 (1)Uploaded byRama Krishna
- PDPIPIDCompUploaded byAsghar Ali
- 5.pdfUploaded byAnonymous NHuqCVE1w
- 04-BeyondFuzzyPIDctrlUploaded byMarco Bertoldi
- cUploaded byDhp Cia
- cstr1.pdfUploaded byGary Kiel Palacios Espinoza
- SCSI-38Uploaded byNagulapati Kiran
- 2_060_paulusova.pdfUploaded byselvam
- 07 13Oct15 522-961-1-ED.pdfUploaded byTole Sutikno
- [Åström, Karl J.; Hägglund, Tore] PID Controlle(BookZZ.org) 075Uploaded byablbabybb
- lec1.pdfUploaded byVijay Raju
- 1-s2.0-S0957415813000901-mainUploaded bynsit.mohit
- Module5 5.pdfUploaded byAshish Mishra
- 1Uploaded byMohamad Abdul Raya
- 5. Temperature Control Waterbath Control System Using PID ControllerUploaded byReno Sandy Yusuf

- ΕΥΚΛΕΙΔΙΟΣ ΕΠΙΠΕΔΟΜΕΤΡΙΑUploaded byGeorge Frangeskos
- Module2-scilabUploaded byorg25gr
- Intro ProtegeUploaded byorg25gr
- Module 3.ScilabUploaded byorg25gr
- Antenna Basic R&SUploaded byKelvin Arana
- Module 1.ScilabUploaded byorg25gr
- White Paper on “High Antennas forUploaded byorg25gr
- Wiki.scilab.org - SysMLUploaded byorg25gr
- Module 6.ScilabUploaded byorg25gr
- Bitcoin: A Peer-to-Peer Electronic Cash SystemUploaded bymkriegs100
- Module-6.scilab.pdfUploaded byorg25gr
- Module-6.scilab.pdfUploaded byorg25gr
- The Kilo Doctrine V1.0Uploaded byorg25gr
- Ευκλείδιος Γεωμετρία.pdfUploaded byorg25gr
- Matlab NotesUploaded bykim
- Diagonal IzationUploaded byorg25gr
- MFJ-269Uploaded bycv86
- firpmUploaded byRakesh Inani
- PEMFCUploaded byorg25gr
- PEMFCUploaded byorg25gr
- Network and Spectrum AnalyzersUploaded byorg25gr
- Grc TutorialUploaded byorg25gr
- TI89 for Linear AlgebraUploaded bypfeffer92
- Sensors Signals Serial SocketsUploaded byorg25gr
- CHARACTERIZATION AND SIMULATION OF A 3.3 KW PEM FUEL CELLUploaded byorg25gr
- OberonUploaded byorg25gr
- The Key to C4ISR InteroperabilityUploaded byorg25gr
- Walking Guide to 42 Greek IslandsUploaded byorg25gr

- Beam Forming a VersatileUploaded bySoumya Maulik
- EMPIRICAL MODE DECOMPOSITION AN INTRODUCTIONUploaded byHari Thota
- E0404028033.pdfUploaded byinventionjournals
- AE61Uploaded byAnima Sen
- 07Uploaded byClara Bella
- Fully Convolutional Networks.pdfUploaded byMarius_2010
- 6409_Decision+TheoryUploaded byValerie Co
- MIT6_0001F16_ps1Uploaded byNikhil Patil
- Simplilearn Deep LearningUploaded byramubalu
- Numerical Method-steven c ChapraUploaded byReza Ferizal
- LU DecompositionUploaded byShyam Prakash
- Queing Theory Model.pptUploaded byHarneet Sachdeva
- Fuzzy Gain-Scheduling Nonlinear Parametric Uncertain System.pdfUploaded byOualid Lamraoui
- Stopping ProblemUploaded bybonvilter
- Chaocipher-Revealed-AlgorithmUploaded byDonna Chambers
- Wikipedia k Nearest Neighbor AlgorithmUploaded byRadu Cimpeanu
- Basic Life in Su Are Nce MathematicsUploaded byEvgeni Nedyalkov
- 8086.docUploaded byDhanya Rao Mamidi
- PSO Surfing the WavesUploaded byJayagowri Cheluri
- IRJET-Analysis of Document Clustering using Pseudo Dynamic Quantum Clustering ApproachUploaded byIRJET Journal
- Lecture Notes - Linear ProgrammingUploaded byeolbielen
- Implementation of discrete hidden markov model for sequence classification in C++ using EigenUploaded bypi194043
- Cryptanalysis of the Dual Elliptic Curve Pseudorandom GeneratorUploaded bypippo847362
- 10 Mathematics Ncert Ch01 Real Numbers Ex 1.1 Ans DgwUploaded byroyalrajoria4912
- Optimal+Control+of+Nonlinear+Inverted+Pendulum+System+using+PID+Controller+and+LQR%3A+Performance+Analysis+without+%26amp%3B+with+Disturbance+InputUploaded bypremkumarreddy_n4922
- Math 2320 Assignment 1 SolutionUploaded bykitty
- Section1_10Uploaded bysonti11
- 4 a Study of Encryption AlgorithmsUploaded byVivek
- Parameters Identification of non linear DC motorUploaded bynaveed161
- SNP Optimization Training SlidesUploaded byRavindranath Reddy