36
PERSONALIZED EXPERIMENTATION IN CLASSICAL CONTROLS WITH MATLAB REALTIME WINDOWS TARGET AND PORTABLE AEROPENDULUM KIT Eniko T. Enikov, University of Arizona Estelle Eke, California State University Sacramento

A Seeps w 2012 Slides

Embed Size (px)

Citation preview

Page 1: A Seeps w 2012 Slides

PERSONALIZED EXPERIMENTATION IN

CLASSICAL CONTROLS WITH MATLAB

REAL‐TIME WINDOWS TARGET AND

PORTABLE AEROPENDULUM KIT

Eniko T. Enikov, University of ArizonaEstelle Eke, California State University Sacramento

Page 2: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Outline Motivation The Aeropendulum Apparatus Real-Time vs. Soft Real Time Student Design Activities◦ Plant modeling, ◦ parameter identification, identification of non-linearities◦ Feedback linearization, steady-state error and system types◦ parameter identification ◦ Matlab's pem() prediction-error minimization function (time

permitting)◦ closed-loop control experiments: proportional, phase lag,◦ phase lead and on/off (bang-bang) control (time permitting)

Results from implementation at CSUS and Univ. of Arizona

Page 3: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Motivation

Develop an portable low-cost apparatus that illustrates classical control systems course with a hands-on experimentation.

Eliminate the need for lab space, teaching assistant.

Provide a quick pathway from controller design to implementation for mechanical engineering students.

Page 4: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Experimental Apparatus Acrylic stand Pendulum with angle

sensing potentiometer, DC-motor and propeller

Target circuit board driving the propeller with different PWM ratios in forward and reverse direction

MATLAB Simulink Real Time Windows Target GUI for controller implementation

Page 5: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Data Flow Diagram

Page 6: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Real Time Windows Target Environment

Page 7: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Modeling Tasks

Page 8: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Experiment 1: Parameter Extraction

Using the steady-state response, find the parameters K/mg

Page 9: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Challenge 1: Dealing with Dead Zone

Page 10: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Challenge II: Feedback Linearization

Result Type 1 System

Page 11: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Experiment II: Weightless Pendulum (K=0)

Page 12: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Experiment III: Parameter Identification (Kp=1)

Page 13: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Challenge III: Stability and Root Locus. What is wrong?

Kp>3 (unstable)

Page 14: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Model Correction: Motor Dynamics

Page 15: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Experiment IV: Controller Design Using Bode Plots

Page 16: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Evaluation

Page 17: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Hands-On Activities Open Loop Response

Page 18: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

plot(t,theta,t,PWM); grid minor

0 10 20 30 40 50 60-20

0

20

40

60

80

100

120

PWM

Page 19: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Gather Data

u_ss=[0 10 20 30 40 50 60 70 80 90 100 110 120]; theta_ss=[0 0 0 0 8 16 24 32 40 48 56 68 73]; sine_ss=sind(theta_ss); plot(sine_ss,u_ss) ylabel('PWM Input') xlabel('SIN theta_{ss}')

Page 20: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Steady State Data

0 0.2 0.4 0.6 0.8 10

20

40

60

80

100

120

PW

M In

put

SIN thetass

Page 21: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Fit a Line on Points 3-13P=polyfit(sine_ss(3:13),u_ss(3:13),1) ;plot(sine_ss,u_ss,sine_ss(3:13), polyval(P,sine_ss(3:13))) shglegend('Experiment', 'Linear fit')

Page 22: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Slope and Offset P = 92.4879 24.1771

0 0.2 0.4 0.6 0.8 10

20

40

60

80

100

120

X: 0Y: 24.18

ExperimentLinear fit

Page 23: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Project Installment # 2 Update Model

24

5.92

0

uK

mgS

u0=24Slope=92.5

Page 24: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Test Using Closed Loop with Zero Gain (Slope needs adjustment, c. a 80)

0 5 10 15 20 25 30-40

-20

0

20

40

60

80

100

Page 25: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Check System Type using Kp=1Theta=30

Page 26: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

plot(t,theta)

0 2 4 6 8 10 12-5

0

5

10

15

20

25

30

35

40

4-5 degrees error(linearizationIs not perfect)

Page 27: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Identify Parameters From the response extract approximate values

for and , then calculate and . (Use formulas for overshoot, peak time, rise time etc. to find and and then related to the physical parameters).

The plot achieved for proportional controller may produce an over-damped relation in which case you will not be able to find out the parameters by using the above formulas.

Just try increasing the proportional gain Kp to the point when you start getting an overshoot.

Page 28: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Using Kp=2

0 1 2 3 4 5 6 7 8 9-10

0

10

20

30

40

50

sec

Tr=0.4 sec=>wn=4.5PO=(48-32)/32=50%K/mL=4.5^2/Kp=10c/mL^2=2*dzeta*wn/Kp=0.97

Matlab for Damping > zeta=fzero(@(x)exp(-pi*x/sqrt(1-x^2))-0.5,0)zeta=0.22

Page 29: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

System Identified

g=tf(10,[1 0.97 0])

10

+0.97

-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4-0.4

-0.3

-0.2

-0.1

0

0.1

0.2

0.3

0.4Root Locus

Real Axis (seconds-1)

Imag

inar

y A

xis

(sec

onds

-1)

Page 30: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Test Stability with Kp=1, 2, 3…

Kp=2.4 ->stability limit

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5-10

0

10

20

30

40

50

60

Page 31: A Seeps w 2012 Slides

Modify The Model

sss 1)97.0(10

2Kp

g=tf(10,conv([1 0.97 0],[1 4.5]))rlocus(g)

-7 -6 -5 -4 -3 -2 -1 0 1-3

-2

-1

0

1

2

3

System: gGain: 2.3Pole: -0.0129 + 2.06iDamping: 0.00627Overshoot (%): 98Frequency (rad/s): 2.06

Root Locus

Real Axis (seconds-1)

Imag

inar

y A

xis

(sec

onds

-1)

Page 32: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Adjust for Steady State Error

sss 5.41)97.0(10

2 Kp

sbss 5.41)97.0(10

2 Kp

2

305

101

1

bb

ess

Page 33: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Lag Compensator

-12 -10 -8 -6 -4 -2 0 2 4-10

-5

0

5

10System: untitled1Gain: 1.34Pole: -0.0834 + 2.05iDamping: 0.0407Overshoot (%): 88Frequency (rad/s): 2.0

Root Locus

Real Axis (seconds-1)

Imag

inar

y A

xis

(sec

onds

-1)

sss 5.41)297.0(10

2 pszs

1.05.0

ss

-15 -10 -5 0 5 10-15

-10

-5

0

5

10

15

System: untitled1Gain: 0.46Pole: 0.092 + 1.81iDamping: -0.0509Overshoot (%): 117Frequency (rad/s): 1.81

Root Locus

Real Axis (seconds-1)

Imag

inar

y A

xis

(sec

onds

-1)

15

ss

Page 34: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Step Response of Lag Compensation

0 5 10 15 20-5

0

5

10

15

20

25

30

35

40

45

X: 15.39Y: 30.8

c=tf([1 .5],[1 .1])

clagd=c2d(c,0.01)

Page 35: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Prof. Eke’s Slides on Implementation

Page 36: A Seeps w 2012 Slides

www.aeropendulum.arizona.edu

Optional Activities

Lead Compensator Lead-Lag Compensator On/Off Controller