Lecture 12 - Control Flashcards
Why do we use control?
Why use control at all?
* Correct or wrong?
Supplying a certain voltage / pulsewidth will make the motor spin at a certain speed.
* Not always!
This will only work in idle condition, not under load (e.g. driving up a slope)
What is motor control and how is it done?
- Using a feedback control will make sure the desired speed is maintained under load.
- If motor goes too slow → increase speed
- If motor goes too fast → reduce speed
- How is this done?
(1) Read current speed
(2) Compare with desired speed
(3) Change motor output accordingly
What are some things to consider when working with motor control?
- Time delay of controller (for measurement and calculation)
- Time delay of motor (physical reaction time of actuator in real world)
- Inaccuracy of encoder data
- Inaccuracy of actuator movement
What is an On-Off controller
Simplest case: Only on/off of control value, “Bang-Bang Controller
Refer to slides (NEED TO KNOW HOW TO CODE)
What is a timer?
- We need a timer function that calls our control routine regularly at exactly the right time intervals
- Background timer = interrupt from clock
- Most microcontrollers contain a number of timers that can be set by software.
Refer to slides (NEED TO KNOW CODE)
What are some parameters to consider for background timer frequency
Parameters to consider
* Encoder ticks per meter
* Lowest controlled speed
Refer to slides
What is a watchdog timer?
A watchdog is a specialized timer/counter
* It is initialized to a certain value and keeps counting down
* If the watchdog counter reaches zero, an interrupt is raised
➢ Correctly running program will reset the watchdog timer in regular intervals to its initial value, so no interrupt will occur
➢ Effective tool for fault detection, e.g. if program “hangs”
➢ Can be used to detect hardware errors and software errors
Refer to slides
On-Off Controller with Hysteresis
Refer to slides
What is a proportional controller?
P-controller (proportional controller)
R(t) = Kp * (vdes(t) - vact(t))
Linear change of control value to reduce error → better controller
Where:
* Kp is a constant value, “controller gain”
* Kp must be selected to achieve fast goal speed without overshoot
* Note: No equilibrium when desired velocity is reached: if vdes(t) = vact(t) then R(t) = 0
Refer to slides
What is an intergral controller?
Adding I-Controller (Integral Controller) Part
* Problem: P-Controller may reach equilibrium without reaching the target velocity → steady state error
* Solution: Integral part is used to eliminate steady state error (REFER TO SLIDES FOR EQUATION)
What is dertivative controller?
Adding D-Controller (Derivative Controller) Part
* Problems: P-Controller responds slow to change in input P-Controller with high gain tends to oscillate
* Solution: Add a derivative term for response/damping (REFER TO SLIDES FOR EQUATION)
What is a PID controller?
REFER TO SLIDES (FOR EQUATIONS)
PID-Controller is combination of P, I, and D controller
* Simple, universal controller
* Trade-offs: Response time vs. stability
* Noise limits max. proportional gain
* Note physical limits of actuator e.g. max acceleration, velocity
What are the tuning method for PID Paramter Tuning?
Manual Tuning
Ziegler-Nichols method
Cohen-Coon method
What is Manual tuning?
- Select typical operating setting for desired speed, turn off integral and derivative part, then increase KP to max. or until oscillation occurs.
- If system oscillates, divide KP by 2.
- Increase KD and observe behavior when changing desired speed by about 5%. Choose a value of KD which gives a fast damped response.
- Slowly increase KI until oscillation starts. Then divide KI by 2.5
What is velocity control?
Velocity Control is what we have achieved so far We can make a motor drive at a certain speed and make it maintain that speed
Refer to slides