Acknowledgements. Control System. Tracking. CS122A: Embedded System Design 4/24/2007. A Simple Introduction to Embedded Control Systems (PID Control)

Similar documents
Introduction to control theory

Chapter 7 Control. Part Classical Control. Mobile Robotics - Prof Alonzo Kelly, CMU RI

(Refer Slide Time: 1:42)

Lecture 25: Tue Nov 27, 2018

Analysis and Design of Control Systems in the Time Domain

Overview of the Seminar Topic

Feedback Control of Linear SISO systems. Process Dynamics and Control

CDS 101/110a: Lecture 8-1 Frequency Domain Design

EE 422G - Signals and Systems Laboratory

Introduction to Feedback Control

Control. CSC752: Autonomous Robotic Systems. Ubbo Visser. March 9, Department of Computer Science University of Miami

Dr Ian R. Manchester

Video 5.1 Vijay Kumar and Ani Hsieh

School of Mechanical Engineering Purdue University. ME375 Feedback Control - 1

BASIC PROPERTIES OF FEEDBACK

Where we ve been, where we are, and where we are going next.

Control System Design

CHBE320 LECTURE XI CONTROLLER DESIGN AND PID CONTOLLER TUNING. Professor Dae Ryook Yang

Design and Implementation of Two-Degree-of-Freedom Nonlinear PID Controller for a Nonlinear Process

ECSE 4962 Control Systems Design. A Brief Tutorial on Control Design

Lecture 6: Control Problems and Solutions. CS 344R: Robotics Benjamin Kuipers

B1-1. Closed-loop control. Chapter 1. Fundamentals of closed-loop control technology. Festo Didactic Process Control System

Control Lab. Thermal Plant. Chriss Grimholt

Feedback Basics. David M. Auslander Mechanical Engineering University of California at Berkeley. copyright 1998, D.M. Auslander

FUZZY CONTROL CONVENTIONAL CONTROL CONVENTIONAL CONTROL CONVENTIONAL CONTROL CONVENTIONAL CONTROL CONVENTIONAL CONTROL

Review: stability; Routh Hurwitz criterion Today s topic: basic properties and benefits of feedback control

Latches. October 13, 2003 Latches 1

Experiment 81 - Design of a Feedback Control System

Plan of the Lecture. Review: stability; Routh Hurwitz criterion Today s topic: basic properties and benefits of feedback control

Lab 3: Model based Position Control of a Cart

Embedded Systems and Software. A Simple Introduction to Embedded Control Systems (PID Control)

(b) A unity feedback system is characterized by the transfer function. Design a suitable compensator to meet the following specifications:

Process Control J.P. CORRIOU. Reaction and Process Engineering Laboratory University of Lorraine-CNRS, Nancy (France) Zhejiang University 2016

1 An Overview and Brief History of Feedback Control 1. 2 Dynamic Models 23. Contents. Preface. xiii

(Refer Slide Time: 00:01:30 min)

FEEDBACK CONTROL SYSTEMS

Control 2. Proportional and Integral control

Uncertainty and Robustness for SISO Systems

Process Solutions. Process Dynamics. The Fundamental Principle of Process Control. APC Techniques Dynamics 2-1. Page 2-1

= ~ M3~ Figure 0.1: Sensor and sensorless modes

CM 3310 Process Control, Spring Lecture 21

Inverted Pendulum: State-Space Methods for Controller Design

YTÜ Mechanical Engineering Department

Analysis and Design of Hybrid AI/Control Systems

Integrator Windup

Alireza Mousavi Brunel University

MAE143a: Signals & Systems (& Control) Final Exam (2011) solutions

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Mechanical Engineering 2.04A Systems and Controls Spring 2013

Reglerteknik, TNG028. Lecture 1. Anna Lombardi

DC-motor PID control

PID Control. Objectives

Application Note #3413

YTÜ Mechanical Engineering Department

Control Systems I Lecture 10: System Specifications

CDS 101/110a: Lecture 10-1 Robust Performance

Tuning of Internal Model Control Proportional Integral Derivative Controller for Optimized Control

DSP Configurations. responded with: thus the system function for this filter would be

2.004 Dynamics and Control II Spring 2008

The loop shaping paradigm. Lecture 7. Loop analysis of feedback systems (2) Essential specifications (2)

An Introduction to Control Systems

Open Loop Tuning Rules

Pitch Rate CAS Design Project

Outline. Classical Control. Lecture 1

SRV02-Series Rotary Experiment # 1. Position Control. Student Handout

IVR: Introduction to Control (IV)

EEE 188: Digital Control Systems

Dynamics and PID control. Process dynamics

