Controlling 18 motors





I wrote:

> 18 motors?  Something tells me you aren't running a
> machine tool <grin>.  Maybe a 6 legged robot, with
> 3 DOF per leg?

> I have a project like that in mind too, but I'm planning
> to use a PC for high level control, and PICs or other
> small micros for the low level motor control, either
> one per motor or one per leg.

And several people responded:

Alex Kovacic replied:

> The TMS320LF2407 (or TMS320LF2406)DSP from Texas Instruments has
> been chosen to perform the motor control and low-level processing
> duties.  This DSP features high-speed processing, a built-in
> communication protocol, two ADC converters, and quadrature
> capture pins for positional feedback from the motors.
>
> and only one is needed for three motors... also free samples from
> Texas Instruments.
>
> you would need two pics per motor to do it properly..?????????

John Griessen replied:

> Have you looked at Cygnal's small footprint 8051 based chips with
> decent 12 bit or 10 bit D2A A2D and network ports like rs485 or
> CAN built in?   Triscend makes a 8051 + FPGA + memory + IO on
> one $5 chip, and they say they will sell it for $3 soon...some
> simple integer DSP ALUs could be built into the 40K gates of
> register oriented FPGA in that chip.  Open source icarus berilog
> can generate synthesized logic for such a chip, (with a little
> further testing....)

and Frank Monahan warned:

> This all sounds good BUT ! What are you goining to use for
> a PID Filter?  Be carefull. build something that you don't
> have to reprogram every time you need to change motors or
> feedback settings..Man I know, Frank M.

Thanks everyone for your input.  The project is a little off
topic for the list, since it won't use EMC directly.  However
the control architecture is inspired by the EMC model, and I
will be using real-time Linux for master computer.  I expect
that some EMC code snippets may wind up in my robot controller.

That said, this post will be my last on the topic unless there
is interest expressed...

This is strictly a hobby project.  When it comes to electronic
parts, I am looking at things that I can buy in small quantities
from Digikey or other sources.  That eliminates many DSPs and
other specialized chips, either from part availabilty or the
cost of the development environment.

My robot will be bigger and heavier than the usual table-top
ones that use RC servos for motors.  (about 30 lbs total)
The legs will be actuated by lead screws, driven by small DC
gearmotors extracted from inexpensive cordless screwdrivers.
The screw/motor combo should be able to generate about 100lbs
at the nut, with a speed of close to 1 inch/sec.  That will
deliver 30 lbs and 3 inches/sec at the feet.

A low resolution (5 cycle) encoder on the motor shaft will
be used for servo control of the screw.  The resolution of
the encoder is multiplied by the 91.125:1 ratio of the
gearbox, giving me almost 4000 counts per inch of screw
movement.  The encoder frequency will be under 4KHz.

The nuts that run on the screws will be spring loaded where
they connect to the legs.  The joint angles will be measured
by analog potentiometers.  The difference between the joint
angle expected based on screw position, and the joint angle
actually measured by the pots can be used to compute the
forces on the feet (by some non-trivial kinematics code that
will run on the master CPU at 100Hz or less).

For the low level control, there are <$6 PICs that have multiple
channels of A/D, a PWM generator, an I2C interface, and enough
digital inputs to read an encoder in software at 3KHz.  In the
simplest scheme, the PIC will read the joint angle pot and
encoder and send the info back the the PC, where an EMC-like
servo loop will generate output commands that the PIC loads
into the PWM generator.

Eighteen servo loops, even if only at 1KHz, is still a heavy
load on the master CPU.  A better implementation would move
the servo loop to the PIC, while leaving the trajectory
planner, kinematics, and all higher level code in the master.
Hopefully I can code a servo loop that runs on the PIC at
4KHz or faster.  Each pass needs to read the encoder bits,
update the encoder count, generate a position error, perform
the PID algorithm, and write to the PWM generator.  A slower
thread, around 1KHz, would read the A/D and send joint angle
and encoder position up the I2C link, while receiving a new
motion command down the link.  The PID tuning parameters would
be supplied by the master at power up.

Sorry for the off topic digression.  Even though this isn't
a machine tool, the whole project wouldn't be possible without
EMC, both as a source of inspiration, and because many mechanical
parts will be made on my Shoptask, after I finish installing an
EMC based CNC controller on it. (Did I mention that this project
is going to take a _long_ time to finish?!)  I want to take the
opportunity to thank the entire EMC development team for a great
program!

John Kasunich







Date Index | Thread Index | Back to archive index | Back to Mailing List Page

Problems or questions? Contact