The Official Raspberry Pi Projects Book - Projects_Book_v4

(singke) #1

raspberrypi.org/magpi The Official Raspberry Pi Projects Book 91


NASA ARM Projects


and everyone could watch all at
once. And you can also give away a
sheet of paper at the end and have
them say, ‘Hey, a robot drew this –
how cool is that?’ ”
Asked about what the ARM
can draw, Dan says it depends
on what he can program into
it and what the hardware can
actually replicate. He admits
that the drawing action is a
little jerky, which is due to the
hardware itself: “There’s a lot
of slop in the joints, a couple of


degrees, and some slop in the
other mechanisms, which makes
it really hard to draw [smooth]
curved lines.” However, since
it understands positions and
coordinates, “Any line that you
can express as x and y coordinates,
so virtually anything, you can
program into it and it’ll just follow
that over and over.”


>STEP-01
Manipulator arm
Dan replaced the four-axis OWI Edge
arm of the earlier robots with a six-axis
Sain Smart manipulator. It features four
standard MG996 55 g metal-gear servos
and two SG90 servos.

>STEP-02
Control box
Inside the control box, a Pi 1 Model B is
hooked up to a PCA9685 breakout board
to drive the servos. Along with status LEDs
and wiring, there’s a USB hub to supply
power to both the Pi and the arm.

>STEP-03
Drawing mechanism
The tip of the arm rotates to lower one
of two Sharpie pens for drawing. Each is
held loosely in a tube so that the force
of gravity provides enough pen pressure
to mark the paper.

BUILD A DRAWING ROBOT


The force of gravity is used to
get the pen pressure right, as each
Sharpie pen is held loosely in a
tube. “We previously tried some
other spring-like mechanisms, but
we just settled on gravity drawing
because it’s so much easier and it
works perfectly fine.”
So, what’s in the shiny control
box? Somewhat surprisingly, along
with a PCA9685 I^2 C servo controller
and other components, the ARM
uses an original Raspberry Pi 1
Model B – as did the two previous

versions of the project, which
were based on OWI Edge robot
manipulators. In autumn 2016,
Dan was granted permission to
upgrade the project’s robots:
“I kept about half the internals of
the control box and got completely
new robot manipulators.”
While the hardware setup was
relatively straightforward, the

We wanted a demo where you


could just push a button, step


back, and everyone could watch


software took a lot longer. “The
original robots were programmed
in Python, but I noticed that we
had performance issues, so we
switched entirely to C++.” After
getting basic robotic functionality
working by spring 2017, Dan
made improvements over the
summer, including adding the
drawing capability.

Above Pressing
the button
causes the arm
to start drawing a
preprogrammed
sketch, in this case
the NASA logo
Free download pdf