The goal of this assignment was to design a robotic arm that could sense and record how it was being moved in the x and y direction and then repeat the same motions on its own with a marker on a 8.5x11 sheet of paper.
Our robotic arm, Larry, is a two-linkage robotic arm with an end effector that is an Expo marker. Larry’s base contains the EV3 brain and three overturned wheels for support. The actual arm utilizes two large motors for sensing and controlling the angle of each link. The Expo marker at the end of the arm is controlled by a medium motor.
The minimum and maximum positions of the robotic arm are shown in the video below.
Larry's end effector works by rotating the medium motor 90 degrees in either direction to engage or disengage with the writing surface. It engages before playing back the recorded motion and disengages immediately afterwards. The end effector is attached to the motor by a gear coupled to the rotating axle of the motor. It is connected to the Expo marker by LEGOs held in tension and two rubber LEGO stoppers.
For Challenge 2, we implemented the equations discussed in class to calculate the position of a two-bar linkage. To do so, we needed to find the lengths of the links and convert from units of LEGO studs to inches. We then created empty arrays to store the values of the positions (3 total for our initial code and 500 for the continuous recording). We then iterated over these arrays using a loop. Within each cycle of the loop, we read the angles from the motors' sensors, calculated the Cartesian position of the marker, and then added all the results to the associated arrays at the proper index. After running the loop over the full length of the arrays, we had a complete recording of the marker's position and the angles necessary to trace it.
We confirmed the accuracy of our system by engaging the end effector before recording the position. When we then played it back, it was easy to see if the output matched the input by comparing the two paths.
Challenge 3 took the information gained in step 2 to mimic the motions inputted by the user. We made an array that we stored location data inside and created a variable that would move through the array as time progressed. At first the array was only 3 long but we later modified it to be much larger so that we could continuously record position and angle information so that the arm could move more smoothly.
Playback of 3 points:
Continuous recording and playback:
This is essentially the same code, but with larger arrays and less wait time to compensate the greater number of points desired. Additionally, the interface instructions are slightly different.