Top Banner
PID Control of Car Position Exercises in Manual Tuning
23

PID Control of Car Position

Feb 25, 2016

Download

Documents

Gail

PID Control of Car Position. Exercises in Manual Tuning. Before We Begin. In this assignment, you will be tuning PID controllers manually. Proper manual tuning of PID controllers relies on intuitive understanding of PID performance, so we are aiming here to provide such an understanding. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: PID Control of Car Position

PID Control of Car Position

Exercises in Manual Tuning

Page 2: PID Control of Car Position

Before We Begin• In this assignment, you will be tuning PID

controllers manually.• Proper manual tuning of PID controllers relies

on intuitive understanding of PID performance, so we are aiming here to provide such an understanding.

• There are MANY excellent resources that provide more rigorous/mathematical analysis.– Here is one: http://

lorien.ncl.ac.uk/ming/pid/PID.pdf

Page 3: PID Control of Car Position

Introduction of Terminology• Before we discuss PID control, we must first introduce a few

terms that occur frequently in feedback control.– Plant

• This is the physical system in a control loop. In our example, this is the car. It is often represented with a G.

– Sensor• A device that measures the quantity we are trying to control. In our system,

this is the optical encoder.– Actuator

• A device that enables us to change the state of the system in some way. In our system, this is the DC motor.

– Controller• A piece of logic/arithmetic/magic that operates on the error signal to compute

actuator effort. It is often represented with a C.

Page 4: PID Control of Car Position

Feedback Loop

C G+-

Error SignalControl/Actuator

Effort Loop Output

Sensor

Reference Trajectory

Page 5: PID Control of Car Position

Feedback Loop for Car Position

C G+-

Position Error (in meters)

Control Effort (Motor Voltage)

Actual Car Position (in meters)

Encoder

Desired Car Position (in meters)

• The signals represent actual physical quantities.– Controller computes a voltage from car position

error.– Plant responds to this voltage, resulting in a

position.

Page 6: PID Control of Car Position

PID Control• A PID controller computes control effort, u, from error signal, e, as

follows:

u=KPe+KD e’+KI ∫e(τ )∂τ

or in the Laplace domain:

U=E(KP+sKD+KI/s)

– Called “PID” because one of these terms is Proportional to e, one scales with the Integral of e, and another scales with the Derivative of e.

– KP,I,D are coefficients that you must assign. Finding these values is called “tuning” the controller.

Page 7: PID Control of Car Position

Proportional Control• If you take KD =KI =0, then we have proportional control:

U=KpE• That is, the actuator effort is proportional to the error

signal.• KP determines how “hard” the controller pushes in

response to an error.• If KP is large, then the actuator will respond strongly to an

error. This is called a “firm” controller.• If KP is small, then the actuator will respond weakly to an

error. This is called a “loose” controller.

Page 8: PID Control of Car Position

PD Control

• If you take KI =0, KP,KD≠0:U=E(KP+sKD)

• This is called PD control.• KP still determines how “hard” the controller pushes

in response to an error.• KD weights the derivative of the error signal.

Page 9: PID Control of Car Position

PD Control

• In a properly tuned controller, the effect of the derivative term is to slow the plant down as it approaches its end-point.– Reduces overshoot, increases damping.

• Differentiation amplifies high frequency sensor noise, which can result in instability.

Page 10: PID Control of Car Position

PI Control• If you take KD =0, KP,KI>0:

U=E(KP+KI/s)• This is called PI control.• The integral term provides large steady-state

gain.– In the presence of even a small steady-state error, the

integral of the error signal grows until the error is corrected.

• The integral term degrades transient behavior.– Increases overshoot, reduces damping.

Page 11: PID Control of Car Position

PID Control• If you take, KP,I,D>0, then you have a full PID

controller.– Proportional term dictates controller stiffness.– Integral term provides large steady-state gain but

degrades transient response.– Derivative term improves transient performance

at the cost of increased susceptibility to high-frequency noise.

Page 12: PID Control of Car Position

Assignment 3• In order to complete this assignment, you will need to install

