The Official Raspberry Pi Projects Book - Projects_Book_v4

(singke) #1

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


FRED-209 Projects


Left David originally tried mounting a
standard Nerf gun on the top of a robot,
but soon realised that it wasn’t really
going to work that well

>STEP-01
Servo pusher
David 3D-printed most of the parts for his Nerf firing
mechanism, including the servo pusher. An arm
connected to the servo moves a rod forward to push
the dart from the magazine.

>STEP-02
Flywheel flinger
The dart is pushed into twin rotating flywheels which
propel it rapidly down the barrel. These, along with the
robot’s drive motors, require a lot of battery power.

>STEP-03
Completed mechanism
The 3D-printed lid has a slot to load the upside-down
Nerf gun magazine. A roller underneath moves along
to tilt the whole mechanism up and down to aim.

BUILD A NERF


DART-FIRING ROBOT


Above A long threaded bar converts motor rotation into lateral movement to tilt the
whole firing mechanism (not shown) up or down for aiming purposes


bot successfully. Getting the
right motors is an area where I
am definitely still learning and
it’s a critical factor to get right in
building a successful bot.”
Since he’d already bought a Dagu
Rover 5 chassis, David opted to
mount his Nerf mechanism on that
until he obtained some stronger
motors. He also dropped the


original chunky wheels in favour of
smaller ones with caterpillar tracks.
Controlled manually using a
wireless PS3 joypad, FRED-209
can fire multiple foam darts at the
chosen target(s). Its twin motors
are driven using a ZeroBorg board,
while the firing servo is connected
directly to the GPIO 18 PWM pin on


the Raspberry Pi. A tilt mechanism
for aiming is controlled by the
joypad’s shoulder buttons.
David describes the robot’s
public debut at the Cotswold Jam
as ‘controlled chaos’. “It went
down extremely well. I built some
‘evil alien’ targets to give the
participants something to aim at –
apart from each other!”

Continuing work on the project,
David plans to power it with LiPo
batteries – “It currently runs on
14 (!) AA batteries which really
don’t last very long as the drive
motors and flywheel motors are
pretty greedy.”
He also plans to add a camera to
enable FRED-209 to find and fire at
targets automatically. “I did some
very simple vision processing for
4-Bot, my Raspberry Pi Connect 4
robot, but this takes it up several
levels. I am currently learning
OpenCV and SimpleCV for vision
processing... The plan is the bot
will recognise colour/shape to
locate target. I can see it working
well as a burglar detector...
providing the burglar is wearing a
black and white stripy shirt and
carrying a bag marked ‘swag’!”

It uses the original Nerf flywheels,


and the original Nerf magazine


which can hold six darts

Free download pdf