Jump to content


Clark3DPR

Member Since 09 Oct 2019
Offline Last Active Nov 22 2019 06:21 AM

Posts I've Made

In Topic: Cyberpunk 2077 Kang Tao 3D Printed Nerf Gun

21 November 2019 - 06:51 AM

This is still excellent work, I look forward to seeing more from you in the future!

Id also recommend considering coarse thread screws into simple holes. In my Mk18, Ive got a screw going through the plunger head into the plunger rod and I havent had one fail despite the ~15kg springload applied directly opposite. I think for m2.6/#4 Im using a 2.6mm designed diameter hole, for m3/#6 a 3mm hole.

 

I will try the plastic larger thread pitch screws for my next nerf project. 15kg sounds like a stiff spring!


In Topic: Cyberpunk 2077 Kang Tao 3D Printed Nerf Gun

20 November 2019 - 02:21 AM

Part 6 - Assembling & Post-Processing
 
Assembling was done using M3 screws, they are small and can be ordered online from Radio Control parts retailers.
 
M3 Thread is small and difficult to print accurately (your results may vary), and so the printed threads could strip easily. The solution was heated threaded inserts. These are metal 'nuts' that get heated with a soldering iron, then inserted into a printed hole. The plastic melts around it, then cools and hardens again.
 
Some parts needed to be glued, such as the sleeve around the Nerf mag. This glued together sleeve was double sided taped onto the Nerf mag so I could remove it and reuse the Nerf mag in the future.
 
Masking was done with simply good old masking tape. Cut tape into small strips and triangle to get into the tight corners. This Kang Tao is my first 3D printed project, and so it is a prototype with a bunch of ideas mashed together. Future projects will have separate pieces for differently coloured parts, therefore not require masking. Additionally, correctly coloured filament could mean no painting either!
 
Before painting, primer was used. Get primer that adheres to plastic. Primer is especially useful if you have different coloured filaments mashed together in one project like I did. Primer will prevent the different filament colours showing through the paint. Spray can primer.
 
Paint used was mostly paint from the local hardware store. Get some that adheres to plastic. Tamiya paint 'PS Series' has proven to work great too. All spray cans.
 
For added aesthetics, I bent some thin Aluminium sheet 0.5mm thick. Placed it over the 'firing chamber' area to give it that metal look and feel. (Because it is real metal!).
 
 
Part 7 - Final Form
 
After a long journey, I present to you the finished Kang Tao from Cyberpunk 2077:
 
Haj10Ke.jpg
 
 
Announcement! Get the STL files from Thingiverse so you can print it yourself!
 
 
Enjoy!
 
P.S. Appreciate my work? You can support my Youtube channel by subscribing here: https://www.youtube....5VLFy1indyyzAA?

In Topic: Cyberpunk 2077 Kang Tao 3D Printed Nerf Gun

09 November 2019 - 09:14 PM

Part 5 - Arduino Code

 

Use the following code with the schematic in the last post to give you a better idea of what does what.

There was much research, trial and error to get the code working, but here it is:

const int buttonPinF = 2;      // Flywheel Rev microswitch pin number
const int buttonPinS = 5;      // Solenoid microswitch pin number
int buttonStateF = 0;             // Variable for reading the Flywheel Rev microswitch status
int buttonStateS = 0;             // Variable for reading the Solenoid microswitch status
int solenoidPin = 4;              // Solenoid MOSFET Gate pin number

#include <Servo.h>

Servo throttle;

int pos = 0;
int pin = 3;                            // ESC signal pin

void setup() {
  
   pinMode(buttonPinF, INPUT); 	       // Initialize the Flywheel microswitch pin as an input
   pinMode(buttonPinS, INPUT); 	       // Initialize the Solenoid microswitch pin as an input
   throttle.attach(pin);
   pinMode(solenoidPin, OUTPUT);         // Sets Solenoid MOSFET Gate pin as an output
    
 // ESC Arming Sequence
   for (pos = 90; pos <= 91; pos += 1) { 
      throttle.write(pos);             
      delay(3700);                                         // Wait for ESC to arm / Exit safety mode

// Increase this 3700 value depending on how long it takes for your ESC to arm

   }
}

void loop() {
  
    buttonStateF = digitalRead(buttonPinF);  // Read state of Flywheel microswitch value
 
    if (buttonStateF == HIGH) {  // Check microswitch pressed, if so Flywheel buttonState is HIGH
    throttle.write(92);                 // <(92) = Motor off / (92) = Idle speed
  } else {
    throttle.write(97);                // Motor on (92) = Idle speed / ~(115) = Max speed
  }

buttonStateS = digitalRead(buttonPinS);    // Read state of Solenoid microswitch value

  if (buttonStateF == LOW && buttonStateS == LOW) {
  digitalWrite(solenoidPin, HIGH);           // Switch Solenoid ON
  delay(90);                                                // ON duration
  digitalWrite(solenoidPin, LOW);           // Switch Solenoid OFF
  delay(100);                                             // OFF duration
   } else {
      digitalWrite(solenoidPin, LOW);      // Switch Solenoid OFF
  }
}
 
Uploading the Code
 
Caution: Do not power the Arduino with battery while USB is connected! This could damage the Arduino and/or your laptop/PC. Unplug Lipo Battery before plugging Arduino into PC via USB cable. Unplug USB cable before reconnecting the Lipo Battery. Earth yourself before touching Arduino to avoid static damage to Arduino.
 
Requires a PC / Laptop and the Arduino IDE Software. Copy this code, paste code in software, then upload to Arduino via USB cable.
 
LH5k3oW.jpg
There was a hole cut out of the bottom part and the Arduino's USB port sticking through it. This allows easy access without having to open up everything.
 
How to adjust the code
 
1. When Arduino is powered on via the safety switch, it runs the arming sequence for the brushless ESC's. My ESC's take 3.7secs, 'delay(3700)' in the code. You may have to increase this value up to 10000 (10secs) depending on your own ESC to get it to exit safe mode.
 
2. Hold secondary microswitch to rev flywheels, then press or hold primary microswitch to fire. The '&&' in 'if (buttonStateF == LOW && buttonStateS == LOW)' line of code tells the primary trigger to fire only while the secondary trigger is also held. This helps prevent jams.
 
3. Change 'throttle.write(92)' to increase/decrease motor idling speed or turn them off. By default motors will spin at low speed to decrease rev up time. (Value depends on your motor / ESC but should be around 92)
Change 'throttle.write(97)' to change motor top speed and dart velocity. (Value depends on your motor / ESC, but should be around 115)
 
4. Press or hold primary microswitch to fire solenoid.
 
5. Change 'delay(90)' and 'delay(100)' to increase/decrease fire rate of solenoid.
 
6. When Microswitches are released, ESC PWM signal for flywheels returns to idle rev speed (92) and signal to MOSFET gate for solenoid stops activating.
 
7. When ESC's lose signal from Arduino (when safety switch is on and Arduino powered off), the ESC's revert to safe mode and turn off motors.
 
You can create your own code or modify this code to add functionality such as select fire (full auto, burst & single fire), or a knob (potentiometer) to adjust the speed of the flywheels.
 
 
Hope this helps, and ask questions or suggestions below etc (I'm no expert with coding though), happy to help.

In Topic: Cyberpunk 2077 Kang Tao 3D Printed Nerf Gun

04 November 2019 - 05:03 PM

 

 

 

I think this is a case of differing settings - I've had tree supports that came off a horizontal supported surface so cleanly that I couldn't tell what surface was supported. I've also heard of guys using auto standard supports getting similar results, but have never had much success with them myself.

 

I find trees tend to come off more readily in one piece, but they can lap funnily into areas they don't belong.

 

I feel like it'd be possible to design the supports in as maybe boxes that pop off somewhat cleanly but don't wreck the surface. I may try that since I have some extra filament and printing time...

 

Oh also, I've had great success using coarse thread screws like wood, sheet metal, plastite, etc. Inserts are nice, but IMO overkill for 99% of parts - you don't really need to open and close these things so much that a coarse thread will strip the plastic out except in the case of an access hatch or battery bay. A machine thread could certainly strip though, those are too fine for the plastic to hold long.

 

Interesting, I will test that 3D printed thread, though I use small m3 sizes. Also, printing a threaded hole sideways (sometimes I have to) the hole is sometimes not perfectly circular.

 

I will test tree supports on my next project.


In Topic: Cyberpunk 2077 Kang Tao 3D Printed Nerf Gun

04 November 2019 - 04:32 AM

Part 4 - Electronics
 
Alright, so here is where it gets technical.
 
Schematic
 
GD9GSTL.jpg
 
Drawn to illustrate how everything is connected. An Arduino Nano is used because of it's small size. This should work with a Uno and others too.
 
Refer to this schematic for the below terminologies MS1, C2 etc.
 
Arduino Code will be provided in the next post, as well as an explanation on how to use it, which values you can change in it etc.
 
How it all works
 
W0IZPpW.jpg
 
The way it works, is that when MS2 (secondary microswitch trigger) is held, the brushless motors rev up.
 
When MS1 (primary microswitch trigger) is pressed or held, a signal is sent to the MOSFET gate to fire the Solenoid (S) repeatedly. The solenoid pushes the Nerf dart out of the mag and into the flywheels (M1 & M2) which then accelerate the dart out of the barrel.
 
However, MS1 only activates while MS2 is held. This helps prevent jams in case a dart gets pushed into non-spinning flywheels. This is done in the code.
 
Power supplied to the brushless motors and solenoid do not travel through the microswitches. This means you do not need high current rated microswitches.
 
Brushless Motors
I'm not going to explain how brushless differs from brushed motors here, you can search for some great explanations.
 
There are inrunner and outrunner brushless motors. You want an outrunner motor since they are flatter in shape so you don't have ugly cans sticking out the side of your Nerf blaster. Outrunner motors also have a portion of the external can rotate with the shaft. This makes it easy to 3D print flywheels to go over the motor.
 
Get a motor with rear mounting holes.
 
Voltages of motors should handle at least 12.6V (3s lipo).
 
Current of motor should not exceed Brushless ESC current rating.
 
Power of motors should be >60W. This project uses 12.6V supply voltage x measured 7A motor draw = ~80W each.
 
RPM of brushless motors should be ~25k and are determined by kV rating x Voltage. This project uses 2600kV motors @ 12.6V. Therefore 2600 x 12.6 = ~32,760RPM. I only run the motors at half throttle and darts fly 25m / 82ft!
 
Brushless ESC's
These basically control the power of the brushless motors.
 
Brushless motors don't work with brushed ESC's , get brushless.
 
You need one ESC per motor. Otherwise the back EMF from two motors connected to one ESC will mess up the ESC timing and damage said ESC and / or motors.
 
Current rating of ESC needs to be higher than current draw of motor. Motor in this case was measured at 7A each. Recommend ESC is 20A or higher.
 
Voltage rating of ESC needs to be at least 12.6V (3s Lipo).
 
ESC does not need a built-in BEC. You can use 'OPTO' ESC's. If you have an ESC with BEC, connect the ground and signal cables to Arduino as shown in the schematic. Do NOT connect the ESC 5V Red cable to anything. (Unless you have a specific purpose for it and know what you're doing).
 
