Main Content

This project is about implementing a short and relatively easy Arduino sketch to provide XYZ inverse kinematic positioning. I had built a 6 servo robotic arm but when it came to finding software to run it, there wasn’t much out there except for custom programs running on custom servo shields like the SSC-32(U) or other programs and apps that were complicated to install and communicate with the arm. Then I found Oleg Mazurov’s most excellent “Robotic Arm Inverse Kinematics on Arduino” where he implemented inverse kinematics in a simple Arduino sketch.
I made two modifications to adapt his code:
1. I used the VarSpeedServo library in place of his custom servo shield library because I could then control the speed of the servos and I wouldn’t have to use the servo shield he used. For any one considering running the code provided here I most insistently and emphatically recommend that you use this VarSpeedServo library,rather than the servo.h library, so that you can slow down your robotic arm movement during development or you may find that the arm will unexpectedly poke you in the face or worse because it will be moving at full servo speed.
2. I use a simple sensor/servo shield to connect the servos to the Arduino Uno but it requires no special servo library as it just uses the Arduino’s pins. It only costs a few bucks but it is not required. It makes for a nice clean connection of the servos to the Arduino. And I will never go back to hardwiring servos to the Arduino Uno now. If you use this sensor/servo shield you need to make one minor modification that I will outline below.”

Link to article