Sub $20 Robot Chassis - Picaxe28X1

<Gareth>

New Member
Sub $20 Robot Chassis inc Picaxe28X1 &amp; motors

I have been trying for a long time to create cheap accurate robots to use in a "Swarm" environment.
Most "workable robots" tend to hit the $100 mark ..... frankly this is way to much.

The best sub $20 solution i have found so far is presented here.
This version uses the Picaxe-28X1 (i have also a propeller mcu version which works just the same)

Maybe these types of cost effective setups will allow more people to dive into robotics/programming....



Its tracking very well with its 2 x 0.99p stepper motors ..... which i basically glued back2back
- the ULN2003 motor driver board is already attached to the motor.

What you see below is a "Soak" test of the robot drawing onto a "Glow Sheet" ...
....the robot ran easily for 1 hour (prove_ing that steppers are not as power hungry as continuous servos)


Here it is in action :-
[video=youtube_share;AWbuSU7ebhg]http://youtu.be/AWbuSU7ebhg[/video]

I am using 2x 3.7Volt 500mAhr helicopter style lipo batteries ..... and the current drain is very good.
The Picaxe 28X1 sits on a (really bare bone) picaxe board from rkeducation. (its the board "Hot Glued" to the back)
Code:
;"G" for Gareth
; Stepper Driver code for testing
; 0.99p motors
; linear coding at moment just to get
; Tracks rolling ;-)
; Gareth - aka youtube "Chiprobot"

let dirsc =%00010000
let pinsc =%00010000
main:
high portc 1

let pinsc =%00010000 ; switch UV LED "On"
w2=600
Gosub North
let pinsc =%00000000 ; switch UV LED "Off"
w2=211
Gosub East

let pinsc =%00010000
w2=400
Gosub North
let pinsc =%00000000
w2=211
Gosub East

let pinsc =%00010000
w2=200
Gosub North
let pinsc =%00000000
w2=211
Gosub East

let pinsc =%00010000
w2=100
Gosub North
let pinsc =%00000000
w2=211
Gosub East

let pinsc =%00010000
w2=100
Gosub North
let pinsc =%00000000
w2=211
Gosub West

let pinsc =%00010000
w2=200
Gosub North
let pinsc =%00000000
w2=211
Gosub West

let pinsc =%00010000
w2=400
Gosub North
let pinsc =%00000000
w2=211
Gosub West

let pinsc =%00010000
w2=200
Gosub North
let pinsc =%00000000
w2=211
Gosub West

let pinsc =%00010000
w2=100
Gosub North
let pinsc =%00000000
w2=211
Gosub West

let pinsc =%00010000
w2=100
Gosub North
let pinsc =%00000000
w2=211
Gosub East

let pinsc =%00010000
w2=100
Gosub North
let pinsc =%00000000
w2=211
Gosub East

let pinsc =%00010000
w2=300
Gosub North
let pinsc =%00000000
w2=211
Gosub East

let pinsc =%00010000
w2=100
Gosub North
let pinsc =%00000000
w2=211
Gosub East

let pinsc =%00010000
w2=100
Gosub North
let pinsc =%00000000
w2=211
Gosub West

let pinsc =%00010000
w2=200
Gosub North
let pinsc =%00000000
w2=211
Gosub East

let pinsc =%00010000
w2=400
Gosub North
let pinsc =%00000000
w2=211
Gosub East

let pinsc =%00000000
let pins = %00000000
stop

North: ; forward stepper sequence (half step)
for w1=0 to w2
let pins =%10001000
pause 1
let pins =%11001100
pause 1
let pins =%01000100
pause 1
let pins =%01100110
pause 1
let pins =%00100010
pause 1
let pins =%00110011
pause 1
let pins =%00010001
pause 1
let pins =%10011001
pause 1
next w1
return
stop

South: ; backward stepper sequence (half step)
for w1=0 to w2
let pins =%10011001
pause 1
let pins =%00010001
pause 1
let pins =%00110011
pause 1
let pins =%00100010
pause 1
let pins =%01100110
pause 1
let pins =%01000100
pause 1
let pins =%11001100
pause 1
let pins =%10001000
pause 1
next w1
return