Dr Ian R. Manchester Dr Ian R. Manchester AMME 3500 : Review

Index. Index. More information. in this web service Cambridge University Press

MATH4406 (Control Theory) Unit 1: Introduction Prepared by Yoni Nazarathy, July 21, 2012

Acceleration Feedback

EXAMPLE: MODELING THE PT326 PROCESS TRAINER

Real-time Systems: Scheduling Periodic Tasks

Innovative Solutions from the Process Control Professionals

PID controllers. Laith Batarseh. PID controllers

Exam. 135 minutes + 15 minutes reading time

Feedback Control CONTROL THEORY FUNDAMENTALS. Feedback Control: A History. Feedback Control: A History (contd.) Anuradha Annaswamy

Survey of Methods of Combining Velocity Profiles with Position control

Positioning Servo Design Example

Inverted Pendulum System

Now, consider the actual molecules reacting with each other:

CHAPTER 3 QUARTER AIRCRAFT MODELING

06 Feedback Control System Characteristics The role of error signals to characterize feedback control system performance.

CDS 270-2: Lecture 6-1 Towards a Packet-based Control Theory

and Mixed / Control of Dual-Actuator Hard Disk Drive via LMIs

VLSI Physical Design Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

MAS107 Control Theory Exam Solutions 2008

Lab 11 - Free, Damped, and Forced Oscillations

Chapter 12. Feedback Control Characteristics of Feedback Systems

Model Predictive Controller of Boost Converter with RLE Load

PHY131H1F - Class 9. Today, finishing Chapter 5: Kinetic Friction Static Friction Rolling without slipping (intro) Drag

9. Fuzzy Control Systems

Lecture 12. Upcoming labs: Final Exam on 12/21/2015 (Monday)10:30-12:30

EE3CL4: Introduction to Linear Control Systems

EC CONTROL SYSTEM UNIT I- CONTROL SYSTEM MODELING

Classify a transfer function to see which order or ramp it can follow and with which expected error.

Newton s Third Law and Conservation of Momentum 1 Fall 2017

Control Systems I. Lecture 2: Modeling. Suggested Readings: Åström & Murray Ch. 2-3, Guzzella Ch Emilio Frazzoli

Topic # Feedback Control Systems

Linear State Feedback Controller Design

Transcription:

Acknowledgements A Simple Introduction to Embedded Control Systems (PID Control) The material in this lecture is adapted from: F. Vahid and T. Givargis, Embedded System Design A Unified Hardware/Software Introduction, John Wiley & Sons, 2002 (Chapter 9) T. Wescott, PID Without a PhD http://www.embedded.com/2000/0010/0010feat3.htm 1 2 Control System Tracking Control physical system s output By setting physical system s input Tracking E.g. Cruise control Thermostat control Disk drive control Aircraft altitude control Chemical processes Difficulty due to Disturbance: wind, road, tire, brake; opening/closing door Human interface: feel good, feel right 3 4 1

Open-Loop Control Systems Plant Physical system to be controlled Car, plane, disk, heater, Actuator Device to control the plant Throttle, wing flap, disk motor, Controller Designed product to control the plant Open-Loop Control Systems Output The aspect of the physical system we are interested in Speed, disk location, temperature Reference The value we want to see at output Desired speed, desired location, desired temperature Disturbance Uncontrollable input to the plant imposed by environment Wind, bumping the disk drive, door opening 5 6 Other Characteristics of open loop Feed-forward control Delay in actual change of the output Controller doesn t know how well thing goes Simple Best use for predictable systems Closed Loop Control Systems Sensor Measure the plant output Error detector Detect Error Feedback control systems Minimize tracking error 7 8 2

Designing Open Loop Control System Develop a model of the plant Develop a controller Analyze the controller Consider Disturbance Determine Performance Example: Open Loop Cruise Control System Model of the Plant May not be necessary Can be done through experimenting and tuning But, Can make it easier to design May be useful for deriving the controller Example: throttle that goes from 0 to 45 degree On flat surface at 50 mph, open the throttle to 40 degrees Wait 1 time unit Measure the speed, let s say 55 mph Then the following equation satisfies the above scenario v t+1 =0.7*v t +0.5*u t 55 = 0.7*50+0.5*40 IF the equation holds for all other scenarios Then we have a model of the plant 9 10 Designing the Controller Assuming we want to use a simple linear function u t =F(r t )= P * r t r t is the desired speed Linear proportional controller v t+1 =0.7*v t +0.5*u t = 0.7*v t +0.5P*r t Let v t+1 =v t at steady state = v ss v ss =0.7*v ss +0.5P*r t At steady state, we want v ss =r t P=0.6 I.e. u t =0.6*r t Analyzing the Controller Let v 0 =20mph, r 0 =50mph v t+1 =0.7*v t +0.5(0.6)*r t =0.7*v t +0.3*50= 0.7*v t +15 Throttle position is 0.6*50=30 degrees 11 12 3

