Download - Ct01 06 Design
-
7/30/2019 Ct01 06 Design
1/28
2006 The MathWorks, Inc.
MATLAB and Simulink forControl Design Acceleration
Control Design
-
7/30/2019 Ct01 06 Design
2/28
6 - 2Control Design
2006 The MathWorks, Inc.
Section Outline
Uses of feedback
Control design methods
Time domain
Frequency domain Control design tools
SISO tool Simulink Response Optimization
-
7/30/2019 Ct01 06 Design
3/28
6 - 3Control Design
2006 The MathWorks, Inc.
Uses of Feedback
Make things happen as closely as possible tosome specification e.g. rise time.
Solve potential problems
Overshoot Oscillation Positioning errors Plant instability
Place limits on parameters Reduce effect of plant uncertainty
Make efficient use of control energy
-
7/30/2019 Ct01 06 Design
4/28
6 - 4Control Design
2006 The MathWorks, Inc.
Control Design Tools
The Control System Toolbox offers a variety oftools for designing and evaluating controllers
Root locus and Bode design (SISOTOOL) Pole placement
LQR (Kalman filtering) techniques
The advanced control toolboxes offer alternativedesign techniques
Robust, Mu-Analysis, and Synthesis
Fuzzy Logic, Neural Networks Model Predictive Control
>> doc control
-
7/30/2019 Ct01 06 Design
5/28
6 - 5Control Design
2006 The MathWorks, Inc.
Loop Shaping
Control system design essentially consists ofshaping the nominal system in the frequencydomain.
This is typically done by adding transfer functionterms to ensure: Enough roll-off at high frequency Enough gain at low frequency Good stability margins
PID control is loop shaping with a constrainedcontroller structure and is sufficient for manyapplications
-
7/30/2019 Ct01 06 Design
6/28
6 - 6Control Design
2006 The MathWorks, Inc.
Root Locus Diagram
Shows the effect ofincreasing gain k
Diagram plotted from openloop plant, rlocus(G)
Poles travel towards zerosor infinity as k increases
Determination ofdestabilising gain
>> ms_transferfcn
>> rlocus(ms_tf)
-
7/30/2019 Ct01 06 Design
7/28
6 - 7Control Design
2006 The MathWorks, Inc.
Root Locus Loop Shaping
Place dominant closed-loop poles in the desired region bychanging the gain and by introducing additional poles and
zeros.
-
7/30/2019 Ct01 06 Design
8/28
6 - 8Control Design
2006 The MathWorks, Inc.
Stability Margins
The amount by which gain and phase can changewhile still maintaining stability
Gain margin (GM) Phase margin (PM)
Phase Margin
Gain Margin
-
7/30/2019 Ct01 06 Design
9/28
6 - 9Control Design
2006 The MathWorks, Inc.
Frequency Domain Design
Phase-Lead Compensator
PD is an ideal Phase-Lead Compensator Phase-Lag Compensator
PI is an ideal Phase-Lag Compensator Lag-Lead and Lead-Lag
PID is an ideal lead-lag or lag-lead compensator These techniques can be used to change the
phase and gain margins.
-
7/30/2019 Ct01 06 Design
10/28
6 - 10Control Design
2006 The MathWorks, Inc.
Phase-Lead
Phase-Lead
z=1 p=5
z=1p=5
peak=2.23
peak=6.98
ps
zsksH
)(
-
7/30/2019 Ct01 06 Design
11/28
6 - 11Control Design
2006 The MathWorks, Inc.
Phase-Lag
Phase-lag
p=1 z=5
z=5
p=1
peak=2.23
peak=-6.98
ps
zsksH
)(
-
7/30/2019 Ct01 06 Design
12/28
6 - 12Control Design
2006 The MathWorks, Inc.
Lead-Lag and Lag-Lead
Lead-lag compensator
Phase-lead and phase-lag cascade
1> 2peak1< peak2
Increases the magnitude of the system frequencyresponse by 20log(a) in the range peak1-peak2
Lag-lead compensator
Phase-lag and phase-lead cascade
1> 2peak1< peak2
Increases the magnitude of the system frequency
response by -20log(a) in the range peak1-peak2
)1)(1(
)1)(1()(
21
21
sas
ssacsH
)1)(1()1)(1()(
21
21
ssasascsH
>> leadlaglaglead
-
7/30/2019 Ct01 06 Design
13/28
6 - 13Control Design
2006 The MathWorks, Inc.
Lead-Lag and Lag-Lead Plots
>> leadlaglaglead
Lead-Lag Peak magnitude is20*log10(5)
Peak magnitude is-20*log10(5)
peak1=1 peak2=100
Lag-Lead
peak1=1 peak2=100
-
7/30/2019 Ct01 06 Design
14/28
6 - 14Control Design
2006 The MathWorks, Inc.
SISO Design Tool
Feedbackstructure
Currentcontrol law
Tools for addingcontroller polesand zeros
Graphical displayof open-loop,closed-loop, andcontroller polesand zeros
Zoom controls
Root locus
Bode
response
Response Characteristics>> ms_transferfcn, sisotool(ms_tf)
-
7/30/2019 Ct01 06 Design
15/28
6 - 15Control Design
2006 The MathWorks, Inc.
Adding Design Constraints
Right-click and select NewDesign Constraint
Specify Settling Time
-
7/30/2019 Ct01 06 Design
16/28
6 - 16Control Design
2006 The MathWorks, Inc.
Adding a Controller
Controllers may be added and changed in several ways
1. Click here, and then drag
the poles, zeros or gain in
the Root Locus window.
2. Click in the CurrentCompensator box or on thered colored C block to see acontroller editor GUI.
-
7/30/2019 Ct01 06 Design
17/28
6 - 17Control Design
2006 The MathWorks, Inc.
Choose theAnalysis menuto view timeresponses
Viewing Responses (LTI Viewer)
Opens the LTIViewer to display
responses
-
7/30/2019 Ct01 06 Design
18/28
6 - 18Control Design
2006 The MathWorks, Inc.
Draw Simulink Diagram
LTI System
block
-
7/30/2019 Ct01 06 Design
19/28
6 - 19Control Design
2006 The MathWorks, Inc.
Tuning the PID Gains
After the initial design there are severalways to further tune the controller Adjust the gains by trial and error
Write a custom optimization script Use the Optimization Toolbox Use Simulink Response Optimization
-
7/30/2019 Ct01 06 Design
20/28
6 - 20Control Design
2006 The MathWorks, Inc.
Simulink Response Optimization
Simulink Response Optimization offers designersthe ability to: Optimize block parameters Place constraints on any signal
-
7/30/2019 Ct01 06 Design
21/28
6 - 21Control Design
2006 The MathWorks, Inc.
Using Simulink Response
Optimization
>> mass_spring_respopt
Insert and connect the SignalConstraint block just like anyother Simulink block
-
7/30/2019 Ct01 06 Design
22/28
6 - 22Control Design
2006 The MathWorks, Inc.
Specifying Constraints
There are two ways to specify constraints: Using the mouse to drag from the center point, end point ortime boundary
Right-clicking on a boundary and use the Constraint Editor
-
7/30/2019 Ct01 06 Design
23/28
6 - 23Control Design
2006 The MathWorks, Inc.
Specifying Tunable Parameters
Specify the tunableparameters by name
The tunable parameters must be specified. This is doneusing the Optimization->Tuned Parameters pull down menu
-
7/30/2019 Ct01 06 Design
24/28
6 - 24Control Design
2006 The MathWorks, Inc.
Running the Optimization
The constraint values that give this response can beloaded frommass_spring_constrains.mat.
If left to run, the finalresponse will be similar this
-
7/30/2019 Ct01 06 Design
25/28
6 - 25Control Design
2006 The MathWorks, Inc.
Review: the Design Steps
We completed all steps in the design process:
1. Performance/control specifications2. Model development
3. System analysis
trim and linearize model4. Controller design
a.Import system into Control System Toolbox
b.Design a controller, inspecting time and
frequency domain response
c. Use Simulink Response Optimization to further
tune controller5. Performance specification tests simulatecomplete system to see if specifications are met
6. Implementation
-
7/30/2019 Ct01 06 Design
26/28
6 - 26Control Design
2006 The MathWorks, Inc.
Additional Considerations
Real designs must take account of many ofthe following components
Signal conditioning and prefilters Noise filters
Notch filters Characteristics of the A/D and D/A
converters
Actuator dynamics
Sensor dynamics Discretization of the controller Implementation of the controller
-
7/30/2019 Ct01 06 Design
27/28
6 - 27Control Design
2006 The MathWorks, Inc.
Implementation
Use Real-Time Workshop Rapid simulations: non-real time Rapid prototyping applications: hardware-in-the-loop Embedded system design: code generated for embeddedsystems
Rapid
Simulation
Hardware-in-
the-Loop
Simulation
Embedded
System
Code
GenerationPrototyping
Code
EmbeddedCode
Deployment
Test
-
7/30/2019 Ct01 06 Design
28/28
6 - 28Control Design
Summary Outline
Uses of feedback
Control design methods
Time domain
Frequency domain Control design tools
SISO tool Simulink Response Optimization