Motoron M2U550 + Raspberry Pi 5

I want to Power a Pololu Micro Metal Gearmotor with the M2U550 Motorcontroller and a Raspberry Pi 5. But im not competent enough to make it work. I tried it with Python and C (final version should be in C), but the Motor didnt move at all. I connected the Motoron to 3.3V (Pin 1) and Ground of the RPi. The Motoron RX Pin is connected to the RPi’s TX Pin (Pin 8) and the TX is connected with the RX Pin (Pin 10). The Power for the Motor comes also from the RPi (I know it shouldn’t but at the moment I dont have an other option) via 5V (Pin 2). Could this be the mistake? The LED’s on the Motoron are on but only on the Side where the pins are that connect to the Pi. The one’s next to the Motor aren’t on.

Does anyone have ideas on how to resolve this problem

Thanks in advance

Hello.

I moved your post to the motor controllers support category.

The 5V supply from your Raspberry Pi is probably not appropriate for powering your motors, especially if you have any other devices connected and power from the RPi. For now, I recommend you disconnect the motors from your system and we can check whether your Motoron is working by watching the indicator LEDs on the board.

Can you post some pictures showing all of your connections and clarify the LED behavior? It sounds like both the yellow and red LED near the logic pins are on solid, which would suggest that your Motoron is trying to enable the motor outputs, but is being prevented by some kind of fault. (There is more information in the “LED feedback” section of the Motoron user’s guide.) Are you able to read the “Error active” and “Status flag” variables, and if you have not already, can you try the relevant examples for the serial Motoron from our Motoron Python library?

- Patrick

Thanks for your fast response

I know that the 5V power supply is not optimal. It is only for testing if the motor is at all working. My motor is a 6V Low Power Motor (Pololu - 50:1 Micro Metal Gearmotor LP 6V with 12 CPR Encoder, Back Connector (encoder works perfect btw)). At the moment there are no other devices connected to de Pi.

The red LED is always turned on but the yellow one is blinkin about every 1s. I tried running the serial_simple_example.py programm of the Motoron library. This programm (my own too) ran without an error but the motor didnt do anything. I read the "LED feedback” section but I cant really conclude anything from this.

The connections are pretty untidy since I use a breadboard and 20cm jumperwires so a picture would not be very helpfull. But I’m pretty confident, that the connections are correct.

To confirm the motors are working, can you temporarily connect the motor leads directly to an appropriate power supply (i.e. test them separately from the Motoron)?

For the Motoron, can you try the serial_careful_example.py program (again, without motors for now)? That program should indicate which error flag is being set.

And I still think seeing some pictures of your system, including close ups of the board and connections, would be useful. If that encourages you to also tidy up the wiring, that would be a great bonus. :wink:

- Patrick

I’m currently not at home so I can’t test the motor by its own, but I will do that, but I ran the serial_careful_example.py and it resultet in a pretty large errormessage:

r1@r1:~/Documents/WRO/Motor/motoron-python $ python serial_careful_example.py
Traceback (most recent call last):
  File "/home/r1/Documents/WRO/Motor/motoron-python/serial_careful_example.py", line 60, in <module>
    while mc.get_motor_driving_flag(): pass
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/r1/Documents/WRO/Motor/motoron-python/motoron.py", line 609, in get_motor_driving_flag
    return bool(self.get_status_flags() & (1 << STATUS_FLAG_MOTOR_DRIVING))
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/r1/Documents/WRO/Motor/motoron-python/motoron.py", line 503, in get_status_flags
    return self.get_var_u16(0, VAR_STATUS_FLAGS)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/r1/Documents/WRO/Motor/motoron-python/motoron.py", line 437, in get_var_u16
    buffer = self.get_variables(motor, offset, 2)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/r1/Documents/WRO/Motor/motoron-python/motoron.py", line 415, in get_variables
    return self._send_command_and_read_response(cmd, length)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/r1/Documents/WRO/Motor/motoron-python/motoron.py", line 1624, in _send_command_and_read_response
    return self._read_response(response_length)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/r1/Documents/WRO/Motor/motoron-python/motoron.py", line 1968, in _read_response
    raise RuntimeError(f"Expected to read {read_length} bytes, got {len(response)}.")
RuntimeError: Expected to read 3 bytes, got 0.

I dont have any idea what it means.

If you really want to see my wiring then I can provide it, but you sould be warned since it is not at all pretty. But I currently have no other option and since it is only for testing and not a permanent thing I dont really care. But it will take a few hours until I’m home.

I just tested the motor and it runs perfectly.


This is the connection to the Motoron. I disconnected the motor and its encoder so its no longer a mess.

Thank you for the picture. Can you also post some close-up pictures showing both sides of your Motoron board?

- Patrick

Yes of course.


Cable color Raspberry Pi 5 Motoron
Red Pin 1 (3.3V) VDD
Brown Pin 6 (Ground) Ground
Green Pin 8 (Tx) Rx
Blue Pin 10 (Rx) Tx

To clarify, can you also remove the Motoron from the breadboard so you can take and post a picture of the bottom side of it?

The error message you posted indicates that there is a communication issue, and we have another version of this product that looks very similar but uses a different control interface, so I want to be certain that you have the correct product before proceeding any further.

- Patrick

Sure.

Thank you for that; I am sure that you have the right board now.

Can you try a loopback test with your Raspberry Pi’s serial pins? Here is a tutorial for that:

If the loopback test fails, then the issue probably has something to do with your Raspberry Pi hardware or how it is set up. If the loopback test works, then that might indicate there is something wrong with your Motoron. In that case, please contact us directly with your order information and a reference to this thread.

- Patrick

Thank you. I actually found the issue. Basicly on the Rpi 5 there is a new uart debug port (between the two HDMI ports), which uses the /dev/serial0 oder /dev/ttyAMA10. For the UART connection via the 40 pin header you have to use /dev/ttyAMA0 and not serial0. If you change that in the serial_sinmple_example.py from the motoron library, it works. Now I just have to figure out how to write own code in C but think that shouldn’t be to hard.

Thanks alot for your help. Maybe I will have more questions in the future. We will see

1 Like

I’m glad to hear that it’s working now! Thank you for letting us know the solution.

- Patrick