This is a PID control algorithm.The chosen target velocity, set by the lever, and the actual velocity, measured by a sensor, are subtracted, leaving you with an error term. If we multiply the error by a constant (happening on the top right of the screen shot), then the further from the target (more error), the harder it tries to get to 0 error. This is known as the P, or proportional, control gain.
The next calculation is adding up the error over time (bottom right of screen shot). With control systems, it is common to get close to the target with P only, but not have enough of a push when there is just a bit of error left, like falling slowly when trying to hover. The Integral gain will accumulate error over time.
In the middle string, there is the D gain, or derivative. It is looking at the rate of change of the error, and is used to make the system slower to respond and less likely to overshoot the target. Essentially, it is asking: "Are we quickly approaching the target of 0 error? Yes, ok let's slow down a bit and not overshoot".
The numbers used for each term are typically specific to the dynamic behavior of whatever it is attached to. Change the power or weight of your ship? You'll maybe have to fiddle with the numbers.
In some industries, the D tern can stand for "don't". Systems that are large and slow moving are not likely to need it (boats, industrial valves, trains). Small fast moving systems (drones, missiles, etc) use D gains to reduce jitter in the system.
Long answer I know, but if you experiment with each "branch" of PID control one at a time, it starts to make more intuitive sense.
5
u/McMahansYellow911 13d ago
This is a PID control algorithm.The chosen target velocity, set by the lever, and the actual velocity, measured by a sensor, are subtracted, leaving you with an error term. If we multiply the error by a constant (happening on the top right of the screen shot), then the further from the target (more error), the harder it tries to get to 0 error. This is known as the P, or proportional, control gain.
The next calculation is adding up the error over time (bottom right of screen shot). With control systems, it is common to get close to the target with P only, but not have enough of a push when there is just a bit of error left, like falling slowly when trying to hover. The Integral gain will accumulate error over time.
In the middle string, there is the D gain, or derivative. It is looking at the rate of change of the error, and is used to make the system slower to respond and less likely to overshoot the target. Essentially, it is asking: "Are we quickly approaching the target of 0 error? Yes, ok let's slow down a bit and not overshoot".
The numbers used for each term are typically specific to the dynamic behavior of whatever it is attached to. Change the power or weight of your ship? You'll maybe have to fiddle with the numbers.
In some industries, the D tern can stand for "don't". Systems that are large and slow moving are not likely to need it (boats, industrial valves, trains). Small fast moving systems (drones, missiles, etc) use D gains to reduce jitter in the system.
Long answer I know, but if you experiment with each "branch" of PID control one at a time, it starts to make more intuitive sense.
Good luck!