+ All Categories
Home > Engineering > PID Control System

PID Control System

Date post: 16-Feb-2017
Category:
Upload: asheesh-kumar-shahi
View: 790 times
Download: 0 times
Share this document with a friend
20
PID Control Systems ASHEESH K. SHAHI [email protected] Department of Electronics and Comm., Amity School of Engineering & Technology (ASET), Amity University, Uttar Pradesh, India 1
Transcript
Page 1: PID Control System

1

PID Control Systems

ASHEESH K. [email protected]

Department of Electronics and Comm.,Amity School of Engineering &  Technology (ASET),

Amity University, Uttar Pradesh, India

Page 2: PID Control System

2

Feedback ControlSay you have a system controlled by an

actuatorHook up a sensor that reads the effect of the

actuator (NOT the output to the actuator)You now have a feedback loop and can use it

to control your system!

Actuator Sensor

Page 3: PID Control System

3

Introduction to PIDStands for Proportional, Integral, and

Derivative controlForm of feedback control

Page 4: PID Control System

4

Simple Feedback Control (Bad)double Control (double setpoint, double current) {

double output;if (current < setpoint)

output = MAX_OUTPUT;else

output = 0;return output;

}

Why won't this work in most situations?

Page 5: PID Control System

5

Simple Feedback Control FailsMoving parts

have inertiaMoving parts

have external forces acting upon them (gravity, friction, etc)

Page 6: PID Control System

6

Proportional ControlGet the error - the distance between the

setpoint (desired value) and the actual valueMultiply it by Kp, the proportional gainThat's your output!double Proportional(double setpoint, double current, double Kp) {

double error = setpoint - current;double P = Kp * error;return P;

}

Page 7: PID Control System

7

Proportional TuningIf Kp is too large, the

sensor reading will rapidly approach the setpoint, overshoot, then oscillate around it

If Kp is too small, the sensor reading will approach the setpoint slowly and never reach it

Page 8: PID Control System

8

What can go wrong?When error nears zero, the output of a P

controller also nears zeroForces such as gravity and friction can

counteract a proportional controller and make it so the setpoint is never reached (steady-state error)

Increased proportional gain (Kp) only causes jerky movements around the setpoint

Page 9: PID Control System

9

Proportional-Integral ControlAccumulate the error as time passes and

multiply by the constant Ki. That is your I term. Output the sum of your P and I terms.

double PI(double setpoint, double current, double Kp, double Ki) {

double error = setpoint - current;double P = Kp * error;static double accumError = 0;accumError += error;double I = Ki * accumError;return P + I;

}

Page 10: PID Control System

10

PI controllerThe P term will

take care of the large movements

The I term will take care of any steady-state error not accounted for by the P term

Page 11: PID Control System

11

Limits of PI controlPI control is good for most embedded

applicationsDoes not take into account how fast the

sensor reading is approaching the setpointWouldn't it be nice to take into account a

prediction of future error?

Page 12: PID Control System

12

Proportional-Derivative ControlFind the difference between the current error and

the error from the previous timestep and multiply by the constant Kd. That is your D term. Output the sum of your P and D terms.

double PD(double setpoint, double current, double Kp, double Kd) {

double error = setpoint - current;double P = Kp * error;static double lastError = 0;double errorDiff = error - lastError;lastError = error;double D = Kd * errorDiff;return P + D;

}

Page 13: PID Control System

13

PD ControllerD may very well stand

for "Dampening"Counteracts the P

and I terms - if system is heading toward setpoint,

This makes sense: The error is decreasing, so d(error)/dt is negative

Page 14: PID Control System

14

PID ControlCombine P, I and D terms!double PID(double setpoint, double current, double Kp, double Ki, double Kd) {

double error = setpoint - current;double P = Kp * error;static double accumError = 0;accumError += error;double I = Ki * accumError;static double lastError = 0;double errorDiff = error - lastError;lastError = error;double D = Kd * errorDiff;return P + I + D;

}

Page 15: PID Control System

15

Effects of increasing a parameter independentlyPARAMET

ER Kp Ki KdRISE TIME DECREASE DECREASE MINOR

CHANGEOVERSHOOT INCREASE INCREASE DECREASE

SETTLING TIME

SMALL CHANGE

INCREASE DECREASE

STEADY STATE ERROR

DECREASE INCREASE NO EFFECT

STABILITY DEGRADE DEGRADE IMPROVE IF Kd IS SMALL

Page 16: PID Control System

16

PID TuningStart with Kp = 0, Ki = 0, Kd = 0Tune P term - System should be at full power

unless near the setpointTune Ki until steady-state error is removedTune Kd to dampen overshoot and improve

responsiveness to outside influencesPI controller is good for most embedded

applications, but D term adds stability

Page 17: PID Control System

17

Effects of varying PID parameters on the step response of a system

Page 18: PID Control System

18

PID ApplicationsRobotic arm movement (position control)Temperature controlSpeed control (ENGR 151 TableSat Project)

Page 19: PID Control System

19

ConclusionPID uses knowledge about the present, past,

and future state of the system, collected by a sensor, to control

In PID control, the constants Kp, Ki, and Kd must be tuned for maximum performance

Page 20: PID Control System

20

Questions?


Recommended