10 SERVO 01.2016
The first big news I have is that the folks at Rutgers
and Digilent have been busily moving forward with the
MPIDE compiler to bring the Arduino compiler syntax from
the older 0023 to the newer 1.0 levels. That work was
completed by early September according to my contacts
within the community. This brings the modern API to the
chipKIT platform. So, if you are familiar and happy with the
Arduino integrated development environment (IDE), then
you are all set to move over to the MUCH faster chipKIT line
of boards to do your Arduino development. (Personally, I
find the Arduino IDE to be too old and cumbersome, and
want the newer toys that a modern IDE has.)
I use UECIDE for my Arduino and chipKIT work. Now, if
we can get Majenko to adopt the new compiler syntax, I
will be in embedded prototype heaven! To get the new
MPIDE, go to www.chipkit.net.
Q. Is it better to have the microcontroller control the speed of your robot motors directly through an H- bridge or should I use a dedicated speed controller?
Bill Thomas
A. Wait for it ... it depends. It depends on what you are trying to achieve. If cost is your main determining factor or you have very limited space (like the little
Antweight combat machines), then a separate controller
may not be your friend. A separate controller for your
motors will take up a lot more space than a simple motor
driver will.
For instance, I have used the 754410 16-pin one amp
motor driver for my really small robots. Whenever I needed
more than an amp of startup current, I piggy-backed two of
them. They worked great and took up very little space.
However, they needed four wires for direction and two more
for PWM for typical motor direction and speed control.
The 754410 is also really cheap. To control two motors,
I needed code to decide which way to set the direction
lines and what number needed to be stored in the PWM
register to get the speed setting I needed. Rather than
waste processing time, I would keep the last known
settings around and only make changes if the newly
requested speed and direction were different from the last
ones sent.
Those last two points are the main downside to having
the same micro control the high level thinking of your robot
and the low level motor controls. You are stealing
processing cycles from your higher level processes to run
the “grunt” level stuff like motors. You also need a lot of
I/O pins to control the motors; in this case, six.
In some instances (like the Raspberry Pi), you may not
have those I/O lines to work with. “A picture is worth a
thousand words,” they say, so let me show you an example
with a simple motor driver schematic in Figure 1.
In Figure 1, I reduced the I/O lines by two by tying one
from each motor driver to ground, and using one I/O line
each to set direction and PWM. This worked, but created a
complex PWM/direction setup that required me to reverse
the “sense” of the PWM depending on forward or reverse
directions. Not that fun, but it did save a couple of I/O
lines.
Now, let’s compare what you will need if you decide to
liberate your main controller and use an all-inclusive motor
controller instead of a motor driver. With a motor controller
board, all you need for I/O is the communication channel.
This could be as simple as two lines for an asynchronous
serial or I2C connection, or as high as three lines for a bi-directional SPI bus.
Typically, the serial port is the easiest to configure and
use, and I2C is the most complex since you will probably be
using a library to handle the timing.
If you need speed, then SPI is the fastest of the lot and
not too difficult to configure. Your basic offboard speed
controller will only allow you to set speed and direction to
your motors. More sophisticated (expensive) motor
controllers will allow you to set speed and direction with
by Dennis Clark
Our resident expert on all things robotic is merely an email away.
roboto@servomagazine.com
Tap into the sum of allhumanknowledge and get your questions
answered here! From software algorithms to material selection,
Mr. Roboto strives to meet you where you are — and what more
would you expect from a complex service droid?
Ask Mr. Roboto
r. Roboto is back (mostly) from his moving saga. Literally, I have been moving
the last couple of months and 90% of my lab is still in boxes. This makes things
a little challenging! I don’t have a lot to work with, but what I have I will share
with you. I hope that Santa was good to you ... let’s move on. M