Week 11 – James

Hi, James here (again)

If you are wondering why this is named week 11. It’s because we didn’t write  for 2 weeks, except for Oliver, so that’s why.

Today we were making a 2 sensor line follower.  We used 2 colour sensors to detect reflected light of a certain colour like black, white and silver.

We are using 2 sensors because there is a silver line at the green chemical spill blob so we need to stop there.

This is how the 2 sensor line follower will work.

          Inputs           |         Outputs
---------------------------|--------------------------
Left Sensor | Right Sensor | Left Motor | Right Motor
------------------------------------------------------
White       | White        | Forwards   | Forwards
Black       | White        | Stop       | Forwards
White       | Black        | Forwards   | Stop
Silver      | Silver       | Stop       | Stop

Note:
Black reflects about 12% of the light
White reflects about 72% of the light
Silver reflects about 30% of the light

For our inputs we used greater than 50% to detect white and less than 50% to detect black and silver.

For this post I think this won’t need pseudocode because my table describes it perfectly.

Here is my code for the 2 sensor line follower.

We used variables to set the speed for how fast the robot turns around corners and for its forward speed.  We used variables so we didn’t have to change speed values in many blocks of code.

We tuned it by experimenting with different speeds to see if it would follow the line on our mat and not run off.

There was a thing very interesting.  I couldn’t use a turn speed of 70 but I could use a turn speed of 75.

The two sensor line follower didn’t jiggle around like our original one sensor follower.  The two sensor follower behaved more like the 1 sensor PID line follower which was made by Richard.

One thought on “Week 11 – James”

Comments are closed.