Propeller chip and Servo
Gluen
Posts: 5
Hello
I'm quite new to the propeller scene, so bare with me.
I have a couple of questions.
1)
I have·bought at PING))) package containen the ping, brackets and a servo which is to be mounted on a robot.
The purpose of the servo is to make it sweep in front of the robot.
I find it hard to get some info about the servo in the package:
http://www.parallax.com/detail.asp?product_id=900-00005
How can I find out·what to send to the servo?
I've·heard/read that it must receive pulses:
A high pulse with a pulse width of 1-2 ms and then a low pulse of 20ms (the 20ms is what I have heard)
http://forums.parallax.com/showthread.php?p=640383
Is there really no better documentation for this servo?
Anyways, I have found out,·that my·particular servo must have·between 0.375 and 2.3875 high pulses to get full turns either way.
My code is heavily inspired by Bryan K, with some small adjustments
http://forums.parallax.com/showthread.php?p=635355
MY CODE:
FIRST OBJECT FILE(CALLED TestingServo):
''Servo pinout to Prop:
'' black = ground
'' red = 6 volts
'' white = signal coupled to a 4.7 k resistor to prop pin
CON
· servopin = 0
VAR
· long pulse· 'change this value to change the pulse duration
PUB Servo(puls)
pulse := puls
dira[noparse][[/noparse]servopin]~~
outa[noparse][[/noparse]servopin]:=0
······· Repeat 40
········· !outa[noparse][[/noparse]servopin]
········· waitcnt(pulse + cnt)················· ' High time· between 0.375ms and 2,3875ms
········· !outa[noparse][[/noparse]servopin]
········· waitcnt(1_600_000 + cnt)··········' Low time· 20ms·
MY SECOND OBJECT FILE (CALLED Sweep.spin):
CON
· _clkmode = xtal1 + pll16x
· _xinfreq = 5_000_000
OBJ
· dimmer: "TestingServo"
PRI Pause_ms(msDelay)
· waitcnt(cnt + ((clkfreq / 1000) * msDelay))
PUB Sweep
· repeat
··· dimmer.Servo(30_000)
··· Pause_ms(2000)
··· dimmer.Servo(191_000)
··· Pause_ms(2000)·
2)
Bryan K. states (look in link above):
'' white = signal coupled to a 1 k resistor to prop pin
Beau Schwabe states:
''·normal servos are driven from a prop pin through a 4.7k resister··
How come this differences?
Hope you can help me clarify these things.
Thanks in advance.
·
I'm quite new to the propeller scene, so bare with me.
I have a couple of questions.
1)
I have·bought at PING))) package containen the ping, brackets and a servo which is to be mounted on a robot.
The purpose of the servo is to make it sweep in front of the robot.
I find it hard to get some info about the servo in the package:
http://www.parallax.com/detail.asp?product_id=900-00005
How can I find out·what to send to the servo?
I've·heard/read that it must receive pulses:
A high pulse with a pulse width of 1-2 ms and then a low pulse of 20ms (the 20ms is what I have heard)
http://forums.parallax.com/showthread.php?p=640383
Is there really no better documentation for this servo?
Anyways, I have found out,·that my·particular servo must have·between 0.375 and 2.3875 high pulses to get full turns either way.
My code is heavily inspired by Bryan K, with some small adjustments
http://forums.parallax.com/showthread.php?p=635355
MY CODE:
FIRST OBJECT FILE(CALLED TestingServo):
''Servo pinout to Prop:
'' black = ground
'' red = 6 volts
'' white = signal coupled to a 4.7 k resistor to prop pin
CON
· servopin = 0
VAR
· long pulse· 'change this value to change the pulse duration
PUB Servo(puls)
pulse := puls
dira[noparse][[/noparse]servopin]~~
outa[noparse][[/noparse]servopin]:=0
······· Repeat 40
········· !outa[noparse][[/noparse]servopin]
········· waitcnt(pulse + cnt)················· ' High time· between 0.375ms and 2,3875ms
········· !outa[noparse][[/noparse]servopin]
········· waitcnt(1_600_000 + cnt)··········' Low time· 20ms·
MY SECOND OBJECT FILE (CALLED Sweep.spin):
CON
· _clkmode = xtal1 + pll16x
· _xinfreq = 5_000_000
OBJ
· dimmer: "TestingServo"
PRI Pause_ms(msDelay)
· waitcnt(cnt + ((clkfreq / 1000) * msDelay))
PUB Sweep
· repeat
··· dimmer.Servo(30_000)
··· Pause_ms(2000)
··· dimmer.Servo(191_000)
··· Pause_ms(2000)·
2)
Bryan K. states (look in link above):
'' white = signal coupled to a 1 k resistor to prop pin
Beau Schwabe states:
''·normal servos are driven from a prop pin through a 4.7k resister··
How come this differences?
Hope you can help me clarify these things.
Thanks in advance.
·
Comments
I asked if there was a value resistor that could be used with both the PING and a normal servo. Mike Green gave this answer....
As far as control for the servo, use the Servo_32 object that's in the object exchange, found here ww1.parallax.com/Default.aspx?tabid=65 There is a well documented demo included that explains how to use the object as well.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian Meade
"They who dream by day are cognizant of many things which escape those who dream only by night" - Edgar Poe