Lecture 5 Introduction to control

Similar documents
Phys Lecture 5. Motors

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

ANNA UNIVERSITY :: CHENNAI MODEL QUESTION PAPER(V-SEMESTER) B.E. ELECTRONICS AND COMMUNICATION ENGINEERING EC334 - CONTROL SYSTEMS

Automatic Control Systems 2017 Spring Semester

6.270 Lecture. Control Systems

Implementation of Conventional and Neural Controllers Using Position and Velocity Feedback

JUNE 2014 Solved Question Paper

EC CONTROL SYSTEMS ENGINEERING

SECTION 6: ROOT LOCUS DESIGN

Lecture 10. Lab next week: Agenda: Control design fundamentals. Proportional Control Proportional-Integral Control

Introduction to Servo Control & PID Tuning

Motor Control. Suppose we wish to use a microprocessor to control a motor - (or to control the load attached to the motor!) Power supply.

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

Motomatic Servo Control

MM7 Practical Issues Using PID Controllers

Experiment 9. PID Controller


Feedback Systems. Many embedded system applications involve the concept of feedback. Sometimes feedback is designed into systems: Actuator

ME 375 System Modeling and Analysis

Dr Ian R. Manchester

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

BSNL TTA Question Paper Control Systems Specialization 2007

[ á{tå TÄàt. Chapter Four. Time Domain Analysis of control system

ADJUSTING SERVO DRIVE COMPENSATION George W. Younkin, P.E. Life Fellow IEEE Industrial Controls Research, Inc. Fond du Lac, Wisconsin

Lecture 2 Analog circuits. Seeing the light..

Position Control of AC Servomotor Using Internal Model Control Strategy

MCE441/541 Midterm Project Position Control of Rotary Servomechanism

Electro-hydraulic Servo Valve Systems

Classical Control Design Guidelines & Tools (L10.2) Transfer Functions

This manuscript was the basis for the article A Refresher Course in Control Theory printed in Machine Design, September 9, 1999.

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

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

ELECTRICAL CIRCUITS 6. OPERATIONAL AMPLIFIERS PART III DYNAMIC RESPONSE

Performance Optimization Using Slotless Motors and PWM Drives

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

Electrical Engineering. Control Systems. Comprehensive Theory with Solved Examples and Practice Questions. Publications

CDS 101/110: Lecture 8.2 PID Control

EE 3TP4: Signals and Systems Lab 5: Control of a Servomechanism

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

1.What is frequency response? A frequency responses the steady state response of a system when the input to the system is a sinusoidal signal.

Optimizing Performance Using Slotless Motors. Mark Holcomb, Celera Motion

Lecture 2 Analog circuits. Seeing the light..

CDS 101/110: Lecture 9.1 Frequency DomainLoop Shaping

LM311 comparator open collector output. LM311 comparator open collector output. LM311 comparator open collector output

The PID controller. Summary. Introduction to Control Systems

Advanced Servo Tuning

Dr Ian R. Manchester Dr Ian R. Manchester Amme 3500 : Root Locus Design

Magnetic Levitation System

Lecture 18 Stability of Feedback Control Systems

Position Control of DC Motor by Compensating Strategies

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

Lecture 8 ECEN 4517/5517

Experiment 1: Amplifier Characterization Spring 2019

Analog Electronic Circuits Code: EE-305-F

R. W. Erickson. Department of Electrical, Computer, and Energy Engineering University of Colorado, Boulder

Ball Balancing on a Beam

PURPOSE: NOTE: Be sure to record ALL results in your laboratory notebook.

ECE 5670/ Lab 5. Closed-Loop Control of a Stepper Motor. Objectives

MEM380 Applied Autonomous Robots I Winter Feedback Control USARSim

EEL2216 Control Theory CT2: Frequency Response Analysis

While the Riso circuit is both simple to implement and design it has a big disadvantage in precision circuits. The voltage drop from Riso is

Module 08 Controller Designs: Compensators and PIDs

Laboratory Assignment 5 Digital Velocity and Position control of a D.C. motor

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

9 Feedback and Control

Design of a Simulink-Based Control Workstation for Mobile Wheeled Vehicles with Variable-Velocity Differential Motor Drives

PROCESS DYNAMICS AND CONTROL

CSE 3215 Embedded Systems Laboratory Lab 5 Digital Control System

Bode and Log Magnitude Plots

Ver. 4/5/2002, 1:11 PM 1

Control Design for Servomechanisms July 2005, Glasgow Detailed Training Course Agenda

Step vs. Servo Selecting the Best

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

Cantonment, Dhaka-1216, BANGLADESH

LECTURE FOUR Time Domain Analysis Transient and Steady-State Response Analysis

Shaft Torque Excitation Control for Drivetrain Bench

Optimal Control System Design

Rotary Motion Servo Plant: SRV02. Rotary Experiment #03: Speed Control. SRV02 Speed Control using QuaRC. Student Manual

Frequency Response Analysis and Design Tutorial

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

ECE 203 LAB 6: INVERTED PENDULUM

DC SERVO MOTOR CONTROL SYSTEM

Servo Tuning Tutorial

ME 5281 Fall Homework 8 Due: Wed. Nov. 4th; start of class.

Positive Feedback and Oscillators

Penn State Erie, The Behrend College School of Engineering

ME451: Control Systems. Course roadmap

Laboratory Tutorial#1

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

Chapter 5. Tracking system with MEMS mirror

Different Controller Terms

Lecture 2 Analog circuits. IR detection

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

Servo Closed Loop Speed Control Transient Characteristics and Disturbances

International Journal of Research in Advent Technology Available Online at:

DC Motor Speed Control using PID Controllers

Readings: FC: p : lead compensation. 9/9/2011 Classical Control 1

PROCESS DYNAMICS AND CONTROL

JNTUWORLD. 6 The unity feedback system whose open loop transfer function is given by G(s)=K/s(s 2 +6s+10) Determine: (i) Angles of asymptotes *****

Lecture 2 Analog circuits. Seeing the light..

Transcription:

Lecture 5 Introduction to control Feedback control is a way of automatically adjusting a variable to a desired value despite possible external influence or variations. Eg: Heating your house. No feedback (open loop): Actual temperature varies depending on whether windows are open, how cold it is outside etc,.. Desired temperature T Outside temperature House temperature responds to heat Determine typical heater power required Turn heater on or off

Control: Introduction Feedback control is a way of automatically adjusting a variable to a desired value despite possible external influence or variations. Feedback (closed loop): Measure actual house temperature T Desired temperature T Outside temperature House temperature responds to heat Analyze difference between Desired and Actual temperature Turn heater on or off

The purpose of control theory is to make these two numbers the same despite external influences Feedback control is a way of automatically adjusting a variable to a desired value despite possible external influence or variations. Feedback (closed loop): Measure actual house temperature T = Desired temperature T Outside temperature House temperature responds to heat Analyze difference between Desired and Actual temperature Turn heater on or off

Feedback Control Build a circuit that: Steadies a piece of paper attached to a motor by optical feedback, such that when the motor is translated, the end of the paper remains stationary. Note: Use the QRD1114 to detect the paper position. Feed this through an op-amp with controllable gain, and use the op-amp to drive a motor that turns the paper. Experiment with different gain values.

Feedback Control Build a QRD circuit and use voltmeter to check that output varies by a few volts when paper comes near QRD Buffer its output with a TL082 Build a variable gain inverting amp with a TL082 and a pot. Use a fixed positive voltage reference that lies in the range of the QRD values. Hook it all up

Control: Introduction ON/OFF control: X = distance between center of robot and center of tape x while(1) { if (x=0) go_straight(); if (x>0) turn_left(); if (x<0) turn right(); } This tends to lead to oscillations around the center of the tape.

Control: Introduction Proportional control: x > 0 X = distance between center of robot and center of tape steer(int dir); - a hypothetical function that steers robot left (dir<0) or right (dir>0) in a radius of 600 /dir. while(1) { steer(k*x); } K is the proportional gain of this feedback loop and MUST be negative. This is much better and more accurate than ON/OFF control, though it will still have significant error and oscillate for large values of K. x

Control: Introduction Proportional control: x > 0 X = distance between center of robot and center of tape steer(int dir); - a hypothetical function that steers robot left (dir<0) or right (dir>0) in a radius of 600 /dir. while(1) { steer(k*x); } x So what is the right algorithm?????

Transfer functions revisited (Laplace transform notation: s~jw) V(s) is the Laplace transform of v(t). Some rules: 1) Proportionality: v out (t) = K*v in (t) H(s) = V out (s)/ V in (s) V out (s) = K*V in (s) 10log H(s) H(s) = K q log(k) V st ( s) v( t) e dt 0 Time domain Frequency domain log w 0 log w

2) Integration: 10log H(s) v V out out ( t) ( s) H ( s) K KV K s v in s in ( t) dt ( s) q Time domain Frequency domain -10 db/dec log w 0-90 log w

