Let's Make Robots!


Since this project is not finished yet the robot just sits there for now...

Most of the LEGO platform used for this robot was used in DTU RoboCup 2006.

PICAXE Pete is my first time using the PICAXE controller.

The robot has a homemade line sensor using light dependent resistors (LDRs) and a homemade PICAXE-board with an L293 driver chip as well (see picture).

It can either connect to a single 7,2 V pack og two of these in serial (for giving the motors more power).

Power to the chips and line sensor is regulated by an LM7805 voltage regulator with some bulk capacitors. Of course the PICAXE board also has a means of connecting the programmer cable to the board for programming the PICAXE chip.

PICAXE 40X1 board

I took the robot apart and took some pictures while putting it back together - just so you can see how it's made. I think the design is rather nice actually :-)

First of all there is the "engine block":

Engine block for PICAXE Pete

Then there is the "tail section":


These two are then put together:


(Disregard those grey 1x4 plates in the left side of the picture. They're a leftover from some strange idea I had. Next image shows some added axles for the active wheels (notice they run through the rotation sensors - they're the blue ones in case you wondered). There's also been added some things at the front for the line sensor:


Then finally the active wheels (from the Technics Super Car set) are added and the vehicle is finished:


A look from the rear:


This is kind of an expensive construction since it uses bricks from a MINDSTORMS 2.0 set, a Technics Super Car set and two separately purchased LEGO rotation sensors (they are NOT cheap!). Anyway I like this vehicle!

With line sensor, controller board and batteries the whole thing looks like this:


It's not really the prettiest robot in the world :-).

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Coooal (With the voice of Arnold Schwartzenegger)

Why so many sensors? You know smooth line-following can be done with just 2 analouge inputs, jip??

Looking forward to see the code!


Monster traction, I am not sure my Lego-Slaughter will actually kill that one :D

/ Frits

...since it doesn't really need a sensor in the middle. I think if I were to use only two LDRs they would have to be very close to the line edges in order for the following to be smooth but then the robot could easily lose the line when driving fast and getting to a sharp corner - I think :-). Anyway I haven't seen a line follower that does smooth line following with only two sensors. Can you build one and show me a video of it doing smooth line following, please? ;-)

Oh my God there is a loose connection to one of the LDRs on the line sensor... I have to dig out my soldering iron and fix this. Also I forgot how much I hate programming in basic.

...I was just reading the wrong input pin :-).

Any progress on the project?

/ Frits 

Yes as a matter of fact I reconnected both the line sensor and the motor pwm outputs this weekend. Also I took it for a test run and it went insanely fast so I decided to gear it down to 3:1 instead of 1:1 - and this also gives more torque so everyone is happy :-).

Oh yes I also added a cardboard cover around the line sensor so the LDRs won't be too much influenced by ambient light.

A funny thing I noticed was that when I had reconnected the motors to the pwm outputs and cleared memory from the PICAXE BASIC programming environment one of the motors started playing "Happy birthday"!! I almost fell down from my chair from laughing... it was really ridiculous!

Regarding the line following thing I am trying out a new strategy this time instead of the old "compute mean value"-strategy that I also used for my NXT line follower... It will be interesting to see how well it works - or if it just blows up!

- Jimmy

Happy Birthday!?!?! Whan on earth? Easter egg in Picaxe 40´s? .. I had to lok into that:

Aparently the 8M versions have some internal tunes, one being "Happy Birthday". But I did not think the 40's had these..

YES! They do - I had no clue, lol. In all the bootstrapped Picaxes there are at least one tune, "Happy Birthday". Straaaange thing to use space on IMHO :D (Even though it is only a matter of a few bytes, aparently)

PLAY pin, tune should work on every Picaxe. I have no time to try, though :) "tune" should be "0" for Happy Birthday, "pin" the pin to send the music!

So somewhere in your allmost deleted memory a "Play tune" must have been send to the motors! 

Well well, now we have seen and heard that as well.. 

On a more serious note:

rotation sensors: What signal do you get from them? Do you have to count in the code, or do you get a number or whut? Sample code, please :)

Thanks for the update, looking forward to the first video of this Picaxe meets Lego hell on earth! 

/ Frits 

The rotation sensors are a bit annoying in that you have to first power them for some number of ms (they have internal capacitors that store the energy) and the you have to switch the output to input and read the value within a number of ms. This is because they only have 2 wires and thus no separate signal wire.

What you read in is one of 3 (I think it is 3) different voltage levels and you then have to use this to determine whether it is a CW or a CCW rotation. When the voltage level changes you know that the rotation sensor axle has been rotated 1/16 revolution (since this is the resolution of the rotation sensor - again this is as far as I remember. If you want the specific numbers you can look in the LEGO hardware manual for the MINDSTORMS NXT).

- Jimmy


Sounds totally useless to me, if you are not building an extra circuit, completely dedicated for handling the rotation sensors and counting continuously.

/ Frits 

You can just use timers and interrupts for handling the rotation sensors. It's not that big a deal - but it's not as trivial as just reading a signal wire. Of course the new NXT motors are easier to interface since they have encoders built into them with dedicated signal wires.

- Jimmy

I have never used timers and interrupts!

Sample code, please!!

/ Frits