Lynxmotion Tech Support

www.lynxmotion.com
It is currently Sun May 19, 2013 1:59 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Feb 06, 2008 5:55 pm 
Offline
Roboteer

Joined: Wed Apr 11, 2007 6:36 pm
Posts: 13
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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 06, 2008 7:53 pm 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
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...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 06, 2008 8:57 pm 
Offline
Roboteer

Joined: Wed Apr 11, 2007 6:36 pm
Posts: 13
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group