Stryfeduino – Part 2 – It’s alive

By | 8. July 2016

Servo Motor


The Servo Motor will act as a lever to pull the trigger. But to assure it can work properly we have to make one or two adjustments to the safety features of the Trigger. The Nerfgun has a mechanism to lock the Trigger in case no magazine is loaded or the flywheel button isn’t pressed. We have to at least remove the latter one because finally, we will control the flywheels with a transistor and the flywheel button is only for manual use.

Flywheel Lock

The push of the button will drop the plastic piece that prevents the Trigger from sliding back. With a small piece of duct tape this problem is gone.

Stryfeduino - RC - 10 - Trigger lock Stryfeduino - RC - 11 - Trigger lock 1 Stryfeduino - RC - 12 - Trigger lock 2

Magazine Lock

We need to remove the two screws holding the plate above the magazine safety switch. After that disassemble it an remove the latch, that will prevent the Trigger from sliding back when no magazine is loaded.

Stryfeduino - RC - 13 - Magazine Lock 1 Stryfeduino - RC - 14 - Magazine lock 2 Stryfeduino - RC - 14 - Magazine lock 5

Servo Mount

Since Servos have standardized screw holes, why not take advantage of that and make a little servo mount that we can then glue to the gun. This way we can change the servo easily. Just cut out two 20mm pieces from the aluminium L-profile.

Stryfeduino - RC - 04 - L profile Stryfeduino - RC - 15 - Cut profile

Transfer the holes of the servo motor to the L pieces and use the drill. I recommend 4mm screws to connect the Ls with the motor after using 3mm ones myself… well now I have to use extra washers to hold the screws in place.

We also need to extend the servo disc on one side so that it can pull the trigger. I don’t really know how this connector discs work properly, so we have to improvise. I just screwed together the star shape with the rotor shape as far as I could because the screws were a little too big. To be safe I added a zip tie. Maybe someone can leave a comment and tell me how this is done properly 😉

Stryfeduino - RC - 16 - Mark holes Stryfeduino - RC - 17 - Drilled edges Stryfeduino - RC - 18 - Servoholder

To establish a strong connection between the aluminium pieces and the gun we use two component epoxy glue. With a file and sand paper all the contacting areas are roughened up to increase the surface area. Before glueing everything together let’s stick a little piece of paper between the aluminium and the servo. That way squeezed out epoxy can’t accidentally glue the servo to the mount or the Nerfgun and thus render it useless.

Stryfeduino - RC - 19 - Servo anti glue Stryfeduino - RC - 20 - epoxy glue Stryfeduino - RC - 21 - epoxy glue mixed

Epoxy needs quite some time to cure, so we better use some clamps to hold everything together tightly. Try to remove any excess glue that squeezes out to make it look cleaner and reduce the risk of wrong connections.

Stryfeduino - RC - 22 - Servo clamp Stryfeduino - RC - 23 - Servo mount iso angled Stryfeduino - RC - 24 - Servo mounted 2

Wiring

The first time I tried this, I started with a Servo motor that I had lying around. It had only 5 kg/cm of torque which wasn’t enough to pull the trigger. Same story with a 9 kg/cm one but then finally with 15 kg/cm, it was able to do it repeatedly without problems.

To be clear the servo is rated at 15 kg/cm at 6V, since we only apply 5V the real torque is more like 13.7 kg/cm with a linear approximation.

The next thing is the power consumption. The Arduino is not able to supply enough current to the servo. In this case the Arduino ProMini isn’t even able to provide enough voltage. We solve this problem by providing the power from the USB cable.

Stryfeduino - RC - 08 - USB power Stryfeduino - RC - 25 - Nano servo

We connect the black and red wire from the USB with the red and black wire from the Servo. Than we connect the yellow or orange wire from the Servo with a PWM capable pin of the Arduino (3, 5, 6, 7, 9) and the black one to GND. Done!

Stryfeduino - RC - 26 - Circuit Servo

Implementation

To give it a go, we use the Basic Servo Example code from the Arduino Editor which looks like this:

#include <Servo.h>

Servo myservo;

Int servoPin = 5;
int minpos = 0;
int maxpos = 15;
int d = 200;

void setup() {
  myservo.attach(servoPin);
}

void loop() {
  myservo.write(maxpos);
  delay(d);

  myservo.write(minpos);
  delay(d);
}

This code will basically continuously turn the Servo, which is connected to Digital Pin 5, from 0° to 15° with a delay of 200ms between each rotation.

As you should have noticed, the Servo motor is mounted to the “wrong” side of the chassis, the one with no wires. This means we need to feed the wires to the other side. To accomplish that we drill a little hole beside the Servo, feed three new wires through it and connect a male 1×3 pin header to both ends. This way we can connect the Servo to the outside pins and the Arduino with a 3 pin female pin header to the inside.

Stryfeduino - RC - 27 - Servo mount close Stryfeduino - RC - 28 - Servo con outside Stryfeduino - RC - 30 - Servo connection Stryfeduino - RC - 31 - Servo con inside

Leave a Reply