Considering the Disturbance Assume road grade can affect the speed From 5mph to +5 mph v t+1 =0.7*v t +10 v t+1 =0.7*v t +20 Determining Performance V t+1 =0.7*v t +0.5P*r 0 -w 0 v 1 =0.7*v 0 +0.5P*r 0 -w 0 v 2 =0.7*(0.7*v 0 +0.5P*r 0 -w 0 ) +0.5P*r 0 -w 0 =0.7*0.7*v 0 +(0.7+1.0)*0.5P*r 0 -(0.7+1.0)w 0 v t =0.7 t *v 0 +(0.7 t-1 +0.7 t-2 + +0.7+1.0)(0.5P*r 0 -w 0 ) Coefficient of v t determines rate of decay of v 0 Bigger coefficient will result in slower response >1 or <-1, v t will grow without bound <0, v t will oscillate 13 14 Designing Closed Loop Control System Stability v t+1 = 0.7v t +0.5u t -w t = 0.7v t +0.5P*(r t -v t )-w t =(0.7-0.5P)*v t +0.5P*r t -w t v t+1 =(0.7-0.5P) t *v 0 +((0.7-0.5P) t-1 +(0.7-0.5P) t-2 + +0.7 0.5P+1.0)(0.5P*r 0 -w 0 ) 15 Stability constraint (i.e. convergence) requires: 0.7-0.5P <1-1<0.7-0.5P<1-0.6<P<3.4 To avoid oscillation: (0.7-5 P) >= 0 P <=1.4 16 4

Reducing effect of v 0 v t+1 = 0.7v t +0.5u t -w t = 0.7v t +0.5P*(r t -v t )-w =(0.7-0.5P)*v t +0.5P*r t -w t v t =(0.7-0.5P) t *v 0 +((0.7-0.5P) t-1 +(0.7-0.5P) t-2 + +0.7-0.5P+1.0)(0.5P*r 0 -w 0 ) To reduce the effect of initial condition 0.7-0.5P as small as possible P=1.4 Avoid Oscillation v t+1 = 0.7v t +0.5u t -w t = 0.7v t +0.5P*(r t -v t )-w =(0.7-0.5P)*v t +0.5P*r t -w t v t =(0.7-0.5P) t *v 0 +((0.7-0.5P) t-1 +(0.7-0.5P) t-2 + +0.7-0.5P+1.0)(0.5P*r 0 -w 0 ) To avoid oscillation 0.7-0.5P >=0 P<=1.4 17 18 Perfect Tracking v t+1 = 0.7v t +0.5u t -w t = 0.7v t +0.5P*(r t -v t )-w =(0.7-0.5P)*v t +0.5P*r t -w t v ss =(0.7-0.5P)*v ss +0.5P*r 0 -w 0 (1-0.7+0.5P)v ss =0.5P*r 0 -w 0 v ss =(0.5P/(0.3+0.5P)) * r 0 - (1.0/(0.3+0.5P)) * w o To make v ss as close to r 0 as possible P should be as large as possible Closed-Loop Design Finally, setting P=3.3 Stable, track well, some oscillation u t = 3.3 * (r t -v t ) 19 20 5

Analyze the controller v 0 =20 mph, r 0 =50 mph, w=0 v t+1 = 0.7v t +0.5P*(r t -v t )-w = 0.7v t +0.5*3.3*(50-v t ) = 3.3 * (50-v t ) But valid u t ranges from 0-45 Controller saturates Analyze the controller v 0 =20 mph, r 0 =50 mph, w=0 v t+1 = 0.7v t +0.5*u t u t = 3.3 * (50-v t ) Saturate at 0, 45 Oscillation! feel bad 21 22 Analyze the controller Analyzing the Controller Set P=1.0 to void oscillation Terrible SS performance 23 24 6

v t+1 = 0.7v t +0.5*3.3*(r t - v t )-w w=-5 or +5 39.74 Close to 42.31 Better than 33 66 Cost SS error Minimize the effect of disturbance General Control System Objective Causing output to track a reference even in the presence of Measurement noise Model error Disturbances Metrics Stability Output remains bounded Performance How well an output tracks the reference Disturbance rejection Robustness oscillation 25 Ability to tolerate modeling error of the plant 26 Performance (generally speaking) Rise time Time it takes from 10% to 90% Peak time Overshoot Percentage by which Peak exceed final value Settling time Time it takes to reach 1% of final value 27 Plant modeling is difficult May need to be done first Plant is usually on continuous time Not discrete time E.g. car speed continuously react to throttle position, not at discrete interval Sampling period must be chosen carefully To make sure nothing interesting happen in between I.e. small enough Plant is usually non-linear E.g. shock absorber response may need to be 8 th order differential Iterative development of the plant model and controller Have a plant model that is good enough 28 7