some software.– Download this zipped directory: http://

dl.dropbox.com/u/8406152/EE%20141%20PID%20Assignment.rar– You will need to download winrar or something similar to unzip this.– Run setup.exe to install PID_control.exe, which you will use for this

assignment.– The download file also contains a configuration file called config.txt.

Create a working folder and put config.txt in it. You will be using this folder for all data, controllers, etc that you generate in future assignments.

– This is a very big file (200MB) because it includes the LabVIEW Run-Time Engine. Future programs will not include this and will be much smaller in size.

Page 13: PID Control of Car Position

Getting Familiar with the Software• Step 1: Provide a path to your working directory.• Step 2: Slide the controls to set KP,I,D.• Step 3: Press the “Done Tuning?” button and

watch the resulting step response.

Page 14: PID Control of Car Position

What Will You be Turning In?• This assignment will walk you through manual tuning of a PID controller.• You will be asked to provide a document showing the performance resulting from a

number of controllers.• Use the Prnt Scrn function to copy and paste the step response of the controllers into this

document (see below).– Make sure that figure shows both the position and voltage traces as well as the gains in the boxes

just underneath.• Provide a descriptive title for each plot, but do not waste your time writing anything else.• Additionally, you will be demonstrating your controllers during your group meetings.

Page 15: PID Control of Car Position

Problem 1:Proportional Controller

• Find the proportional gain that yields the best performance. Provide a plot for this controller.

• What happens if you increase KP to much? What happens if KP is too small? Provides plots of these cases.

Page 16: PID Control of Car Position

Problem 2:PD Controller

• Tune a PD controller to provide the best performance. Provide a plot of this.– One method to do this is to increase KP until you

start to see significant oscillation or “ringing” and then increase KD until this is sufficiently damped.

– What happens if you double KD? Halve it? Provide plots of the resulting controllers.

Page 17: PID Control of Car Position

Problem 3:PID Controller

• Tune a PID controller to provide the best performance. Provide plots of the resulting controller.– You might want to start with your PD controller and

work from there.• What effect does adding the integral term have on

the transient response? Steady-state response?• Can you see the effect of the integral controller in

the voltage trace?

Page 18: PID Control of Car Position

Problem 4:Ziegler-Nichols Tuning

• Ziegler-Nichols tuning is a heuristic method of tuning a PID controller.

• It typically yields very stiff controllers with high overshoot, poor damping.

• The resulting controller is often used as a starting point for subsequent optimization.

Page 19: PID Control of Car Position

Ziegler-Nichols Tuning• Set KI,D=0, and increase KP until you see a purely oscillatory

response.– This condition is called marginal stability.– The gain at which this happens is called Ku.

– Compute the period of this oscillation. Call this Tu.

• The Ziegler-Nichols tuned P,PI, and PID controllers are found using the following table:

Control Type KP KI KD

P Ku/2 0 0

PI Ku/2.2 1.2KP/Tu 0

PID .6Ku 2KP/Tu KPTu/8

Page 20: PID Control of Car Position

Ziegler-Nichols Tuning• Generate each of these Z-N controllers

(P,PI,PID)– Provide a plot of each.– What can you say about the performance relative

to your controllers?

Page 21: PID Control of Car Position

What is the take home lesson?

• PID controllers are very versatile, highly useful, and ubiquitous.– Used in a vast majority of industrial control

systems.– With a bit of skill, they can be tuned manually

with little trouble for many systems.– No plant model is required for manual tuning.

Page 22: PID Control of Car Position

What is the take home lesson?• There are some very significant shortcomings

to this approach.– Guess-and-check approach is possible for this

small/cheap/innocuous system, but you wouldn’t want to do this with an expensive or potentially dangerous system.

– There are many systems for which PID control is either impossible or highly sub-optimal.

– More systematic and mathematically rigorous methods are often required.

Page 23: PID Control of Car Position

What is the take home lesson?

• A pure derivative controller is not physically realizable (or all that desirable), so PID controllers are typically replaced with lead-lag compensators.– This will be the subject of a future assignment.