PDA

View Full Version : Parallax Servo Controller question - Ramp or Speed?



EEder
03-09-2005, 01:11 PM
According to http://www.parallax.com/dl/docs/prod/motors/ServoController.pdf , the 'R' parameter dictates a Ramp, but in practice it doesn't seem to.

I've been using that parameter as the basic rate, or speed and until today, when I need to make it ramp up/down, didn't know it was supposed to be the ramp rate!

I'm controlling two servos here, and the following code moves the servos to the X,Y position at what appears to be a constant speed of "rate"




x = X_MIN
y = Y_MIN
rate = 10 ' the speed of the servos
SEROUT 15, Baud+$8000,["!SC", 1, ra, x.LOWBYTE, x.HIGHBYTE, CR]
SEROUT 15, Baud+$8000,["!SC", 3, ra, y.LOWBYTE, y.HIGHBYTE, CR]




Why is my 'rate' parameter making it move at a constant speed and not ramping?

glaso
03-09-2005, 07:09 PM
I think that your problem is just a matter of names in the variables. You have the variable "ra" in the serout statement and you must have "rate" or viceversa.

maybe..




x = X_MIN
y = Y_MIN
rate = 10 ' the speed of the servos
SEROUT 15, Baud+$8000,["!SC", 1, rate, x.LOWBYTE, x.HIGHBYTE, CR]
SEROUT 15, Baud+$8000,["!SC", 3, rate, y.LOWBYTE, y.HIGHBYTE, CR]

EEder
03-10-2005, 07:04 AM
Actually, that was just me being lazy. You're right, that would cause a problem, but in my actual code, that is fixed. Thanks though :)

Actual code should be:




x = X_MIN
y = Y_MIN
rate = 10 ' the speed of the servos
SEROUT 15, Baud+$8000,["!SC", 1, rate, x.LOWBYTE, x.HIGHBYTE, CR]
SEROUT 15, Baud+$8000,["!SC", 3, rate, y.LOWBYTE, y.HIGHBYTE, CR]

John B
03-10-2005, 11:37 PM
Hi there,

You are correct, the docs refer to the ra variable as a ramp factor, but it really functions as a rate. In the indeterminite future, we will support true servo ramping. Originally we were going to have one parameter that controlled the ramp and the rate, hence the ra parameter. The manual will be modified shortly to include support for the USB version of the controller; when we do, the ra parameter's name will be changed to rate to better relfect its functionality. Sorry about the confusion.

John B.

EEder
03-11-2005, 12:54 PM
Thank you for the clarification, John. Much appreciated.