For our final project, we wanted to do something robotics because we thought it would be cool. Originally, we planned to build a robotic pet dog but it was deemed to be mechanically too hard. So we undertook a robotic arm project instead. Since a project on robotic arm was done last year, we wanted to take a different approach. Our project plan was to be able to train the arm to do something and have it repeat the movement automatically. The movement was also to be optimized in software so that it tries to use best path possible between two points.
Operation mode
There are three modes of operation that we provide:
Normal mode: the arm can be controlled manually to any position desired.
Training mode: the arm can also be controlled manually as desired except the movements that you make will be recorded and optimized for playback. This mode is obtained by a push-pull button.
Playback mode: the arm will automatically move from one point to another with the data obtained from the previous training session. If no training was done, the arm will not move. While the arm is in this mode, change of mode is blocked and prohibited.
Interaction with the arm
The manual control of the arm is provided by the control box that came with the arm except that the connections from the control box go through the microcontroller which controls the outputs to a series of switches that turn on/off /switch direction of the arm’s gear motors. The mode of operation is provided by a push-pull button and a push button. When the push-pull button is off and the push button is not pressed, the arm is in normal mode. When the push-pull button is on, the arm is in training mode and when the push button is pressed, the arm is in playback mode. The arm automatically reverts to normal mode after it has finished executing the trained motion.
Sensors input
Wrist photosensor
We wanted to take a different approach in sensing the robot arm’s environment to last year’s project, so we originally planned to use hall-effect sensors to detect arm’s movement. These hall-effect sensors seemed ideal in that no mechanical connection between the sensors and the magnet are required, hence it should give pretty high accuracy and robustness. But, we encountered a lot of problems such as small distance range of detection and difficult to implement a rotational movement detection scheme. After two weeks of perseverance to no avail we finally gave up and decided to look for something else to use.
We found the potentiometer scheme to be pretty robust in detecting angled movement from shoulder, elbow and gripper and phototransistor sensors to be ideal in detecting rotational movement from the base and wrist.
Software design
We divided our program into several tasks:
void scan (void) – This task scans the input from the manual control box and record the buttons and the directions that were pressed. The operation mode is also determined by this function from the input buttons.
void output (void) – This task outputs to the reed relay switches that control the gear motors to make appropriate arm movement.
int performConversion(int) – This task converts the input voltage from the selected potentiometer and return the digital value.
void record(void) – This task records the motion sensors input while in training mode. This means recording the initial voltage reading (by calling performConversion) for gripper, elbow and shoulder sensors and counting pulses detected by the phototransistors for wrist and base.
void recordFinal(void) –This task records the final voltage readings for gripper, elbow and shoulder sensors at the point when the mode returns from training mode to normal mode.
void play(void) – This task playback the data in the most recent training session. It blocks access to other mode until the movements have finished executing.
The main loop continually calls the scan function at a predefined interval. It then checks what mode it is in. If it is in normal mode, it just output to the motor whatever input was scanned in by calling the output function. If it is in training mode, it also additionally calls the record function to track the movement. The recordFinal function is also called when it detects a change in mode from training to normal. Lastly, if it is in replay mode, it playbacks the movement by calling the play function.