East:  ; clockwise stepper sequence (half step)
for w1=0 to w2
let pins =%10011000
pause 1
let pins =%00011100
pause 1
let pins =%00110100
pause 1
let pins =%00100110
pause 1
let pins =%01100010
pause 1
let pins =%01000011
pause 1
let pins =%11000001
pause 1
let pins =%10001001
pause 1
next w1
return

West:  ; anticlockwise stepper sequence (half step)
for w1=0 to w2
let pins =%10001001
pause 1
let pins =%11000001
pause 1
let pins =%01000011
pause 1
let pins =%01100010
pause 1
let pins =%00100110
pause 1
let pins =%00110100
pause 1
let pins =%00011100
pause 1
let pins =%10011000
pause 1
next w1
return
And now some Autonomous code
This uses the "Pause" command :-
Code:
; Auto-mode Sub 20 Dollar Robot 
; addition of Sharp distance sensor.
; Stepper Driver code for testing 0.99p Stepper motors
; Gareth - aka youtube "Chiprobot"

let dirsc =%00010000 ;UV Led pin
let pinsc =%00010000
let w4=timer ; seed the random number generator
main:

let pinsc =%00010000 ; switch UV LED "On"
w2=1           
Gosub North    ; General full steam ahead direction
readadc10 1,w1 ; Sharp sensor or IR analog input
readadc10 0,w5 ; Lipo Battery monitor analog (simply connected to 5V regulator)

if w5 <980 then sleep 1 endif ; if Battery analog dips below this level, then either Sleep (or shutdown) to save the Lipo batteries from dropping below 3Volts

if w1>400 then  ; trip level - object detected - do something different
   random w4
   let pinsc =%00000000 ; switch UV LED "Off" whilst turning
   
   w2=b8
   if w2>127 then gosub West ; This part of code stops the 
   if w2<127 then gosub East ; robot getting stuck in a corner
     endif
goto main  


North: ; forward stepper sequence (half step)
for w1=0 to w2
let pins =%10001000
pause 1
let pins =%11001100
pause 1
let pins =%01000100
pause 1
let pins =%01100110
pause 1
let pins =%00100010
pause 1
let pins =%00110011
pause 1
let pins =%00010001
pause 1
let pins =%10011001
pause 1
next w1
return
stop

South: ; backward stepper sequence (half step)
for w1=0 to w2
let pins =%10011001
pause 1
let pins =%00010001
pause 1
let pins =%00110011
pause 1
let pins =%00100010
pause 1
let pins =%01100110
pause 1
let pins =%01000100
pause 1
let pins =%11001100
pause 1
let pins =%10001000
pause 1
next w1
return

East:  ; clockwise stepper sequence (half step)

for w1=0 to w2
let pins =%10011000
pause 1
let pins =%00011100
pause 1
let pins =%00110100
pause 1
let pins =%00100110
pause 1
let pins =%01100010
pause 1
let pins =%01000011
pause 1
let pins =%11000001
pause 1
let pins =%10001001
pause 1
next w1
return

West:  ; anticlockwise stepper sequence (half step)

