Thread Tools
Dec 29, 2009, 02:29 AM
Registered User
Thread OP

building a servo driver (again)

(Sorry about starting a new thread) hey in the last thread
you guys helped me build a servo driver but im having trouble
getting it to work... i programmed the picaxe 08m with this code

'Switch controlled servo

symbol pos = b0 'variable b0 renamed pos
pos = 150 'value asigned to variable
servo 4,pos 'servo on GPIO 4 cented
if pin1 = 1 and pin2 = 1 then goto main
if pin1 = 0 and pin2 = 0 then goto main
pause 100 'delay switch debounce
if pin1 = 1 then goto upp
if pin2 = 1 then goto dnn
goto main
pos = pos+1 max 200 'variable incremented
servopos 4,pos 'servo moves up
goto main
pos=pos-1 min 100
servopos 4,pos 'servo moves down
goto main

it went through said it was successful. then i built the circuit at the bottom,
put on the servo, supplied it with 5 volts and nothing happened the servo didn't
center or anything.I've gone over the circuit several times and havent found anything wrong.could you guys check over see if im overlooking something?
thanks guys
Last edited by newbielife5; Dec 29, 2009 at 02:56 AM.
Sign up now
to remove ads between posts
Dec 29, 2009, 03:25 AM
Registered User
Greetings Bryan I will build the circuit and get back to you. Dave
Last edited by orraman; Jan 07, 2010 at 06:04 AM.
Dec 29, 2009, 03:56 AM
Registered User
Thread OP
hey dave thanks for doin that for me.
ill be back on tommorow
Dec 29, 2009, 04:59 AM
Registered User
My fault I am afraid, I have put the 10k resistor on the wrong side of the 22k resistor in the diagram.
This will cause no damage but can prevent a proper download.
I will make up a board and check the servo output.

Profound apologies
After things are sorted out properly could I ask you to edit the diagram in your post so that others will be saved from my mistake.

From Help in the Editor, Page 7 of Manual 1 shows the correct download circuit.
Dec 29, 2009, 07:14 AM
Registered User
It might help to start with a simple LED flashing program. Next on the 18X

I use was a loop with debug to dump an a/d value to the screen, see it change
when you turn it. Then you are on your way!
Dec 29, 2009, 09:10 AM
Registered User
I was going to suggest that but spotted my mistake and thought it best to sort it out immediately.

The ammended circuit is working on a 08M Prototype board.
Picaxe recommend starting at 100ms for switch debounce but the speed of the servo is very low.
I have reduced that to 3ms and although I am using a piece of wire for the switch there have been no problems.
My intention had been to show the most easily understood code but I was not sure that the servopos command would work with such a small pause.
In practice it works fine with a frame rate of 20ms on the scope but it is always posssible to use the Pulsout command if it is needed.

Dissleccik Dave
Dec 29, 2009, 07:30 PM
Registered User
Thread OP
dang i just reprogrammed it with that fix but it still wont work
gonna have to go over it all again...
Dec 29, 2009, 07:46 PM
Registered User
The program itself seems functionally fine, perhaps it is a hook up problem, 5v to servo on red, signal on white (or yellow or whatever you have), and ground on black. Did you tie the servo and picaxe to the same ground btw, or i should say did you tie the ground for the picaxe circuit to the ground for servo power, if not I believe the servo will not function.
Last edited by jppizhere; Dec 29, 2009 at 07:53 PM.
Dec 29, 2009, 08:02 PM
Registered User
Thread OP
yes i have the servo connected right, and it is connected to same ground as the picaxe. i have no idea what could be wrong i even rebuilt the whole circuit again on a breadboard
Dec 29, 2009, 08:05 PM
Registered User
Do you have a DVM or scope? Write a simple test program to just turn one
bit on and make sure that works. This is called troubleshooting!
Dec 29, 2009, 08:12 PM
Registered User
How about try the servopos example out of picaxe manual and see if it drives the servo, if not is a hardware issue, if it does software is the culprit
Dec 29, 2009, 08:12 PM
Registered User
Thread OP
no i dont have one
Dec 29, 2009, 08:47 PM
Registered User
Do you have an LED and a 1K resistor? You need to test the downloading of the program and execution. If it will not flash a led, it won't do anything else.
Dec 29, 2009, 09:11 PM
Registered User
Thread OP
ahhhh, i found out what it was it was the batterys i had to use a seperate pack for it to work. but now my problem is down on my rov i only have 1 battery pack and cannot have another just for the servo. so is there anyway to filter out the noise so i can use the same pack?
Dec 29, 2009, 09:45 PM
Registered User
It should work on one battery. Make sure the grounds of the chip and servo are run separately to the batt -. Make sure you have at least a .1uF cap on the power pins of the chip, short leads. Add a 10uF or 100uF for more filtering. Do you have a 5V regulator for the chip? This is easy to do, running a servo
from a PICAXE.

Quick Reply

Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
For Sale ACE Chargemaster, Overnighter, and Servo Driver!! aeronot Aircraft - General - Miscellaneous (FS/W) 4 Feb 22, 2010 01:11 AM
Help! Can you use a servo driver to operate an ESC? Lance Nordby Power Systems 27 Jan 24, 2010 02:43 PM
Sold Servo Extension building service BD Flyer Aircraft - Sailplanes (FS/W) 56 Jan 07, 2010 03:37 PM
Question build a servo driver newbielife5 DIY Electronics 34 Dec 11, 2009 01:16 PM
Servo board as actuator driver for servo based recievers? anestho Scratchbuilt Indoor and Micro Models 1 Aug 04, 2005 10:17 AM