Eniko T. Enikov, University of Arizona Estelle Eke, California State University Sacramento PERSONALIZED EXPERIMENTATION IN CLASSICAL CONTROLS WITH MATLAB REAL TIME WINDOWS TARGET AND PORTABLE AEROPENDULUM KIT
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
Motivation Develop an portable lowcost 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.
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
Data Flow Diagram
Real Time Windows Target Environment
Modeling Tasks
Experiment 1: Parameter Extraction Using the steady-state response, find the parameters K/mg
Challenge 1: Dealing with Dead Zone
Challenge II: Feedback Linearization Result Type 1 System
Experiment II: Weightless Pendulum (K=0)
Experiment III: Parameter Identification (Kp=1)
Challenge III: Stability and Root Locus. What is wrong? Kp>3 (unstable)
Model Correction: Motor Dynamics
Experiment IV: Controller Design Using Bode Plots
Evaluation
Hands-On Activities Open Loop Response
plot(t,theta,t,pwm); grid minor 120 100 PWM 80 60 40 20 0-20 0 10 20 30 40 50 60
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}')
Steady State Data 120 100 80 PWM Input 60 40 20 0 0 0.2 0.4 0.6 0.8 1 SIN theta ss
Fit a Line on Points 3-13 P=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))) shg legend('experiment', 'Linear fit')
Slope and Offset P = 92.4879 24.1771 120 100 Experiment Linear fit 80 60 40 X: 0 Y: 24.18 20 0 0 0.2 0.4 0.6 0.8 1
Project Installment # 2 Update Model mg S K u 24 0 92.5 u0=24 Slope=92.5
Test Using Closed Loop with Zero Gain (Slope needs adjustment, c. a 80) 100 80 60 40 20 0-20 -40 0 5 10 15 20 25 30
Check System Type using Kp=1 Theta=30
plot(t,theta) 40 35 30 25 20 4-5 degrees error (linearization Is not perfect) 15 10 5 0-5 0 2 4 6 8 10 12
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 K p to the point when you start getting an overshoot.
Using Kp=2 50 40 30 20 10 0 Tr=0.4 sec=>wn=4.5 PO=(48-32)/32=50% K/mL=4.5^2/Kp=10 c/ml^2=2*dzeta*wn/kp=0.97-10 0 1 2 3 4 5 6 7 8 9 sec Matlab for Damping > zeta=fzero(@(x)exp(-pi*x/sqrt(1-x^2))-0.5,0) zeta=0.22
System Identified g=tf(10,[1 0.97 0]) 10 +0.97 0.4 Root Locus 0.3 Imaginary Axis (seconds -1 ) 0.2 0.1 0-0.1-0.2-0.3-0.4-1 -0.8-0.6-0.4-0.2 0 0.2 0.4 Real Axis (seconds -1 )
Test Stability with Kp=1, 2, 3 Kp=2.4 ->stability limit 60 50 40 30 20 10 0-10 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Modify The Model Kp ( s 2 10 0.97s) 1 s 3 Root Locus g=tf(10,conv([1 0.97 0],[1 4.5])) rlocus(g) Imaginary Axis (seconds -1 ) 2 1 0-1 -2 System: g Gain: 2.3 Pole: -0.0129 + 2.06i Damping: 0.00627 Overshoot (%): 98 Frequency (rad/s): 2.06-3 -7-6 -5-4 -3-2 -1 0 1 Real Axis (seconds -1 )
Adjust for Steady State Error Kp 10 2 ( s 0.97s) 1 4. 5s Kp 10 2 ( s 0.97s b) 1 4. 5s 1 e ss 10 1 b b 2 5 30
Lag Compensator s z s p 10 2 ( s 0.97s 2) 1 4. 5s Imaginary Axis (seconds -1 ) 15 10 5 0-5 -10 s 5 s 1 Root Locus System: untitled1 Gain: 0.46 Pole: 0.092 + 1.81i Damping: -0.0509 Overshoot (%): 117 Frequency (rad/s): 1.81 Imaginary Axis (seconds -1 ) 10 5 0-5 s 0.5 s 0.1 Root Locus System: untitled1 Gain: 1.34 Pole: -0.0834 + 2.05i Damping: 0.0407 Overshoot (%): 88 Frequency (rad/s): 2.0-15 -15-10 -5 0 5 10 Real Axis (seconds -1 ) -10-12 -10-8 -6-4 -2 0 2 4 Real Axis (seconds -1 )
Step Response of Lag Compensation 45 40 35 30 25 20 15 10 5 0 X: 15.39 Y: 30.8 c=tf([1.5],[1.1]) clagd=c2d(c,0.01) -5 0 5 10 15 20
Prof. Eke s Slides on Implementation
Optional Activities Lead Compensator Lead-Lag Compensator On/Off Controller