Retrofit - FANUC Robot arm
Previously mentioned in this blog post, my LR Mate 200 il Fanuc arm is now in the process of being retrofitted to be ran with modern electronics and controls, in parallel with a LiDAR and camera system.
I am motivated by the prospects of automation in industry, and also because robots are fun to play with.
Most robots are too large to easily be moved and demo’d, or aren’t industrially relevant due to their size. The LR Mate is still “portable” by a single person in a regular car or cargo bike, and if I integrate the control electronics into the arm and its base, small enough even for the most space restricted setups.
Utilizing LiDARs and modern cameras also enables real “seeing” robots as opposed to the classical “blind” robotics that has been the status quo for decades.
As a reminder, here is the datasheet:
After getting very familiar with open loop steppers, and building Arctos a plastic 3D printed stepper driven arm which I had mixed feelings about, I wanted to try servos with a closed loop and FOC.
Unfortunately, a lot of conversation about diy robotics has moved onto unsearchable “dark” web (discord channels mainly) meaning it can be difficult to get an overview of existing projects that may be of interest, or exploring hardware availability. I hope to collate bellow a collection of robot arm projects, servo motor controllers, and provide basic guidance on the software options to control a multi axis arm.
Motor controller
I selected the ODrive S1 to prototype the arm, and to keep things simple I’m experimenting with their “upgraded” 16384 CPR AMT212B shaft encoder instead of going the cheaper magnetic route. I was happy to see separate mosfets, and a braking resistor, as I did not know if my motors would be thermally limited. I remember when the project used to be open source, but if it works with less hassle than the failed previous times I wanted to control a three phase motor I’ll be happy.
Edit: Adding this after working with ODrives for two axes: The hardware is great, I got the motors spinning in an afternoon, with the encoders, and minimal effort under ubuntu 24 and 26. I believe the user experience of purchasing these drives could be better: everything is an added cost, metal heatsinks, magnets, wiring etc. I ran the motor drivers without heatsinks initially, which overheats my drives. I will be equipping them with a DIY aluminium plate to cool them.
I compared the ODrive with some alternatives like:
- MJBots Moteus C1/R4/N1/X1 - probably the closest to what I wanted
- SimpleFOC - not “commercialized” and but these were more difficult to stack axes, less robust, lower voltage
- VESC but out of budget and overkill
- Tinymovr M5.2 - but limited to 38v
- MIT Mini Cheetah - eaten by others in this list, and I don’t know if I trust aliexpress sellers
- Source robotics spectral - lower voltage
- Some Makerbase aliexpress drivers, but I wanted to help fund further development since my use case is a bit outside of the usual drone motors
There are also some open source projects on hackaday/github, but where the driver felt like the project:
And some interesting similar projects for integrated modules:
There is also the Makerbase MKS XRIVE MINI.
- These are available on Aliexpress, and are a copy of the older OSS ODrive variant 3.6. The MKS XDrive MINI costs about 37eur, and includes a magnet, braking resistor and wiring harnesses.
Overall the ODrive was the closest to being plug and play. My goal is not to become a hardware person, but to focus on the software development, and so far ODrive and the daisychaining of CAN modules, as well as the python library and wider compatibility have been very good.
Comprehensive projects
There is also the excellent ExcessiveOverkill :
I believe this is most likely the best route for future endeavours - he is clearly an expert at what he does and has much more skills in PCB design, electronics and the actual hardware.
ODrive
Once the decision was made, I waited a few months to build some budget and emailed ODrive asking for confirmation if it would likely work.
Disclaimer: When I reached out to ODrive, I asked if there could be a discount code as I am a student, in exchange for the publicity of this post/linkedin/tutorials and sharing with people at my university, which they accepted. No money exchanged hands and I still paid over a thousand euros for all the parts. My opinions were not reviewed by ODrive before posting.
The first motor was wired up for bench testing; for the encoder I used the “compatible” AMT212B directly from ODrive, unfortunately it is more expensive than when purchased from other suppliers and adds a substantial amount of BOM cost. I may try the built in encoder (later edit: this is a dead end) or an external magnetic encoder like the AS5600, MA702 or 14 bit AS5048 (later edit: these work well, but are not “absolute” as easily - also require a housing and are more hassle). Odrive has very nice features like harmonic compensation and anti-cogging.
Using an encoder with the ODrive directly also closes the loop and avoids time sensitive high speed calculations being done by whatever computer I place in the loop which, for a dummy like myself, is a major pitfall I am trying to avoid.
Assembly of all the parts is greatly simplified by having the right tools. Over the years, I’ve acquired a lot of crimping “sets” as well as some tools of varying quality, but that did not prevent the absolute headache that is JST crimp connectors. This is a useful explanation of JST connectors from IOT Expert and another useful page on common crimpers from Matt Millman.
Once all assembled and wired for a single ODrive using a USB isolator and following the Getting Started guide, the motor spins!
Software control
For software control there are multiple avenues. The one I am most familiar with, before doing any research, is ROS2, and I wanted good 3D visualizations in something like Foxglove which I have also used before. LinuxCNC is also an option for executing G-Code and appears to have some 6 axis robot arm support.
In the current configuration, commands are sent over CAN to the motors.
Foxglove is an excellent method for visualizing from ROS, although they moved away from being opensource/free. EDIT: I am now using RViz and experimenting with Rerun. ROS also has some tutorials for 6 axis robotcs:
- 6 Axis robot in ROS
- ROS in Foxglove Studio
- Moveit, a comprehensive platform for this kind of robotics
- There also exists a ROS2 controller for ODrive
- And a Python robotics controller
Before starting I had also learned that Reprapfirmware has inverse kinematics for 6 axis arms, although this seemed like a less well supported direction to head in:
There is also the excellent Robot Academy
And here is a list of other people with similar projects that may be of interest:
Kinematics
Something I did not realize before starting this process was that the inverse kinematics, and monitoring for self colisions, would be a topic that has a closed form solution, and that is already available.
For this arm, I am using Moveit2
Getting to the interesting bits
Robotics hardware is a “solved” problem insofar as robotics have been able to hit <0.1mm accuracy repeatibly for quite some time, on the condition you have the budget. Current challenges lay in the software side, and this is recognized as what is driving future robotics use. Consortiums such as the ARM institute have some interesting projects. Robots, like nearly all CNC machines, have also always been “blind” to their environment. I consider this a major exploration direction for this project.
For basic control I run CANbus, and am aiming to work with an intermediary running ROS and Moveit, to separate my laptop from the direct arm control. Data goes CAN <-> MCU <-> Linux.
To achieve co-ordinated movement I will use:
- MoveIt 2 as mentioned before as a motion planner/IK motor that can be used with ROS
- ROS2 with a URDF of the LR Mate 200iL
- A VLA to output end-effector delta pose commands (some seem to also do velocity and rotations - my starting point here is roboneuron/openvla)
Some general notes from prior research: Technologies that are relevant for manufacturing; Many more in the MultiRobot MultiMachine Interoperability PDF:
- MTConnect, it can interface with ROS-Industrial
- OPC Unified Architecture: open62541, opcua_ros2_bridge, ros2-opcua
- Modbus TCP/RTU for simpler and older or more versatile CNCs
- Exposing ROS over network with rosbridge_suite or MQTT bridging
Machine tending in ROS seems to lack a lot of public sources.
- https://github.com/mehmet-engineer/ROS_Machine_Tending
Moving the arm
Once I had tested the ODrive S1 with the on axis encoder, as well as the built-in magnetic encoder of the two drivers I bought, I placed them into the arm for some tests, as I do not have the budget at the time of writing to purchase all the controllers required for all the axis.
These movements are as far as I have gotten as of end of Sept - a fully equipped arm would still require another +/- 1000eur!