Jump to content


Kingbob's Content

There have been 133 items by Kingbob (Search limited from 11-November 96)


By content type

See this member's


Sort by                Order  

#352338 Arduino gun controller mk3

Posted by Kingbob on 21 March 2016 - 07:06 AM in Modifications

Nah i wasnt happy with having the tray going in and out with all the parts in a decent way. So ended up removing the rear of the tray from the main part and just used the bay instead.

 

Yes that is a switch, just a dpst, but only using one side.

 

That wire on the spring isnt fully fitted yet, was just laid on top for sizing by length. It will go underneath the spring and be glued down out of the way.




#352396 Arduino gun controller mk3

Posted by Kingbob on 24 March 2016 - 08:40 AM in Modifications

Since all the parts are in and working, its basically just software now. Should be finished by the end of the weekend!




#352413 Arduino gun controller mk3

Posted by Kingbob on 24 March 2016 - 11:07 PM in Modifications

Yeah the battery i'm using is rated to 20C continuous, which is why i chose it. I used to competitively race RC cars so know all about batteries, but i didnt know the specs of the motor. The h-bridge i'm using is rated to 4A, and seems to be holding up fine atm.

 

Will have a look and see if i can find a higher rated one.




#352416 Arduino gun controller mk3

Posted by Kingbob on 24 March 2016 - 11:41 PM in Modifications

Did a bit of research, the H-Bridge i'm using is based on an L298N driver, which will do 4A and seems to be holding up so far, though the max ive run it at is 60% power.

 

If (or when) it cooks, i'll replace it with one based on the BTS7960B which can handle 43A. Though I'm guessing thats combined both channels, but its still 21.5A per side.

 

Checked ebay and they can be bought for $10-12US:

http://www.ebay.com/...fsAAOSwd4tTsNEz

 

51cGeHS5FDL._SY300_.jpg




#352300 Arduino gun controller mk3

Posted by Kingbob on 20 March 2016 - 07:55 AM in Modifications

Updated version of the schematic.

 

stampedeschematic.jpg




#352296 Arduino gun controller mk3

Posted by Kingbob on 20 March 2016 - 06:36 AM in Modifications

Found a h=bridge locally!

 

Current state:

stampede9.jpg




#352190 Arduino gun controller mk3

Posted by Kingbob on 14 March 2016 - 03:35 AM in Modifications

These look interesting for a nano. The size is about the same as a Uno, but the good part is that where each pin is broken out to the headers, they also have a +V and GND for each pin.

 

Handy when you want to connect multiple extras.

 

28858-2.jpg




#352193 Arduino gun controller mk3

Posted by Kingbob on 14 March 2016 - 06:28 AM in Modifications

Assuming theres space to fit one. Wouldnt want to try and fit one in a Stryfe or a Rayven.




#352269 Arduino gun controller mk3

Posted by Kingbob on 19 March 2016 - 10:02 AM in Modifications

Its lucky i had a bunch of nano's in my parts box. Down to just 4 spares now! Though theres no reason i couldnt use a pro mini, a Uno or even a Mega would fit in the battery compartment of the Stampede.

 

A H bridge basically is a regulator. Just takes the pwm signal and outputs the proportional voltage to match. The stampede runs on 6x D cells so the motor should run on ~9V anyway, so 11.1V shouldnt be a stretch. I'm guessing the motor controller i was using was designed for an analog signal input instead of a PWM input. Basically fried the FET's input.




#352417 Arduino gun controller mk3

Posted by Kingbob on 25 March 2016 - 03:30 AM in Modifications

Good progress on it today! Firing all works now, everything as intended.

Only issue ive discovered is that when the arduino is first turned on, the control pin to the h bridge goes high while it boots. Which means it fires about 5 times when turned on.

 

Only way i can think of around it so far is to route that signal pin through the safety switch, so wont fire with the safety on. But means i have to remember to turn the safety on every time. 

 

 

Edit: occurred to me i might be able to just put a pull down resistor on it, might do the trick.

 

Edit 2: Yup, pull down resistor does the trick!




