problem with pulsing servos

snork

New Member
I have two 360 degree modified servos as described here http://www.acroname.com/robotics/info/ideas/mod322hd/mod322hd.html. so the problem appears, when i send a centrepulse using three different code versions:

main:
servo 1,150
servo 2,150
pause 10
goto main

=> both servos are standing still

main:
servo 1,150
servo 2,150
pause 10
goto loop

loop:goto loop

=>one of them is spinning

main:
pulsout 1,150
pulsout 2,150
pause 20
goto main

=> both are spinning

(what im actually working on is a driving software for my robot, where the direction is compass-corrected. the code seems to be right for me so far, but the juddering servos make the navigation impossible. so im looking there for the fault.)

greetings

snork
 

Michael 2727

Senior Member
Hi Snork,

I can't help with your question, but there
is an alternative to modifying a servo.

I made one like this about 20 years ago
to automate a set of Vertical Blind curtains.

I snipped off the rotational stop on the splined output cog, then removed the Pot
completely, replacing it with 2 = value resistors. That made it think it was centered.

I attached the wooden plug (12mm MDF board) from a
44mm holesaw to the servo. The plug was put on a drill and a groove cut into the
edge about 4mm W x 3mm Deep then 4mm holes
were drilled into the groove 2mm apart all
the way round.
These holes allowed my home made cog to grip
the Beaded Curtain chain that opened and closed it.
The whole thing just hung at the bottom of
the beaded chain, the battery pack provided
the weight to prevent the whole thing
spinning while driving the chain up or down.

Bit off track but fun.





Edited by - Michael 2727 on 12/2/2005 6:52:36 AM
 

Jeremy Leach

Senior Member
I'm no servo expert (although I'd like to try this), but reading the article in the link you've given says:
<i>
You'll need a controller (we use a BrainStem GP 1.0 module) that outputs a 1.5ms centering pulse and supplies power to the servo. Plug in the servo. The motor will probably be spinning. Adjust the potentiometer (whose knob you just removed) with a small screwdriver until it stops rotating. As an optional next step, you can put a tiny bit of glue on the pot to hold it in that centered position

</i>

So it looks to me as though you haven't done this step properly.

If I've got this right, the whole idea of this mod is to convert the servo into just a geared motor - ie ditch any sort of positional feedback? (which means that the servo command will be of no use to you once you've completed the mod?)

Edited by - Jeremy Leach on 12/2/2005 6:58:54 AM
 

Technical

Technical Support
Staff member
Your test progam is flawed

main:
servo 1,150
servo 2,150
pause 10
goto main

The servo command outputs a pulse every 20ms in the background. However in your program you are actively resetting the servo command quicker than this (every 10ms), hence completely destroying the timing!

Your test program should look like this - ie just using the servo command once:

main:
servo 1,150
servo 2,150
loop:
goto loop

Then adjust the pot to get a stationary motor at this pulse stream as Jeremy suggests.
 

snork

New Member
I already centred the servos using the first code listed, like described on the homepage. I forgot to say that. It appears that the accuracy of the pulses varies in the different codes. its quite complicated to remove the electronics so i prefer to use the other way. im not sure if one of the servos is damaged or if the picaxe doesnt send proper pulses. ill keep on testing:/, hopefully ill find a way.

thx for advice

snork

edit: it works now. thx to technical:)

Edited by - snork on 12/2/2005 10:46:33 AM
 

BeanieBots

Moderator
To test your servos/PICAXE, simply send a fixed servo stream.
eg
main
servo 1,150
loop
goto loop

The tight loop at the end is keep the PICAXE running and hence keep sending pulses.

As pointed out by Technical, always keep at least 20mS between servo command updates. That includes any servo command so you must also insert a pause between the two update lines.
Trial and error will find pause values that give the best results. The exact value is also a function of the rest of your code when in a tight loop, so any changes to your code may result in a required change to your pause value.
 

flyingnunrt

Senior Member
Since you have modified the servo it now has a fixed feedback voltage from the pot to it's own internal amp which you can trim out via the pot to make the servo stationary with no signal.
This will not be the normal positional feedback associated with a normal servo.
if you apply a signal with a pusle width of say 1ms the servo should rotate one way and with a signal of say 2ms it should rotate the other way.
you have tuned the servo for &quot;centre&quot; with a output pulse of 150 so now you should add the rotate left and rotate right commands.
Try this
Main:
servo 1,150
servo 2,150
pause 20
goto main
'Servo stopped (but not centred)
may creep a little.

Main:
servo 1,100
servo 2,100
pause 20
goto main
'both servos rotating forward

Main:
servo 1,200
servo 2,200
pause 20
goto main
'both servos rotating in reverse

Main:
servo 1,100
servo 2,200
pause 20
goto main
'servos going oposite directions

I would think that it will be difficult to get the servos to stop creeping at the 150 position.


Edited by - flyingnunrt on 12/3/2005 4:31:03 AM
 
Top