TODO add: PID material from Pont slides Some inverted pendulum videos Model-based control and other more sophisticated

Similar documents
1. Consider the closed loop system shown in the figure below. Select the appropriate option to implement the system shown in dotted lines using

L09. PID, PURE PURSUIT

Experiment 9. PID Controller

6.270 Lecture. Control Systems

Introduction to PID Control

Different Controller Terms

-binary sensors and actuators (such as an on/off controller) are generally more reliable and less expensive

PYKC 7 March 2019 EA2.3 Electronics 2 Lecture 18-1

DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING BANGLADESH UNIVERSITY OF ENGINEERING & TECHNOLOGY EEE 402 : CONTROL SYSTEMS SESSIONAL

MM7 Practical Issues Using PID Controllers

Understanding PID Control

International Journal of Research in Advent Technology Available Online at:

Chapter 5. Tracking system with MEMS mirror

Control and Optimization

Balancing Robot. Daniel Bauen Brent Zeigler

Closed-Loop Transportation Simulation. Outlines

CSE 3215 Embedded Systems Laboratory Lab 5 Digital Control System

CHAPTER 4 PID CONTROLLER BASED SPEED CONTROL OF THREE PHASE INDUCTION MOTOR

Lab 11. Speed Control of a D.C. motor. Motor Characterization

Lab 23 Microcomputer-Based Motor Controller

Welcome to SENG 480B / CSC 485A / CSC 586A Self-Adaptive and Self-Managing Systems

6.4 Adjusting PID Manually


Sensors and Sensing Motors, Encoders and Motor Control

Sensors and Sensing Motors, Encoders and Motor Control

PID Control Technical Notes

Controller Algorithms and Tuning

Figure 1: Unity Feedback System. The transfer function of the PID controller looks like the following:

Uç N. MADHUSUDHANAREDDYM.Sc.,

MEM380 Applied Autonomous Robots I Winter Feedback Control USARSim

OVEN INDUSTRIES, INC. Model 5C7-362

A Primer on Control Systems

Linear Control Systems Lectures #5 - PID Controller. Guillaume Drion Academic year

Loop Design. Chapter Introduction

LECTURE 2: PD, PID, and Feedback Compensation. ( ) = + We consider various settings for Zc when compensating the system with the following RL:

The Discussion of this exercise covers the following points: Angular position control block diagram and fundamentals. Power amplifier 0.

SECTION 6: ROOT LOCUS DESIGN

A Fast PID Tuning Algorithm for Feed Drive Servo Loop

A SOFTWARE-BASED GAIN SCHEDULING OF PID CONTROLLER

CDS 101/110: Lecture 8.2 PID Control

RWM control on EXTRAP T2R using various controller configurations.

Design of PID Control System Assisted using LabVIEW in Biomedical Application

PID-CONTROL FUNCTION AND APPLICATION

5 Lab 5: Position Control Systems - Week 2

GE423 Laboratory Assignment 6 Robot Sensors and Wall-Following

STABILITY IMPROVEMENT OF POWER SYSTEM BY USING PSS WITH PID AVR CONTROLLER IN THE HIGH DAM POWER STATION ASWAN EGYPT

SINGLE SENSOR LINE FOLLOWER

Cantonment, Dhaka-1216, BANGLADESH

Observer-based Engine Cooling Control System (OBCOOL) Project Proposal. Students: Andrew Fouts & Kurtis Liggett. Advisor: Dr.

Design of Compensator for Dynamical System

The Embedded System. - Development and analysis of an Embedded DC-motor controller - by Embedded System Team

ENGS 26 CONTROL THEORY. Thermal Control System Laboratory

EE 4314 Lab 3 Handout Speed Control of the DC Motor System Using a PID Controller Fall Lab Information

Rotary Motion Servo Plant: SRV02. Rotary Experiment #02: Position Control. SRV02 Position Control using QuaRC. Student Manual

QuickBuilder PID Reference

Configuration Example of Temperature Control

Lab 5: Control and Feedback. Lab 5: Controls and feedback. Lab 5: Controls and Feedback

Servo control: Ball on beam

ME 333 Assignment 7 and 8 PI Control of LED/Phototransistor Pair. Overview

Temperature Control in HVAC Application using PID and Self-Tuning Adaptive Controller

Feedback Systems in HVAC ASHRAE Distinguished Lecture Series Jim Coogan Siemens Building Technologies

Closed-loop System, PID Controller

Teaching Children Proportional Control using ROBOLAB 2.9. By Dr C S Soh

Control System for Lamp Luminosity. Ian Johnson, Tyler McCracken, Scott Freund EE 554 November 29, 2010

Andrea Zanchettin Automatic Control 1 AUTOMATIC CONTROL. Andrea M. Zanchettin, PhD Winter Semester, Linear control systems design Part 1

2.017 DESIGN OF ELECTROMECHANICAL ROBOTIC SYSTEMS Fall 2009 Lab 4: Motor Control. October 5, 2009 Dr. Harrison H. Chin

