The initial CAD model of the arm.
For a Robotics class at Tufts, I built a writing robot arm with 2 teammates. We decided to build an out-of-plane arm as an extra challenge, which has additional degrees of freedom and can lift the pen off the writing surface. Our design used a high-torque servo at the base to rotate around the vertical axis, two servos to maneuver the arm, and an additional servo to rotate the pen. With two weeks to design and build the robot, we got to work creating a 3D model of our design. I designed lightweight, laser-cut arms with cutouts for motor mounting, while my groupmates designed the 3D printed motor mounts, the base, and the pen holder.
Mapping the setpoints for the pen.
In the second week of the project, I started work on the software. Our goal was for the robot to be able to write each of our groupmates' initials, so I began by creating SVG files of our names. I then sampled these vector-font files at discrete points, which we would command the robot to move to. Since there are areas that require the robot to lift the pen (e.g. moving between letters), I wrote an algorithm which found "lift locations" and interpolated trajectories for the pen to follow while it was off the page. The full setpoint trajectory can be seen in the video, with pen lifts shown in red.
Once I had a set of target points for the pen, I moved on to calculating the inverse kinematics for the robot. Inverse kinematics is a way of calculating the angles that the robot's motors should move to in order to move the tip of the pen to a given position. To achieve this, I used a Python library called ikpy which allowed me to create a full model of the robot's geometry, including the length of each link and the rotational axis of each motor. I then used this model to calculate the state of the robot arm for each of the discrete setpoints in our initials. To check that the calculated motor angles would actually write our initials, I created an animation of the robot arm in Matplotlib.
An animation of the robot arm following the trajectory to write "AHB".
After verifying that the inverse kinematics were correct, I wrote software that would control the motors in the arms and move them to the correct angles. We used the PCA9685 servo HAT to send positions to the four motors from a Raspberry Pi. View the code on GitHub here.
With the software complete, we assembled all the hardware for the arm, callibrated each of the motors, and integrated our electronics. After some testing, the arm successfully wrote each of our intials!
The final robot writing my intials.