a seeps w 2012 slides
TRANSCRIPT
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
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
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.
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
www.aeropendulum.arizona.edu
Data Flow Diagram
www.aeropendulum.arizona.edu
Real Time Windows Target Environment
www.aeropendulum.arizona.edu
Modeling Tasks
www.aeropendulum.arizona.edu
Experiment 1: Parameter Extraction
Using the steady-state response, find the parameters K/mg
www.aeropendulum.arizona.edu
Challenge 1: Dealing with Dead Zone
www.aeropendulum.arizona.edu
Challenge II: Feedback Linearization
Result Type 1 System
www.aeropendulum.arizona.edu
Experiment II: Weightless Pendulum (K=0)
www.aeropendulum.arizona.edu
Experiment III: Parameter Identification (Kp=1)
www.aeropendulum.arizona.edu
Challenge III: Stability and Root Locus. What is wrong?
Kp>3 (unstable)
www.aeropendulum.arizona.edu
Model Correction: Motor Dynamics
www.aeropendulum.arizona.edu
Experiment IV: Controller Design Using Bode Plots
www.aeropendulum.arizona.edu
Evaluation
www.aeropendulum.arizona.edu
Hands-On Activities Open Loop Response
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
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}')
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
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')
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
www.aeropendulum.arizona.edu
Project Installment # 2 Update Model
24
5.92
0
uK
mgS
u0=24Slope=92.5
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
www.aeropendulum.arizona.edu
Check System Type using Kp=1Theta=30
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)
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.
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
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)
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
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)
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
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
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)
www.aeropendulum.arizona.edu
Prof. Eke’s Slides on Implementation
www.aeropendulum.arizona.edu
Optional Activities
Lead Compensator Lead-Lag Compensator On/Off Controller