Shop OBEX P1 Docs P2 Docs Learn Events
Servo motor problems, help!!! — Parallax Forums

Servo motor problems, help!!!

sam_samarsam_samar Posts: 2
edited 2009-03-18 19:54 in BASIC Stamp
Hello,
I have problems with continuous rotation motors. I have a system, where is·sixteen motors.

This is my software:
' {$STAMP BS2}
'{$PBASIC 2.5}
' {$PORT COM12}
ch VAR Byte
pw VAR Word
ra VAR Byte
Sdat CON 14
baud CON 398
counter· VAR Word
DO
ra = 5
ch = 0
pw = 1250
SEROUT Sdat, Baud+$1000,[noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
PAUSE 1000
ra = 5
ch = 0
pw = 250
SEROUT Sdat, Baud+$1000,[noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
PAUSE 2000
LOOP

And this continue to all 16 channel.

hop.gif

PROBLEM!!!

All motor move 0->180 dgrees·and back to 180-0 degrees all to time.

Now I must change motor speed, it is now too high. How I change motor speed?? How I change program?

Thank you!
1944 x 2592 - 810K

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-18 17:00
    You do not have continuous rotation servos if they behave the way you describe. Ordinary servos move to a position specified by the two byte value in the SEROUT statements (pw.LOWBYTE and pw.HIGHBYTE). Continuous motion servos use the same value to specify the speed and direction. With ordinary servos, you can't control the speed. What you can do is to change their position in small amounts, allowing a pause between each movement. The very small movements will be rapid, but the overall movement will be slow. If the steps are small enough, you won't notice the difference.
  • sam_samarsam_samar Posts: 2
    edited 2009-03-18 17:29
    Thanks Mike,

    If I use "standard servomotor", can I change speed?
  • PropabilityPropability Posts: 142
    edited 2009-03-18 18:27
    sam

    ·It looks like you do have continuous rotation servos in your picture and that you are using the parallax servo controller.

    From what I see in your code you are commanding the servo to go from full foward to full backwards as you go thru the loop.

    I do not have a PSC but from what I see is that the value of 750 would be no movement so just vary the values from 750 to 1250 for one direction and 750 to 250 for the other direction.

    Pete
  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-18 18:52
    Please reread my message. You cannot change the speed of standard servos but you can change the effective speed by moving them slowly through a series of small quick steps. For example, if you want the servo to move from a pulse width value of 250 to 1250, you can move it from 250 to 300, then from 300 to 350, then from 350 to 400, etc. up to 1250, each step with a pause of 100 to 250ms afterwards. The resulting movement will appear to be slow, but is made up of small rapid movements. You can make the steps smaller if needed.
  • PropabilityPropability Posts: 142
    edited 2009-03-18 19:31
    If the OP does have a PSC it does allow "ramping" of the servos "speed" .

    Pete
  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-18 19:54
    Good point. The "ra" parameter is the ramping specification. Look in the documentation for the Parallax Servo Controller (PSC) for a description of this parameter. It specifies how long the controller should take to make the movement requested and works as I described by taking a specified amount of time to change the control pulse width from the current value to the requested value.
Sign In or Register to comment.