System integration
USB hub communication
I was unsure how to connect all the robot joints together for a while. Jake Read shows I2C communication using his OSAP library. It would make for a nicely integrated whole, but the joints that have I2C connections might react more slowly than the one in the base, which would be directly connected to the full-speed USB port. So two weeks before the final presentation I ordered a tiny USB hub from a Swiss company called Yoctopuce. When it arrived I was eager to see if it worked and whether it was able to supply enough current to two motors at the same time. So I took my bike over to Hamraborg, bought a USB-C cable, cut it in half and soldered the wires to connectors that I ordered with the USB hub. And here I am running two BLDC motors from one USB port on my laptop (note that this is a special 3A port with a battery charging logo on it):
Now the whole thing works on a breadboard. Whew!
Power budget
A bit later I realized that I hadn't checked whether that single USB-C port on my laptop could support all the motors and things that I wanted to build into the arm. So I bought another USB-C cable, cut it in half and connected more motors. And here I have three brushless motors and one stepper motor running on one USB-C port at the same time:
Instead of the stepper motor I'll actually be using a tiny DC motor as a Z-axis, and I also need to power an end effector.
Assembling a robot joint
The night before my final project presentation, I assembled one robot joint and managed to hide all the wires. Here it is running a PID cascade control loop using the SimpleFOC library:
Phew, it works!
Design file
The motor control code is the same as in Motor Control.