Battery
 
u6b55z9.jpg
 
A single battery to power everything. I recommend using a XT60 connector.
 
Voltage is 12.6V 3S Lipo Battery.
 
Capacity is 1300mAH minimum recommended.
 
Current Discharge Rating of battery should be enough for the power draw of all loads. In this project, load current is ~25A.
 
Max discharge rate of battery is calculated by Discharge Rate (25C) x Capacity in Ah (1,300mAh = 1.3Ah).
 
Therefore 25 x 1.3 = 32A max discharge rate for the battery. You should be able to find these numbers in the battery specs.
 
MOSFET
 
LzHzMgs.jpg
 
Powering a 12V / 8A Solenoid straight from an Arduino will cause magic smoke (Arduino dies). Solution? MOSFET.
 
The power MOSFET is used as an on / off switch for the Solenoid. It basically interrupts the ground that powers the Solenoid. This is known as a N-Channel MOSFET. Make sure you get a N-Channel.
 
The MOSFET knows when to turn on and off because of a signal sent to the MOSFET gate pin from an Arduino output pin (D4 in this case). Arduino's put out 5V, and the gate should be fully on at 5V. For this to work it needs to be a Logic Level MOSFET.
 
Current draw from Solenoid is rated at 8A. Make sure the MOSFET has a higher max current rating. This project uses a 30A max rated MOSFET.
 
Voltage though the MOSFET is 12.6V to power the solenoid. This MOSFET is rated at 60V max which is plenty of headroom.
 
Temperature of the MOSFET is less than 35°C in this case. This is achieved because the MOSFET is rated for 30A, though there is only ~8A of load being pulled through it. The other reason is the load (Solenoid) is only powered on momentarily before switching off, instead of powered on constantly. A heat sink is not necessary in this case.
 
Solenoid
 
6nPuf5f.jpg
 
This pushes the dart into the flywheels. All you want is a 12V rated Solenoid with 35mm stroke length. Shorter strokes will not push the full length type Nerf darts far enough.
 
The spring on the solenoid is upgraded to a stiffer spring. 0.9mm wire diameter, 14mmOD and 40mm length. This prevents pusher rod from getting stuck on darts and also increases fire rate!
 
Because the Solenoid is powered on momentarily as opposed to continuously, it should only get mildly warm ~40°C and therefore not require cooling.
 
These solenoids are relatively cheap and generic. They can be found on Ebay, Aliexpress etc.
 
Safety Switch
SW safety switch is simply a 2 position slider switch. It has 3 contacts, though only 2 are used. Powers off Arduino when safety is on, preventing flywheels & solenoid from activating.
 
Protection Circuitry
This section explains how to prevent frying your electronics!
 
C1 33μF is all I had (100μF recommended) & C2 100nF (0.1µF) reduces voltage sag and spikes to the Arduino power input.
 
Caution: C1 is polarity sensitive, striped side is negative, else it goes bang!
 
D1 prevents reverse voltage to Arduino VIN. Take note of it's polarity.
 
D2 is a fly-back / freewheeling diode. It prevents the solenoid (or other inductors) from creating back EMF. This back EMF could otherwise damage the MOSFET. Take note of it's polarity.
 
R1 & R2 are 4.7kΩ pull-up resistors for MS1 & MS2. This prevents floating voltage at the microswitches.
 
R3 is a 10kΩ pull-down resistor to prevent floating voltage at the gate of the MOSFET.
 
R4 is a 150kΩ for the optional LED's. My LED's are 2 in series at 2.4V / 50mA each. Your resistor value may vary. These LED's flash on and off in sync with the solenoid to replicate muzzle flash!
 
 
That sums up this guide. Arduino Code will be provided in the next post, as well as an explanation on how to use it, which values you can change in it etc.
 
Any questions leave a comment below :)