Week 10 – Oliver

This week at coding we came up with a better solution for our find the can code. If the robot was pointing straight towards the can my code made it go forward 2 wheel rotations, turn clockwise for 1 rotation and then repeat the old code. I also made the robot slowly go up to 50 speed when it is pushing the can so the sudden jerk didn’t make the robot go skewed. This meant that some parts of my pseudocode:

(Newer) Pseudocode:
1. When the robot reaches the green area, stop moving.
2. If the can is in the robot's field of view then go forward 2 rotations, otherwise go to 4.
3. Turn 1 rotation clockwise and continue.
4. Turn on axis anticlockwise until an object is detected within a range of 60cm. (can)
5. Turn 1 degree at a time anticlockwise until the can is not detected while counting number of degrees.
6. Halve the number of degrees turned and turn clockwise that number.
7. Move forward, 3.5 rotations, increasing the speed of the robot each time.

This is my pseudocode turned into Mindstorms code:

Some problems that I had were the robot’s ultrasonic sensor having a very wide range of vision, meaning that the algorithm that I had made got confused by the can being straight in front of the robot.

This is my programming in action for the find the can part:

Next week we will do a line follower with 2 sensors and join that onto our find the can code.

WORD OF THE DAY: Cancatervate – Heaping things into a pile.