What is PID?
PID stands for Proportional, Integral, and Derivative.
PID is a method of, normally autonomous, control over motors that creates more dynamic movement as compared to the rigid velocity/voltage control students are likely used to.
Why and When should you use PID?
PID is more accurate than regular coding when it comes to fast movement. This can be useful for robots given the limited time of autonomous periods.
How does PID work?
PID takes information from either the Motor encoder (data coming from the smart motors), a rotational sensor, or both and applies different values to that number in order to dynamically change the speed of the motor as it approaches the specified goal.

Comparison between PID and traditional motor control methods
What does coding with PID look like?
It wouldn't be in the spirit of VEX to show a full coding example, but pseudocode is fine! The most important part of PID coding is the equation that makes it all possible.

The fundamental PID equation
PID Implementation Steps
Setup Phase
- Reset motor position to 0
- Set motor velocity to 0
- Spin motor forward
- Set Previous_error to 0
- Set all variables used in code to 0
Main Control Loop
How do you find the PID constants?
You need to adjust the PID constants Kp, Ki, and Kd for every different system of your robot you are using PID Control on.
Adjust Kp (Proportional)
First, adjust Kp until it just barely overshoots the target.
Adjust Kd (Derivative)
From there, adjust Kd until it slows down just before the goal.
Adjust Ki (Integral)
Finally, Ki can be adjusted until your robot reaches the goal as quickly as possible without over or undershoot.
⚠️ Important Note
If Kd is too high, you will see fast jitter as the motor moves towards the goal.