Let's Make Robots!

Servo Tester Using Picaxe 08M

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Andres Briano's picture

Hey Rick100,

I took the liberty of copying your code provided in this post and stripping it out to the bare minimum. I ended up with this:

#picaxe 18x

symbol potvaluex = w3
symbol potvaluey = w4

setfreq m8  'run @ 8 MHz for twice servo resolution

pause 2000
low 4   'initial state of servo signal lines
low 5

main:
readadc10 0,potvaluex ' 'read 10 bit value into potvalue
potvaluex = potvaluex * 5 / 17
potvaluex = potvaluex + 150
pulsout 4,potvaluex
pause 50

readadc10 1,potvaluey ' 'read 10 bit value into potvalue
potvaluey = potvaluey * 5 / 17
potvaluey = potvaluey + 150
pulsout 5,potvaluey
pause 50

goto main

I get the same jitter as before. Do you have any idea why this is not working for me when it clearly works for you? 

Thanks,
Andrés

Rick100's picture

I would delete the first 'pause 50' and change the second one to 'pause 25' but I don't think that's your problem . Is the circuit built on a breadboard ? Have you tried adding a 100 or 220 uF cap where the power supply comes onto the board ? Measure voltages while its running . Try measuring voltage from where ground enters the board to the ground pin on the picaxe and the ground pins of the servos in case you have a bad connection . Do this for the positive voltage also .If the connections are good the voltage reading should be be close to zero . While it's running , push on the connections .  Whenever I have any kind of erratic behaviour , I always look for bad connections . You can also try the following code that does't read the pots to try and isolate the problem . It just sets the servos to center position .

#picaxe 18x

symbol potvaluex = w3
symbol potvaluey = w4

setfreq m8  'run @ 8 MHz for twice servo resolution

pause 2000
low 4   'initial state of servo signal lines
low 5

main:

pulsout 4,300
pulsout 5,300
pause 30

goto main

 

It's an edited version of your code and I haven't tested it .

Good luck and let me know how it goes .

Rick

Andres Briano's picture

Hey Rick100,

I have experimented with something similar, but with the pots placed on a joystick: PIC-AIM. I struggled with it for a month with no success. Servo jitter was my enemy. The funny thing is that I have collected this page of yours before I started that experiment. It looks as though the answer to my problem has been in "My Collection" all along. I´ve taken a look at your code and your pulseout approach looks promising. I can´t wait to adapt it to my gizmo.

For some reason I remembered this project of yours today...

Andrés

happytriger2000's picture

I'm using a Stamp board to compile Servopot4.bas and Im getting th following error: 'serfreq' command not supported in this mode, does it mean I have to get a Picaxe 08M in order to run Servopot4.bas?

 

http://i1204.photobucket.com/albums/bb407/cncfreakcncfreak/Picaxe%20projects/DSC03657.jpg

http://s1204.photobucket.com/albums/bb407/cncfreakcncfreak/Picaxe%20projects/?action=view&current=DSC03656.jpg

 

Rick100's picture

I am not familer with your Stamp board . Is it the original Parallax Basic Stamp , also called the Stamp 1 ? The program will not run on a Parallax Stamp . It will run on an Picaxe 08M without change . I haven't tried it yet on an 08M2 . I have some ordered and will post any code updates as soon as I can .

Good luck.

The electrician's picture
Check out this link, they are cheap connect servo potentiometer and 6V battery and it works ;-) http://www.mindsetsonline.co.uk/product_info.php?cPath=16_13_530&products_id=1009480
Korel's picture

Very handy tool my friend. I also like food containers too,easy to make them waterproof also. Thanks for sharing :)

isotope's picture

I have built myself one few months ago. Mine is very simple comparing to yours, it just controls 2 servos with 2 pots. And it is very bulky as I've used my favorite enclosure - lunch box :) I believe this device is a MUST HAVE for a robot hobbyist, and as you have said, preferrably DIY. Thanks a lot for posting! Ah, here is mine:

Rick100's picture

What processor did you use or did you use a 555 timer . I like food containers as enclosures also . Here is a picture of my FTDI breakout board with a Picaxe programming jack .

isotope's picture

Same as you did. 08M rocks! :)