How To Make Motors In Romi Chassis Spin In Same Direction


I purchased a Romi chassis and hope to run it from my Beaglebone Blue controller, as shown in the photo below. This post is about how to operate the motors so that the wheels spin in the same direction. Power to the motors is shown in the photo below: there are 4 plugs on the Beaglebone Blue which are 2 pin, 1.5mm pitch, JST ZH connectors. In my implementation, these power wires are running to the “M1” and “M2” pins on a “Magnetic Encoder Pair Kit for Mini Plastic Gearmotors”, product #1523. In each case, the red wire goes to M1, and the black wire goes to M2.

The Beaglebone Blue controller is connected to my home network by wifi. The Beaglebone runs the latest available “IoT” image and the software is fully up to date. I am able to log in to the Beaglebone over ssh. When I run the command 'rc_test_motors", the wheels spin just fine, but one spins forward and the other spins in reverse.

How do I get each wheel to spin in the same direction? Is this a matter of learning the control software that came with the “IoT” linux distribution? Or should I reverse the connections on one of the M1/M2 pins for one motor?

Note that I can’t simply reverse a plug at the controller end: it won’t fit properly into the JST ZH housing, since the housing and plug are keyed.

Thanks a ton!


This shows the motor connectors. I discuss the miswired encoder connections in a separate post so please ignore that.

This shows how I wired the encoders:

Hello, Bob.

If one of your motors is spinning in the wrong direction, you can correct this by switching the wires connecting to the motor terminals (e.g. the wires coming from the M1 and M2 pins on the magnetic encoder board). As you mentioned, your connector is keyed, so you cannot simply turn it around, but you might consider swapping the wires on the encoder board, so the black wire goes to M1 and the red wire goes to M2.

Alternatively, it should be possible to account for this in your program. However, I am unfamiliar with the IoT image for the BeagleBone boards, so I do not have any specific advice for doing that.

By the way, the soldering on some of the pins on your encoder boards looks a bit suspect (particularly the one on the right). You might consider touching up the joints to make sure you have a good electrical connection.