idiote servo command

Bloody-orc

Senior Member
Why the **** does the servo lose power after servo command? it only stays powered on until there is a pause command after it. if i start doing something else (readadc, or actually anything). this is just IDIOTIC! and weeery annoying to find out 1 day before competition...

is there a way around this?

program is:
#picaxe 18x
servo 4,150
main:
readadc 2,b0
pause 10
debug
pause 10
goto main

servo is http://www.conrad.fr/webapps/mini_servo_s-36.html


Edited by - bloody-orc on 23/11/2006 17:55:42
 

Bloody-orc

Senior Member
tryed with all things shut down
prgoram:
servo 4,150
pause 500
main
goto main
and still no go...

Edited by - bloody-orc on 23/11/2006 18:53:03
 

Fowkc

Senior Member
Never mind, didn't read the program carefully enough. My answer was completely irrelevant...

Edited by - Fowkc on 23/11/2006 20:11:18
 

BeanieBots

Moderator
OK, keep calm, it's going to be something silly because the servo command DOES work and it DOES keep the servo active.

It does not like any other timing critical commands such as serout and/or debug so remove anything like that.
Do not update the command without at least a 20mS pause.
If your program ends, so will the servo command.
Double check that you have reset pulled high and serin pulled low.
Do not use any pins=.. commands.

Check with a simple example program:-

main:
servo 4,130
pause 500
servo 4,170
pause 500
goto main
 

ljg

New Member
You haven't said anything about your circuitry.

Is the same battery powering the 18X and the servo? power surge might cause resets.

It's better to separate logic and power sources.

at the very least put a 100uF cap across the servo power leads.
 

Bloody-orc

Senior Member
all are separate. and for some freaky reasons it has started to work now a bit better.
so thanks for the answers. i just added some rubber bands...
 

BeanieBots

Moderator
How does it behave with the example code I gave?
If that does not work properly, then you have a hardware problem which must be fixed before looking into any software interaction problems.
 

Bloody-orc

Senior Member
i tested it with my own code and the servo seemed to hold up fine. seems that my servo was just a bit tired (it was 2.00 in the night when i tested it)
 

BeanieBots

Moderator
Glad you got it working.
Here's a little tip while you're playing with servos. (does not work for ALL servos)

main:
for b0=1 to 200
pulsout pin,120
pause 20
next b0

for b0=1 to 200
pulsout pin,180
pause 20
next b0
got main

Run the program and that the servo moves as expected. Feel how strong it is. Now change the two pause 20 lines to pause 10 and feel how strong the servo is.
I've used this trick to great effect with hexpods. I must stress, this trick only works with the cheaper grade servos.
 

Rickharris

Senior Member
Everything is a hardware problem - the software is only doing what it was designed to do. It may be wrong but still what it was designed to do.
 

BeanieBots

Moderator
Surely you could say the same about the hardware. At least it can never be an electronics fault as my old boss always used to refer failures. It is always a mechanical fault. The clue is in the final diagnosis. BROKEN wire, BURNT component, MELTED cable, etc, etc. I'm still waiting to find an electron that disobeys the laws of physics. When I do, I'll call it an electronic fault ;-)
 

Dippy

Moderator
Blimey, we've digressed from servos and on to semantics. It just amuses (?) me that when there is a problem so many people blame the PICAXE before anything else.

The number of threads I've seen which start off with "PICAXE doesn't work.." and end in a red face... no wonder hippy's taking a break.(Actually he's probabaly designing a PICAXE powered transputer).
 

D n T

Senior Member
It always comes down to the final diagnosis, its like always finding something in the last place you look.
A computer programmer on gave me a pearl of wisdom "SH#@ in, SH#@ out".
A wise man told me to learn the basic principles then build on them, some of us are still learning those basics and building on them, and often it hppens on the wrong side of midnight, but hey you get that.

Thats one of the reasons I like this product and forum, because there is so much information freely available and lots of people who have been there and done that to ask for help. I reckon a lot of users have made some of the mistakes that newbies ask about and have learned from them so they don't mind sharing, I have done it myself.

Bloddy orc, thats why they invented Coca Cola, to give people stressing about electronics a chance to chill out and a shot of caffine to keep them awake.
Thanks to all for the help.

Edited by - D n T on 25/11/2006 04:12:08
 
Top