based on ece 2100/2200 knowledge mae 4780/5780: feedback ... · analog integrated circuit design...

22
1 Sources: 3400 lecture from Justin Selig and Adarsh Jayakumar, 2017 ECE 3400: Intelligent Physical Systems Introduction EE-version Robot-version Servos! …and a little EE again Feedback Control Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback Control Systems ECE 4530: Analog Integrated Circuit Design ECE 5540: Advanced Analog Integrated VLSI Circuit Design

Upload: others

Post on 19-Apr-2020

18 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

1

Sources: 3400 lecture from Justin Selig and Adarsh Jayakumar, 2017

ECE 3400: Intelligent Physical Systems

• Introduction• EE-version• Robot-version• Servos!• …and a little EE again

Feedback ControlBased on ECE 2100/2200 knowledgeMAE 4780/5780: Feedback Control SystemsECE 4530: Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design

Page 2: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

2

Feedback ControlOptimizing a system’s performance by feeding its output back into its input.

A(s)

B(s)

u e y

f

+-

Why should you care now?• Reason about circuit design• Used for speed control in the servos• Better line following• etc…

…amplifier, motor, robot, etc

Page 3: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

3

Feedback ControlOptimizing a system’s performance by feeding its output back into its input.

A(s)

B(s)

u e y

f

+-

• y = eA(s)

• f = yB(s)

• e = u - f

y =

H(s) = yu

A(s)1+A(s)B(s)=

eA(s) = A(s) [u - f] = A(s) [u – yB(s)] = uA(s) – yA(s)B(s)

Page 4: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

4

Feedback in a Non-Inverting OpAmp

u = Viny = Vout

A(s) = Av B(s) = R1

R1+ Rf

A(s)1+A(s)B(s)H(s) =

For Av →∞VoutVin

=R1

R1+ Rf

= 1+ Rf

R1

Av(R1 + Rf)(R1+ Rf + AvR1)

=VoutVin

=

Circuit Analysis

H(s) = yu

A(s)1+A(s)B(s)=

Page 5: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

Feedback in a Schmitt Trigger

output

Circuit Analysis

H(s) = yu

A(s)1+A(s)B(s)=

Upper thresholdLower threshold

input

time

Ampl

itude

time

Vout = 0V

(R2||R3)Vref

R1+ R2||R3

Va =Positive feedback!

+

Va = 1.66V

Vout = 5VR2Vref

R2+ R1||R3

Va =

Va = 3.3V

(1)

Vref

R1

R3 R2

0V

(1)

Vref

R1

R3

Vin

R2+-

Vout

Vref

R1

R3

R2

5V(2)

(2)

R1 = R2 = R3 = 10K

Page 6: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

6

Feedback Control and Line Following

Left Servo Speed : 50Right Servo Speed : 50

Left Servo Speed : Right Servo Speed :

50 + error50 - error

Page 7: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

7

Feedback Control and Line FollowingDisturbances

ROBOT SERVOS

Output

IR SENSORS

Measured output

PID

Controlleroutput

Setpoint

• Set-point: Distance from line we want• Controller Output: Motor speeds we want• Measured Output: Deviation from the line

Page 8: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

8

Feedback Control and Line FollowingDisturbances

ROBOT SERVOS

Output

IR SENSORS

Measured output

PID

Controlleroutput

Setpoint

• Proportional: Looks at the instantaneous error• Integral: Sum of errors over time• Derivative: Rate of change of error over time

www.Polulu.com

Page 9: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

9

Feedback Control and Line FollowingDisturbances

ROBOT SERVOS

Output

IR SENSORS

Measured output

PID

Controlleroutput

Setpoint

A - Rise TimeB - Percent OvershootC - Settling TimeD - Steady State Error

Page 10: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

10

Feedback Control and Line Following

Disturbances

ROBOT SERVOS

Output

IR SENSORS

Measured output

Kp

Setpoint

Controlleroutput+

-

eKI ∫(e)dt

KD d/dt(e)

+

U(t) = KPe(t) + KI ∫e(t)dt + KD d/dt(e(t))

Page 11: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

11

Feedback Control and Line Following

• What’s the disadvantage of PI control? • Steady state error

//P-controller:

void PControl(){error = IRmeasurements(); motorSpeed = Kp*error + originalSpeed;

}

Page 12: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

12

Feedback Control and Line Following

• What’s the disadvantage of PI control? • Long settling time• More overshoot

//PI-controller:void PIControl(){

errorSum = errorSum + IRmeasurements()*dT; motorSpeed =

Kp*error + Ki*errorSum + originalSpeed;}

Page 13: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

13

Rise time, settling time, and overshoot

• Where would you want your system to be?

Page 14: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

14

Feedback Control and Line Following

//PID-controller:void PIDControl(){

errorSum = errorSum + IRmeasurements()*dT; errorDiff = (error – lastError)/dT;motorSpeed =

Kp*error + Ki*errorSum + Kd*errorDiff + originalSpeed;

}

Page 15: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

15

Feedback Control and Line FollowingPointers for adjusting your control:• You can decrease trise and ess by

increasing KP, at the expense of increased overshoot

• You can decrease trise and eliminate ess by increasing KI at the expense of increased overshoot and settling time

• You can decrease the overshoot and the settling time by increasing Kd

Page 16: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

16

Feedback Control and Line FollowingPointers for adjusting your control:

• Set all coefficients to zero• Increase Kp until system oscillates• Increase Ki until steady state error corrected• Increase Kd until overshoot decreased

Page 17: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

17

Feedback Control and Line FollowingDisturbances

ROBOT SERVOS

Output

IR SENSORS

Measured output

PID

Controlleroutput

Setpoint

• Proportional: Looks at the instantaneous error• Integral: Sum of errors over time• Derivative: Rate of change of error over time

www.Polulu.com

Page 18: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

ContinuousPositional |

Have you ever wondered what is inside your servo?

Page 19: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

Have you ever wondered what’s inside your servo?• What are the two standard types of servos?

• Continuous• Positional

• How do we get positional control?• Potentiometer

• How can you change a positional control to a speed control?• Cut the feedback loop!

• How do we get speed control?• Back EMF

Page 20: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

H-Bridge

BAL6688: Servo Control

Linear Pulse Generator

Pulse Width Comparator

Input Pulse

2.5V Reference

M

Feedback

Trigger

Pulse Stretcher(Gain)

Pulse Width Error

Direction

5V

Counter-ClkClockwise Pulse

5V

Back EMF

Something along these lines…

Page 21: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

Z1Z2

VoutVin

= -Z2

Z1

Analog Feedback Control

21

Function Z1 Z2 H(s)

Gain (P) R1 R2 -R2/R1

Integration (I) R C -(RC)-1/s

Differentiation (D) C R -RCs

PD control C||R1 R2 -R2C (s+ (R1C)-1)

PID control C1||R1 R2C2

PI control R1 R2C -R2(s+(R2C)-1)R1s

Page 22: Based on ECE 2100/2200 knowledge MAE 4780/5780: Feedback ... · Analog Integrated Circuit Design → ECE 5540: Advanced Analog Integrated VLSI Circuit Design. 2. Feedback Control

22

Go Build Robots!