Hi All.
I'm building a "Head" that can track movement left to right and vice verser.
The hardware:
2x SRF05 u/sonic sensors.
1x servo with the guts ripped out and stop filed off.
1x Picaxe 18A
1x axe033 lcd module (just so i can see what the u/sonics are doing)
1x 555 h-bridge (credit crunch and all that you know. All i had were 555's so i had to make a plan)
http://www.electronicsforu.com/EFYLinux/circuit/sep2004/CI-02-DC_Motor.pdf
The problem:
It sort of works, tracking me as i walk past (at about 0.0001 km/ph just faster that a snail at full tilt) it at about a distance of about a meter, very jerky and won't keep still even when i come to a complete stop. more often than not it will get tired of me just standing still and just head off to track .....well i just don't know what!!. the other problem is that it only for a few miniutes then it locks up and will do nothing more.
My thoughts:
For what their worth, i think that the gearing on the servo is not fine enough therefore with every pulse of the motor it moves just off the target and has to start all over again. This becomes a vicious cycle untill it misses the target colmpetely and foucses on the next nearest thing, even then it does not keep still.
I think that the biggest problem is with the code. Here's what i've got so far, i know that there's a mistake in it but i just can't see it.
PLEEEEEEEEASE can anyone help.
symbol trig = 0
symbol echo = 0
symbol trig1 = 1
symbol echo1 = 1
symbol range = w1
symbol range1 = w2
main:
pulsout trig1,2
pulsin echo1,1,range1
let range1 = range1 * 10 / 58
pause 10
serout 3,N2400,(254,192,"range ",#range," ")
pause 10
pulsout trig,2
pulsin echo,1,range
let range = range * 10 / 58
pause 10
serout 3,N2400,(254,128,"range1 ",#range1," ")
pause 10
if range < range1 then gosub cw
if range1 < range then gosub ccw
goto main
cw:
toggle 5
goto main
ccw:
toggle 4
goto main
p.s the u/sonics are about 5cm apart.
thanks
bulldog
I'm building a "Head" that can track movement left to right and vice verser.
The hardware:
2x SRF05 u/sonic sensors.
1x servo with the guts ripped out and stop filed off.
1x Picaxe 18A
1x axe033 lcd module (just so i can see what the u/sonics are doing)
1x 555 h-bridge (credit crunch and all that you know. All i had were 555's so i had to make a plan)
http://www.electronicsforu.com/EFYLinux/circuit/sep2004/CI-02-DC_Motor.pdf
The problem:
It sort of works, tracking me as i walk past (at about 0.0001 km/ph just faster that a snail at full tilt) it at about a distance of about a meter, very jerky and won't keep still even when i come to a complete stop. more often than not it will get tired of me just standing still and just head off to track .....well i just don't know what!!. the other problem is that it only for a few miniutes then it locks up and will do nothing more.
My thoughts:
For what their worth, i think that the gearing on the servo is not fine enough therefore with every pulse of the motor it moves just off the target and has to start all over again. This becomes a vicious cycle untill it misses the target colmpetely and foucses on the next nearest thing, even then it does not keep still.
I think that the biggest problem is with the code. Here's what i've got so far, i know that there's a mistake in it but i just can't see it.
PLEEEEEEEEASE can anyone help.
symbol trig = 0
symbol echo = 0
symbol trig1 = 1
symbol echo1 = 1
symbol range = w1
symbol range1 = w2
main:
pulsout trig1,2
pulsin echo1,1,range1
let range1 = range1 * 10 / 58
pause 10
serout 3,N2400,(254,192,"range ",#range," ")
pause 10
pulsout trig,2
pulsin echo,1,range
let range = range * 10 / 58
pause 10
serout 3,N2400,(254,128,"range1 ",#range1," ")
pause 10
if range < range1 then gosub cw
if range1 < range then gosub ccw
goto main
cw:
toggle 5
goto main
ccw:
toggle 4
goto main
p.s the u/sonics are about 5cm apart.
thanks
bulldog
Last edited: