02 - Introduction To The NI LabVIEW Control Design and Simulation Module PDF
02 - Introduction To The NI LabVIEW Control Design and Simulation Module PDF
02 - Introduction To The NI LabVIEW Control Design and Simulation Module PDF
Agenda
Simulation Concepts
PID Concepts
Advanced Control Algorithms
Conclusion
Agenda
Simulation Concepts
PID Concepts
Advanced Control Algorithms
Conclusion
Time consuming
Risk
Simulation
What is simulation?
Use mathematical formulas to represent dynamics
of a system
Simulation Benefits
Faster, better control algorithm code
development
Understand how your control algorithm effects
the system
Evaluate impact of
Sampling rate
Sensor response time, noise, offset/gain error
Deadtime, backlash or resonance
Todays Example
NI 9505
Motor Drive Module
Ethernet
Maxon Amax
Brushed DC Motor
Desired
Position
+-
Error
PID
Toolkit
NI 9505
Disturbance
PID
Compensator
Drive
Output
Motion
System
Measured
Position
Windows
Real-Time Hardware
FPGA Hardware
10
Encoder
Sensor
11
Today
12
Shaft
Angle
i
+
DO5
d
Tf B
dt
Ti J
B
d 2
dt 2
+
-
vR iR
L
vL L
vm
Vsup
id
di
dt
+
-
ve K e
Tm Kt i
Sum of Forces
d 2
d
0 Kt i J 2 B
dt
dt
di
d
vm Ri L K e
dt
dt
Rearrange to put highest order derivative terms on the left side of equation:
d 2 Kt
B d
dt 2
J
J dt
di
R
Ke d vm
i
dt
L
L dt
L
13
d
dt
0 Kt I J s 2 B s
J s2 B s
Vm
K t / JL
BR K t K e
s 3 s 2 B / J R / L s
JL
14
15
Challenges
16
Shaft
Angle
i
+
DO5
d
Tf B
dt
Ti J
B
d 2
dt 2
+
-
vR iR
L
vL L
vm
Vsup
id
di
dt
+
-
ve K e
Tm Kt i
Sum of Forces
d 2
d
0 Kt i J 2 B
dt
dt
di
d
vm Ri L K e
dt
dt
Rearrange to put highest order derivative terms on the left side of equation:
d 2 Kt
B d
dt 2
J
J dt
di
R
Ke d vm
i
dt
L
L dt
L
17
d
dt
18
Dynamic
System
Outputs
(response signals)
20
21
Simulated
22
Agenda
Simulation Concepts
PID Concepts
Basic PID Algorithms
Loop Rate
PID tuning
23
error
OP
SP
PV
25
PID Parameters
Proportional
Drive to setpoint
Error 0, OP 0
Steady-state error
Integral
Eliminate steady-state error
OP proportional to error
Derivative
26
Proportional-Integral-Derivative (PID)
Proportional
The further the system is from the set point, the larger the
actuator output to drive it to the set point
Integral
The longer the system has been off from the set point, the
larger the actuator output to drive it to the set point
Derivative
27
28
PID VIs
Simulation VI
Function Blocks
Ready to Run
Custom
30
Function
Blocks
Windows
Yes
No
Yes
Yes
Yes
Real Time
Yes
Yes
Yes
Yes
Yes
FPGA
No
No
Yes
No
No
PID and
Fuzzy Logic
Toolkit
LabVIEW RT
PID and
Fuzzy Logic
Toolkit
Control
Design and
Simulation
Mathscript
RT
Included
with Product
31
32
Integrator Antiwindup
33
34
35
Frequency Response
Gain Crossover Frequency
Frequency (Hz)
Input
System (Plant)
Output
36
Rule of thumb
The control loop should be at least ten times faster than the gain
crossover frequency of the system (minimum 2X faster)
Crossover frequency = 40 Hz
Suggested Loop rate = 400 Hz
CAUTION: Increasing the control algorithm gain increases the crossover frequency
37
38
39
40
Conclusions
The performance and stability of the system
depends on the frequency response of the
system AND the control algorithm
Systems that change quickly or have complex
behavior require faster control loop rates
Increasing the gain of the control algorithm may
mean you need to run the control system faster
41
Automatic
Autotuning
Frequency Based (Analytical PID)
Time Based (Optimization)
44
45
Conclusions
P gain is the most important factor in PID tuning
I gain gets rid of steady-state error
D gain is rarely used and may cause problems if
feedback signal is noisy
If you increase the gain, you may have to
increase the loop rate
46
Agenda
Simulation Concepts
PID concepts
Advanced PID Algorithms
Conclusion
47
Feedforward
Gain Scheduling
Adaptive PID
Model Predictive
Control
48
Feed forward
49
Gain Scheduling
PID 3
PID 2
PID 1
50
Self-Tuning
Parameter or Structure of the
Controller modifies with changes
on the plant
Set Point
+-
Controller
Configurator
Plant
Estimator
Controller
System
(Plant)
51
52
Set Point
+-
PID
Servo
System
(Plant)
+-
Estimator
Regulator
u=-k.x
States
53
min J xT Qx u T Ru 2 xT Nudt
0
Constraints
Optimizer
Set Point
System
(Plant)
+-
PID Control
54
55
Agenda
Simulation Concepts
PID concepts
Advanced PID Algorithms
Conclusion
57
58
Questions?
To find
Code used on the demonstration
Technical documentation
Follow up whitepapers
Go to
www.ni.com\info
and enter the code
devdays2010ctrl
59
Additional Resources
60
Deadtime
The interval of time between initiation of an input change or
stimulus and the start of the resulting response
Deadtime
61
Dead time
Deadtime is a delay between when a process
variable changes, and when that change can be
observed.
Examples:
62
Backlash
Example: Motor spins but gate doesnt begin to
open for some time due to a sloppy mechanical
system.
63
Resonance or Vibration
Avoid exciting the system at the resonant
frequency
Offset
Y mX b
Steady State Response
Constant Stimulus
65
Linear system
y 7y 0
y 2 y 8 y sin 2 x
'
''
'
y x 1 y sin 4 x
''
66