Getting sick of initial jerk in hservo command

I’ve been working on my robot for a while and to get to the point I’ve been using HSERVO to command the servos in my robot. However, I’m really getting sick of the way the servos jerk to one side when I apply power to the robot. Is there any way to keep this from happening? I’m pretty sure I saw a thread on this somewhere but I forgot where.

Simply make sure the hservo is used to enable the servos before using the timed move function. Using the timed move before hservo enables the servo makes it incorrectly assume it starts the move at 0uS.

I’d be willing to bet money in a future release hservo will ignore the timed move information if the servo is not already enabled. :wink:

Sorry but I don’t quite understand. What do you mean by timed move function? :confused:

Post your code. Will look at it. Gotta go…

[code]enablehservo

shoulder con p12

shoulderangle var sword

main

shoulderangle= 90* 155

hservo[shoulder\shoulderangle\200]
hservowait[shoulder]
goto main[/code]

This is how an hservo command is structured. hservo[servo pin\position\time]

If time is anything other than 0 on the first movement, you will have errors like what you are describing.

Post a line like this somewhere above main and below enablehservo: hservo[shoulder\someacceptableangle\0]

Oh :astonished: darned outdated BAP manual … figures :unamused:

Here is the official all things Atom programming manual in PDF format. From the Basic Micro forum.

forums.basicmicro.net/syntax-man … tml#p42400

Also, just to clarify, the third argument is not time. Its distance to move every 20ms(eg speed). Assuming an ARC-32 running at 20mhz you have 60000 points between 0ms and 3ms centers at 1.5ms pulses(eg 0). If your current position is 0 and you want to move to 10000(eg 2ms pulses) and you want to do it in 1 second you must set the speed argument to 10000/50 = 200. So every 20ms the servo will move 200 steps along it’s planned move of 10000 steps.

The 50 is from 1s divided by 20ms = 50 times.