LLAF

I haven't posted a Lego robot or a line follower, so I thought I'd do both together.

Line followers have been done to death. I've blown the dust off my Lego RCX. Yes, that's right: Noah had one of these controlling the Ark, but we haven't seen any BOA-bots in ages. Time to get back in the saddle.

There are three things going on here:

1) It's got 2 light sensors and a bit more intelligence than the time-honoured "change direction when you loose the line" type algorithm.

2) I've added a differential gear. It's part of the feedback train rather than the drive train. The diff turns a rotation sensor. As you can see, if both wheels turn, the diff doesn't turn. If one wheel turns, the diff runs one way. If the other wheel turns (the same direction) the diff turns the other way. This means it "knows" with reasonable precision what rotational angle it's sitting at in the ground plane.Of course, it also means it has no idea how far it's travelled.

3) I'm programming it in a subset of C. I'm not a C programmer. I prefer assembly, or even LabVIEW. This should be good sport to watch.

Oh, yeah. The name. LLAF = "Lego Line (Another) Follower."

Now, about that software. Time to do some headscratching.

Follows a line

  • Actuators / output devices: Stock Lego motors with 4:1 reduction gears.
  • Control method: autonomous, using Lego RCX, coded using RCXCC.
  • CPU: Lego RCX.
  • Operating system: RCXCC.
  • Power source: 6x AA cells.
  • Programming language: A subset of C.
  • Sensors / input devices: 1 rotation sensor, two light sensors.
  • Target environment: A flat, pale surface with a dark line drawn on it.

This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/llaf

What is the logic you use in this thing?
explain the method you use please, because im stuck at ‘change direction onve you lose the line’

BOA !

Hey Big Guy,

It has been a while… Nice to see you back in the saddle, hope your Sister’s dog is ok.

Anyhoo, a few questions :

Regarding 2) - why? I can appreciate the differential built with lego gearing (it looks impressive) - why create a differential feed back drive vs just putting in a couple encoders? If it “Just cause I can” motto - then I can appreciate that, I just don’t understand if there is a benefit beyond. Conceivably, you could get distance & rotational position with encoders and some math.

Why C ? - I’m guessing “Lego RCX” has a C-unlike language? If you need help on creating any bugs, let me know I’ve made many.

 

Sketchy

A well-worn algorithm is:

1) Drive forward until you lose the line.

2) n = 0

3) n = n + 1

4) turn CW n units

5) If you found the line goto 1

6) n = n + 1

7) turn CCW n units

8) If you found the line goto 1

9) goto 3

So, when the line is lost, the bot scans for it. An extension to this algorithm is to remember if the last time the line was lost is was found by a CW or CCW turn and start by that maneuvre the next tiem the line is lost. The probability is you’ll be oging the right direction.

With multiple light sensors, however, the bot can tell which way the line has turned and knowing the distance between them, it can make a fair stab at guessing by how much it has turned.

 

Cats and Dogs

Sisters dog now has a cat to play with.

Ah. There are 2 reasons:

1) Because I needed to SEE if I could (I was pretty sure, but by ego needed a massage).

2) Because the RCX only has 3 sensor inputs (sigh).

The RCX native coding thing is based on little lego blocks you drag around the screen and plug together in a sequence. It’s a real ball-ache. It’s actually a very very tightly defined subset of the LabVIEW which I love so much, but soooo tightly defined as to be useless.

…but, then, it WAS designed for 8 year olds.

I have more bugs than an African rain forest. Thanks for the offer.

I like the minimal feedback system
Using the differential as feedback is creative. Let us know when you hit the 90% done mark and we will help over the hump. This robot has 100%-potential!