(HS Comp) Week 7: Race to the Wall pt2

Student Name: Jerico M.

Objective: The main target this week was the exact same as last week, which is to basically get a time.

Procedure: Since last week we were unable to get a time, we at least solved our problems. Therefore all we did this week was to re-assemble the robot but with a 9V battery pack this time, except the only problem was that we needed to be within the 10x10cm and 500g limits.

asdf.jpg

As can be seen in the image above, weight wasn’t a problem even with the extra batteries added. Although, size seemed to be an issue as we wanted our motors side by side but we couldn’t carry this out as the wheels were too thick, thus making our robot exceed by 0.6mm. What we did instead was have one motor at the front and at the back running a pair of wheels each. After doing this, we were eligible to obtain a time as we were within the given limits. We did test runs first and realized that our robot was curving on its way to the wall and it could only complete the race half of the time. We still managed to get 8.5s for our first measurement which wasn’t bad at all seeing as we were the second in our class.

We then looked for ways to improve this time to get as high up in the leader board as possible. One thing I suggested to my teammates were to add a bit more voltage, so we added a few batteries to give it more voltage. We also decided to remove the delay in our switch for when the robot’s reversing in order to minimize our time completing the race. From taking these steps we got an even better time of 4.7s!

Results:

race1.PNG

race2 ed.jpg

The code above was the final version of our Race to the Wall, as you can see we used mostly if and else statements including states. The coding itself is pretty self-explanatory, i.e from lines 23-32 we have a statement for the switch in order to know whether the switch has been pressed or not and from lines 33-41 we have a statement for the reflective sensor which identifies whether it’s on white or black. The rest can be eyeballed such as from lines 43-48 the robot is told to carry out the action for the current state and that there’s a two second delay before the robot is to move forward towards the wall. Then from there, until the robot hits the wall and the switch is pressed “s1 = 1” the motors are told to reverse until the sensors see black “c1 = 0”.

Leave a comment