Week 6 – Rich

The last few weeks have been a bit of a mish mash with different students away at different events, school holidays and pets day preparation.  It was nice to have everyone back together again today!

The children are starting to become really familiar with the robot and how the EV3 language works so I felt it was a great time to start working towards our ultimate goal – the New Zealand RoboCup Junior rescue competition.  The first part of the rescue challenge is to autonomously follow a black line.  The video, below, shows what they achieved today.  You’ll notice that the robot wobbles quite a bit!  This is normal for a basic algorithm but it can be dramatically improved with maths and much more complexity… perhaps something to come back and look at once the complete rescue challenge is achieved!

You’ll see, in the posts below this one, that they’ve all done a great job describing what they did today so I won’t write any more 🙂

The Challenge:

A terrible earthquake has hit the city and caused a large chemical storage unit to rupture spilling thousands of litres of toxic chemicals in the centre of the city. There is a person trapped on a sinking water tank in the middle of the chemical spill. Rescue crews are having trouble entering the city with the amount of rubble around and rescue from the air has also been ruled out due to the noxious gases rising around the city.

It has been decided that the best form of rescue is the deployment of an autonomous robot that can navigate to the scene and rescue the stranded person by pushing or dragging the water tank out of the chemical spill. The water tank must be upright throughout the rescue.

Week 6 – Josh

Today at coding class we cracked into our overall goal, making a line follower.  First we had to learn about switch blocks which is really the program asking the robot a question about its surroundings and answering yes or no.  E.g is the colour sensor on a black line; yes turn right, no turn left.

We then got stuck into our first challenge.  The pseudocode challenge guidelines are as follows.

Step 1: Write a program that follows the RIGHT edge of a line.
Hints: If your sensor sees black, turn right.  If your sensor sees white, turn left.  Use loops and switches!
Step 2: Try it out on different lines.  Did your line follower work the same on straight and curved lines?
Step 3: If not, instead of turn Steering = 50, try smaller values.
Is it better on the curved lines now?
After some trial and error I got the robot to follow the line but when it got to a sharp turn it lost the line.  After adjusting the speed and steering I got it to work.  (I slowed down the speed and increased the steering).  This was a very interesting task as everyone used something different to steer to start with.  I used ‘On’, but the others used rotations, time and degrees.  We ended up all finishing on ‘On’.  The picture of the code is to the left .  We then checked the solution and it was very similar, the only real difference was the speed and steering.
The second challenge was pretty much an add on to the last task as we just had to make it stop when the touch sensor is pressed while the same line following code applies.  As you can see we changed the repeat forever to until touch sensor is pressed.  This was a very good lesson and is setting us up for our final goal.
Our Mindstorm Adventures Continue.

Week 6 – Brayden

This week we completed two line following challenges using the colour and touch sensors. At the start of the lesson we were given a challenge where we had to programme the Mindstorm to follow the right side of a line.

This had to be completed by programming the mindstorm to ‘zigzag’ across the edge of the line by using a switch in the code.

We used the switch to determine whether the Mindstorm was on the black line or on the white of the track. If it was on the black it would turn slightly to the right and move in that direction. If it was on the white it would turn slightly to the left and move in that direction. This would cause the Mindstorm to cross back and forth over the edge of the line. At first there were a few bugs in the code but after some alterations to the code we all achieved this.

My Line Follower Challenge 1 Code (Explanation in the blue comment blocks)

We then attempted another challenge. In this challenge we had to use the code we had just created and alter it so if the touch sensor was pressed the Mindstorm would stop moving. We achieved this challenge fairly quickly.

My Code for the Line Follower Challenge 2

I am looking forward to testing my coding knowledge in future weeks.

Week 6 – Oliver

🙂 This week at coding we made a simple line follower that (surprise, surprise) followed a line. It wasn’t at all simple to make it though.

We had two challenges. Our first was to make a line follower that successfully followed lines using white and black. Our second was to make our robot stop running the program if the touch sensor was pressed.

At first, I tried to use the Reflected Light Intensity block to see if the light that was on the line was more or less than 50. This did not work because of the ambient light making the numbers mixed up. My idea was to make the robot follow the edge of the line, but it was too complicated for me and I didn’t understand it. We will do that sort of code in future weeks.

I then decided to use the Compare Colour mode. This detects what colour the colour sensor is seeing, then reports it to the code. If the sensor detects black then the robot turns right 35 degrees, and on white it turns left 35 degrees.

This session took a lot of trial and error and a lot of mistakes. In the end I learned a lot about the language and how it works. My final result is down below. 😉

WORD OF THE DAY: Hunt-and-peck. Using only one or two fingers to type on a computer keyboard.

Week 6 – James

Hi it’s James here. This week we started our goal which is doing a line – following challenge like the one in Robocup Junior ( Our course looks like this).

This is basically what the course looks like at Robocup Junior. ( It’s only missing a ramp)

We looked an algorithm on how to make the robot follow a line. We followed a section of the course going the opposite direction of where the robot is facing in the picture, above.  The robot can’t follow the middle of the line because it can’t see the black line ahead of itself like a human can.  If you look at the code below it is coded to follow one side of the line. (mine was the right side).

If the robot is placed on the left side of the line it turns around and goes the wrong way. When it follows the right side, it jiggles side to side like this.

The algorithm is repeating forever moving away from the black line and when the color sensor is on the color white, it moves back towards the black line.

To make the code work I adjusted the speed to 35 and then I made several adjustments to the turning starting from 45 and -45 and going to 70 and -70.

I had several problems like with the switch block and other things in the code  but here are the main problems I had…

  • My speed was too fast to get around some corners.
  • I turned too much when doing the jiggle.

I could make my code better by adding some more comments.