View Full Version : How many motors can i drive with a propeller ?

09-17-2007, 11:14 PM

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.

Chad George
09-17-2007, 11:27 PM
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.


Mike Green
09-17-2007, 11:44 PM
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.

09-18-2007, 12:52 AM
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 ?

09-18-2007, 02:10 AM

Vous Ítes francais? Par hasard?

I mean the cc motor isn't exactly easy to understand. I guess you mean courant continue - aka DC?

There is one thing that is a complete mystery to me; why do you need one encoder for position and one for PID? Can you explain? Usually, you use one and the same encoder for all position, speed and acceleration measurement.


Fred Hawkins
09-18-2007, 02:32 AM
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.

09-18-2007, 03:23 AM
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

09-18-2007, 06:49 AM
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 (http://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,

Lunch cures all problems! have you had lunch?