Week 8 – 2019 – Oliver

Our task this week was to make a program that could overcome the ramp (thanks Mrs. Bennet) obstacle while still completing the rest of the course. The robot’s sensors were too far away from the wheel chassis originally, so as the robot’s wheels moved up the ramp, the sensors got farther and farther off of the ramp. The light emitted by the sensors was at too much of a distance to be reflected back effectively. This caused the robot to think both sensors were on black because the amount of reflected light was low and in turn, the robot turned in a circle and ran off the ramp.

The code above was able to go over the ramp, but to make the robot able to achieve this I needed to remove the hint section of the code. The hint-detection part of the code activated when the light changed on the ramp, so next week I aim to try and reincorporate it into the program.

When the sensors were moved closer to the wheels, the original program stopped working. This is because changes to the physical robot also make errors in the code. To counteract this, I edited my line follower so the wheel not turning turned backwards instead of staying in place. For example, if the robot turned right then the left wheel would move forward and the right wheel would move back. I experimented with multiple measures but found that the best was the wheel turning 1/4 of the way backwards for every 1 turn of the forwards-turning wheel.

I also started making a program to detect hints without getting fooled by the ramp. My logic was that if the amount of reflected light drops below a certain threshold, the robot would assume it was on the ramp and continue until the lone was found again. The problem with this code is that the amount of reflected light on the ramp changes gradually, while the amount of light on a green or silver hint changes suddenly. Next week I will seek to find a solution to this problem. This is my code so far:

Richard explained to us a concept of making a new program. He told us that instead of altering the old code and risking making errors, to make a whole new program and copy and paste our old code in to change. That way, if an error appears, the old code is always there to revert back to if needed.

Useless Fact of the Day: Intelligent people have more zinc and copper in their hair.