Yesterday when I ran the test program (EasyMotors.js), it worked fine and did exactly as instructed, but today it suddenly is no longer obeying/executing orders.
It starts off but it never pauses on sleep(1), nor does it stop when gpg.stop(); is executed and continues running forever, until I kill the program and exit.
Also, when I give it gpg.forward() command, only one wheel spins.
When I send the gpg.forward() command, initially, both wheels start to spin. In one of my codes I have this:
delay = parseInt(command[command.type].delay);
this.gpg.forward();
if (delay > 0) setTimeout(this.stopVehicle, delay);
Basically, I run a timeout when I’d like for GoPiGo to stop, once forward executes. What I noticed is that when stopVehicle() runs (which only has gpg.stop()), only the left wheels tops, and not the right wheel - the right wheel also runs a lot faster than the left one.
What this is telling me is, when gpg.stop(); runs, (or even if sleep(1) runs), it ignores those commands (at least, the right wheel seems to ignore those commands).
Thanks for the photos. It’s quite obvious (to me) what’s happening. One of the motors has one sensor that is completely bent backwards. It’s those little black thingies that are quite near the spinning disk. Those sensors should be within one or two millimeters of the spinning disk.
Can you bend it back into position? That will be the quickest fix.
If it cannot be bent back, then we will replace the motor.
Great! Thanks for letting us know it’s now back to normal!
Those sensors are what detects how far the motor has driven. It allows for methods like driveCm() which most other Pi-based robots on the market cannot handle.