Shop OBEX P1 Docs P2 Docs Learn Events
Propeller chip and Servo — Parallax Forums

Propeller chip and Servo

GluenGluen Posts: 5
edited 2007-04-05 12:20 in Propeller 1
Hello

I'm quite new to the propeller scene, so bare with me.
I have a couple of questions.

1)confused.gif
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)confused.gif
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

  • parts-man73parts-man73 Posts: 830
    edited 2007-04-05 12:20
    The value of this was recently discussed in this thread http://forums.parallax.com/showthread.php?p=641462

    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....
    Mike Green said...
    I set up the servo connectors on my own Protoboard with 1K resistors and use one position for a PING. The main reason for these resistors is to protect the Propeller I/O pins from excess current if something is misconnected (say to +5V). For the PING, it provides a +5V pulse at times. A 1K resistor limits the current through the protective diodes to (5V - 3.9V) / 1K = about 1ma. If a servo failed and put its supply voltage on the control pin, this would also protect the Propeller. If the Propeller program were buggy and tried to drive the PING pin LOW when the PING was trying to drive it HIGH, you'd still be safe at (5V - 0V) / 1K = 5ma.

    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
Sign In or Register to comment.