I’m trying to test the ranges on a whole bunch of servos that I have before I install them into the kits. i.e. set them to 1.5ms pulse to get them centered so I can line up the horn on it, etc.
I am using a Bot Board with an ATOM Pro, and ATOM-ProIDE 8.0.1.6. I have a simple program to send centering pulse of 1500us, then 2250us pulse for a second, then 1500us, then 750us. (below)
(Changing the extremes to 500/2500 doesn’t make a difference in the final positions vs 750/2250)
The servos all seem to exhibit the same behavior. (I am calling the 1500us pulse 0 degrees)
Also, when at the 750us end, the servo grunts like its trying to go beyond the physical range of the motor.
1500, 2250, 1500, 750, 1500
0 degrees, +35 degrees, 0 degrees, -25 degrees, 0 degrees
If I move the servo manually, the range of motion on them is:
-25 degrees to +160 degrees
What am I missing in getting my servos to a) get their full range of motion, and b) get the center to be more in the center
- Robert
Here is the code I am using to move the servos.
; How many times to do the main loop
loopCount var Word
; How many times to hold at each position
counter var Word
; What size pulse to use.
pulseSize var Word
; Which set of pins to use
pulsePort var Word
start:
; Ring the starting bell
Sound 9,[200\4235]
; For this testing, I only need to use p0
pulsePort = p0
FOR loopCount = 1 TO 10
low pulsePort
; Center
pulseSize = 1500
gosub MoveServo
; Max
pulseSize = 2250
gosub MoveServo
; Center
pulseSize = 1500
gosub MoveServo
; Minimum
pulseSize = 750
gosub MoveServo
; Center
pulseSize = 1500
gosub MoveServo
; Signal End Of Loop Audibly
Sound 9,[200\4235]
NEXT
;------------- Move The Servo To This Position
MoveServo
; Move to this position for 1 second 50*20ms = 1000ms = 1s
FOR counter = 1 TO 50
PULSOUT pulsePort, pulseSize
PAUSE 20
NEXT
return