PID Motor Control: Presented by Bo Chiasson
PID Motor Control: Presented by Bo Chiasson
Presented by Bo Chiasson
Overview
The reason we selected “make type def.” for the enum earlier is so that our local variables will
auto populate. Otherwise we would have to delete the local variable and add a new one every
time we add a new case.
Case Structure ctd...
In the event that your cases are created out of order logically...
Case Structure ctd...
Just right click on the case structure, rearrange cases..
We have just created an open loop, meaning it will continue to perform the task created without
feedback from an outside source.
Create a virtual folder
Place all VI’s and Controls created so far into
new Virtual Folder
Take a break…
Encoders
Four possible ways to wire
Note: This is used for a motor with direct drive meaning a 1:1 ratio. If you are using anything
else you must multiply it by the gear ratio you have it at. Ex. 1440 encoder but a gear ratio of
30:1. Meaning motor shaft will spin 30 times before the wheel rotates once. To get an accurate
count you would multiply 30 by 1440 and get 43200 ticks per rev rather than 1440.
Give it a try
Compare results
PID Control
- PID control is a control loop feedback mechanism used in automation and process control
- Uses a closed loop rather than an open loop
PID Control ctd...
- Clothes dryer
- Timer to dry clothes
- Stops whether clothes are damp or dry
- Thermostat
- Set a temperature
- Furnace or AC will kick in and out to maintain temp
- Setpoint (SP)
- What you want the process variable to be
- Process Variable (PV)
- What you are measuring
- Error (E)
- Difference between SP and PV
PID Control ctd...
Proportional
- Will produce an output proportional to error. The larger the error, the larger the control
output based on the “Gain Factor” (K).
Integral
- Accounts for past error values. If there is still error overtime it will change the output by
an “Integral Factor” (I) until error is gone.
Derivative
- Known as rate of change. Seeks to reduce the effect of the error by exerting a control
influence generated by a rate of change.
PID Control ctd...
Tuning
-Refers to adjusting the P,I, and D values until a desired control response is created.
PID Control ctd...
PID Control ctd...
Responses Created:
For faster processes and applications such as flow loops or motor control we only use
Proportional and Integral control known as “PI Controllers”
Using this newly gained knowledge we will now get into creating a PI Controller for motor
control.
PID Control ctd...
Goal:
Determine what will be the SP, PV, and Error for motor control
PID Control ctd...
Encoder
PID Control ctd...
PID Control ctd...
Goal:
- Straight
- Right Turn
- Left Turn
PID Control ctd...
PID Control ctd...
PID Control ctd...
PID Control ctd….
Goal: Create a VI to navigate through a maze using the 3 new subVI’s created