Wednesday, 1 July 2015

My Robotic EPQ

My extended project was to create an Artificial Intelligence robot claw, to the stage where it can move, grab and be controlled by an application over Bluetooth. When I started the project I thought I could build the robot which would have a tank and a claw together so it could move about a room and perform all the functions of a claw. However, when I got advice from my supervisor and robot construction consultant, I changed my plans to make it more realistic in the time period that I had.

I believe that it was a relevant and interesting project because it allowed me to use most of my creativity and my interest in electronics and programming; also, it allowed me to learn new things, such as creating an app, how microchips work, and also a new programming language C++. So in the end I learned a vast of amount of information, which I believe was good for extended projects because there was so much potential for progression and planning to reach the goal of the project. 

The goal of the project was to create an Artificial Intelligence robot claw. So at the beginning I went about this in three stages.
• Planning
• Research
• Development/ testing

 The planning stage was mainly looking at what I will be doing and then how much time I will be spending on the other stages to see if I was going to finish the robot on time. This was very straight forward and I will need to do research, so it should take me roughly 3 months. I thing that I had planned was I was going to do research test it out then do more research, so a bit like trial and error.

Research was split in several parts.
 • Learning C++
 • how the Arduino works with h-bridges or a shield
• How to build an app
• How to create a PCB from scratch
(Figure 1, Screenshot of Arduino website)
I went ahead and looked at how the Arduino board would work and how I can use it to control motors. The most straight forward way was by using an h-bridge; however, that only allowed me to use up to 2 motors per chip.

Another method I could have used and did in the end was with a motor shield as that allowed me to control up to 4 motors.

The final option I had was to make my own circuit board.

Fig 2.1 Arduino with H-Bridge on breadboard
Fig  2.2 Arduino motor shield

Fig , 2.3 my own circuit board

Because I was dealing with circuitry, I had to make schematics for the H-bridge chip and also how it all connects to the Arduino. 

Fig 3.1, 3.2, 3.3, my schematics drawings

During the research stage, I visited loads of websites to help me understand what I was doing. I also looked online to see if people have done similar project to what I was hoping to do. From what I found out, a couple of people had done similar projects to what I was doing, but neither used more than four motors if they used the motor shield and when they did use more than four motors  they used breadboards. For me, breadboards were good for designing and testing but for the end product a circuit board would be neater, and would reduce the risk of untidy wires or short circuits.

Here are some of the websites I visited during my research;

Fig 4.1, 4.2, 4.3, 4.4, screenshots form some of the websites I used

As well as understanding what I had to do, I had to also research how to do it. Once I had done all of the research, I could move on to the development work. Development work was a little more straightforward as all the ideas and how to do it was written during the planning stage of the project, so at the beginning I mostly concentrated on creating the robot and making it work with the Arduino attached to breadboards.

I started by assembling a bought robotic arm, then got rid of the circuit board that came with it to insert my own, which would be more efficient as then I could control it with a wireless adapter and not via the cable that came with the original circuit board.

Fig 5, the robotic arm

I then had to connect the Arduino to breadboards, which then would be connected to the motors of the robot. As well of just connecting the wires I had to program the Arduino for then I could send out the signals through the pins, allowing the h-bridge to set the each motor wire to high or low.

The coding side was not too hard as I’m a programmer; however I had to learn a new language so it was a bit different to the previous language I was used to. I programed the Arduino in C++ in the Arduino development software. The simplest way of explaining what I’m doing it the code says what I want it to do and the Arduino does it.

 Fig 6.1 Arduino attached to breadboard, 
Fig 6.2 Code for the Arduino

Once I had the code working with the Arduino and controlling the robot, I moved on to creating an app and installing the Bluetooth module to the Arduino.

To create the app I used app inventor which is simple to use. I did some of their tutorials at first and once I understood how all the components work, I made my own app. What my app had to do was send the same signals that my computer did when it was connected to the Arduino. Once my app worked, I had to connect the Bluetooth module to the Arduino that was simple as it was four wires involved, Ground, 5V, and two signal wire. Once everything was connected I had to test it.

Fig 7.1, Screenshot of App inventor
 7.2 Screenshot of the video showing the App working with the robot

      Once all of that was working, I made a custom circuit board; however it was not as efficient as I wanted, so with my supervisors we decided to use a motor shield instead. The disadvantage of using the motor shield was that it could only hold up to 4 motors and I needed to be able to control up to 6 motors.

So I started by re-writing the code for the Arduino and made sure that the shield worked with four of the motors. Once it did that’s where I had to decide. I had a choice of two options.

1.       I hacked the Arduino board for then I can accept another shield with it in parallel but that meant understanding how a 74HCT595 latch work, and re-writing the code for the microcontroller chip.
2.       Modify the motor shield for then I can add a custom circuit board to it.

After some thought and research, I found that I would be easier to just add my own custom board to it. So I had to make some new schematics, as my previous board was two big. So I used the same circuitry as my previous board but made it smaller. To do so I had to hand wire each components together.
Fig 8.1 soldering the board

8.2 modifying the motor shield

Once I had the Arduino shield working with the circuit that I made I had to put everything together. To start off with I laser cut a base to put on the robot for then it can hold everything. I then neatly tucked all of the wires into the robot and then made them come out just behind the Arduino. I then hot glued the Arduino and my circuit board to the laser cut base. I also added a switch to the battery pack for then I can turn on and off the circuitry. I tried and tuck in as much wire for then it had an appealing look to the final design.

Fig 9 Final Robot Look

By Aymeric Bouyer


No comments:

Post a Comment