Serial PID Control


I have connected my 3pi robot via serial and have uploaded the serial 3pi slave program to it. I am able to control the 3pi using the computer keypad (courtesy of Geoff) without any issues. The problem is that in PID mode: the right motor is just constantly on, the left does not move, nor does the motor speed change in accordance to line position. I get the same effect when I use the Pololu serial transmitter program to transmit the same code, so it is not a problem with my code, it must just be the settings I am using for the PID.

Here are the 6 bytes I am sending using the Pololu serial transmitter in the 6-byte command mode:

  0xBB 0x1e 0x1 0x14 0x3 0x2

Has anyone else experienced this problem before, would greatly appreciate any tips :slight_smile:




Are you actually placing your robot on a line, and are you calibrating the sensors for that line? What readings are you getting from the line sensors. Remember that the PID is producing motor speeds based on the outputs of the line sensors (modified by a set of constants), so if the motor outputs aren’t making sense, one of the first things to check is whether your inputs make sense. If you put our example line-following code on the 3pi and run it, does it follow the line?

- Ben

Hi Ben,

Thanks for your pointers. The mistake I was making is that I wasn’t calibrating the sensors before I entered the PID values. Works sweet now, I can now change from manual control to line following mode over the serial link.

Thanks again!