Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

PID control is a way for a robot to correct its motion by constantly comparing where it is to where it should be. In a wheeled robot driving toward a target line, the controller uses the error between the desired path and the actual path to decide how strongly to steer or adjust motor power. This matters because real robots slip, drift, and respond with delays, so they need feedback rather than a fixed command.

A visual PID diagram makes it easier to see why different control terms can cause overshoot, remove bias, or smooth motion.

Key Facts

  • Error is the difference between the target value and the measured value: e = setpoint - measurement.
  • PID control law: u = Kp*e + Ki*integral(e) + Kd*de/dt.
  • The proportional term Kp*e gives a correction that grows as the robot gets farther from the desired path.
  • The integral term Ki*integral(e) adds up past error to remove steady-state error caused by bias or friction.
  • The derivative term Kd*de/dt reacts to how fast the error is changing and helps damp overshoot.
  • Too much gain can make a robot oscillate, while too little gain can make it slow or unable to reach the target accurately.

Vocabulary

Setpoint
The desired value the controller is trying to reach, such as the target line or desired path.
Error
The difference between the setpoint and the robot's measured position, speed, or direction.
Proportional control
A control action that makes the correction directly proportional to the current error.
Integral control
A control action that corrects for accumulated past error so the system can eliminate steady offset.
Derivative control
A control action that responds to the rate of change of error to reduce overshoot and oscillation.

Common Mistakes to Avoid

  • Using only a large Kp to make the robot respond faster is wrong because too much proportional gain can make the robot overshoot the path and oscillate.
  • Forgetting the sign of the error is wrong because reversing e = setpoint - measurement can make the robot steer away from the target instead of toward it.
  • Adding too much integral gain is wrong because accumulated error can build up and cause a large delayed correction called integral windup.
  • Treating derivative control as a cure for all noise is wrong because derivative action can amplify noisy sensor readings unless the measurement is filtered.

Practice Questions

  1. 1 A robot is 0.12 m to the right of its desired path, so e = -0.12 m. If Kp = 4.0, Ki = 0, and Kd = 0, what is the control output u?
  2. 2 For a PID controller, let e = 0.20, integral(e) = 1.50, de/dt = -0.40, Kp = 3.0, Ki = 0.8, and Kd = 0.5. Calculate u = Kp*e + Ki*integral(e) + Kd*de/dt.
  3. 3 A robot using P control reaches the target line but repeatedly overshoots left and right. Explain which PID term could help reduce the oscillation and why.