Shop OBEX P1 Docs P2 Docs Learn Events
How many motors can i drive with a propeller ? — Parallax Forums

How many motors can i drive with a propeller ?

t2nt2nt2nt2n Posts: 21
edited 2007-09-17 23:49 in Propeller 1
Hi,

I want to drive 6 cc motors, each of one could be driven with a mouse wheel encoder, to give the scale of the rotation, and another mouse wheel encoder, for the PID driving.

So, for each motor, I need 2 I/O for the PWM, and clockwise or not rotation, 2x2 I/O for each brace of encoders (number of impulses + QEI),or I am wrong ?

So, can I drive at least 5 motors with one propeller ?

And is there some trick to drive 6 motors ?

Tx a lot for your infos.

Comments

  • Chad GeorgeChad George Posts: 138
    edited 2007-09-17 16:27
    You could definitely use an I2C I/O expander (MCP23008) for the direction control lines.

    Also I've played around with the idea of using an SPI I/O expander (MCP23S08) to read quadrature encoders.
    The I/O expander can be put into a continuous read mode so you basically get a shift register.
    Also it has interrupt capabilities. I haven't actually done this yet, but I don't see any reason why it
    won't work.

    As for cog utilization, I managed to get an assembly driver that generated 3 pwm signals at a time.
    So I know it could be done with just 2 cogs, but I think you could probably to it with 1 cog.

    However you end up doing the encoders it should only take 1 cog to handle 6 encoders.

    -Chad
  • Mike GreenMike Green Posts: 23,101
    edited 2007-09-17 16:44
    I'm not sure why you need two encoders per motor. There's an object in the Object Exchange that handles up to 16 gray code position encoders with one cog and provides both absolute and relative position information.

    6 motors would require 12 I/O pins. 6 encoders would require another 12 I/O pins for a total of 24. The main problem you will run into is the shortage of cogs. Most of the PWM drivers written so far use 1-2 cogs per motor. One, for example, uses a single cog to generate the PWM and temporarily uses a 2nd cog to handle any ramping. It should be possible to combine the two functions with careful coding so you'd have one cog per motor plus one cog to handle the encoders and the last cog would be available for external communication or something else.

    It should also be possible to handle multiple motors using one cog with assembly language since the actual instruction speed is quite fast and deterministic. Assembly language in general is not for beginners and the Propeller has some special features that would take some time to learn properly for something of this complexity.
  • t2nt2nt2nt2n Posts: 21
    edited 2007-09-17 17:52
    Tx a lot for your very quick reply.

    My 6 motors are used to move a robotic arm.

    I need 2 encoders per motor because 1 encoder is setted on a master arm, and gives the scale for each DOF (so each motor) to a slave arm.

    The #2 encoder is for a PID controlling.

    My problem is that a given DOF can modify another, if needed (to keep the "final finger" at the same spot, for instance, when moving wrist and elbow, for instance, or to scale the motions of the master arm). I forgot to mention that all is connected to a PC, to give some option of moving (so a cog will be used for this task).

    So, as I see that propeller has 8 cogs which can exchange infos, I think that it's perhaps more easy for a newbie to controll all the bazar.

    With 12+12+12 I/O, i shall surely need 2 propellers, but one is insufficient ?
  • SkogsgurraSkogsgurra Posts: 231
    edited 2007-09-17 19:10
    Allo!

    Vous
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-09-17 19:32
    You might be able to use a 74hc595 serial to 8 bit parallel chip. Tri state outputs too, so maybe only one line to motor's power circuit... Be that as it may, you can probably
    add as many as you need to fan out to lots of motors. Your limit would be then getting the encoders tied to pins.
  • t2nt2nt2nt2n Posts: 21
    edited 2007-09-17 20:23
    Hi,
    Yes I am french, and CC is DC (I hesitated about the DC abbreviation).

    My idea is to drive one motor, exactly as if I drive it with a mouse : a vertical movment= a rotation of a motor, for instance, an horizontal mvt = a rotation of another motor....and so on.

    So I can fit one encoder on each DOF of a master arm, and I just move it handly, and the slave arm can reproduce the movment.

    So I need 2 encoders per motor to drive my arm (slave arm) : one encoder is to measure the motion of the master arm, and the other is here to control the PID of the movment of the slave arm.

    I can also save on HD all the motions datas, and replicate the motion : then only the #2 encoder is used....

    So, I can use also a PIC, as 16F88, to drive one motor (one PIC=PWM+PID of one motor).

    But as my project could work with many means (drived with the master arm, reproducing a saved motion, slave finger on the spot - here i move some DOF of the master arm, but the slave finger has to stay at the same position, so more of one slave DOF has to change if only one master DOF is changed, and others means that i surely discover when all this bazar will run ...) the propeller seems interesting to me ....

    Post Edited (t2nt2n) : 9/17/2007 9:20:24 PM GMT
  • LawsonLawson Posts: 870
    edited 2007-09-17 23:49
    Since you need so many encoder channels it would make sense to look at external encoder counting ICs. www.tranzistoare.ro/datasheets2/85/85469_1.pdf the LS7366 looks like a nice part for this. (I found this with a quick google search for "quadrature counter")

    Now adding six or twelve of this chip may turn out to be more expensive than an extra Propeller, who knows? I've also seen older counter ICs that communicate with an 8-bit bus.

    Another Option,
    Marty

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Lunch cures all problems! have you had lunch?
Sign In or Register to comment.