In-Depth Understanding of PID Control
PID (Proportional, Integral, Derivative) is a classic control algorithm responsible for calculating the Error. Error is the distance between the robot's current position (Process Variable) and the ideal center line (Setpoint).
PProportional (Current Reaction)
Kp directly multiplies the Error value. Think of it like a spring. The further the robot deviates from the center line, the stronger the spring (Kp) pulls it back.
- If Kp is too low: The robot responds sluggishly and will overshoot sharp turns.
- If Kp is too high: The robot is pulled back so forcefully that it crosses the center line again (Overshoot), resulting in jittery, zig-zag movements.
DDerivative (Future Prediction)
Kd reads the "rate of change of error" (the difference between the current error and the previous error). The best analogy is a Shock Absorber on a car.
- Primary Function: When the robot moves rapidly toward the center line due to Kp's pull, Kd detects this fast movement and acts as a "BRAKE" so the robot lands smoothly in the center without overshooting.
- Usage: In fast line follower robots, the PD combination is crucial for navigating sharp corners (like a square track) smoothly.
IIntegral (Past Accumulation)
Ki sums up all errors over time. Why is this needed? Suppose one of your robot's motors is slightly worn out (or there's a heavy load on one side). P and D alone might not be strong enough to pull the robot to the absolute center (leaving a constant 1-2 cm error).
Over time, Ki will accumulate this small residual error. Eventually, the value becomes large enough to force the robot precisely to the center. Namun, dalam robot cepat, Ki sering diset ke 0 karena rawan menyebabkan osilasi liar.