Controller Design: P Proportional controller A controller that multiplies the tracking error by a constant Closed loop model with a linear plant E.g. v t+1 = (0.7-0.5P)*v t +0.5P*r t -w t P affects Transient response Stability, oscillation Steady state tracking As large as possible Disturbance rejection As large as possible Controller Design: PD Proportional and Derivative control + D * ((r t -v t )-(r t-1 -v t-1 )) = P * e t + D * (e t -e t-1 ) Consider the size of error over time Intuitively Want to push more if the error is not reducing fast enough Want to push less if the error is reducing really fast 29 30 PD Controller Need to keep track of error derivative E.g. Cruise controller example v t+1 = 0.7v t +0.5u t -w t Let u t = P * e t + D * (e t -e t-1 ), e t =r t -v t v t+1 =0.7v t +0.5*(P*(r t -v t )+D*((r t -v t )-(r t-1 -v t-1 )))-w t v t+1 =(0.7-0.5*(P+D))*v t +0.5D*v t-1 +0.5*(P+D)*r t -0.5D*r t- 1 -w t Assume reference input and disturbance are constant, the steady-state speed is V ss =(0.5P/(1-0.7+0.5P)) * r Does not depend on D!!! P can be set for best tracking and disturbance control Then D set to control oscillation/overshoot/rate PD Control Example 31 32 of convergence 8

PI Control Proportional plus integral control u t =P*e t +I*(e 0 +e 1 + +e t ) Sum up error over time Ensure reaching desired output, eventually v ss will not be reached until e ss =0 Use P to control disturbance Use I to ensure steady state convergence and convergence rate PID Controller Combine Proportional, integral, and derivative control u t =P*e t +I*(e 0 +e 1 + +e t )+D*(e t -e t-1 ) Available off-the shelf 33 34 Block Diagram View of PID Controller Software Coding Main function loops forever, during each iteration Read plant output sensor May require A2D Read current desired reference input Call PidUpdate, to determine actuator value Set actuator value May require D2A 35 36 9

Software Coding (continued) Pgain, Dgain, Igain are constants sensor_value_previous For D control error_sum For I control Computation u t =P*e t +I*(e 0 +e 1 + +e t )+D*(e t -e t-1 ) 37 38 PID tuning Analytically deriving P, I, D may not be possible E.g. plant not is not available, or to costly to obtain Ad hoc method for getting reasonable P, I, D Start with a small P, I=D=0 Increase D, until seeing oscillation Reduce D a bit Increase P, until seeing oscillation Reduce D a bit Increase I, until seeing oscillation Iterate until can change anything without Excellent Reference for PID Control PID Without a PhD by Tim Wescott http://www.embedded.com/2000/0010/001 0feat3.htm excessive oscillation 39 40 10

Practical Issues with Computer- Based Control Quantization Overflow Aliasing Computation Delay Quantization & Overflow Quantization E.g. can t store 0.36 as 4-bit fractional number Can only store 0.75, 0.59, 0.25, 0.00, -0.25, -050,-0.75, -1.00 Choose 0.25 Results in quantization error of 0.11 Sources of quantization error Operations, e.g. 0.50*0.25=0.125 Can use more bits until input/output to the environment/memory A2D converters Overflow Can t store 0.75+0.50 = 1.25 as 4-bit fractional number 41 Solutions: Use fix-point representation/operations carefully Time-consuming Use floating-point co-processor Costly 42 Aliasing Quantization/overflow Due to discrete nature of computer data Aliasing Due to discrete nature of sampling Aliasing Example Sampling at 2.5 Hz, period of 0.4, the following are indistinguishable y(t)=1.0*sin(6πt), frequency 3 Hz y(t)=1.0*sin(πt), frequency of 0.5 Hz In fact, with sampling frequency of 2.5 Hz Can only correctly sample signal below Nyquist frequency 2.5/2 = 1.25 Hz 43 44 11

Computation Delay Inherent delay in processing Actuation occurs later than expected Need to characterize implementation delay to make sure it is negligible Hardware delay is usually easy to characterize Synchronous design Software delay is harder to predict Should organize code carefully so delay is predictable and minimized Write software with predictable timing behavior (be like hardware) Time Trigger Architecture Synchronous Software Language and/or RTOS 45 12