I am having some issues with the programming of Lynx Motion Tri-track robot in PBasic which is controlled using a PS2 controller.
The issue I am having is that the robot continuously rolls backwards at a very slow pace when it is turned on, even if there is no input received from the PS2 controller.
I know that the issue is caused by the software and not hardware as I have put a stop command at the start of the code which had solved the issue temporarily, however if I control the robot using the PS2 controller in any way it starts rolling again and doesn’t stop until it is turned off and on again.
Does anyone have an idea what could be causing this? Any suggestions would be appreciated.
I will assume you are using something like the Sabertooth or Roboclaw to control the motors. You will find that not all motors/controllers have their zero point with a pulse width of 1500. Some may be like 1495, others may be something like 1505. So experiment with your code and adjust the zero points until both motors are really stopped. I would try going one direction until you see the motor starting to move, then go back the other way until the motor again starts in the opposite direction and choose a value about half way between.
The PS2 controllers are not always perfect at getting to and staying at the middle value usually 127 or 128. So most of our programs define a dead zone where there is a range of ± values from the center that map to center (or zero) when you convert to signed byte…