Frequency Response Analysis and Design Tutorial

Digital Logic, Algorithms, and Functions for the CEBAF Upgrade LLRF System Hai Dong, Curt Hovater, John Musson, and Tomasz Plawski

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

The PID controller. Summary. Introduction to Control Systems

PROCESS DYNAMICS AND CONTROL

Class 5. Competency Exam Round 1. The Process Designer s Process. Process Control Preliminaries. On/Off Control The Simplest Controller

Introduction to Digital Control

EE 308 Spring Preparation for Final Lab Project Simple Motor Control. Motor Control

GE420 Laboratory Assignment 8 Positioning Control of a Motor Using PD, PID, and Hybrid Control

When you configure a PID loop in iocontrol, choose one of the following algorithms: Velocity ISA Parallel Interacting

Module 08 Controller Designs: Compensators and PIDs

Introduction to Servo Control & PID Tuning

Based on the ARM and PID Control Free Pendulum Balance System

VECTOR CONTROL SCHEME FOR INDUCTION MOTOR WITH DIFFERENT CONTROLLERS FOR NEGLECTING THE END EFFECTS IN HEV APPLICATIONS

PROCESS DYNAMICS AND CONTROL

12. ELECTRONICS & INSTRUMENTATION FOR TEMPERATURE

Load Frequency and Voltage Control of Two Area Interconnected Power System using PID Controller. Kavita Goswami 1 and Lata Mishra 2

SxWEB PID algorithm experimental tuning

Servo Tuning. Dr. Rohan Munasinghe Department. of Electronic and Telecommunication Engineering University of Moratuwa. Thanks to Dr.

