This page (revision-25) was last changed on 2021-11-08 09:09 by Murray Altheim

This page was created on 2019-12-22 08:01 by Murray Altheim

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
25 2021-11-08 09:09 8 KB Murray Altheim to previous
24 2021-06-24 22:52 8 KB Murray Altheim to previous | to last
23 2021-01-23 22:25 8 KB Murray Altheim to previous | to last
22 2020-09-27 01:11 8 KB Murray Altheim to previous | to last
21 2020-09-27 01:11 8 KB Murray Altheim to previous | to last

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 14 changed one line
A __Proportional–Integral–Derivative__ or __PID Controller__ is a general-purpose mechanism for regulating the output of any kind of system through the use of a ''feedback loop''. The feedback signal provides an indication of the current output of the system and is used to alter the system so that its output matches the desired value. PID Controllers are used in temperature controllers and automobile cruise controls. One of its first industrial uses was as an automated steering system for ships.
A __Proportional–Integral–Derivative__ or __PID Controller__ is a general-purpose mechanism for regulating the output of any kind of system through the use of a ''feedback loop''. The feedback signal provides an indication of the current output of the system and is used to alter the system so that its output matches the desired value. PID Controllers are used to control oven temperatures and in automobile cruise controls. One of its first industrial uses was as an automated steering system for ships.
At line 16 added 5 lines
What sets a PID Controller apart from simpler controllers is that it combines three types of __control terms__ to quickly reach and stay at the desired system output value, minimising overcorrection and maximising stability. These three control terms are what forms its acronym: ''Proportional'', ''Integral'', and ''Derivative''. Because of this a PID Controller is also sometimes called a ''three term controller''.
!! How does it work?
At line 18 changed one line
What sets a PID controller apart from simpler controllers is that it combines three types of __control terms__ to quickly reach the desired system output, minimising overcorrection and maximising stability. These three control terms are what forms its acronym: ''Proportional'', ''Integral'', and ''Derivative''.
|| Proportional Term | multiplies the error value by a fixed gain value to determine the corrective value influencing the system output (this value is described as a ''proportional'' to the output). | because a "P-only" controller is using the value of the error to generate its corrective value, it will overshoot its target, then undershoot, with smaller and smaller oscillations until the error approaches zero. Unfortunately, as the output of the system oscillates closer and closer to its target the amount of correction also approaches zero, so the controller never gets there.
|| Integral Term | integrates the error value into the correction over time so that it minimises this overshoot and pushes the output towards the target value. | the amount of integral applied to the formula needs to be carefully tuned, otherwise this can create its own form of oscillation. Given this tuning is quite tricky to get right, there is generally some overshoot and therefore oscillation in a PI controller.
|| Derivative Term | projects the rate of change of the corrective value, and reduces its amount as the system nears the target. This allows the controller to move towards its Set Point as fast as possible, with as little oscillation as possible. | the Derivative Term is intended to smooth the operation of a PI Controller, but the value of the Derivative must also be tuned.
At line 20 changed one line
A __Proportional term __ multiplies the error value by a fixed proportional gain value to determine the corrective value influencing the system output. Because a controller using only a proportional term is using the value of the error to generate its corrective value, it will overshoot its target, then undershoot, with smaller and smaller oscillations until the error approaches zero. Unfortunately, as the oscillation of the system gets closer and closer to its target the amount of correction also approaches zero, so the controller never gets there.
The more I read about PID controllers the more I found that tuning the Integral and Derivative control terms is considered something of a black art. There are a number of constants in the formula, and tweaking them is done by trial and error, in other words: guessing.
At line 22 removed one line
The __ Integral Term__ integrates the error value into the correction over time so that it minimises this overshoot and pushes the output towards the target value. This requires that the amount of integral applied to the formula be carefully tuned, otherwise this can create its own form of oscillation. Given this tuning is quite tricky to get right, there is generally some overshoot and therefore oscillation in a PI controller.
At line 24 changed one line
A __Derivative Term__ projects the rate of change of the corrective value, and reduces its amount as the system nears the target. This allows the controller to move towards its Set Point as fast as possible, with as little oscillation as possible.
!! Slew Rate
At line 26 changed one line
The more I read about PID controllers the more I found that tuning the Integral and Derivative control terms is considered something of a black art. There are a couple of constants in the formula, and tweaking them is done by trial and error, in other words: guessing.
To add another twist to a robot motor controller, as mentioned above we don't want to tell the motors to go from zero to a projected speed immediately, or from full speed to stopping suddenly, as that would both overly stress the motors and drive system, and cause the robot's movements to be very jerky, perhaps even causing it to crash. We want to gradually ''slew'' the value so that it changes at a maximum rate, called a __slew rate__. This is measured in some measure of motor speed per unit of time.
At line 28 changed one line
To add another twist to a robot motor controller, we don't want to tell the motors to go from zero to a projected speed immediately, as that would both overly stress the motors and drive system, and cause the robot's movements to be very jerky. I want to ''slew'' the value so that it changes at a maximum speed, called a __slew rate__.
For example, when experimenting with a motor controller written in [Python], the motor speed is set as a value between 0.0 and 1.0, where half-speed is 0.5. We might set a slew rate of 0.2 per second, meaning that it would take 5 seconds to go from a stop (0.0) to full speed (1.0).
At line 30 removed one line
All in all, I've now got requirements for a robot motor control that include a proportional term, integral term, derivative term, and a slew rate.
At line 37 added one line
!! Conclusions
At line 39 added one line
All in all, we've now got requirements for a robot motor control that includes a Proportional Term, Integral Term, Derivative Term, and a Slew Rate.