Download Print this page

Parallax Continuous Rotation Servo Manual page 4

Advertisement

Calibration – "Center" the Servo
The servo has a pot entiometer access port, right above the plac e where the cable attaches to the c ase.
The port allows the user to adjust the servo to hold completely still when receiving a 1.5 ms pulse width.
This is the value in the "center" of the range of control pulses the servo will accept.
To center the servo, program your host device to
20 ms. S ample calibration code is giv en below f or all BASIC Stamp model s, Spin for the Propeller
P8X32A microcontroller, and SX/B for the SX chip.
product page at www.parallax.com.
Connect the servo to your microcontroller's I/O pin. The example programs below specify an I/O pin.
BASIC Stamp Calibration Code - for all BS2 models
Connect the servo to BASIC Stamp 1/O pin P12, or update the ToServo PIN declaration.
Run the program, and gently twist the potentiometer adjustment screw until the servo does not
turn or vibrate.
sensitive so a very light touch will be required.
'
CenterParallaxCrServo.bs2
' {$STAMP BS2}
' {$PBASIC 2.5}
#SELECT $Stamp
#CASE BS2, BS2E, BS2PE
Center CON 750
#CASE BS2SX, BS2P, BS2PX
Center CON 1875
#ENDSELECT
ToServo PIN 12
DO
PULSOUT ToServo, Center
PAUSE 20
LOOP
Propeller Chip Calibration Code – for P8X32A
Download and unzip the Propeller code file from the 900-00008 product page.
Connect the servo signal pin to Propeller I/O pin P0.
Run the program CenterParallaxServo.spin, and gently twist the potentiometer adjustment screw
until the servo does not turn or vibrate.
The potentiometer is very sensitive so a very light touch will be required.
{{ CenterParallaxServo.spin
For centering Parallax Continuous Rotation Servo
or holding Parallax Standard Servo at 90° position.
Sends a 1.5 ms pulse approx every 20 ms }}
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
servoPin = 0
PUB CenterServo | tInc, tc, tHa, t
Copyright © Parallax Inc.
NOTE: Calibrating the servo may take some patience. The potentiometer is very
' PULSOUT Duration units are 2 us for these models
' PULSOUT Duration units are 0.8 us for these models
' connect servo to I/O pin P12, or change it here
' ToServo pin outputs 1.5 ms pulse
' refresh pulse every 20 milliseconds
' System clock → 80 MHz
' Using 5 MHz external crystal oscillator
' Servo signal to this I/O pin-change if needed
Parallax Continuous Rotation Servo (#900-00008)
deliver a 1.5 ms pulse,
All are avail able for downl oad from th e 900-00008
NOTE: Calibrating the servo m ay take some p atience.
continually refreshed ever y
v2.2 10/24/2011 Page 4 of 8

Advertisement

loading

This manual is also suitable for:

900-00008Rob-16048