(1) Identify individual entries in a Control Loop Diagram. (2) Sketch Bode Plots by hand (when we could have used a computer

Design of stepper motor position control system based on DSP. Guan Fang Liu a, Hua Wei Li b

Lecture 5 Introduction to control

Embedded Control Project -Iterative learning control for

Andrea Zanchettin Automatic Control 1 AUTOMATIC CONTROL. Andrea M. Zanchettin, PhD Spring Semester, Linear control systems design

PERSONALIZED EXPERIMENTATION IN CLASSICAL CONTROLS WITH MATLAB REAL TIME WINDOWS TARGET AND PORTABLE AEROPENDULUM KIT

Design Of PID Controller In Automatic Voltage Regulator (AVR) System Using PSO Technique

Figure 1.1: Quanser Driving Simulator

AVR221: Discrete PID Controller on tinyavr and megaavr devices. Introduction. AVR 8-bit Microcontrollers APPLICATION NOTE

Control System Design for Tricopter using Filters and PID controller

TUNING OF PID CONTROLLERS USING PARTICLE SWARM OPTIMIZATION

CHAPTER 6 INTRODUCTION TO SYSTEM IDENTIFICATION

PID. What is PID and how does it work? Auto tuning PID with the 5400 Controller. Visit our website at:

COMPARISON OF TUNING METHODS OF PID CONTROLLER USING VARIOUS TUNING TECHNIQUES WITH GENETIC ALGORITHM

Engine Control Workstation Using Simulink / DSP. Platform. Mark Bright, Mike Donaldson. Advisor: Dr. Dempsey

Transcription:

TODO add: PID material from Pont slides Some inverted pendulum videos Model-based control and other more sophisticated controllers? More code speed issues perf with and w/o FP on different processors

Last Time Estimating worst case execution time Holistic scheduling: real-time guarantees over a CAN bus

Today Feedback (closed loop) control and PID controllers Principles Implementation Tuning

Control Systems Definitions: Desired state variables: X*(t) These are given to the system from outside E.g. room temperature should be 70 Estimated state variables: X (t) E.g. room temperature is currently 67 Estimation uses standard data acquisition techniques Actions: U(t) E.g. thermistor + ADC System commands U(t) converted into driving forces using transducers E.g. turn off the furnace

More Control Terms Goal of a control system is to minimize error: e(t) = X*(t) X (t) Evaluating a control system Steady-state controller error Average e(t) Transient response How long the system takes to reach 99% of the desired final value after X*(t) is changed Stability Does the system reach a steady state (smooth constant output) or does it oscillate?

Early Feedback Control Centrifugal governor for a throttle

Simple Closed Loop Example We re designing a thermostat Goal is to heat room to a set temperature We can turn the furnace on and off When furnace is off, room cools down by itself Fancy control is not needed here! Rather we just need two temperature settings T low temperature at which we turn on the furnace T high temperature at which we turn off the furnace The difference between these provides hysteresis An on/off ( bang bang ) controller works well when the physical system is slow to respond What happens if control loop runs too fast or slow?

Thermostat Code int Thigh, Tlow; bool on = false; timer_interrupt_handler (void) { int T = read_adc(); if (T < Tlow &&!on) { turn_furnace_on(); on = true; } if (T > Thigh && on) { turn_furnace_off(); on = false; } }

Another Simple Controller We re controlling a robot arm attached to a stepper motor Need to get the arm to a certain position Position sensor tells us where the arm is Algorithm: if E > 1mm then decrement position by 1mm if E < -1mm then increment position by 1mm Pretty tough to go wrong with a strategy like this But slow to converge What happens if control loop runs too fast or slow?

PID Controllers Simple controllers like previous two examples work but in many real situations Respond slowly Have large errors Better answer: PID (Proportional Integral Derivative) PID equation: U ( t) = KPE( t) + KI E( τ ) dτ + t 0 K D de( t) dt K P, K I, and K D are design parameters Can be fixed at zero to simplify the controller

PID Intuition K P determines response to current error Too large Oscillation Too small Slow response Can t eliminate steady-state error K I determines response to cumulative error Can eliminate steady-state error but often makes transient response worse K D determines response to rate of change of error Damps response when error is moving in the right direction Amplifies response when error is moving in the wrong direction Can be used to increase stability and improve transient response

PID Loop Skeleton Code double UpdatePID (SPid *pid, double error, double position) { } position = ReadPlantADC(); drive = UpdatePID (&plantpid, plantcommand - position, position); DrivePlantDAC (drive);

Proportional Control double UpdatePID (SPid *pid, { } double pterm; double error, double position) pterm = pid->pgain * error; return pterm;

Example System 1

Example System 2 Problem: Proportional control can t always eliminate steady-state error

Example System 3 Problem: When there is too much actuator delay, proportional control cannot stabilize the system

Integral Control double iterm; pid->istate += error; if (pid->istate > pid->imax) { pid->istate = pid->imax; } else if (pid->istate < pid-> imin) { } pid->istate = pid->imin; iterm = pid->igain * istate; In practice, always used in conjunction with proportional control

Example 2 with PI Control Steady state error is eliminated

Integrator Issues Sampling time becomes more important Sampling time shouldn t vary more than 1%-5% On average, sampling should be periodic Integrator range is important Integrator windup occurs when the integrator value gets stuck too high or too low Limiting the range makes this less of a problem Reasonable heuristic: Set integrator limits to drive limits Usually, if you can t stabilize a system with proportional control, you can t stabilize it with PI control either

Differential Control double dterm; dterm = pid->dgain * (position - pid->dstate); pid->dstate = position; Basically just computes the slope of the system state Attempts to predict system future based on recent past history

Example 3 with PD Control

Differential Issues Derivative is very sensitive to noise In practice, might keep a buffer of several samples into the past in order to smooth out noise This is just a low-pass filter Decreases responsiveness which is the point of differential control in the first place Important for sampling period to be very even Do sampling in a high-priority interrupt or thread

Full PID Source Code typedef struct { double dstate; // Last position input double istate; // Integrator state double imax, imin; double igain, // integral gain pgain, // proportional gain dgain; // derivative gain } SPid; double UpdatePID (SPid * pid, double error, double position) { double pterm, dterm, iterm; pterm = pid->pgain * error; pid->istate += error; if (pid->istate > pid->imax) pid->istate = pid->imax; else if (pid->istate < pid->imin) pid->istate = pid->imin; iterm = pid->igain * istate; dterm = pid->dgain * (position - pid->dstate); pid->dstate = position; return pterm + iterm - dterm; }

Implementation Issues Example code uses floating point Convert to integer or fixed-point by hand OR Keep using FP if the control loop frequency is low or if HW FP is available Multiplies can be avoided by selecting constants that are multiples of 2 Sampling rate Too low Slow response time Too high Differential noise and integral overflow Rule of thumb: Set sampling rate between 1/10 and 1/100 of desired settling time Difficult control problems argue for higher sampling rates

Tuning the Parameters Method 1: Plug system model into Matlab, it hands you the parameters Method 2: Tune by hand Happy fact: When the system is not too sensitive, control parameters only have to be roughly correct to do a good job Requirements for hand tuning: Need to be able to observe controller variables and output Need to be able to supply square-wave inputs Note: Parameters can interact in complex ways Tuning is an art Tuning by hand will be difficult if system is barely controllable System may be uncontrollable

Tuning Differential Gain Start here unless you can do without dgain, in which case set it to 0.0 and move to pgain Start with small proportional gain, e.g. 1.0 Start with dgain == pgain * 100 Increase dgain until unacceptable oscillation, overshoot, or noise occurs Oscillation from too much dgain is much faster than oscillation from not enough Back off by factor of 2-4 System will now be sluggish time to tune P and I

Tuning pgain and igain Start with a pgain around 1-100 By experimentation find the value of pgain where oscillation starts Then back off by a factor of 2-4 Start with igain around 0.0001-0.001 Again find a value that gives reasonably good performance without causing oscillation

Conclusions Feedback control is a broadly useful technology for getting an embedded system to have some desired effect on the real world In practice manual tuning replaces analytic solutions However, Matlab has great support for feedback control Can generate efficient code too