top of page

Drawing Arm

I worked with a partner to build and program a 2 DOF arm that can trace the shape of a heart. A servo motor is mounted at each joint, an LED is located at the tip of the arm, and the arm is controlled by an ESP32. The LED flashes at each position along the trace.

 

The arm is programmed to move to 15 predetermined (x,y) positions, found using Desmos, that form the shape of a heart. I implemented inverse kinematics to find the angle at which each joint should be positioned to reach each (x,y) value, given each arm length. I initially tested a script that could tell me whether the (x,y) values I picked were reachable by the arm. Values were either reachable, out of range, or needed to be clamped due to the servo motor range of 180°. The main script utilizes the finalized (x,y) values deemed reachable. The initial inverse kinematics code can be accessed here.​​​

​

My partner and I created a servo controller script to run the motors at an appropriate duty cycle to reach the predetermined points. When the motors were not cycling through the points, they were programmed to keep the arm at its “home” position- extended completely straight and vertical. The next script created controlled the behavior of the LED. A series of LED states were defined and utilized in the main script to make the LED flash on whenever the robotic arm reached and paused at a trace point. The servo controller and inverse kinematics scripts were also integrated into the main script to give the robot arm all of its necessary functionality. The final scripts can be accessed here.

Main Micropython Skills Used:
  1. Defining classes 

  2. Performing operations on lists, arrays

  3. Debugging and error analysis

​For part 1 of the project, I designed DC motor holders (not used for final project), while my teammate Calum designed the arm in SolidWorks. The arm could be screwed onto the top of the motor holder. For the coding portion, I designed the inverse kinematics script to convert (x,y) coordinates of a heart to theta values for the joints of the arm. Calum worked on the main code to communicate with the servo motors and turn on/off the LED. We both worked on integrating our codes and troubleshooting the servo offsets. 

IMG_6359.HEIC
bottom of page