With the auto-loader tested, all that was left to do was install the extra electronics in the control box.
I took the whole thing apart, drilled and tapped new holes, then re-assembled everything and re-routed the wires. Came out decently clean, despite being hacked in as an afterthought.
The system is pretty simple.
- There's a L298N motor driver that acts as a stepper driver. I chose that because it can handle a lot of current, and this stepper needs to be powerful.
- Feeding that is a switching buck regulator which allows me to adjust the output voltage lower than 24V. The motor is rated for 12, but I run it at 16, since I only use it in short bursts during reloading.
- Last is an arduino, it controls the motor using the "Stepper" library. To trigger a shot, I tapped into the serial stream that I send to the gimbal controller. There are a few characters that I can send to the controller that it will ignore, for example '@'. So what I did is make the arduino eavesdrop on the stream, and if it sees an @, it will trigger the fire/reload sequence. In this way I can control 2 devices with a single serial stream.
I used an M12 cable and some heat-shrink butt splice connectors to connect the nerf gun to the control box. These connectors are great, they're waterproof, and the can be installed with just a lighter!