I’m having difficulties with one of my encoder motors, when I set it to reverse it drives in reverse at full speed and will not stop until power is cut. It’s only happening to one specific motor, I tested this by moving the motor to different ports and the problem follows it.
I suspect the problem is with the motor hardware, as the other 2 encoder motors don’t have an issue even when I move them to the same port.
Does anyone on this forum have any suggestions for debugging this motor?
I have the MegaPi on top of a Raspberry pi running Python3.8.3 and megapi library.
Here’s an example of the code I’m using
Python 3.8.3 (default, Jun 1 2020, 05:31:00)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from megapi import *
Version:3.8.3 (default, Jun 1 2020, 05:31:00)
[GCC 6.3.0 20170516]
>>> bot = MegaPi()
init MegaPi
>>> bot.start()
<megapi_python3.mSerial object at 0x769c1820>
>>> bot.encoderMotorRun(3, 0) <-- No movement, as expected
>>> bot.encoderMotorRun(3, 50) <-- Moves as expected at a slow pace
>>> bot.encoderMotorRun(3, -50) <-- Motor runs full speed in reverse
>>> bot.encoderMotorRun(3, 0) <-- Motor continues to run at full speed