IMAG0048This past week, I have taken on the job of putting together and programming the media center’s very own Makebot robot. Last Thursday was the first day that I could get the robot to function on its own and even now there are still tons of tricks and codes that I have yet to learn and/or discover. At times the process was frustrating and there were many moments where I felt there was no where else to go with it. Then, out of no where, there would be a breakthrough. However, it all started with actually building the robot.

Building the Robot

This is by far the easiest part of the process. It took my fellow student assistant Bedrudin Becirovic and myself only an hour to fully assemble the robot. It also helped that the robot came with a manual that had step-by-step instruction on how to put it together. RadioShack, however, neglected to include a manual about the next step.

Programming the Robot

At first, we assumed that as soon as we plugged in the robot it would be already programmed for us to control over Bluetooth, since that’s what the box said it would do. Arduino1 However, when we tried to set up the app that the manual recommended us to download, we found that the only thing we could control was the little buzzer on the command module that would go off every time we connect to the robot. We tried seeing if the manual could help us but it could not. It did, however, point us to the Makebot website, where there would be additional help and instructions. After a few hours of searching and browsing, we finally came upon some websites where we could download the necessary programming for the robot. We also had to download the Arduino programming software.

After downloading and re-filing everything where it should be on the computer, we were able to upload the example programming into the robot. Our next step was to learn how to program the robot to do exactly what we wanted it to. I continued to research and learn the programming language, C+, that was required to give commands to the robot. What I learned was that before you even give the commands to the robot, you have to tell it what it will be capable of doing. In the beginning, I tried to just give it commands such as, Motor_1.run, which would hypothetically make the first motor run. However, nothing happened and the Arduino software told me there was an error. It turned out that I was supposed to first declare in the program that the robot could use its motor and add a function that would activate the robot’s capability of using its motor.Arduino3 I did this by putting in MeDCMotor MotorL(M1);, MeDCMotor being the variable type, MotorL being what the variable will be called, and M1 being the motor variable itself. This setup also applied to the ultrasonic sensor for the robot, where I would have to declare that the robot could use the ultrasonic sensor. On top of that, through void setup/loop functions, I had to put in other information so that the robot would know which way to turn the motor to go forward, backward, turn, etc. I also have to setup the different speeds that the robot would go to when reacting to a certain situation, not to mention I had to tell the robot how to react to said situations by putting in “if/else” functions for when it picked things up at certain distances through its ultrasonic sensor.

After figuring out how that all worked, I began playing around with different numbers and parameters that could possibly improve the robot’s independent performance. So far, the robot can roam around the media center on its own. Whenever it comes upon something that it might run into, it stops, backs up, and turns to get around the obstacle. Of course, it still doesn’t do this perfectly and depending on the obstacle, it may not get all the way around it, but it’s a work in progress, and as my knowledge of C+ grows and my experiments bring more information, I hope to eventually be able to let the robot go and not have to worry about it breaking itself.

Controlling the Robot?

Arduino2Since the beginning with the robot, I haven’t went back to try to program it to be controlled by a remote. However, I have learned that there are functions and program files that I can use to set it up. If successful, anyone would be able to control the robot with their phones through Bluetooth. My biggest hope with this development is that we can learn how to get that setup and running before we make the robot smart enough to enslave us.