Robotic Airsoft Turret

Mar 2020

Write up below:

Two years prior to covid, I had sawed out a wooden airsoft "coca cola" gun during freshmen year of high school, which you can see in the image below. Essentially, you take a piece of wood, zip tie a coca cola bottle to it, put a slightly-greater-than-6-mm-inner-diameter tube into the front of it, an air valve in the back, and fill it with BB's. When you pressurize the coca cola bottle, the only way for pressure to equalize is through the barrel. If the BB's stand between the high pressure and low pressure zones, you get a rapid-fire airsoft gun.

Hardware

My turret (doesn't really have a name - maybe call it the discombobulator) was built from old 3D printer electronics; two stepper motors, the control board, belts, and bearings were all from my old anycubic i3. The turret base and structure was made of simple sawed scrapwood, and some components (like the turret bearing base and 2nd axis structure) were designed in OnShape and printed on my Creality Cr-10 v2.

Pneumatics were controlled by a 12V electric solenoid that a relay onboard the turret actuated, controlled via serial.

View of the gantry. Geared lazy susan had too much slop, so I, literally, slapped a belt on.

Turret base: a salvaged stepper belt-drives the plywood gear, with the 3D-printed second-axis mount on top.

Software and FW

Control was fly-by-wire, and I used a raspberry pi to host a web server that would take commands from a client browser (joystick in browser via chrome's Gamepad API) on the network, and send two axes and a button state over to the turret controller as discussed above.

Firmware on the controller was handwritten C++ code (the 3D printer boards are just Arduino Mega 2560s), and it basically took movement and shoot commands over serial in a tuple-like structure as inputs. For example: b'<25 25 1>' would instruct the robot arm to move motor 1 to 25, motor 2 to 25 and open the electronic solenoid to pressurize the chamber.

Mermaid chart here shows how that arch looks:

Control path: browser gamepad input to the Pi, then serial over USB to the turret's firmware.
Archangel Michael