Jump to content


Photo

Arduino gun controller mk3


75 replies to this topic

#51 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 24 March 2016 - 08:40 AM

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


  • 0

#52 DjOnslaught

DjOnslaught

    Member

  • Members
  • 350 posts
  • Location:Maryland
  • State:Maryland
  • Country:United States

Posted 24 March 2016 - 11:40 AM

Sweet! I know you'll be glad to be finished this one.
  • 0

#53 jwasko

jwasko

    PowerBeard

  • Moderators
  • 1,021 posts
  • Location:Pittsburgh, PA
  • State:Pennsylvania
  • Country:United States

Posted 24 March 2016 - 12:20 PM

Its rated to 5A 24V, and i'm only using a 1500mAh 11.1V battery yet it cooked.

 
Just saw this post and wanted to share:
 
Asuming you are using LiPo 11.1V battery, it should have a "C" rating on the label. I'm going to guess yours is somewhere around 20C continuous (some packs will have two C ratings. One is for continuous output, the other is "burst" or momentary peaks of output, like if your flywheels jam).
 
The maximum amps that the battery (should) be putting out is its capacity (e.g. 1500mAh) multiplied by the C rating. So a 1500mAh, 20C LiPo could put out 30,000mA aka 30Amps.
 
I've never seen a spec sheet for the stock stampede motor (which is a RS360PH-3560, by the way), but for comparison the RS360SH-2885 draws around 13amps at stall. The stampede motor probably draws a little more than that.

 
Also, I thought Blastersmiths UK sold their kit with a FET but apparently they are using a relay to control the motor. Probably because of this.
Not sure if that would work here, but it's something you could look into if need be.  

Good job on all this arduino work, by the way. You understand far more than I do about electronics.


  • 0

-Jwasko, STILL Sole Surviving member of Steel City Nerf and Sober Sister of the Sex Dwarves
We NERF ON all day, and FUCK OFF all night


#54 DjOnslaught

DjOnslaught

    Member

  • Members
  • 350 posts
  • Location:Maryland
  • State:Maryland
  • Country:United States

Posted 24 March 2016 - 04:07 PM

Jwasko your battery knowledge is always useful on things like this though.
  • 0

#55 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 24 March 2016 - 11:07 PM

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.


  • 0

#56 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 24 March 2016 - 11:41 PM

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


  • 0

#57 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 25 March 2016 - 03:30 AM

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!


Edited by Kingbob, 25 March 2016 - 06:25 AM.

  • 0

#58 jwasko

jwasko

    PowerBeard

  • Moderators
  • 1,021 posts
  • Location:Pittsburgh, PA
  • State:Pennsylvania
  • Country:United States

Posted 25 March 2016 - 08:19 AM

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.

Yeah, I kinda figured you would know about the batteries but put it in there just in case.

 

Unfortunately not sure of exact motor specs for you but I will say that I have seen 20A microswitches regularly used on Swarmfires (which have the same motor) and they run great so if you ever do need to upgrade that 21.3A BTS7960B should work well for you.


  • 0

-Jwasko, STILL Sole Surviving member of Steel City Nerf and Sober Sister of the Sex Dwarves
We NERF ON all day, and FUCK OFF all night


#59 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 26 March 2016 - 02:40 AM

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???


  • 0

#60 xXD3V1LXx

xXD3V1LXx

    Member

  • Members
  • 258 posts
  • Location:Greenport, NY
  • State:New York
  • Country:United States
  • DevilNerf on Youtube

Posted 26 March 2016 - 08:50 AM

The best spot would be right behind the handle like right on the bar that "supports" the grip
  • 0
A quote from Ice Nine
"Use the golden rule: Don't be a dick."

NERF On
-Devil

#61 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 26 March 2016 - 10:44 PM

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.


  • 0

#62 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 27 March 2016 - 12:35 AM

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!

Edited by Kingbob, 27 March 2016 - 12:41 AM.

  • 0

#63 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 27 March 2016 - 02:10 AM

Current working complete circuit diagram.

 

stampedeschematic2.jpg


  • 0

#64 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 27 March 2016 - 02:53 AM

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


  • 0

#65 DjOnslaught

DjOnslaught

    Member

  • Members
  • 350 posts
  • Location:Maryland
  • State:Maryland
  • Country:United States

Posted 27 March 2016 - 05:53 PM

Dude, that looks amazing. I'm still trying to figure out my fire control mech for select fire, but might forgo it and add it later.
  • 0

#66 shandsgator8

shandsgator8

    Member

  • Members
  • 603 posts

Posted 27 March 2016 - 06:17 PM

Sweet work


  • 0

#67 CaliforniaPants

CaliforniaPants

    Futtbrustrated

  • Moderators
  • 459 posts
  • Location:Fresno, CA
  • State:California
  • Country:United States

Posted 27 March 2016 - 09:06 PM

this is the most impressive thing that I can barely understand that Ive seen in awhile, looking forward to a video showing it all off. props for putting up ebay links and schematics as well as your failures that other people might get if they follow along. god damn. 


  • 0

trans as shit because fuck you


#68 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 27 March 2016 - 10:01 PM

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.


  • 0

#69 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 27 March 2016 - 10:10 PM

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


  • 0

#70 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 28 March 2016 - 03:36 AM

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


  • 0

#71 DjOnslaught

DjOnslaught

    Member

  • Members
  • 350 posts
  • Location:Maryland
  • State:Maryland
  • Country:United States

Posted 28 March 2016 - 05:59 AM

Turned out amazing dude, I need a larger secondary board to set my regulator, header, nano and stuff on then I'll throw up some images of what I got going on with mine.

Yours has turned out amazing and I'm glad I could help and thankful you inspired to change a few things I was gonna do.
  • 0

#72 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 28 March 2016 - 06:03 AM

Yeah i wish mine was still on one board like it was to begin with, before i zapped it. In hindsight i really would have used one of those nano expansion boards, has a 5V regulator onboard too.

 

Feel free to use my code, might give you some ideas, though i dont claim its perfect!


  • 0

#73 CaliforniaPants

CaliforniaPants

    Futtbrustrated

  • Moderators
  • 459 posts
  • Location:Fresno, CA
  • State:California
  • Country:United States

Posted 28 March 2016 - 07:55 PM

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


  • 0

trans as shit because fuck you


#74 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 28 March 2016 - 09:31 PM

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.


  • 0

#75 DjOnslaught

DjOnslaught

    Member

  • Members
  • 350 posts
  • Location:Maryland
  • State:Maryland
  • Country:United States

Posted 31 March 2016 - 06:23 AM

Turned out awesome.
  • 0


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users