#352438 Arduino gun controller mk3

Posted by Kingbob on 26 March 2016 - 02:40 AM in Modifications

Made great progress today, had to do some switching around of what is connected to which arduino pin since i had used all the pwm pins for non-pwm functions.

 

The firing mechanism and detection is all done. Got the jam door open detection and firing prevention working (decided that was necessary after it tried to eat my finger during testing). Got the single/triple/full auto firing working, and stops at 0 ammo. And buzzes to let you know you're out.

 

Would you believe my biggest problem now is working out where to mount the joystick???




#352474 Arduino gun controller mk3

Posted by Kingbob on 27 March 2016 - 10:10 PM in Modifications

Here is a copy of the current arduino sketch

 

https://drive.google...iew?usp=sharing

 

You'll also need the following libraries:

Adafruit INA219 voltage/current monitor https://github.com/a...Adafruit_INA219

Adafruit GFX library for LCD's https://github.com/a...uit-GFX-Library

Adafruit ST7735 LCD driver https://github.com/a...-ST7735-Library




#352475 Arduino gun controller mk3

Posted by Kingbob on 28 March 2016 - 03:36 AM in Modifications

A couple of clips, showing the mag size detection working, the safety switch indicator, and the jam door indicator. The screen is a bit hard to read hence the better pic below. Can see the shooting mode joystick change the mode, and the relative shooting. Regardless of shooting mode it stops at 00. Also buzzes if you pull the trigger with no ammo or if the jam door is open. Note that its not shooting at full speed, it can go faster but i'm trying not to cook the underpowered h-bridge until the new high power one arrives.

 

 

A closer view of the screen, sorry bit hard to read on the camera. The flicker is also from the camera, not the screen.

 

https://youtu.be/8RlWPoPg8PU

 

 

 

The screen layout:

- The mag number at the top shows the size of the loaded magazine regardless of the number of rounds left. Works the same as my others, uses hall effect sensors to detect a small magnet on the magazine

- "LOADED" says "INSERT" when theres no mag, or flashes "RELOAD" when its run out.

- Jam door open, obviously only displays when the jam door is open. It also prevents firing while open so I dont chop my fingers off.

- The round counter, self explanatory

- The battery voltage updates every second. ( i need to tweak the redraw slightly, the 4th digit is a bit messed)

- The current draw as mentioned above has been disabled, but i havent removed it from the screen yet

- The mode 1 3 Auto sets the firing rate. This changes to "Safety" if the safety switch is thrown, and prevents shooting. Controlled by a small joy stick.

- Pulling the trigger when the safety is on, or it has no ammo makes a buzzer sound twice.

 

