Introduction: Robotic Arm Controller

We were given a project that consist in make a controller for ELISAVA robotic arm. Our first idea was using a PS2 DualShock controller for moving between sections of this robotic arm and rotate it, sadly we weren't able to achieve this goal because the library downloaded to use the PS2 controller in Arduino UNO didn't recognize the controller (the controller was tested on the PS2 device and worked fine (is an original SONY product)), but we did the code so that we could have a probe that indeed it didn't work because of the library.

Originally for the PS2 controller we wanted to use the four buttons it have on the left part of the pad, so we reused that code and adapted it to work for four individual buttons that we later buyed. The project is meant to have an UP button to move upwards on the sections of the robotic arm, a DOWN button to move downwards on those sections, and then a RIGHT and LEFT buttons to rotate the selected section to the left or to the right to the users choice.

Supplies

For the idea of the PS2 controller we used the Arduino UNO and the PS2 DualShock controller because the controller already have the outputs differentiated and with the library that we downloaded, the program could work with them individually. For the alternative we buyed 4 buttons and four resistances of 240 ohms, one for each button, also we buyed 5 LEDs to know in which section the user is, so we buyed 5 more resistances of 240 for the LEDs.

Step 1: Make the Connections for the PS2 Controller

We found a guide to correctly connect the DualShock 2 controller to the Arduino so we wouldn't make a mistake in this part. In the image you can see how it has to be connected. As you can see in the images, the controller has power and it's well connected to the Arduino UNO, we had to use the 3.3V output for Arduino because otherwise we had to buy a 4 ways converter as the Controller only works at 3.3V.

Step 2: Flow Diagram PS2 Controller

Step 3: Code for the PS2 Controller

We made the code of the PS2 controller and should work but the program doesn't recognize the controller, even in the example program the developer of the library includes when you download it, the controller wasn't recognized.

Step 4: Alternative for the DualShock 2

After trying the PS2 controller and see that we couldn't make it work because it won't be recognize by the program, we used a 4 buttons system to emulate the same principle we wanted to get form the PS2 controller.

Step 5: 4 Buttons Controller Flow Diagram

Step 6: Code for the 4 Buttons Controller

The code is fully commentated on how it works. We used an array to go from section to section and move them, so it will take less memory from the Arduino. When you press the UP or DOWN button it moves the selected direction in the array and then the RIGHT and LEFT buttons give the value to the space we are int the array. After that, we copy the values of each space in the array to the predefined names (handed by uatea team) so the program in Processing can read them.

Step 7: Conclusions

After this project we learn that the coding is not the only important thing at programming, there are external failures and wiring problems all along every project, for example the error with the PS2 controller hit us hard because we wanted to implement this controller from our childhood to make a vintage vibe. But it's not in our hands that it worked or not. Besides that we had a lot of problems with the wiring part at the buttons alternative, we don't know why it doesn't work as it should.