Servo Tester Using Picaxe 08M

servopot4.bas (3312Bytes)
servotst.png (4535Bytes)

This is my second Picaxe project . It is a simple servo tester or servo cycler built using an 08M . It has 3 modes of operation . In mode 1 each servo is controlled by its own pot . In mode 2 both servos are centered with a 1.5 millisecond pulse . In mode 3 both servos are cycled with the left pot setting the low end point and the right pot setting the high end point . The modes are cycled using a normally open switch . I had to use the pulseout command instead of the servo and servopos commands to avoid jitter .

     I used an enclosure from an old rc toy airplane charger for the case . It was a tight fit for the 4 AA battery box , 2 pots , circuit board etc. The circuit board was made by laser printing onto a label backing sheet and transferring by iron to the pcb . Ferric chloride was used for etching . This was the first time I tried the laser printer method and the results were ok but not great .

    I know you can buy a single channel version of this for a few dollars but I like to make my own stuff . It's really handy for setting up servos without doing any programming . I have included the basic program and schematic for anyone who is interested .

servotst.png

https://www.youtube.com/watch?v=GEul631_k0I?hl=en

Nice work. Can you post a

Nice work. Can you post a schematic of your circuit?

 

Thanks for sharing!

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 :slight_smile: 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:

servotester.jpg

Included schematic

Thanks . I included the schematic as an attachment along with the code . I have edited the post to include the image in the main body . I’m new here so I’m still not sure where to put things .

What processor did you use

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 .

Same as you did. 08M rocks!

Same as you did. 08M rocks! :slight_smile:

Very handy tool my friend. I

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

Cheaper servo tester

Check out this link, they are cheap connect servo potentiometer and 6V battery and it works :wink:

http://www.mindsetsonline.co.uk/product_info.php?cPath=16_13_530&products_id=1009480

’serfreq’ command not supported

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

 

I am not familer with your

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.

JOY!

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

I´ll be DAMNED!

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

I would delete the first

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