We have been working on a PID control loop for our arm. We use a Rev Through Bore Encoder, with the Absolute Encoder Adapter and a Spark MAX motor controller. We’ve had great success when the contraption works, however, we have had 2-3 occasions where the encoder may have been loose or disconnected and it led to the arm “flailing” and trying to rotate. We were wondering if there are any checks we could implement to mitigate the risks. We try to check that it is plugged in before every run, but sometimes it loosens unexpectedly.
Are there any code solutions to verify that the encoder is connected or to run any checks on the encoder such that it doesn’t ruin the arm? Should we try to solder the encoder for additional wire security?
Some people use the absolute encoder only to calibrate the relative encoder on startup. Not only should it flail less if it fails, but it may be more precise. That won’t stop your arm from trying to move out of bounds, of course. To fix that, you can may be able to detect a hard stop as high current with no motion.
Making sure you have enough slack in your cabling from the spark max to the encoder
I would either put tape over the absolute encoder adapter around the spark max or
Hot glue the edges of the connector to the spark max body. Also put a dab of hot glue ontop of the connector so the connector doesn’t come out
Make sure to put enough hot glue that nothing will come apart but enough that if you need to replace something, you can scrap the hot glue off without damaging anything
I’m not a big fan of zip tying the connector cause the zip tie goes over the female connector (which is at the end of the board) instead of the center of the board to more securely have connected
Yeah, but I’ve never had an issue with damaging the connector because of the zip tie.
Maybe REV can do another revision of the adapter boards to move the connector a bit.
In 2023, our software team implemented multiple checks to protect the mechanically and electrically complex robot arm from fault or hazardous conditions. They are described in this post under the heading “Avoiding Arm Self-Destruction”. This feature kicked in to prevent damage on multiple occasions. Our through bore encoders were wired directly to the Rio, but the general approach is applicable regardless.