Moonlight Machine

This is a robot that is based on the start here bot, and my CD Scout. It's basically the same input and output devices in the CD Scout, but this one has a better chasis and a switch in the rear that senses when it is runing into something and tipping backwards. It has 2 LED's. One that is green for when it is going forward, and one red for when it stops.

This is a pretty solid platform and i plan on testing and tinkering around with alot more types of input and output devices on this chasis.

The second video is some code that makes it track moving objects:

symbol detection = 50
let b1=150

main:
readadc 4,b1
if b2 < 180 and b2 > 120 then
low 5 : high 6 : high 4 : low 7
end if
if b2 < 120 then
low 6 : low 5 : high 7 : high 4
end if
if b2 > 180 then
low 7 : low 4 : high 5 : high 6
end if
if b1 > detection then gosub servoleft
if b1 < detection then gosub servoright
goto main

servoleft:
let b2=b2 max 200 min 100
inc b2
servo 3,b2
return

servoright:
let b2=b2 max 200 min 100
dec b2
servo 3,b2
return

I was in a hardware store and saw the moonlights and thought they would be an excelent chasis so i picked one up and picked up a ball bearing wheel for the 3rd point of support for it:

 

 

It goes forward until it sees an obstruction and then turns towards the next most promising direction and goes forward again

  • Actuators / output devices: roller-arm microswitch for tilt recognition
  • Control method: autonomous
  • CPU: Picaxe 28x1
  • Operating system: Basic
  • Power source: 3 AA on 1st circuit and 4 AA on second circuit
  • Sensors / input devices: Sharp IR

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

Back on tipping?
How does it detect tipping or when it is running over something, to back away from? Tilt sensor? Back emf on the motors?

Sensor and Power Supply?

Wow, i like him, it is very nice, but why the Sensor move only when he saw anything?

And work the electronic and all other components only with 4.5V???

 

sensor and power

It’s coded to just look strait and when something gets in range of the sensor, it will stop and look left and right to see which way is best to turn and go forward again. The power is 4.5 volts on the circuit that powers the controller and 6 volts for the other side of the board. The moonlight has a 4 double A battery pack on the bottom that i use for 6 volts.

Hey, thats a pretty good idea. I think I want to see if i can get it to keep looking back and fourth while moving forward and make direction changes on the fly.

Back on tipping

It has a microswitch with a roller arm on it that triggers when it leans back onto the floor.

http://www.highlandwoodworking.com/ProductImages/dust/184967.jpg

 

Mode 2 Code

I just did a rough draft of some code that makes him do slight turns on the fly based on what it sees from left to right:

 

symbol servo_turn = 700
symbol dangerlevel = 60
symbol turn = 300

main:
high 2
low 1
high 4 : low 5 : high 6 : low 7
servo 3, 100
pause servo_turn
readadc 4, b1
servo 3, 200
pause servo_turn
readadc 4, b2


if b1 < dangerlevel and b2 < dangerlevel then
goto main
end if

if b1 > dangerlevel then
goto left
end if

if b2 > dangerlevel then
goto right
end if

left:
high 6 : high 5 : low 7 : low 4
pause turn
goto main

right:
low 6 : low 5 : high 7 : high 4
pause turn
goto main

You nailed the object follow…

Awesome! Damn good. Period.

Good Job, My Man…