Afghanistan
Albania
Algeria
Andorra
Anguilla
Antigua & Barbuda
Argentina
Armenia
Aruba
Australia
Austria
Azerbaijan
Bahamas
Bahrain
Bangladesh
Barbados
Belarus
Belgium
Belize
Benin
Bermuda
Bhutan
Bolivia
Bonaire
Bosnia & Herzegovina
Botswana
Brazil
British Indian Ocean Ter
Brunei
Bulgaria
Burkina Faso
Burundi
Cambodia
Cameroon
Canada
Canary Islands
Cape Verde
Cayman Islands
Central African Republic
Chad
Channel Islands
Chile
China
Christmas Island
Cocos Island
Colombia
Comoros
Congo
Cook Islands
Costa Rica
Cote D Ivoire
Croatia
Cuba
Curacao
Cyprus
Czech Republic
Denmark
Djibouti
Dominica
Dominican Republic
East Timor
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Ethiopia
Falkland Islands
Faroe Islands
Fiji
Finland
France
French Guiana
French Polynesia
French Southern Ter
Gabon
Gambia
Georgia
Germany
Ghana
Gibraltar
Greece
Greenland
Grenada
Guadeloupe
Guam
Guatemala
Guinea
Guyana
Haiti
Hawaii
Honduras
Hong Kong
Hungary
Iceland
India
Indonesia
Iran
Iraq
Ireland
Isle of Man
Israel
Italy
Jamaica
Japan
Jordan
Kazakhstan
Kenya
Kiribati
Korea North
Korea South
Kuwait
Kyrgyzstan
Laos
Latvia
Lebanon
Lesotho
Liberia
Libya
Liechtenstein
Lithuania
Luxembourg
Macau
Macedonia
Madagascar
Malawi
Malaysia
Maldives
Mali
Malta
Marshall Islands
Martinique
Mauritania
Mauritius
Mexico
Midway Islands
Moldova
Monaco
Mongolia
Montserrat
Morocco
Mozambique
Myanmar
Nambia
Nauru
Nepal
Netherland Antilles
Netherlands (Holland, Europe)
Nevis
New Caledonia
New Zealand
Nicaragua
Niger
Nigeria
Niue
Norfolk Island
Norway
Oman
Pakistan
Palau Island
Palestine
Panama
Papua New Guinea
Paraguay
Peru
Philippines
Pitcairn Island
Poland
Portugal
Puerto Rico
Qatar
Republic of Montenegro
Reunion
Romania
Russia
Rwanda
Saipan
Samoa
Samoa American
San Marino
Sao Tome & Principe
Saudi Arabia
Senegal
Serbia
Seychelles
Sierra Leone
Singapore
Slovakia
Slovenia
Solomon Islands
Somalia
South Africa
Spain
Sri Lanka
St Barthelemy
St Eustatius
St Helena
St Kitts-Nevis
St Lucia
St Maarten
St Pierre & Miquelon
St Vincent & Grenadines
Sudan
Suriname
Swaziland
Sweden
Switzerland
Syria
Tahiti
Taiwan
Tajikistan
Tanzania
Thailand
Togo
Tokelau
Tonga
Trinidad & Tobago
Tunisia
Turkey
Turkmenistan
Turks & Caicos Is
Tuvalu
Uganda
Ukraine
United Arab Emirates
United Kingdom
United States of America
Uruguay
Uzbekistan
Vanuatu
Vatican City State
Venezuela
Vietnam
Virgin Islands (Brit)
Virgin Islands (USA)
Wake Island
Wallis & Futana Is
Yemen
Zaire
Zambia
Zimbabwe
1. Control System Design
Workflow
Product architecture
Computer Setup
Typical control design workflow
Design controller to improve system performance
Analyze the model
Model the system of interest
2.) Overview
Tuing controllers
Setting controller requirements
Finding system characteristicts
Linearizing a model
Defining a control design workflow
Testing controllers
Products used
Simulink Control Design.
Control Systems Toolbox
Simulink
MATLAB
Course Example
IO connectors
Load encoder
Flexible Shaft
Motor
DC Servo Motor
Power Amplifier
basic_motor_iopts
Workflow
Implementation
Verification
Design
Modeling
Design Controller
Create Plant Models
Refine and Deploy
Setting IO Points
Output measurement
Input perturbation
The Simulink Model
Sits on top of MATLAB
Linear Analysis
Uses initial conditions as an operating point.
Running the model generates the lti object
Should linearize if designing a control system.
Defining the linearization task
Can view options from Edit Model I/O's option
Define the operating point (ic's)
Define Input/Output signals.
Analysis -> Control Design -> Linear Analysis
Try: basic_motor_iopts
Setting operating points
Click the Step button in the Linearize section.
Set Model Initial Condition.
Operating Points option.
Exploring the linearized Model
Model contains 5 states
double-click the variable name linsys1
Step response contains a high-frequency oscillation.
Model Representations
Simulink Models
LTI Object
Matlab can only handle LTI: LINEAR.
Simulink can handle non-linear models.
Simscape.
Mathmatical Models
Know all the equations
Parameters are known.
White Box modeling
System Identification
Equations are unknown.
Measurement data is obtained.
Frequency Response
Form the overall description of the system from I to O.
Grey Box Modeling
Want to tune equation parameters from test data.
Some imperical data.
Some equations known.
Linear Time-Invariant Models
State Space ('ss')
Transfer Function ('tf')
[num,den] = ss2tf(ss)
Zero-Pole-Gain ('zpk')
ss = tf2ss(num,den)
All interchangable via function.
LTI Viewer
Step Response
Bode Plot
Root Locus
Frequency Response Data Model ('frd')
Not easily convertable to linear models.
Can only visualize via bode() plots
Simulink model
Have to transcribe equations to blocks
Modification will be diffucult.
Can contain LTI blocks
Can contain Simscape models
Have to derive correct equations.
Simscape Model
Don't need to derive basic equations.
Uses predefined blocks
Physical models
Runs inside Simulink
Generates simulink signals
System Model (MATLAB)
system class ('sys')
Creation is Scriptable in MATLAB
MATLAB Layer
Math
Statisticts
Application Deployment
Database access and reporting
Optimization
MATLAB
Simulink Layer
Verification, Validation, and Test
Simulation Graphics and Reporting
Real-Time Similation and Testing
Simulink
Event-Based Modeling
Physical Modeling (SimScape)
Physics Toolboxes
Control Systems
Signal Processing
Image Processing
Computer Vision
Test and Measurement
Utility Toolboxes
Code Generation
Parallel Computing
Other Toolboxes
Geospacial
Biology
Finance
System Identification
Model validation
Model estimation
Data importing and preprocessing
Uses system identification toolbox.
Parameter Estimation
Model preparation
Estimation Process
Parameter estimation tips
Uses Simulink Design Optimization
Uses Optimization TOolbox
Uses Global Optimization Toolbox (for pattern search optimization)
Grey-Box Modeling
6. System Analysis
Automation
DC Motor Analysis
Linear System Analyzer
System analysis functions
Open-Loop analysis
Goals
Frequency Response
Transient Response
Stability
Functions (MATLAB)
pzmap
zero
pole
linearSystemAnalyzer
step
damp
stepinfo
bode
lsim
bodemag
margin
bandwidth
dcgain
impulse
evalfr
nichols
nyquist
Course Example: DC Motor Model
edit createSimpleDC
dcmotor = createSimpleDC(0.5,2)
Linear System Analyzer
Interactive
Runs any kind of plot
Can get all command line results
Finding system characteristics
Righ-click on any plot and select points to plot
Inspect plot with arrow tool.
Setting Control Requirements
Right-click on any plot
Select the Characteristics sub-menu
Requirements per plot.
Tuning the controller
Analysis -> Control Design -> System Designer
Select blocks to tune.
Click OK
Browse to the Controller section
Click Add Blocks
Expand the Edit Architecture section.
View the Signals and Linearization Options tabs
In the Edit ARchitecture Dialog
Select the blocks and parameters to tune.
Select Design Plots
Select Root Locus Editor
Select Bode Editor
Select "Tuning Methods" section from the ruler
Arrange plots
Select Analysis plots
Create a closed-loop response by setting Select Response to Plot option.
New Step to create a new step response.
Use the "New Plot" ruler button.
Repeat for new Bode plot.
Click plot
Specify the Ref and pos_L signals
Using Design/Analysis plots
Read resulting values by selecting items on the plots
Drag/Drop plotted gain points to taste.
Set all scales to something sane.
Can add design requirements on Design plots
Can add tuning requirements on Analysis plots
Test the mess by rerunning the model.
Overview
Will try a series of plausible system models
Can preform black-box modeling (unkown architecture).
Difficult in the real world to describe a system using known physical laws.
Need a plausible set of architecture canidates.
Need IO data
Will attempt to fit to each architecture.
Need to narrow identification algorithms.
Process
Use frequency data
Gather experimental data
Plant uncertainty can be used to create a robust controller.
Validate the model
Estimate the model
Collecting data
Can use white noise for frequency unbiased range.
Drive system with a sine sweeps at frequencies of interest
DC Motor data
timedata = iddata(output,input,Ts)
load measured_data
bode(freqdata)
freqdata = idfrd(Hpm,F,Ts)
plot(timedata)
Create Frequency Response Data (frd) object.
System Identification App
Open System Identification App from the toolbox ruler
Provides GUI to MATLAB functions
Has a pul-down pop-up for data import settings.
Pre-processes data on GUI page.
Can remove means, etc.
Allows for frequency fit ranges.
Splits input data between fit and verify
Allows model structure to be selected.
Validates on same GUI page.
Will grind out best model order from given range.
Has buttons to view/plot results
Has buttons to export results to workspace.
Tips for better estimation
Estimate many models and compare
Start simple
Obtain appropriate measurement data
Keep the model structure in mind
Design Optimization
Parameter estimation
Use experimental data to fit model parameters.
Response optimization
Use design requirements to tune model parameters.
Two methods
Workflow
Must map all measured signals to the model.
Must map every variable to the MATLAB workspace
Parameters tab on ruler.
Experiments tab on ruler
Add plots
Estimate parameters with the Estimate button.
View estimated parameters
Tips for better estimation performance
Use "Fast restart simulation" (partial pre-compile between runs)
Use "Accelerator mode" (fully compiles model)
Use Parallel simulations (toolbox)
Linearization
Frequency response estimation.
Linearization functions
Selection of operating points
Linearization workflow
Workflow
Two approaches
Simulation
Linearization.
Perform linearization
Find the operating point
Prepare the model
Do a series expansion for an aproximization
Example
Start Linear Analysis Tool
Name signals so we can find them later in the tool.
Use right-click pull-down menu.
Assign linear analysis points
pendulum_simple
Running observations
Simulink will adjust all other parameters to fit.
Can run model from various trim points.
Can "trim" model about various operating points.
Open-Loop vs. Closed-loop.
Open-loop is just plant model, no controller.
Linearize model by choosing a trimmed operating point.
Try to stabilize the inverted pendilum.
pendulum_feedback
Open model with a controller
SIMO/MISO/MIMO
Set the plot I/O carefully for requirements.
Add step response and bode plots of the linearized system using the plots and results tab
Linearize the model about its default operating point.
pendilum_disturbance
Added another output for velocity
Use I/O Selector from right-click of plot.
Scripting linearization functions
pendilum_lin
Use 4 primary functions
operspec returns a MATLAB variable that represents an operating point specification.
findop Iteratively searches for an operating point that meets an operating point specification.
linio sets linearization input and output points in the model.
linearize linearizes a Simulink model about the specified I/O and operating point.
Frequency Response Estimaton
Analyzing models that cannot be linearized analytically (statespace?)
Review the results
Simulate the model and perform estimation.
Create input data
Define input and output points
For validating linearization results
Linearization
An operating point must be chosen.
Will use general linearization formula
For systems that can be well-approximated by a linearized version
Creating Input signals
Chirp signals
Random signals
pseudorandom noise.
Number of periods
Sinestream
Several sequential sine waves of varying amplitudes and frequencies.
Excites the system over a range of frequencies such that each is only active for an instant.
Ramp Periods
Settling periods
Performing Estimation
Click the Bode button in the Estimate section
Internal Algorithm
Simulate the model using input signal.
Discard settling and ramp periods for each frequency
Isolate the desired frequency using a band-pass filter
Enable Diagnostic Viewer in the Options section
Estimate the frequency response using the collection of simulated results.
View results
Use the diagnostic viewer.
Tips
Ensure that the FFT of the transient response used does not contain content outside measured frequency.
Give each frequency longer time to reach steady state.
Increas the number of total periods.
Increase ramp and settling times.
Modify the amplitude of the input signal to reduce non-linear effects.
Ensure transient dynamics or harmonic frequencies are not present in the response.
Outcomes
Linearize nonlinear models about various operating points.
Analyze system models using both simulation and traditional linear analysis techniques (bode plots, pole locations, step response characteristics, etc.)
Use measured data to estimate model parameters
State the various ways you can represent a control system and the pros and cons of each.
Design controllers for systems that meet specific design requirements.
Test
(True): Most classical control design methods rely on the existence of a linear system model.
(True): Simulink models can be linear or non-linear.
Step/impulse system responses
Frequency response of the system (Bode plot)
Analyzing a linear model using the Linear Analysis tool allows you to quickly obtain:
Poles/Zeros of the linear system
WHich of the following allows you to tune a controller block in Simulink while analyzing the open-loop and closed-loop system?
Control System Designer
Test
What function is used to create a state-space system in MATLAB?
How can a state-space system be modeled in Simulink?
state-space block
Graphical, block-diagram environment
Can model linear and nonlinear systems
ss
What are the benifits of using Simulink for creating models?
PID Control
Automatic tuning
PID controller block
Model setup
Workflow
Uses Control System Toolbox
Additional features.
Uses Simulink Control Design.
Objectives:
Add realistic behavior to a PID controller model, such as discrete updates and saturated outputs.
Tune PID controller gains to obtain good reference tracking and disturbance rejection.
Configure a Simulink model for automatic PID tuning.
Model a PID controller in Simulink
Workflow
Add realistic features.
Tune gains (iterative)
Model feedback loop using a PID controller
Create plant model
Example: Disc Head asembly
Ki (back emf constant)
Solenoid
K (stiffness)
Disk drive motor
J (inertia)
theta (angle)
Read/Write head
C (Damping)
>> diskPlant
Model setup
Step time: 1
Use the Step block for the reference angle signal.
Simulink -> Continuous library
>> diskControlled
Final value 2e-4
initial value: 0
PID controllers
N - Filter coefficient (frequency of approximate derivative
D Derivative Gain
I - Integral gain
P - proportional gain
u
y
Integrator
Available controller blocks
PD
PI
I
P
Parallel
PID
Ideal (sequential)
Tuning controller Gains
Manual via frequency-based approaches
Automated "hit the 'tune' button".
Manual via trial & error
Auto tune behavior
Breaks after the PID block
Auto-linearized about current point.
Linearization
Intitial controller gains calculated
Assumes PID before plant in loop.
Assumed controller structure
Balances robustness (stability) and speed
Auto-Tune Interface
Response plot
Plot/Domain selection
Plant selection
PID tuner ap in control systems toolbox ap ruler
System export.
Interactive tuning
Procedure
Start the PID Tuner by clicking the Tune button.
Double-click the PID controller block
>> diskCtrlWithTF
>> pole(Plant)
Analyze the poles of the open-loop plant model.
Export the open-loop plant model to the MATLAB workspace by selecting Update Block -> Expoert option in the REsults section of the toolstrip.
Auto-Tune Algorythm
Two design modes:
Gains are adjusted based on robustness and performance goals
Uses a frequency-based design algorithm
Response time and transient behavior
Frequency domain
Time domain
bandwidth, phase
V & V
Click Show Parameters button
Visually inspect response plot
Simulate the complete simulink model with new PID controller.
Hit the Update Block button and close the PID Tuner window.
Right click and select Characteristics
View Performance and robustness section
Output Saturation
Enable Limit output option
Select the PID Advanced tab
Double-click the PID controller block
Set the following saturation limits.
Discrete PID controllers
Retune the controller gains by clicking "tune"
Click the Apply.
Emulate this by specifying a sample time on the PID block
Used with embedded systems.
PID Tuner window now displays a staircase plot
Plug discretized PID back into the system by clicking "Update Block"
Retest full system.
Additional Features.
Bumpless transfer
Windup prevention
External control gains (time varying)
Feedforward compensation.
Data type control
Classical Control Design
Closed-loop analysis
PID Control
Lead-Lag control
Uses Control System Toolbox
Uses Simulink Control Design
Open-Loop tuning
Outcomes
Design a lead-lag compensator to meet specified requirements.
Use open-loop analysis (root locus, Bode, etc) for effective control design
Perform classical control design on both simulink odels and LTI objects
Design a PID controller to meet specified requirements
Class Example
L
R
Input voltage
DC Motor control
torque
Vemf
Load disturbance
omega (angular velocity)
Kf(omega) viscous friction
Angular velocity
Approach
Won't throw a PID controller in and say "tune"
Will start with a 1/1 controller and build up as needed
Creating a controller structure
Use a Step block to represent the desired velocity.
Use the TransferFcn block for the controller with num/den coefficents
The angular velocity is subtracted from the desired angular
Create a negative feedback loop
Assigning Closed-Loop signals
dcmotor_feedback
Angular velocity of the motor should match the desired value
Load disturbances should have a minimal impact on angular velocity
Designate signals as system I/O
Control System Designer
Analysis
Control Design
Control Sustem Designer
Edit Architecture section is expanded.
Define:
Open
Tunable blocks in the Simulink model that represent the controller
Signals in the model which are of interest to the design.
Linearization options (operating point, sample time, etc.)
Open-Loop Transfer Function
"Open Loop" is easier to obtain analytically.
Use "Open Loop"for root locus, Bode, Nichols, etc.
"Open Loop" infers behavior of the closed loop.
Simulink obtains "Open Loop" by breaking system after the controller.
Rename the "open-loop" response to LoopTransfer.
Selecting Tuning Methods
Use the Tuning Methods menu
Bode Plot Editor
Select Response to Edit
Set to "Loop Transfer"
Click Plot
Root Locus Editor
Selecting analysis plots
New Plot menu
Create plots of the responses between any two signals of interest.
Plot between wref and w signals.
Use New Input-Output Transfer Responses to create new responses.
Can use the Select Response to Plot parameter to create a new response.
Allow you to directly see the effect of tuning the controller on the overall closed-looop system.
Change plot layout in View tab.
Improving Steady-State Error with Gain.
Increase the gain of the controller
Can drag closed-loop poles (pink squares) in the root locus design plot.
Drage the bode magnitued esign plot up or down.
Open the compensator Editor dialog by double-clickickg the tunable block name.
In the parameters tab change the parameter of the selected block.
Try 1,10. Notice SS goes from 0.2 to 0.7.
Improving Steady-State Error with an Integrator.
Open the Compensator Editor dialog
Use the Pole/Zero tab
Right-click box under Dynamics
Select Add Pole/Zero
Integrator
Settles to 1.0, but is slower.
Improving Steady State Error in Frequency Domain.
More gain at low frequency reduces SS error
More gain slows system down.
Integrator increases settling time.
Integrator increases low-frequency gain eliminating SS error.
Improving Transient Response.
Common metrics
Settling time
Rise time
Percent overshoot
Try a proportional-plus-integral (PI) controller.
Add a zero to the compensator.
Open the Compensator Editor
Select the Pole/Zero tab
Right click box under Dynamics
Select Add Pole/Zero
Select Real Zero
Add Design Requirements to Design Plots
Creates right-hand exclusion zone on root locus plot.
For settling time of a system less than a given value
Requires knowlege about how the open-loop design plots affect the closed-loop system response.
Can tune the PI controller graphically using the design plots of the open-loop system.
Pi-shaped exclusion zone on root locus.
Maintain high bandwidth
Limited overshoot
Bode plot magnitude minimum.
Add Design Requirements (Analysis Plots)
Step Response
Settling Time
Magnitude response in a frequency range
Closed-loop Bode plot
Rise time
Creating a PID Controller
Can't meet requiremnts now with a PI controller
Must add a derivative
Add another zero
Add another pole to make it realizable (same poles/zeros)
Select Tuning methods
Select PID Tuning
Can manually add a derivative or automatically create a PID controller.
Change the Controller Type to PID
Ensure that the Design with 1st-order derivative filter option is enabled.
Click the "Update Compensator" button.