Putting robotics at your service™

Free shipping on orders over $200

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 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.
Code:
; 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


User avatar
Guru ( offline )
Posts: 9257
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
http://www.lynxmotion.com
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!

Quote:
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.


Code:
ENABLEHSERVO
LOW P0
start:

HSERVO [P0\0]
PAUSE 2000

HSERVO [P0\12000]
PAUSE 1000

HSERVO [P0\0]
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 2014-10-22 22:19
Feedback Form
Feedback Form