First RoboSumo Class 24-01-2018

 

We started the class with a mini challenge (the led blinking challenge). To finish the challenge you should translate the group’s number to a binary number and then put the binary number in the Arduino program and translate the zeros and the ones to light on two different LEDs on the circuit where one represents the ones and the other the zeros. It was my job to convert the our group’s number to binary numbers.

Our group number was 72 so our binary number was as the following:

0001000100100111101101000

The zeros at the beginning and the end were there to delay normally all groups had to do that..

So based on the binary numbers(0 and 1) the LED representer on that number will shine.

robosumo

 

Circuit: 

 

 

Testing:

The testing went as the following; there is a camera that detects the LEDs when they shine. A number is created based on the shining LEDs and the number is then converted to the group number.

Youtube Video:

IMG-20180131-WA0013

This is the code:

capture11

Motor Controlling

As for every week; after the 1 hour lecture every group member reads the robosumo cookbook.

Our main objective in these following weeks was to have the of how to control one motor because we knew if we figured out how to control a single motor we will be able to control two motors.

The Second Week:

In the second week we started to work on the project focused on our main objective. Saleh was incharge of cutting wires and taking pictures and videos as we work on the project while Fahad and I were incharge of building the circuit and writing the code. This weeks session past and we were not able to complete our goal.

The Third Week:

During the third week we started to working as soon as we could because we knew that the 3 hour session in not enough to get the full word done. So we tried to work in a fast pace but in an efficient way too; to make sure that no mistakes were to happen we created a strategy of checking each others work. So with the circuit built and ready me and Fahad started writing the code; I have a small background in coding as I studied C+ and C++ and Saleh started studying the equipment.

These are pictures of the ciruits.

This is a video of me soldering, the video was taken by Saleh.

 

Video while the is motoring, the video was taken by Saleh.

The Fourth Week:

In this week the goal was to add to the circuit a switch, a capacitor and a TCRT5000 and as always we started by reading our lecturer blog and them start our working session. Me and Fahad were incharge of soldering, adding the switch, a capacitor and a TCRT5000 to the circuit and writing the new code and Saleh was incharge of taking pictures and trying to troubleshoot problem or probems because we had some. In this week Fahad left early so me and Saleh tried to troubleshoot the problems that we had.

 The Fifth Week:

During the fifth week me and Fahad tried to troubleshoot the problem that we had earlier on the last week. During this weeks session me and Fahad tried swapping our jobs which are building the circuit and writing the code so we can make the most of it. The group ordered new wheels and motors to use but did not arrive and the group asked Ted for new gearbox as we stripped one gearbox because one was working in a higher pace than the other.

Video of the motors working but the problem is that one is faster than the other; video taken by Saleh.

Friday:

We decided to work on Friday of the same week. Luckliy the lab was free and we talked to one of the lecturers who has helped us understand the process of building the robot up for the race to the wall challenge, he was kind enough to show us some of the robots he have built and in this working session we had our shape fully ready. And me and Fahad cut the metal sheet that we used for the robot.

This slideshow requires JavaScript.

The Sixth Week:

There was no classes during this week due to the weather condition.

Testing/Race to the Wall:

Saleh and Fahad took one for the team and skipped all morning classes so they can work on the robot. As the group was given a a new TCRT5000 piece me and Saleh went to soldier it while Fahad and lecturer Gavin were writing the new TCRT5000 code and it did not work and finally it worked but it took two lecturers to help us. The switch came off so Saleh soldiered it, he did not get it right at first but I helped him a bit and then he got it right. The lab and testing session ended and the robot failed so I personally gave up and went to the next class; after 15 minutes Fahad and Saleh called me and told me that the robot completed the challenge so I did not believe them until Saleh sent me the video.

These are some images of the robot; taken by Saleh.

 

 

 

 

First 3 videos are all failed tries and the last one was a success; all taken by the groups photographer Saleh Al Harbi.

Week 8 & 9:

As always after the 1 hour lecture the group members discuss the notes that have been taken from the lecture. This weeks aim was to decide the final robot design and to start building it. Saleh was incharge of figuring out code of the range finder while me and Fahad where thinking of a design for the robot. We had a design but we failed in building it so we thought that we will think of a new one during the easter break and build the chassis on the next lab session.

Easter Break:

During the easter break we were all discussing our designs and updating each other when we had too about the design and the range finder. The group decided to order a robot building kit.

The Tenth Week:

I personally think that this weeks labs session was a winner for out group as we noticed a lot of stuff. So my personal task to check everything all the cables, equipments, … . So I took the circuit and unsoldered some loose wires and resoldered them just to make sure and I soldered the range finder and while soldering it some solder fell on it but it was taken care of as I took of the solder and them we went on check that if it is damaged by using a external circuit and its code. Sadly the group failed in building the chassis.

 

Images of me soldering the range finder; images taken by the groups photographer Saleh Al Harbi.

The Eleventh Week:

 

rrrrrrrrrrr

The new range finder wire colors: the red wire is the voltage supply, the trigger pulse input is the yellow wire, the echo pulse output is the orange wire,and the black wire is ground.

Me, Salah, and Fahad stayed for after the class to work on the code.

All videos are taken by Saleh Al Harbi.

 

The Twelfth Week:

The code:

[ code language = “cpp”]

void setup()
{
// Pins:
// pinMode(2, output)// for the LED
// pinMode(3, output)// for the LM
// pinMode(4, output)// for the LM
// pinMode(7, output);// for the RM
// pinMode(8, output);// for the RM
// pinMode(12,output);// for trigger
// pinMode(11)// for echo
// pinMode(10)// for the switch

// Digital output for LED
pinMode(2, OUTPUT);

// Digital input for the echo
pinMode(11, INPUT);// for echo

// Digital output for the Trigger
pinMode(12, OUTPUT);// for trigger

pinMode(10, INPUT);// input for the switch

// Digital outputs for left motor
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);

// Digital outputs for right motor
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);

Serial.begin(9600); // setup serial
}

void loop()
{
// Send trigger pulse
digitalWrite(12, HIGH);
delayMicroseconds(20);
digitalWrite(12, LOW);

// Wait for 4ms (68cm return trip at speed of sound)
delayMicroseconds(4000);

// Check if echo pulse is still active
if (digitalRead(11) == 1)
{
// Echo pulse still active: no object within distance
digitalWrite(2, LOW); // LED OFF
digitalWrite(3, HIGH); // Right motor forward
digitalWrite(4, LOW);
digitalWrite(7, LOW); // Left motor forward
digitalWrite(8, HIGH);
}
else
{
// Echo pulse has ended: an object is within distance
digitalWrite(2, HIGH); // LED ON
digitalWrite(3, HIGH); // Right motor forward
digitalWrite(4, LOW);
digitalWrite(7, HIGH); // Left motor forward
digitalWrite(8, LOW);
}

// Wait 100 ms before triggering sensor again
delay(100);
}

[/code]

ppppppp

 

 

 

We challenged a group for a Robosumo fight.

All videos are taken by Saleh Al Harbi.