Week 10 – Rich

Our initial line follower algorithm was a simple one.  If the sensor sees white, the robot turns left.  If the sensor sees black, the robot turns right.  This works well, but the robot is very wiggly and a bit slow!

I was curious to see if I could implement a single sensor line follower that implemented Proportional, Integral, Derivative control or PID.  I’d briefly  studied this when I did my NZCE years ago (does that even exist any more!) and that was about the last time I looked at it.

I did lots of reading, especially around EV3 implementations.  All of the EV3 implementations I looked at didn’t use functions and used loads of hard coded values which I wasn’t so keen on.  So I implemented a version breaking down individual parts into ‘My Blocks’, the EV3 equivalent of functions which, I felt, made the implementation easier to read while abstracting the details into smaller blocks which were easier to test in isolation.

The code is below – It’s too small to see detail so click on it and it will open full size in a new tab 🙂

To compare the implementation of the simple algorithm to the PID algorithm, have a look at the two videos below.  We can see what a huge huge difference it makes.

This little project is beyond the children at this point in their education but it was a useful experiment to show them what can be achieved using maths and how important maths is if they would like to keep following robotics 🙂

 

Week 9 – Rich

The children have been finding the actual rescue part of the challenge… pretty challenging!  They all have different ideas as to how to approach the task from simple (KISS) to more complex involving some maths and angles.  So far, none of them have got an entirely working solution 🙂

I was hoping to have a go at it myself, in parallel with the children, but their need for help during the class has overridden my desire to have a go too.  So, I’ve found a quiet slot in my week to sit quietly and at least write some pseudocode for how I might approach it.  I’ve written it in a way which should be fairly easily translated into the EV3 block language.

I’ve also been looking for a way to embed code into WordPress without using a plugin like Syntax Highlighter which hasn’t been updated in quite a long time.  After a bit of research, I settled on using Gists in my Github account and embedding that.  It seems to work quite nicely 🙂

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 4 – Rich

There are some students away this week so rather than progress with teaching I’ve set a challenge to try and put together all of the pieces we’ve looked at so far.

The challenge is:

There are four flat Lego tiles placed in a straight line 50cm apart.  One tile is red, one tile is green, one tile is yellow and one tile is blue.  The tiles can be placed in any order.

Write EV3 code from the pseudocode, below:

1. Move forwards in a straight line
2. If a red, green or a yellow tile is detected stop and wait for one second
3. If the tile is red, stay stopped
4. If the tile is yellow, move forwards until it is not yellow and go back to 1
5. If the tile is green, wiggle side to side 3 times and go back to 1

In your own blog posts for week 4, describe what you did today.  Show your EV3 code and discuss any problems you had.

Week 3 – Rich

Today, amongst other things, we discussed what pseudocode was and how important it was to use as a means to accurately describe what we want the robot to do before we write EV3 code.  The children discuss pseudocode, in a bit more detail, in their own posts.

The children looked at my EV3 code below, but it was not immediately obvious what the code did at all!  It would take a little time to follow it through and, if there was a block that was unfamiliar to them, they would need to research what it did before progressing to find the full intent of the code.However, by looking at the pseudocode I wrote before writing the EV3 code, the children quickly worked out exactly what the robot was meant to do and could relate it to the EV3 code.

1. Move forwards at a speed of 25
2. When the colour sensor detects a green or a red
     a. coast to a stop
3. Wait one second
4. If the colour is red:
     a. move backwards 240 degrees at a speed of 25
     b. turn right
5. If the colour is green:
     a. move backwards 240 degrees at a speed of 25
     b. turn left

Sometimes it’s useful to put the pseudocode in as a comment in your EV3 program, as below.

Use of pseudocode is something we will continue to develop as the childrens challenges become more complex 🙂

Introduction

Welcome to the children’s website about their journey to enter a RoboCup Junior competition in New Zealand.

Their aim is to compete in the Rescue Challenges.  One of the requirements of being in the competition is listed in the Rescue Rules as:

7.1.2.  All teams must maintain a logbook detailing the design, development and construction of the robot and its programs.

This website will be their means to achieve this.  It will allow them to keep a record for themselves while, at the same time, allowing them to share what they are doing with family, friends, and the school.  It will also give them some experience of using WordPress as a platform.

Some of our aims are to:

  • Examine different line following algorithms from very basic to more advanced
  • Critically evaluate how each algorithm performs and use observation of the robots behaviour to go back to their code and make iterative changes to see if improvements can be made
  • Develop strategies to make changes on the fly, during competition time, if the robot fails the task, for any reason.
  • Learn documentation skills and ways of managing code history.

We hope you enjoy following their progress 🙂

Update – September 19th, 2019:

Today we went to the Regional Taranaki Robocup Junior competition held at the TET Stadium in Stratford.  James competed in the Junior Rescue competition.  Sara and Oliver competed in the Senior Rescue competition.

The children should all feel very proud of what they achieved coming 1st in each of the competitions 🙂  The wins would have made them eligible for the National Robocup competition.  However, due to unforeseen circumstances, the Nationals were held two weeks prior to our Regionals.

The competition was a wonderful learning opportunity for everyone to see how the competition is run and to experience the realities of everything not exactly going to plan despite lots of testing in our own environment.

When things didn’t go right, the children showed wonderful resilience and were able to make some code changes on the fly which resulted in a perfect last run for the Senior competition.

A huge thank you to Sandy for all the organising she did to get us to the competition and to Fabiano and Marie for helping with transport and supporting us all.

Update – September 3rd, 2019:

The children have worked really hard over the last few months.  Today is the first time that they all got their code working to a competition standard where the robots autonomously performed everything they were required to in their grade of the competition.  Sarah and Oliver in the Senior competition and James in the Junior competition.  They should feel very proud of themselves.  The two videos, below, speak for themselves!