Shop OBEX P1 Docs P2 Docs Learn Events
Problem with Servo control or Servo32v3 — Parallax Forums

Problem with Servo control or Servo32v3

GeorgeCollinsGeorgeCollins Posts: 132
edited 2008-10-16 05:36 in Propeller 1
I am using the Prop Object Servo32v3 to control servos. I using a spin studio board connected to a CrustCrawler Quadruped, which has 8 hobby servos.

If I do the following code:
CON
    _clkmode = xtal1 + pll16x                           
    _xinfreq = 5_000_000                                'Note Clock Speed for your setup!!


OBJ
  Servo : "Servo32v3"

PUB Main
  Servo.start
  Servo.Set(0,1000)
  Servo.Set(2,1000)




Servo 0 sets but Servo 2 doesn't

If I reverse the order
CON
    _clkmode = xtal1 + pll16x                           
    _xinfreq = 5_000_000                                'Note Clock Speed for your setup!!


OBJ
  Servo : "Servo32v3"

PUB Main
  Servo.start
  Servo.Set(2,1000)
  Servo.Set(0,1000)




Servo 2 sets but not servo 1. Both servos obviously work and are connected. Why does it matter what order I set the servos in? How do I set multiple servos at the same time?

The prop and servos have different power supplies, and I do not think current drain is the issue.

Thank you for your help.
George Collins

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-16 04:27
    I believe you have to call Servo.set once for each servo's initial position prior to calling Servo.start.
    Read the comments in the source code for the included demo program.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2008-10-16 05:22
    GeorgeCollins,

    Mike is correct, The Servo's must be preset to a known position before you start the servo routine. Doing this also provides information as to what pins you will be using for servo's creating a mask so that the other pins will be ignored from within the servo routine.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • GeorgeCollinsGeorgeCollins Posts: 132
    edited 2008-10-16 05:36
    Thank you, that solves it.
Sign In or Register to comment.