www.natinst.comwww.natinst.com
PID and Fuzzy Logic Control Systems
John Limroth, Software Engineer
Yiannis Pavlou, Applications Engineer
Tues, 10:15a and 11:30a
Wed. 10:15a, 11:30a, 12:45p, 2:00p, 3:30p, and 4:45p
Exhibit Hall (3B)
www.natinst.comwww.natinst.com
OverviewOverview
Control technology• PID control• Fuzzy logic
National Instruments products for control• LabVIEW RT• PID Control Toolset for LabVIEW
Control technology• PID control• Fuzzy logic
National Instruments products for control• LabVIEW RT• PID Control Toolset for LabVIEW
www.natinst.comwww.natinst.com
Control Terminology
Terms: Process variable Setpoint Controller output Plant
Terms: Process variable Setpoint Controller output Plant
Examples: Temperature Desired temperature Heater voltage Furnace
Examples: Temperature Desired temperature Heater voltage Furnace
www.natinst.comwww.natinst.com
PID Control
www.natinst.comwww.natinst.com
PID Parameters Proportional gain – Kc
Integral gain – Kc/Ti
• Ti is the integral time constant or “reset time”
Derivative gain – Kc*Td
• Td is the derivative time constant or “rate time”
www.natinst.comwww.natinst.com
PID Gains – PPID Gains – P
Proportional gain K c – “The Sledgehammer”
• Provides immediate controller response to setpoint change, but PV may not settle exactly on SP using proportional control alone
Proportional gain K c – “The Sledgehammer”
• Provides immediate controller response to setpoint change, but PV may not settle exactly on SP using proportional control alone
www.natinst.comwww.natinst.com
PID Parameter Tuning – P only
www.natinst.comwww.natinst.com
PID Gains – PIPID Gains – PI
Proportional gain Kc – “The Sledgehammer”
• Provides immediate controller response to setpoint change, but PV may not settle exactly on SP using proportional control alone
Integral gain Kc / Ti – Fine tuning
• Integrates the error over time to overcome the offset from Proportional alone such that PV = SP. However, integral action may cause overshoot, oscillation, and/or instability problems
Proportional gain Kc – “The Sledgehammer”
• Provides immediate controller response to setpoint change, but PV may not settle exactly on SP using proportional control alone
Integral gain Kc / Ti – Fine tuning
• Integrates the error over time to overcome the offset from Proportional alone such that PV = SP. However, integral action may cause overshoot, oscillation, and/or instability problems
www.natinst.comwww.natinst.com
PID Parameter Tuning – PI only
www.natinst.comwww.natinst.com
PID Gains – PIDPID Gains – PID
Proportional gain Kc – “The Sledgehammer”• Provides immediate controller response to setpoint change, but PV
may not settle exactly on SP using proportional control alone
Integral gain Kc / Ti – Fine tuning• Integrates the error over time to overcome the offset from
Proportional alone such that PV = SP. However, Integral action may cause overshoot, oscillation and/or instability problems
Derivative gain Kc* Td – Whoa…• Used to put the reigns on PI control to prevent overshoot and
oscillation and to add stability
Proportional gain Kc – “The Sledgehammer”• Provides immediate controller response to setpoint change, but PV
may not settle exactly on SP using proportional control alone
Integral gain Kc / Ti – Fine tuning• Integrates the error over time to overcome the offset from
Proportional alone such that PV = SP. However, Integral action may cause overshoot, oscillation and/or instability problems
Derivative gain Kc* Td – Whoa…• Used to put the reigns on PI control to prevent overshoot and
oscillation and to add stability
www.natinst.comwww.natinst.com
PID Parameter Tuning – PID
www.natinst.comwww.natinst.com
PID Autotuning
www.natinst.comwww.natinst.com
Fuzzy Logic DataflowFuzzy Logic Dataflow
www.natinst.comwww.natinst.com
Fuzzy Logic Control for LabVIEW
Why is fuzzy logic important? Easy to implement an intuitive control
strategy Better control of non-linear systems
• PID control is linear• Fuzzy control is non-linear
www.natinst.comwww.natinst.com
Rule-Based ControlRule-Based Control
Example• “If temperature is high, then heater voltage output
should be low.”
Membership sets• What is meant by “high?”
Example• “If temperature is high, then heater voltage output
should be low.”
Membership sets• What is meant by “high?”
www.natinst.comwww.natinst.com
Fuzzy Sets
Boolean (or two-valued) sets:• Members belong to a set – non-members do not• Traditional Boolean values (on/off, 1/0)
Fuzzy Sets:• Partial membership to set allowed• Values along continuum of 0 to 1
www.natinst.comwww.natinst.com
Boolean Set – “High Body Temperature”
Temperature
Mem
ber
ship
www.natinst.comwww.natinst.com
Fuzzy Set – “High Body Temperature”
Temperature
Mem
ber
ship
www.natinst.comwww.natinst.com
Fuzzy Logic Control
www.natinst.comwww.natinst.com
Fuzzy Logic and PID Combined
IF … AND … THEN …
IF … AND … THEN …
IF … AND … THEN …
Rule base
• • •
Fuzzification Fuzzy Inference Defuzzification
ProcessFuzzy ControllerSet Point Values
Measured Values
PID
Command Variable
P I D
www.natinst.comwww.natinst.com
Fuzzy Logic Design Software
www.natinst.comwww.natinst.com
OverviewOverview
Control technology• PID control• Fuzzy logic
National Instruments products for control• LabVIEW RT• PID Control Toolset for LabVIEW
Control technology• PID control• Fuzzy logic
National Instruments products for control• LabVIEW RT• PID Control Toolset for LabVIEW