Putting robotics at your service™

Free shipping on orders over $75

My Servos dont seem to be using thier full range of motion

Print view Share :
Previous topicNext topic

Page 1 of 1 [ 3 posts ]

Rookie ( offline )
Posts: 13
Posted: 2008-02-06 18:55 
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 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

; 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]

;------------- Move The Servo To This Position
  ;  Move to this position for 1 second 50*20ms = 1000ms = 1s
  FOR counter = 1 TO 50
    PULSOUT pulsePort, pulseSize
    PAUSE 20

User avatar
Guru ( offline )
Posts: 9256
Posted: 2008-02-06 20:53 
Problem is Atom has 1uS resolution, but the Pro has half uS res. So you were really creating these pulslengths.

750 = 375
1500 = 750
2250 = 1125

Jim Frye, the Robot Guy
I've always tried to do my best...

Rookie ( offline )
Posts: 13
Posted: 2008-02-06 21:57 
It actually does say that in the Pro manual. D'oh!

time is a variable or constant (minimum value 8 ) that specifies
the duration of the pulse in 0.5 microseconds increments.

Switching to call HSERVO made it work as expected.


PAUSE 2000

HSERVO [P0\12000]
PAUSE 1000

PAUSE 1000

HSERVO [P0\-12000]
PAUSE 1000

goto start

Thanks for that. I was banging my head trying to figure out why it wasnt working. Guess I should read the manuals a little more closely.

- Robert


All times are UTC - 5 hours [ DST ]. It is currently 2015-08-28 15:11
Feedback Form