3) Differentiation: v V out out dvin( t) ( t) K dt ( s) KsV ( s) in 10log H(s) H ( s) Ks q +10 db/dec 90 log w 0 log w

Feedback loops Y = variable you d like to control (eg: shaft angle of a servo motor) X = your desired value of Y (eg: 10 degrees) X(s) + Y = G(X-HY) Y(1+GH) = GX - Error G(s) H(s) Y(s) Y Motor and amplifier behavior Sensor / compensator behavior G Y/X = G/(1+GH) X 1 GH G = forward transfer function, GH = loop transfer function

Feedback loops: stability Y G X 1 GH This loop will be unstable if GH = -1 GH =1, phase(gh)= ±180 deg. G(s)H(s) = -1 implies Y X for some value of s i.e. there will exist a frequency for which the loop will provide infinite amplification

Loop Stability Y X G 1 GH Partial stability criterion: GH < 1 where the phase of GH is ± 180 deg. 10log GH STABLE q 0 db -8 db Gain Margin w 0 log w 0-180 -270 w 0 log w

Loop Stability Y X KG 1 KGH Partial stability criterion: GH < 1 where the phase of GH is ± 180 deg. 10log GH UNSTABLE q w 0 0 db log w 0 w 0 log w Increasing loop gain eventually makes all systems unstable -180-270

