Newbie's servo issues

I am using the botboard with an atom pro 28, and I have a few issues with my servos…

When I use the ENABLEHSERVO command they all freak out, spinning wildly, then settle into the first position that I tell them to go to… is this typical, or am I doing something wrong?

Also, I have a HSR-1425CR continuous rotation servo and cannot get it to respond. What commands in the Basic Atom IDE can I use to get it to move? Should I be using the same commands as normal servos?

Please read this thread. It will explain what is happening so you can prevent it.
viewtopic.php?f=4&t=6598

CR servos respond to the same pulses as a normal servo. You control the speed and direction instead of the exact position of the output shaft.

remove the time/speed part of the parameters from the first servo position commands.

for example this is my first servo command
Hservo [p4\0,p5-2500]

It positions servo on p4 to 0, and servo on p5 to -2500

if your first servo command looks like

Hservo [p4\0[b]100,p5-2500*100*]

for example, then it will freak out.
I don’t really understand why, though people mentioned it before, something about the servos don’t know where they are yet, but i still don’t get it.
My servos still move a tiny bit when i first start my bot, my robot arm always turns clockwise about 20 degrees and the arm tilts back, and the gripper closes a little, every time i start my bot, then it goes to my initial commands positions.

I guess moving the initial position command without time/speed parameters immediately after the enablehservo command might help. I’m going to test that out now though.

Pretty much all analog servos move a little when they are first powered up. This is normal and not an indicator of trouble. To reduce this remove any delays in your program that would slow down the initialization of these pulses.

Thanks RobotDude.
I placed my initial hservo position immediately after my enablehserial/hservo commands, without any pauses.
The servos still twitch like before, but now it all happens so fast it’s less annoying.

Exactly. 8)

Thanks for helping me solve the initial freak=out issue, but how do I generate the pulses to control the continuous rotation servo, do I leave the position parameter out of the hservo commands? Is that possible? or do I have to generate my own pulses?

The CR servos respond to the same pulses as normal servos. The stop value will be around 1500uS. The full speed CW rotation is around 2000uS and the full speed CCW rotation is around 1000uS. The servo responds proportionally in between these values. You can use the offset registers to adjust the stop value. That will allow 1500uS to stop the servo exactly.

How do I generate those pulses for the servo… using basic atom IDE… I mean what commands do I use, I understand that they respond to pulses in that range, but I am new to all of this and do not know BASIC very well.

Your first post states that the servos freak out before they go to the positions you told them to go to. So I’m assuming you know how to position normal servos with hservo. You can use the same hservo commands for the CR servos as you do for normal servos. I believe hservo’s 0 position is the same as 1500uS. I’m not sure of the conversion for hservo to pulse length though. I will ask Nathan to chime in.

Yes, hservo [pin\0] will start ooutputing 1500us pulses in pin immediately.

Aon the AtomPro24 and 28(16mhz processors) the conversion is 16:1. with 0 being 1500us. So to change to 500us the math is -1000*16 = -16000.

On the AtomPro40 and ARC-32(20mhz processors) the conversion is 20:1.

I got it, thanks. I was not giving it a very high position, but I tried again and now have it spinning. Thank you for your help!