I have been tinkering around with the sample maze solving code included in the Pololu library, and I am having difficulties increasing the turning speed. My main goal is to make my 3pi run as efficiently as the prototype 3pi in the “Pololu 3pi Maze Solving Robot” video in the 3pi User’s Guide. Every time I increase the turning speed, the robot tends to either record a non-existent turn (such as recording a straight or ‘S’ turn when there is no intersection present) or veer off the track. I have tried tuning the PID constants, modifying the turning delays and speeds, and increasing the base speed, but to no avail. Reading the “Improving the Maze-Solving Code” in the 3pi User’s Guide did not provide me with much insight on this problem either.
I am not a master programmer, so I apologize if I am making some simple mistake. Here is my modified version of the file “turn.c”:
void turn(char dir)
// Turn left.
red_led(HIGH); // Some simple light effects
play("L16 c"); // Some simple sound effects
// Turn right.
green_led(HIGH); // Simple light effects
play("L16 e"); // Simple sound effects
// Turn around.
set_motors(0,0); // Stop the motors while performing sound & light effects
play("L16 O7 a#>a#a#>a# !");
int i = 0;
// Don't do anything!
And here is my modified version of the PID constants in the file “follow-segment.c”:
//int power_difference = proportional/20 + integral/10000 + derivative*3/2; //ORIGINAL
int power_difference = proportional/5 + integral/4000 + derivative*3/2; //MODIFIED
Please note that I am asking for advice only; I am not requesting that someone write the code for me. Any help is greatly appreciated.