Servo control
JimG
Posts: 84
I am working my way through the What's a Micro Controller with a BOE and BS2.· I am on Activity 3 that involves controlling a servo motor.· I have no trouble making the program and motor operate but I can't "get it" about how it works, and the how it works is the whole point behind learning this stuff.· I have included a code snippet below.
counter var word
for counter = 1 to 150
· pulsout 14, 1000
· pause 20
next
for counter = 1 to 150
· pulsout 14, 500
· pause 20
next
for counter = 1 to 150
· pulsout 14, 750
· pause 20
next
Thje servo is on I/O pin 14, no problem.· As I said, this works fine.· What I don't understnad is the duration argument.· It one value moves the horn one direction some amount and another value moves it the other direction.· I just don't get the control command at all.· It would seem move logical that a positive number would move it one direction and a negative number would move it the other direction; don't work that way!· ·· Can some one help?
Thanks,
Jim
counter var word
for counter = 1 to 150
· pulsout 14, 1000
· pause 20
next
for counter = 1 to 150
· pulsout 14, 500
· pause 20
next
for counter = 1 to 150
· pulsout 14, 750
· pause 20
next
Thje servo is on I/O pin 14, no problem.· As I said, this works fine.· What I don't understnad is the duration argument.· It one value moves the horn one direction some amount and another value moves it the other direction.· I just don't get the control command at all.· It would seem move logical that a positive number would move it one direction and a negative number would move it the other direction; don't work that way!· ·· Can some one help?
Thanks,
Jim
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
Thanks fo rthe reply.· I have your stuff from the other forum and will "ponder" on it later when my brain starts working again.· I'll let you know if I am still confused.
Jim
Thanks to your writings I better understand how servos work, now, of course, I have mroe questions.
Given the folowing command
PULSOUT <pin>, <duration>
I understand that the <duration> is effectively 2 microsecs so a value of 750 will actually send a 1500 microsec pulse?· Am I right so far?
I coded a loop that sent a stream with appx 20ms spacing from 250 to 1000 which should be sending 500 to 2000 microsec pulses to the servo.· This seems to be the limit of movement for the servo that comes in the BASIC Stamp Discovery Kit.· Since this range is different than the range you spoke of in your message (1000 to 2000 microsecs) I am assuming different servos have different ranges?·
Do they also have different voltage ratings for the opertaing voltage (not the control voltage)?
Do they also have different pussh/pull strengths?
This is a spec typical of what I see when I start searching around for servos, can you help me understand what is is telling me.
Thanks,
Jim
Post Edited (JimG) : 1/21/2006 5:18:02 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
I can't believe that you would rather go out to an awards banquet and be with your family and have a nice day than stay home and answer my questions...some people just have no sense of priority!·
I have found some more information so am better understanding the parameters that describe any given servo.· I also got the spec sheet on the one I have (attached) so things are getting better.·
At the moment, the only thing I am still not sure about is the pulse width.· Are all servos set up on a 1 millisec width?· In other words, are they all set to spread across 1000 to 2000 microsecs?· From the docs I got I can't find where that is specified.
Thanks,
Jim
Sorry I didnt return to the forums yesterday, at the banquet we recieved word that my gf's gpa is in the hospital and went there immeadiately afterwards, hes not doing very well and we are going back in about an hour.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
I'm sorry to hear about the illness. I hope all goes well.
You hav given me enough to work with for th time being. Now I need to experiement a little more.
Jim
And after more than three years, this thread you refer to is still helping people. I just wanted to thank you for taking the time.
Mark Dietrich