by gh9st » Mon Apr 25, 2022 11:10 am
Thanks for your response. I have been having issues using 2 MDDS30 at the same time using 2 CP2102 USB to ttl converters. I am using the Pyserial library for python, and at first was using packet serial mode, but got tired of trying to figure it out and now I am having a hard time getting serial simplified to work right. The devices only receive the first command that is written to the serial port. This is my first time using UART for communications on a pi, so I am new to serial in python. When I get back to my shop I will share my code, but if someone could tell me how to send the packets, I would appreciate it. Im using 2 MDDS30 with 4 motors, and have mapped my mecanum drive speed control to 0-63, and back motor controllers are ttyUSB0, front ones are ttyUSB1, direction is passed as 0 for reverse and 1 for forward, speed is converted to binary, filled with zeros until the length is 5 bits, and then converted to string, and then my packet is concatenated, then encoded to bytes. Output written to serial is b'0110000 for front right motor at 0 speed, and b'01111111 for speed at 63. Any quick ideas on what im not grasping?
I got the controllers working great using:
Adafruit servo hat, connected to RC pins, and using the continuous servo library to set the throttle (-1 to 1). This works great, but I wanted to see if serial was more efficient, as my joystick inputs are sent over MQTT remotely. Now, I haven't really got lag, but I also havent added anything else but the motor controllers and servo hat on the PI. I also think I am not getting full speed output this way.