Shop OBEX P1 Docs P2 Docs Learn Events
Propeller + Servo Control Board --> Let's move some servos! — Parallax Forums

Propeller + Servo Control Board --> Let's move some servos!

PhufPhuf Posts: 2
edited 2008-10-31 20:59 in General Discussion
Hello,

I accidentally posted this same question to the Propeller section without a subject...duh! I'm learning- just registered today.

OK, second post of the daysmile.gif, Here's my problem:

I'm currently trying to establish communication between the servo controller REV B and the Propeller 28X32-Q44 (Propeller Demo Rev F). I noticed on the ServoController pdf that we can use the VER? command and control the position of servos. I'm not proficient in the least with the spin language; my understanding of serial com is very limited, however there's got to be some way to rotate the servo from software. The problem is I don't know where to begin with this software.

My team's objective is to eventually use your ping sensors and prop to control the direction of an RC truck. To do so we need to get a better understanding of how to interact with the servos. Is there any demo spin file that we can use? Any guidance you offer is greatly appreciated. smile.gif

Thanks.

PHuf

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-10-31 19:54
    Hi PHuf, and welcome to our forums. I have removed your post in the Propeller forum, because we don't allow cross-posting. If this thread doesn't get adequate response I will move this thread over to the Propeller forum for you. For future reference you can add a subject line after you post by clicking on the pencil icon on the top right of you post.

    Take care,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-31 20:59
    The Propeller can control lots of servos directly using any of several servo drivers downloadable from the Propeller Object Exchange. Download Servo32v3 and read the comments in the file and look at the included demo program.

    If you need to use the Parallax Servo Controller, you would use one of the serial I/O drivers like Simple_Serial or FullDuplexSerial. The Servo Controller Manual describes the various commands which are sent to the Controller as character strings. To change a servo's position, you'd use the Position Command. For example, if you're using the Simple_Serial driver and declared the object as "ser", you'd position a servo with the following statements:
       ser.str(string("!SC"))
       ser.tx(servoChannel)
       ser.tx(rampValue)
       ser.tx(position & $FF)
       ser.tx(position >> 8)
       ser.tx($0D)
    


    where "servoChannel", "rampValue", and "position" are the command parameters as described in the Servo Controller Manual.
Sign In or Register to comment.