for w1=0 to w2
let pins =%10001001
pause 1
let pins =%11000001
pause 1
let pins =%01000011
pause 1
let pins =%01100010
pause 1
let pins =%00100110
pause 1
let pins =%00110100
pause 1
let pins =%00011100
pause 1
let pins =%10011000
pause 1
next w1
return
Latest code 29th October 2012
Using "Pauseus" command enables tighter control over stepper coil energisation.
Code:
; Auto-mode Sub 20 Dollar Robot Version 2.0
; Adjust w6 to suit your motors (ie if steppers "Stutter" or "Stop" increase this value untill both motors run smoothly under load.
; addition of Sharp distance sensor.
; Stepper Driver code for testing 0.99p Stepper motors
; Gareth - aka youtube "Chiprobot"

let dirsc =%00010000 ;initialise Ultra Violet Led pin
let w4=timer ; seed the random number generator ...not sure if this is actually nessesary..
let w6=40    ; delay between stepper phases (30to50 is optimal for my steppers)

main:
let pinsc =%00010000 ; switch UV LED "On"
let w2=1                   ; Step Forward 1
Gosub North              ; General full steam ahead direction
readadc10 1,w1         ; Sharp sensor or IR analog input
readadc10 0,w5         ; Lipo Battery monitor analog (simply connected to 5V regulator)

if w5 <980 then sleep 1 endif  ; if Battery analog dips below this level, then either Sleep (or shutdown) to save the Lipo batteries from dropping below 3Volts

if w1>400 then                      ; trip level - object detected - do something different too avoid disaster
   let pinsc =%00000000          ; switch UV LED "Off" whilst turning else it will suntan a ring by overexposing 
   random w4                         ; choose some random number
   w2=b8                               ; just extract one part of it as we only actually need a "1" or "0" .... best we can do is 8 bits so we do it this way
   if w2>127 then gosub West   ; This part of code stops the robot getting stuck in a corner
   if w2<127 then gosub East    ; here tooooo....
goto main  


[B]North: ; forward stepper sequence (half step)[/B]
for w1=1 to w2
let pins =%10001000
pauseus w6
let pins =%11001100
pauseus w6
let pins =%01000100
pauseus w6
let pins =%01100110
pauseus w6
let pins =%00100010
pauseus w6
let pins =%00110011
pauseus w6
let pins =%00010001
pauseus w6
let pins =%10011001
pauseus w6
next w1
return
stop

[B]South: ; backward stepper sequence (half step)[/B]
for w1=1 to w2
let pins =%10011001
pauseus w6
let pins =%00010001
pauseus w6
let pins =%00110011
pauseus w6
let pins =%00100010
pauseus w6
let pins =%01100110
pauseus w6
let pins =%01000100
pauseus w6
let pins =%11001100
pauseus w6
let pins =%10001000
pauseus w6
next w1
return

[B]East:  ; clockwise stepper sequence (half step)[/B]
for w1=1 to w2
let pins =%10011000
pauseus w6
let pins =%00011100
pauseus w6
let pins =%00110100
pauseus w6
let pins =%00100110
pauseus w6
let pins =%01100010
pauseus w6
let pins =%01000011
pauseus w6
let pins =%11000001
pauseus w6
let pins =%10001001
pauseus w6
next w1
return
[B]
West:  ; anticlockwise stepper sequence (half step)[/B]
for w1=1 to w2
let pins =%10001001
pauseus w6
let pins =%11000001
pauseus w6
let pins =%01000011
pauseus w6
let pins =%01100010
pauseus w6
let pins =%00100110
pauseus w6
let pins =%00110100
pauseus w6
let pins =%00011100
pauseus w6
let pins =%10011000
pauseus w6
next w1
return
 

Attachments

Last edited:

eclectic

Moderator
Welcome to the Forum.

Can you provide construction details and program(s) please?

I'm sure that others may be very interested.

e
 

<Gareth>

New Member
Thanks.....code just added to description above..... its linear for the moment just to get the stepper in motion....
 

jinx

Senior Member
hi Gareth,
Looking very creative, been a silent fan of your work for the past years. Hope to see more of your creations being posted here would you please post some information/links to how you created the green line for those with curious minds can join in the fun.
jinx
 

<Gareth>

New Member
Welcome to the Forum.

Can you provide construction details and program(s) please?

I'm sure that others may be very interested.

e
Here is the basic set up :-
Sharp Sensor (until i get my cheap 2dollar ultrasonic sonar)

Picaxe 28x1 really barebones board

The UltraViolet LED for my line drawing board.
You can see also how i have glued the steppers Back2Back.
The Lipos are tucked deep inside - I have tested the Lipos under working conditions (1 hour continuous is its life)
You can also see how i have mounted the Sensor with elastic band, pointing straight forward it will detect obstacles, pointing down it will detect cliffs....

The PingPong ball is its third wheel - adjustable via tubes along its chopstick chassis.


Hope these details give a better picture.....
 

<Gareth>

New Member
hi Gareth,
Looking very creative, been a silent fan of your work for the past years. Hope to see more of your creations being posted here would you please post some information/links to how you created the green line for those with curious minds can join in the fun.
jinx
:)
I am a fan of Phosphor Luminescence screens ...... they just soak up UV Leds or UV Lasers enabling you to create "Live Art"
The glow effect lasts for 1 to 2 hours depending on how strongly they are Zapped.
With my <20 dollar robot i simply fixed a UV Led to the axle beneath (10ma was enough) and placed the UV Sheet on the floor with 4 surrounding walls .... and the robot wandered around for 1 Hour on a set of Lipos (okok it did try to escape a couple of times)


The sheet you can see here.....with my UV laser attached to XY servos..... that's another project you can find Here

 
Top