Steady state error Steady state error: The difference between actual and desired values when these values are not fluctuating with time (DC behavior). X(s) + Error = X-Y - Y = KG* Error Error K G(s) Y(s) SSError Make KG 0 (DC gain) large to minimize error. This can increase loop gain at high frequencies and lead to instability. Y KG(0)

Steady state error and stability Another look at negative feedback in an op-amp: Vin Vout + R1 R2 Error V in + - G(s) V out H(s) Model Op-amp as G(s) = K/s H ( s) R 1 R 1 R 2

Steady state error and stability Another look at negative feedback in an op-amp: V in + - K/s V out R 1 /(R 1 +R 2 ) V V out in 1 K / s K R s R 1 1 R 2 s K KR1 R R 1 2 Vin R1 + R2 Vout For large K and low frequency, this reduces to V V out in R 1 2 R 1

Steady state error and stability Another look at negative feedback in an op-amp: V in + - V error K/s V out Stability: GH K s R1 ( R R ) 2 1 R 1 /(R 1 +R 2 ) Phase of GH is -90 for all frequencies. This is inherently stable as GH will never = -1

Steady state error and stability Another look at negative feedback in an op-amp: V in + - V error K/s R 1 /(R 1 +R 2 ) V out GH K s R1 ( R R ) 2 1 Steady state error: V K s out V error sv V out error Verror 0 K At s=0 (DC)! Integration (1/s) in the loop reduces steady state error to zero without need for infinite loop gain at higher frequencies!

Stability Summary Y X KG 1 KGH Having one or fewer poles in the plant function KGH ensures that the loop is never unstable. The more poles exist in KGH, the harder it will be to control. Problems will start to occur when controlling at frequencies above the pole frequencies. Increasing loop gain eventually makes all systems unstable due to unexpected high frequency poles.

Compensation V in + - H(s) G(s) V out A feedback system is usually divided into two transfer functions: The plant function (G(s)) which usually you cannot alter (motor characteristics etc.) A compensator circuit H(s) that you can design to optimize the feedback loop A common type of all-purpose compensation is PID: Proportional (K p ) Integral (K i /s) Derivative (sk d )

PID Compensation V in + - H(s) G(s) V out Typical PID transfer function: H(s) = K tot (K p +K i /s+sk d ) The various gains (K tot,k p,k i,k d ) are adjusted to control how much of each type of compensation is applied for a specific plant function G(s). This adjustment is referred to as tuning and is often done iteratively (a slightly improved form of trial and error) when the plant function G is not well known.

PID example: position servo (demo) q in Knob k V set + TINAH Board knob: q in code H(s) + - - analog(0) V error V pot PID H(s) k Pot Pwm out Motor K/(s(s+a)) motor G(s) q out q out Mechanical connection k potentiometer

PID example: position servo q in Knob k V set + - V error PID H(s) Motor K/(s(s+a)) q out V pot k Motor transfer function: Pot q dt w max q dt (at high frequencies: G=K/s 2 ) (at low frequencies: G=K/s) G( s) K s( s a) Torque Inertia q w w

PID example: position servo q in Knob k V set + - V error V pot PID Motor H(s) K/(s(s+a)) k Pot q out Loop transfer function (stability analysis): G( s) K s( s H(s) =? a) Try proportional control: H(s) = K p

