Hi everyone! I've been a long-time lurker, but here is my 1st post as I've had difficulty finding a thread discussing a similar problem to the one I have been running into. I have built a tensegrity robot that requires 24 motors (Pololu #4753) to control, which are connected to 12 Roboclaw 2x7A motor controllers. These motor controllers are connected to an Arduino Due using the Hardware Serial ports. Currently, 8 of these motor controllers are connected to Serial 1, and the remaining are connected to Serial 2.
The problem I am running into is that when I try to read the speed or position from the motors, only a value of 0 is returned. After checking my code, my first thought was that it may be a hardware issue. I tested the code using spare components not mounted on the robot, and it worked!
Going back to the robot, I checked all the wiring, and everything looked good. This was also supported by the fact that I could send position commands to each motor, and they behaved as expected, though I still got a value of 0 when trying to call values from the encoder to the Arduino. This led me to wonder if the number of components was causing issues. When I disconnected all but one Roboclaw controller and ran the code, I was finally able to read the encoder values from the robot.
My attempt to fix this was to add an external power source to the Arduino in the form of a 9V battery connected using the barrel jack, with the reasoning that the power drawn by all the connected components was greater than what the USB could provide. That did not change anything.
I was wondering if anyone had any suggestions on what I could try next? When I look online, I suspect it may be how I have the motor controllers connected to the Hardware Serial and ground. I have all the motor controllers connected to a screw terminal block, which then has a set of wires connected to the Serial Ports. Is this appropriate, or do I need something like an I/O expanded? I am unsure since the motor controllers seem to be properly receiving commands from the Arduino.
I appreciate any advice anyone might have.