Second Challenge: Turn Left

In the second challenge, you will have to direct your robot to make a left turn while staying in the lines, as pictured below.

You need to program the robot so that it will turn left without passing the red line.

Algorithm

I also made an algorithm before coding. We can change it once we started coding. Below I have my algorithm I started off with.

If it detects red, it’ll make a left pivot turn and continue until the color sensor sees white. If the color sensor does not detect red, keep going and repeat the decision.

Building Plan

In this challenge, I used the Lego EV3 TRACK3R robot by Lego Mindstorms. You can find information about it here. I also added the color sensor which will be in the back of the instruction manual for the robot.

Building Progress Reflection

When I first tried running the program, the color sensor detected the redline, but when it turned, it turned the wrong way.

To fix this, I changed the direction of which the robot would turn when the red line was detected.

Once I switched the direction, it was turning the correct way it needed to, but it was not turning enough

To solve this, I experimented with different degree turns, until it successfully turned enough, which was a 145-degree turn. Once the robot was able to complete the challenge, I decided to add the Victory Fanfare from Final Fantasy once it completed the challenge. The notes weren’t playing the keys that I programmed them to, so I moved all the notes up an octave, which solved the problem. The cause of the problem was of the small speaker in the EV3 robot speaker wasn’t large enough to play the lower notes.

Program

This is an image of the Open Roberta programming I used for the robot.

The coding of this challenge was similar to the Make it Move Challenge, in the sense of having the robot move forward until the color sensor senses a color. After that, all I needed to do was add a turn, and have the robot drive forward until it reached the end of the board.

The easiest part of having the robot completing the challenge was the parts of the code that I have used in the previous challenge since I have already used, therefore making it easier to program. The hardest part of this challenge was troubleshooting the rotation. It was hard because I had to repeatedly keep changing the degree value until the robot turned enough to complete the challenge.

2 thoughts on “Second Challenge: Turn Left

  1. I liked your inclusion of pictures of the “track” being used in the challenge. You might want to change your title to ‘Second Trial: Turn Left’ instead of “Second Trail: Second Left”

    Like

  2. Nice description of building process and great use of visuals when showing your code; however, similar to Makenna, I would speak more on why you choose the color sensor and how it could specifically help within this challenge.

    Like

Leave a comment