Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 9: Control Systems.

Slides:



Advertisements
Similar presentations
Pole Placement.
Advertisements

PID Controllers and PID tuning
Basics of Feedback Control
Chapter 4: Basic Properties of Feedback
Digital Control Systems INTRODUCTION. Introduction What is a control system? Objective: To make the system OUTPUT and the desired REFERENCE as close as.
PID Control -1 + Professor Walter W. Olson
Loop Shaping Professor Walter W. Olson
Control System Design Based on Frequency Response Analysis
Controller Tuning: A Motivational Example
Control Theory (2) Jeremy Wyatt School of Computer Science University of Birmingham.
Process Control Instrumentation II
Intelligent Steering Using PID controllers
Proportional/Integral/Derivative Control
Lecture 5: PID Control.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
1. 2 LOOP DYNAMICS To keep track of deviations from the free-running frequency,
Computer Control: An Overview Wittenmark, Åström, Årzén Computer controlled Systems The sampling process Approximation of continuous time controllers Aliasing.
Ch. 6 Single Variable Control
CHAPTER 11 Op-Amp Applications. Objectives Describe and Analyze: Audio mixers Integrators Differentiators Peak detectors Comparators Other applications.
Brief Review of Control Theory
1 Lab 5: Controls and feedback. 2 Lab 5: Control and Feedback This embedded system uses the Photo sensor to detect the light intensity of the environment.
Professor Walter W. Olson Department of Mechanical, Industrial and Manufacturing Engineering University of Toledo Loop Shaping.
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Feedback Control.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 9: Control Systems.
PID Controller Design and
Low Level Control. Control System Components The main components of a control system are The plant, or the process that is being controlled The controller,
Feedback Control system
Chapter 20 1 Overall Objectives of Model Predictive Control 1.Prevent violations of input and output constraints. 2.Drive some output variables to their.
University of Virginia PID Controllers Jack Stankovic University of Virginia Spring 2015.
PID CONTROLLERS By Harshal Inamdar.
IVR 30/10/2009 Herrmann1 IVR: Control Theory Overview: PID control Steady-state error and the integral method Overshoot and ringing in system with time.
CSCI1600: Embedded and Real Time Software Lecture 12: Modeling V: Control Systems and Feedback Steven Reiss, Fall 2015.
Chapter 8 Feedback Controllers 1. On-off Controllers Simple Cheap Used In residential heating and domestic refrigerators Limited use in process control.
Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015.
ME 431 System Dynamics Dept of Mechanical Engineering.
PID Control of Car Position Exercises in Manual Tuning.
Lecture 25: Implementation Complicating factors Control design without a model Implementation of control algorithms ME 431, Lecture 25.
Lecture 17: Introduction to Control (part III)
Digital Control CSE 421.
Features of PID Controllers
Control 3 Keypoints: PID control
Lecture 16: Introduction to Control (Part II)
Chapter 4 A First Analysis of Feedback Feedback Control A Feedback Control seeks to bring the measured quantity to its desired value or set-point (also.
System Time Response Characteristics
Embedded Control Systems Dr. Bonnie Heck School of ECE Georgia Tech.
1 Teaching Innovation - Entrepreneurial - Global The Centre for Technology enabled Teaching & Learning, M G I, India DTEL DTEL (Department for Technology.
Flow of signal So you have a sensor, now to process data taken from a sensor you will need a processing unit and that is your controller. sensorcontroller.
Lecture 9: PID Controller.
SKEE 3143 Control Systems Design Chapter 2 – PID Controllers Design
BIRLA VISHWAKARMA MAHAVIDHYALAYA ELECTRONICS & TELECOMUNICATION DEPARTMENT o – ANKUR BUSA o – KHUSHBOO DESAI UNDER THE GUIDENCE.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Introduction to control systems
Process Control. Feedback control y sp = set point (target value) y = measured value The process information (y) is fed back to the controller The objective.
Components of Mechatronic Systems AUE 425 Week 2 Kerem ALTUN October 3, 2016.
EEN-E1040 Measurement and Control of Energy Systems Control I: Control, processes, PID controllers and PID tuning Nov 3rd 2016 If not marked otherwise,
Digital Control CSE 421.
Automatic control systems I. Nonlinearities in Control System
Control Systems EE 4314 Lecture 12 March 17, 2015
Digital Control Systems
Control Loops Nick Schatz FRC 3184.
CSCI1600: Embedded and Real Time Software
6: Processor-based Control Systems
Basic Design of PID Controller
Controller Tuning: A Motivational Example
Electronic Control Systems Week 7 – PID Control
Brief Review of Control Theory
Digital Control Systems Waseem Gulsher
Chapter 9: Control Systems
Chapter 9: Control Systems
PID Controller Design and
Presentation transcript:

Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 9: Control Systems

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 2 Control System Control physical system’s output –By setting physical system’s input Tracking E.g. –Cruise control –Thermostat control –Disk drive control –Aircraft altitude control Difficulty due to –Disturbance: wind, road, tire, brake; opening/closing door… –Human interface: feel good, feel right…

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 3 Tracking

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 4 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

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 5 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

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 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

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 7 Close Loop Control Systems Sensor –Measure the plant output Error detector –Detect Error Feedback control systems Minimize tracking error

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 8 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

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 9 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 degree –Wait 1 “time unit” –Measure the speed, let’s say 55 mph –Then the following equation satisfy 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 scenario Then we have a model of the plant

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 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

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 11 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 degree

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 12 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

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 13 Determining Performance V t+1 =0.7*v t +0.5P*r 0 -w 0 v 1 =0.7*v P*r 0 -w 0 v 2 =0.7*(0.7*v P*r 0 -w 0 ) +0.5P*r 0 -w 0 =0.7*0.7*v 0 +( )*0.5P*r 0 - ( )w 0 v t =0.7 t *v 0 +(0.7 t t-2 +… )(0.5P*r 0 -w 0 ) Coefficient of v t determines rate of decay of v 0 –>1 or <-1, v t will grow without bound –<0, v t will oscillate

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 14 Designing Close Loop Control System

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 15 Stability u t = P * (r t -v t ) v t+1 = 0.7v t +0.5u t -w t = 0.7v t +0.5P*(r t -v t )-w =( P)*v t +0.5P*r t -w t v t =( P) t *v 0 +(( P) t-1 +( P) t-2 +… P+1.0)(0.5P*r 0 -w 0 ) Stability constraint (I.e. convergence) requires | P|<1 -1< P<1 -0.6<P<3.4

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 16 Reducing effect of v 0 u t = P * (r t -v t ) v t+1 = 0.7v t +0.5u t -w t = 0.7v t +0.5P*(r t -v t )-w =( P)*v t +0.5P*r t -w t v t =( P) t *v 0 +(( P) t-1 +( P) t-2 +… P+1.0)(0.5P*r 0 -w 0 ) To reduce the effect of initial condition – P as small as possible –P=1.4

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 17 Avoid Oscillation u t = P * (r t -v t ) v t+1 = 0.7v t +0.5u t -w t = 0.7v t +0.5P*(r t -v t )-w =( P)*v t +0.5P*r t -w t v t =( P) t *v 0 +(( P) t-1 +( P) t-2 +… P+1.0)(0.5P*r 0 -w 0 ) To avoid oscillation – P >=0 –P<=1.4

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 18 Perfect Tracking u t = P * (r t -v t ) v t+1 = 0.7v t +0.5u t -w t = 0.7v t +0.5P*(r t -v t )-w =( P)*v t +0.5P*r t -w t v ss =( P)*v ss +0.5P*r 0 -w 0 ( P)v ss =0.5P*r 0 -w 0 v ss =(0.5P/( P)) * r 0 - (1.0/( P)) * w o To make v ss as close to r 0 as possible –P should be as large as possible

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 19 Close-Loop Design u t = P * (r t -v t ) Finally, setting P=3.3 –Stable, track well, some oscillation –u t = 3.3 * (r t -v t )

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 20 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 ) u t = P * (r t -v t ) = 3.3 * (50-v t ) But u t range from 0-45 Controller saturates

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 21 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”

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 22 Analyze the controller Set P=1.0 to void oscillation –Terrible SS performance

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 23 Analyzing the Controller

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 24 Minimize the effect of disturbance v t+1 = 0.7v t +0.5*3.3*(r t -v t )-w –w=-5 or –Close to –Better than Cost –SS error –oscillation

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 25 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 Ability to tolerate modeling error of the plant

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 26 Performance (generally speaking) Rise time –Time it takes form 10% to 90% Peak time Overshoot –Percentage by which Peak exceed final value Settling time –Time it takes to reach 1% of final value

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 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”

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 28 Controller Design: P Proportional controller –A controller that multiplies the tracking error by a constant u t = P * (r t -v t ) –Close loop model with a linear plant E.g. v t+1 = ( P)*v t +0.5P*r t -w t P affects –Transient response Stability, oscillation –Steady state tacking As large as possible –Disturbance rejection As large as possible

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 29 Controller Design: PD Proportional and Derivative control u t = P * (r t -v t ) + 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

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 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 =( *(P+D))*v t +0.5D*v t *(P+D)*r t -0.5D*r t-1 -w t –Assume reference input and distribance are constant, the steady-state speed is V ss =(0.5P/( P)) * r Does not depend on D!!! P can be set for best tracking and disturbance control Then D set to control oscillation/overshoot/rate of convergence

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 31 PD Control Example

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 32 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

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 33 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

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 34 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

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 35 Software Coding (continue) Pgain, Dgain, Igain are constants sensor_value_previous –For D control error_sum –For I control

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 36 Computation u t =P*e t +I*(e 0 +e 1 +…+e t )+D*(e t -e t-1 )

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 37 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 excessive oscillation

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 38 Practical Issues with Computer-Based Control Quantization Overflow Aliasing Computation Delay

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 39 Quantization & Overflow Quantization –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, –Choose 0.25 Result 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 = 1.25 as 4-bit fractional number Solutions: –Use fix-point representation/operations carefully Time-consuming –Use floating-point co-processor Costly

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 40 Aliasing Quantization/overflow –Due to discrete nature of computer data Aliasing –Due to discrete nature of sampling

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 41 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

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 42 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

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 43 Benefit of Computer Control Cost!!! –Expensive to make analog control immune to Age, temperature, manufacturing error –Computer control replace complex analog hardware with complex code Programmability!!! –Computer Control can be “upgraded” Change in control mode, gain, are easy to do –Computer Control can be adaptive to change in plant Due to age, temperature, …etc –“future-proof” Easily adapt to change in standards,..etc