Pixy LEGO PID Block

The Pixy PID block allows you to implement a simple PID controller. Proportional Integral Derivative (PID) controllers are commonly used in feedback control systems. There is a feedback controller in your home’s thermostat and your car’s cruise control. The basic idea is you measure, then compare with a setpoint (the “goal”), then calculate how you should act so that the system reaches the goal. For example, your home’s thermostat first measures the temperature, then compares to the desired temperature, then calculates if it should turn on the heater or air conditioner. A PID controller works in the same way, but uses a special equation to calculate the “action” value. All the user needs to do is set the three gain values, one for proportional, one for integral, and one for derivative.

For example, if you wanted your robot to chase a ball, you could use a PID controller to keep your robot facing the ball. Here, the “goal” is to keep the ball in the center of Pixy’s camera image and therefore facing the ball. The “action” is controlling the motors such that the ball is kept in the center of Pixy’s camera image. In other words, the PID controller calculates the velocity of the motors needed to keep the ball in the center of Pixy’s camera image.

There is a good explanation of PID control here.

Parameters