Shop OBEX P1 Docs P2 Docs Learn Events
syncronise 3 dc motors with basicstamp — Parallax Forums

syncronise 3 dc motors with basicstamp

maverhmaverh Posts: 7
edited 2008-12-21 21:28 in BASIC Stamp
Hi,

I want to use the basicstamp for syncronising 3 dc motors, I use a L298 Driver as driver for the DC motor every motor have a encounter
For every 180 degrees rotation i receive a puls.

for every motor i use :
pin 1 for the direction (clockwise cclockwise)
pin 2 start and stop
pin 3 for input of the pulses

Wat is the best way for programming this, where can i find a example?


Regards,
·· MV

Comments

  • T ChapT Chap Posts: 4,223
    edited 2008-12-21 21:09
    Your info is a little unclear. You are driving each motor with a separate L298? Each motor has an encoder that outputs a pulse every 180 degrees? But, your pins show controls only fr one motor right?


    For syncing 3 motors, I think you would start by getting a code that would start and stop the motors properly, then move to syncing them. For sync at low speeds, I think 180 degrees is a rather small pulse rate, but may be doable. You may want to have one motor be designated as the master, in which case the other encoder pulses are compared, and the L298 adjusted to compensate for the error on the slaves. Although, I can't really see how it is you are using speed control with a single Stamp, you will need some variation of speed control to sync the motors, even if that sync is very short 'stops' on the L298.
  • maverhmaverh Posts: 7
    edited 2008-12-21 21:19
    Hi,

    Yes a driving each motor with a separate L298 driver. And each motor have an encounter that outputs a pulse every 180 degrees.
    I use now for
    motor1 motor2 motor 3
    pin 1 pin4 pin 7 for the direction
    pin 2 pin5 pin 8 start and stop
    pin 3 pin6 pin 9 for input of the pulses

    It is for syncing by low speed. I d'ont now of is it possible with a basicstamp.
  • FranklinFranklin Posts: 4,747
    edited 2008-12-21 21:28
    You could write code that stops the first and second motor that pulses until the third motor pulses and then start again. Or you could use pwm to slow the faster motors to match the slowest. Try with two motors until you understand the coding needed then add the third motor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
Sign In or Register to comment.