Stability: position servo P control Loop transfer function (P only): log GH 0 db GH ( s) Gain Margin a KK s( s p a) 10a Stable for limited gain log w q V out q -90-180 error Verror KK s( s p V a) p error s ( s a ) q KK 0 out at s=0! 10a log w

Stability: position servo I control Open loop transfer function (I only): KK GH ( s) 2 s ( s i a) H ( s) K s i q -180 log w -270 Phase crosses 180 at DC, with infinite DC gain! Inherently unstable at s=0

Stability: position servo D control Open loop transfer function (D only): GH ( s) KK ( s d a) Phase always less than 180 Stable even for large gains! 0-90 q V error H( s) ( s a ) q KK sk d log w SS error 0! Problems: May be hard to implement due to amplification of fast transients. Can be combined with P gain to add high gain stability and low SS error Model is not complete loop will still be unstable at very high gains. d out

Tuning PID Often PID tuning is done by nearly trial and error. Here is a common Procedure which works for many (but not all) plant functions. USE external pots or menus to adjust!!!!! Set P=I=D=0 Increase P slightly and ensure that the sign of the gains is correct. Increase P until oscillations begin Increase D to dampen oscillations Iterate increasing P and D until fast response is achieved with little overshoot Increase I to remove any Steady State error. If overshoot is too large try decreasing P and D. Test with step response: Crit. damped over damped under damped

Control: Introduction How to measure X (distance from tape): Use QRD1114 reflectance sensors to detect lack of reflectance from tape. tape sensor

How to measure X: Control: Introduction X = distance between center of robot and center of tape x > 0 x You can form a rough approximation of X by digital to analog conversion of your digital inputs with history: Situation Left sensor Right Sensor X Both sensors on tape 1 1 0 Left sensor off tape, right on 0 1-1 Right sensor off tape, left on 1 0 +1 Both sensors off (right was last on) 0 0-5 Both sensors off (left was last on) 0 0 +5

Please consider the following problem for a robot with differential rear drive steering: Which robot configuration has more poles in the transfer function between I (current to motors) and x (distance of sensors from tape)? sensors sensors x x pivot 1 pivot 2

x q r 1 v q in 0 x 0 in l Actual x value in time domain: x l sinq vsinqdt lq vqdt Actual X in frequency domain: vq X ~ lq at low v X lq s vq X for l = 0 s q K (we want robot to follow tape) bot I pwm s( s a) where a Tr 1 I bot I bot is the chassis moment of inertia

Design tips for stability Minimize robot polar moment of inertia (I robot ) Maximize robot torque about polar axis (r 1 /D wheel ) Maximize distance from polar axis to tape sensors (l) Minimize sensor dead band Change gear ratio / wheel size to increase torque / reduce speed if you find stability is only achieved at very low motor powers. X lq vq s q s( s Kr Kr 1 1 I I pwm pwm / D / I wheel robot D wheel )

Linearization of non-linear functions Control can be very difficult if G is non-linear. PWM drive (combined with friction) yields a very non-linear torque curve: T PWM Solution: Linearize this curve in software by mapping PWM to desired Torque PWMout PWMin

Analog PID in software (Servo control) loop pot = analog(6); set = knob(); error = set-pot; p=kp*error; d=kd*(error-lasterr); i=ki*error+i; if (i>maxi) i = maxi; if (i<-maxi) i = -maxi; g = p+i+d; motor(3,g); lasterr=error; Feedback potentiometer Set point Proportional Integration Derivative Anti-windup Because i is an integral, it will build up to large values over time for a constant error. An anti-windup check must be put in place to avoid it overwhelming P and D control when the error is removed.

Digital PID in software (Tape following) left=analog(5); right=analog(6); if ((left>thresh)&&(right>thresh)) error = 0; if ((left>thresh)&&(right<thresh)) error = -1; if ((left<thresh)&&(right>thresh)) error = +1; if ((left<thresh)&&(right<thresh)) { if (lerr>0) error = 5; if (lerr<=0) error=-5; } if (!(error==lerr)) { recerr=lerr; q=m; m=1; } p=kp*error; d=(int)((float)kd*(float)(error-recerr)/(float)(q+m)); con = p+d; if (c==30) { printf("%d %d %d %d %d %d\n",right,left,kp,kd,p,d); c=0; } c=c+1; m=m+1; motor(0,-speed+con); motor(3,+speed+con); lerr=error; QRD sensors History Derivative approximation Proportional / Derivative Motor control Display status Special care needs to be taken for the derivative to approximate its real value.