Shop OBEX P1 Docs P2 Docs Learn Events
Starting to experiment with multiple motors — Parallax Forums

Starting to experiment with multiple motors

lardomlardom Posts: 1,659
edited 2010-09-03 06:50 in Robotics
I was searching the obex for Spin code so I could learn to control more than one servo. This is my focus at the moment.
The code I've seen uses PASM. I have begun to study asm but I must first code it in Spin which I understand and then translate it to PASM. I just bought two servos and I want to learn to control them with methods, counters and cogs. My goal down the road is to understand how to build a robotic arm that uses servos and wheels that use quadrature encoders. But one thing at a time.
I completed a project that used a stepper but I always wanted to learn steppers, servos and quadrature encoders, in that order. Thanks

Comments

  • John AbshierJohn Abshier Posts: 1,116
    edited 2010-09-02 10:28
    Look in the library. Servo control and reading quadrature encoders is already a done deal.

    John Abshier
  • Mike GreenMike Green Posts: 23,101
    edited 2010-09-02 10:34
    For controlling servos, I strongly recommend using Servo32v7 from the Object Exchange. It's mature software, handles any number of servos (up to 28 easily) and staggers the pulses to reduce the possible peak power load. This is used as the basis of the Propeller Servo Controller.

    You can "roll your own", but you'd be better off starting with this and modifying it as needed for your use.

    For a simple Spin-only driver, look at Servo-4 from the Object Exchange or the servo driver that's built-into BoeBotBasic (also in the Object Exchange) which can handle 3 servos as written.
  • lardomlardom Posts: 1,659
    edited 2010-09-02 21:56
    Thanks, Mike.
  • max72max72 Posts: 1,155
    edited 2010-09-03 05:11
    I second Mike's suggestion on the servo32 object.
    It is a great object, and well tested.
    On the other hand it is a proppeller assembly highly optimized code, so if you want to have a good understandiong of the code is better to look for something else, easing the learning curve...

    As a side note, mainly if you also use motors, it could happen the motor engine startup resets the propeller. The easiest way to solve it is to split the power supply (one for the propeller and one for the servo/ESC), remembering to have a common ground (all the grounds must be connected togheter).

    Massimo
  • lardomlardom Posts: 1,659
    edited 2010-09-03 06:50
    max72, Easing the learning curve is a good way to put it. The information that's been presented is just what I need.
Sign In or Register to comment.