Shop OBEX P1 Docs P2 Docs Learn Events
Parallax Servo Controller question - Ramp or Speed? — Parallax Forums

Parallax Servo Controller question - Ramp or Speed?

EEderEEder Posts: 12
edited 2005-03-11 05:54 in BASIC Stamp
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,[noparse][[/noparse]"!SC", 1, ra, x.LOWBYTE, x.HIGHBYTE, CR]
  SEROUT 15, Baud+$8000,[noparse][[/noparse]"!SC", 3, ra, y.LOWBYTE, y.HIGHBYTE, CR]




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

Comments

  • glasoglaso Posts: 38
    edited 2005-03-09 12:09
    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,[noparse][[/noparse]"!SC", 1, rate, x.LOWBYTE, x.HIGHBYTE, CR]
     SEROUT 15, Baud+$8000,[noparse][[/noparse]"!SC", 3, rate, y.LOWBYTE, y.HIGHBYTE, CR]
    
    
  • EEderEEder Posts: 12
    edited 2005-03-10 00:04
    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 [noparse]:)[/noparse]

    Actual code should be:

    x = X_MIN
     y = Y_MIN
     rate = 10 ' the speed of the servos
     SEROUT 15, Baud+$8000,[noparse][[/noparse]"!SC", 1, rate, x.LOWBYTE, x.HIGHBYTE, CR]
     SEROUT 15, Baud+$8000,[noparse][[/noparse]"!SC", 3, rate, y.LOWBYTE, y.HIGHBYTE, CR]
    
    
  • John BJohn B Posts: 82
    edited 2005-03-10 16:37
    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.
  • EEderEEder Posts: 12
    edited 2005-03-11 05:54
    Thank you for the clarification, John. Much appreciated.
Sign In or Register to comment.