(the screen looks better than this IRL, remember its only 1.8" diagonal)

 

stampede14.jpg




#352489 Arduino gun controller mk3

Posted by Kingbob on 28 March 2016 - 09:31 PM in Modifications

oh my god the little beep beep, I love it.

 

hahaha, well i figured it should have something to tell you its out of ammo or locked or whatever in case you're not looking at the screen.




#352473 Arduino gun controller mk3

Posted by Kingbob on 27 March 2016 - 10:01 PM in Modifications

I'll have a video up later today.

 

The current monitor isnt currently connected. I double checked the specs after jwasko mentioned the motor current draw, and it wont handle that much. Plus there are warnings about using it for inductive loads like motors that have rapid starts/stops. So for now its just doing the voltage.

 

I also need to tweak the position of the firing detection switch. When i tested it unassembled i didnt know that part of the jam door stops the plunger. I'm only out by about 1mm though, so easy fix. Might be able to get away with just bending the lever on the switch a bit.




#352457 Arduino gun controller mk3

Posted by Kingbob on 27 March 2016 - 02:53 AM in Modifications

The left side of the shell, has the safety switch, and 2x hall effect sensors for magazine size detection. There is an 8pin connector to disconnect it from the other side, makes it easier to work on.

 

stampede11.jpg

 

 

The right side of the shell. You can see all the various bits and pieces. In hindsight i'd have used a nano extension board and put it in the battery bay, would have made hooking everything up easier. The joystick isnt visible as its under the magazine release mechanism, and the voltage/current sensor is mounted flat on the bottom of the battery bay so cant really be seen. 

The magazine insertion switch, and jam door switch are the existing switches in the blaster, just re-purposed.

stampede12.jpg

 

 

The paint needs finishing and detailing (and stripping in the case of the trigger), but here you can see the screen and joystick. The joystick can be reached by the trigger finger.

stampede13.jpg




#352454 Arduino gun controller mk3

Posted by Kingbob on 26 March 2016 - 10:44 PM in Modifications

I actually managed to mount it just above the magazine release switch. That way it can be reached by the trigger finger without having to change grip at all.

 

And, with that, mechanically and electronically its finished!

 

The software is 95% done, everything works, but i'm just making some tweaks to the screen layout and getting it all working just how i want it.




#352455 Arduino gun controller mk3

Posted by Kingbob on 27 March 2016 - 12:35 AM in Modifications

Here is a parts list. The ebay links are just examples of the types i used. 

 

Arduino Nano - $3+
from ebay
 
1.8" colour tft ST7735S based display - $9
 
Regulated Power supply - $4
 
INA219 DC/current monitor - $10
 
2 UGN3505 Hall effect sensors - $3
 
PSP1000 joystick - $3.50
 
Buzzer $1+
 
220ohm resistor - $0.05
your parts box or local electronics shop
 
micro lever switch - $1
ebay or your local electronics shop
 
LM298N H bridge motor driver - $3
Note this is rated to 4A. According to jwasko the 360 size motor in the stampede can draw up to 13A, so will likely die. I'll be replacing it with:
BTS760B 43A H bridge - $11
 
 
 
In hindsight to make assembly easier i'd have used one of these nano expansion boards:
Arduino Nano expansion board - $3+
 
Along with which i'd have used a bunch of these:
Male servo connectors - $5
 
Battery, i had a couple of Lipo's so didnt need to buy one. But i'm using a 3S 11.1V 2500mAh pack capable of 20c discharge. I already had a spare connector for it too
 
Wire, heatshrink, and cable ties
 
It cost me around $37 in electronics, not including wiring, battery, and parts i blew up!



#352456 Arduino gun controller mk3

Posted by Kingbob on 27 March 2016 - 02:10 AM in Modifications

Current working complete circuit diagram.

 

stampedeschematic2.jpg




#352187 Arduino gun controller mk3

Posted by Kingbob on 13 March 2016 - 08:40 PM in Modifications

Yeah i have a solder sucker and de-soldering braid as well, but of course i have to rip all the wiring off to get to it.

 

I've ended up just separating the boards out, makes working on it easier. I did accidentally fire it up briefly while testing the battery connection. I think it fed full voltage to the motor, must have been firing at at least 4 rounds/s. Scared the crap out of the dog!

 

Got sick of soldering/wiring though so put that aside and did some physical work cutting a hole in the shell to mount the screen etc. 




#352150 Arduino gun controller mk3

Posted by Kingbob on 12 March 2016 - 09:13 AM in Modifications

Except I'd soldered the Nano onto it.




#351879 Arduino gun controller mk3

Posted by Kingbob on 28 February 2016 - 10:38 PM in Modifications

I couldnt see any particular reason for it to be there other than being part of all the various safety mechanisms. Most of which i'll be ripping out or disconnecting.




#351989 Arduino gun controller mk3

Posted by Kingbob on 04 March 2016 - 06:39 AM in Modifications

Well, ive started!

 

Ripped out the existing wiring from the Stampede, removed a few bits of un-needed plastic, and soldered in new wires for the motor, trigger switch, safety switch, and magazine sensor switch. Just waiting for my 11.1V LiPo to charge so i can do some testing on the motor.

 

Decided to use the existing motor mechanism for now, wired in a h-bridge so the Arduino can control it. Need to do some testing to make sure i can properly control single/triple/full auto shooting.

 

If i blow it up, or cant get the timing right, then i'll look at using a stepper or servo instead.




#352005 Arduino gun controller mk3

Posted by Kingbob on 05 March 2016 - 12:00 AM in Modifications

So im trying to decide where to mount the screen. It will be on the side of the magazine slot since thats a nice big flat area, but i cant decide whether to put it on the left or right.

Nor can i decide whether to mount it internally, or externally and make a plastic case for it. 

Or to go whole hog and make it fold out.

 

Thoughts?

 

Atm i'm leaning towards internally on the left.




#351874 Arduino gun controller mk3

Posted by Kingbob on 28 February 2016 - 09:37 PM in Modifications

Yeah i was planning to remove the various bits of plastic in the tray and drop it all in there. I could even fit a MEGA in there if i need to, but i have spare UNO's and Leonardos. Once theres a wiring loom taking the various switches, sensors etc back to the tray will just make it easier to work on.

 

I've had a look at where to put the IR sensor for firing, i'll probably remove that little door flap where the dart inserts, and use the existing opening with just a hole for the LED.

 

Once this Stampede is done i'll probably re-visit my rapidstrike and add in a stepper or servo to control the pusher.




#351868 Arduino gun controller mk3

Posted by Kingbob on 28 February 2016 - 08:26 PM in Modifications

Dont need to use a full size servo, a little micro servo will work fine as a pusher.

 

I've got a load of lipo's i can use. 11.1V 2600mAh, 7.4V 4000mAh, and 2x 7.4V 2500mAh. Plenty of room in the battery tray without 6 D cells!




#351850 Arduino gun controller mk3

Posted by Kingbob on 28 February 2016 - 04:30 AM in Modifications

So far the design looks roughly like this.

Note that this is from memory, probably not the same as whats on my breadboard at the moment so might have errors. I'll update and correct it as I go.

 

I'm using a MEGA2560 Arduino at the moment simply because it has more flash and ram than the nano's i normally use. That way i dont have to worry about sketch size until its ready to go. Dont yet know what arduino i'll actually use. Whatever I use will be mounted in the battery tray so theres no shortage of space.

 

The servo may also get swapped for a stepper motor and controller.

mk3.jpg




#351852 Arduino gun controller mk3

Posted by Kingbob on 28 February 2016 - 08:42 AM in Modifications

Nothing major. I'll be using the servo/stepper to push/pull the loading/firing mechanism on the Stampede.

In a Rapidstrike, id use the servo in the pusher instead.




#351854 Arduino gun controller mk3

Posted by Kingbob on 28 February 2016 - 09:04 AM in Modifications

This particular design doesnt actually interact with flywheel motors. But, since brushless speed controllers work like a servo with a PWM signal, then yes it would be relatively simple to add in. Would still need a brushless speed controller though.




#352010 Arduino gun controller mk3

Posted by Kingbob on 05 March 2016 - 09:53 AM in Modifications

Detachable and swappable between sides? Hmmm




#352032 Arduino gun controller mk3

Posted by Kingbob on 06 March 2016 - 07:49 AM in Modifications

Board built, and installed in the battery tray with an 11.1V LiPo.

stampede4.jpg

 

stampede5.jpg

 

stampede3.jpg

 

 

New wiring in to the relevant switches, screen, and other bits and pieces.

stampede6.jpg

 

Need to trim the wiring to length and put the proper connectors on instead of the temporary ones i used while testing.

stampede7.jpg




#352067 Arduino gun controller mk3

Posted by Kingbob on 08 March 2016 - 09:18 PM in Modifications

Pulse Width Modulation. Basically a digital square wave signal with a variable frequency. Feed that to a motor via a FET and lets you control the speed by controlling the voltage through the FET.




#352105 Arduino gun controller mk3

Posted by Kingbob on 09 March 2016 - 11:15 PM in Modifications

I've decided to wire in an extra switch, using the one that was the safety for the jam door.

 

Figured since the arduino will be controlling the firing, it will be possible for it to shoot 3 rounds, or full auto, with that access open. Could be hazardous to fingers, so going to add it back in as a safety, and add a box to the lcd display saying "Jam Door" or similar.




#352145 Arduino gun controller mk3

Posted by Kingbob on 12 March 2016 - 02:11 AM in Modifications

SONOFAM!@#$%&*$#@#$%^&_*&)%^*$@$%!!!

 

I zapped the arduino accidentally while hooking things up. Fried it :(

 

Rebuild time.




#352056 Arduino gun controller mk3

Posted by Kingbob on 08 March 2016 - 07:27 AM in Modifications

The little red one is the FET motor driver. Uses the PWM signal from the arduino to drive the motor directly from the battery.




#352051 Arduino gun controller mk3

Posted by Kingbob on 07 March 2016 - 09:59 PM in Modifications

My local electronics store happens to have quite a few arduino bits they get from china.

 

Its identical to this:

http://www.sainsmart...-1-23v-30v.html




#352036 Arduino gun controller mk3

Posted by Kingbob on 06 March 2016 - 08:25 AM in Modifications

On the left is the regulated power supply for the arduino etc. Takes the 11.1V from the battery and provides a nice 5V for everything.

The blue board at the top is an i2c voltmeter and ammeter.

The black board at the bottom is a buzzer, for indicating when out of ammo etc.

The nano is obvious.

Then theres a double row of headers on the right that will connect to the various switches, display etc etc in the gun.

 

stampede8.jpg




#352042 Arduino gun controller mk3

Posted by Kingbob on 07 March 2016 - 04:13 AM in Modifications

Actually no, the nano can accept 7-12V because of its onboard regulator.

 

But its not recommended to draw more than 20mA per pin from the arduino, and after i had that IR problem in my Rayven i worked out the actual draw of the bits and pieces that I had connected to the +5V output. The hall effect sensors draw ~10mA each, the IR LED draws about 20mA, the IR transistor about 5mA, 5mA for the buzzer, and up to 10mA for the i2c current/voltage board. Thats 60mA already, then have to add in the 1.8" LCD. I couldn't find the exact specs for the lcd i'm using, but found one similar and it has a 150mA regulator onboard. So max could be looking at 210mA draw. 

 

Goes way over the per pin rating, and its recommended the whole arduino not exceed 200mA total!

 

So the regulated power supply runs all the bits and pieces so they don't draw through the arduino, but still get a nice stable 5V.

 

I was just going to use a 7805 5V regulator, which is $2 locally, plus a couple of $0.50 capacitors for smoothing, and a $2 small bread board to put it on. But when i went to the electronics shop, i saw that little pre made unit for $6. Only $1 more and saved me the hassle of building it, so figured why not?




#352043 Arduino gun controller mk3

Posted by Kingbob on 07 March 2016 - 04:19 AM in Modifications

Have also decided for practical wiring reasons to put the screen on the right, mounted internally but flush with the side of the mag slot.




#351845 Arduino gun controller mk3

Posted by Kingbob on 27 February 2016 - 11:34 PM in Modifications

Edit: Parts list: http://nerfhaven.com...e-3#entry352455

Edit: Circuit: http://nerfhaven.com...e-3#entry352456

Edit: Arduino code: http://nerfhaven.com...e-3#entry352474

 

So my first arduino in a nerf was a 7 segment based counter with magazine size detection for a Stryfe and Rapidstrike:

http://nerfhaven.com...nd-rapidstrike/

 

The mk2 added an OLED screen, and voltage monitoring in a Rayven:

http://nerfhaven.com...hot-counter-v2/

 

Now comes the mk3 for a Stampede.

 

This one still has all the things from the others like round counting and magazine size detection etc, but adds a full colour 1.8" LCD screen, battery voltage and current draw display, safety switch, a joystick to select single shot, 3 shot burst, and full auto firing mode selection, and a buzzer to indicate when its out of ammo.

 

The mk1 and 2 were in flywheel blasters so the motor control wasn't done by the arduino. But the Stampede isn't flywheel, and will have its motor controlled by the arduino which lets me select the firing mode (1/3/auto).

 

At the moment its breadboarded while i code it, but will probably open up the stampede and start looking at installation this week.

 

stampede1.jpg

 

stampede2.jpg

 

More to come!