Jump to content


Kingbob's Content

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


By content type

See this member's


Sort by                Order  

#351494 My Nerf shot counter V2

Posted by Kingbob on 14 February 2016 - 02:34 AM in Modifications

Spoke too soon. Whilst i did solve my power issues, i've found another.

The rpm counter is using a standard IR LED/receiver pair mounted on each side of a flywheel. Theres a hole in the flywheel allowing the IT receiver to get a signal once per revolution. All pretty standard.

 

The code im using counts the number of signals received every 250ms, and multiplies it out to give an rpm count. The reason i do it every 250ms is so the display updates at that rate. Whilst its more accurate if I count for say 1 second, it also means the display would only update every second which is very slow.

 

The way the arduino counts the signals is by using one of its interrupt pins, so whenever the IR receiver gets a signal, it interrupts the arduino and forces it to count, before going back to what it was doing. Thats what the interrupt pins are designed for, and work well. 

BUT, what ive found in practice, is that when the motors are at max RPM, (somewhere around 25,000rpm) the counting fails.

 

It could be the IR sensor not being able to output fast enough, its rated to 37,000hz, which seems coincidentally close to the 25000 count as the max i've seen.

 

OR, the interrupt pin cant interrupt and execute fast enough to count the signal its getting.

 

I'm inclined to think its the IR sensor since the interrupt pin would count as much as it could so i'd still get a high count. Instead at high RPM the count simply drops off to almost zero, implying the sensor cant get a clean "sense" of the LED. 

I'm going to look for an IR sensor with a higher frequency, see if that helps.

 

I also have a new arduino on its way that runs at 48Mhz instead of the 16Mhz of the nano. Possible it may be able to keep up with the interrupt counting if thats the issue.

 

Thoughts?




#351584 My Nerf shot counter V2

Posted by Kingbob on 17 February 2016 - 07:14 AM in Modifications

Just about there, I cant be bothered swapping the IR sensor, so just gotta write some code so it says MAX instead of dropping to zero.

 

On the plus side, these just arrived:

http://www.sainsmart...mel-atmega.html

 

Works great. Havent used the SD card to load an image yet, but hooked it up for testing and its all good. Does need some extra double sided tape between the LCD and PCB though.




#351732 My Nerf shot counter V2

Posted by Kingbob on 23 February 2016 - 10:24 PM in Modifications

I hate to admit it, but the RPM counter has me beat.

 

It works fine but only when the arduino is connected to USB.

Tried running it all off a higher Ah capacity battery, upped tthe voltage, added in a 5V regulator, ran everything off that. Tried applying power via the usb port, even tried running it off a usb battery. 

 

Gonna have to live with it until i can get an oscilloscope to see whats going on. Might mock another one up on breadboard and test different types of arduinos too.




#351846 My Nerf shot counter V2

Posted by Kingbob on 28 February 2016 - 01:50 AM in Modifications

This is the circuit (i think), hall sensors for magazine size detection, one switch for magazine insertion detection, and other switch for trigger.

 

The IR LED/transistor for RPM counting are still connected in the Stryfe, and the code is still there, but i'm not displaying it on the screen until i can get a hold of an oscilloscope to work out why it drops out.

 

The OLED screen also needs a 3.3V source, and fortunately the nano has a regulated 3.3V output.

 

 

stryfecircuit.jpg




#351484 My Nerf shot counter V2

Posted by Kingbob on 12 February 2016 - 11:36 PM in Modifications

Success!

 

So I re-jigged the wiring, its now using the 4xAA's for just the arduino side of things. The motors are now powered by a 7.4V 4000mAh LiPo stuffed in the butt of the gun.

The displayed voltage is for the LiPo, and the RPM counter now works heaps better, though it has a bit of trouble keeping up at full RPM!

 

So all my issues solved, and a nice little performance boost as well :D

 

Pics and a video soon.




#351509 My Nerf shot counter V2

Posted by Kingbob on 14 February 2016 - 08:51 PM in Modifications

I suspect its the IR receiver, i did some testing with a spare one, and if the signal it gets is constant, its output stops. So yeah i figure its detecting so frequently that as far as its concerned its a constantly ON signal.

 

I do have a couple of other IR receiver/transistors to try, see if they're more capable. 

 

I'm half inclined to just tweak the software to say "MAX" instead of the RPM if it exceeds the RPM its capable of reading




#351463 My Nerf shot counter V2

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

How's this little project coming along man?  

 

Havent touched the Stryfe since the weekend, will hopefully be able to re-wire the power for the rpm sensor tomorrow and will be done.




#351414 My Nerf shot counter V2

Posted by Kingbob on 09 February 2016 - 06:46 AM in Modifications

Debouncing is mostly for switches, gives you a small delay so that it only gives you one reading instead of potentially multiple.

The problem i have is that its almost not reading at all when the motors are going.




#351408 My Nerf shot counter V2

Posted by Kingbob on 08 February 2016 - 10:00 PM in Modifications

Nah its not a debounce issue, it reads fine if the motors arent being driven.

 

Ie: if i press the motor button the reading is wrong, but if i release the button, it reads correct while they're still spinning. Its only wrong while they're under load.

Unless its plugged into usb.




#351424 My Nerf shot counter V2

Posted by Kingbob on 09 February 2016 - 08:48 PM in Modifications

If it was resistance it wouldnt change when the usb port is plugged in.




#357083 Gun computer MkIV

Posted by Kingbob on 10 December 2016 - 12:22 AM in Modifications

Well the RPM counter is giving me grief. 

I'm using an IR LED/transistor pair attached to either side of a small hole in a flywheel, and at low RPM it does work, but as soon as it gets up to full speed it stops counting. I thought using a faster micro controller would solve it but no change.

 

I can think of 2 reasons why:

1: The output on the IR transistor cant change state fast enough to keep up with the pulses its getting.

2: At full speed the time that IR light is let through the hole in the flywheel is too small for the transistor to register it. 

 

I have some different IR transistors i'll test to see if any of them work better to solve option 1.

 

Only solution to option 2 i can think of is to elongate the hole in the flywheel so the IR light gets longer per RPM to register.

But i dont want to unbalance the flywheel  by removing too much plastic.

 

Anyone have any other suggestions?




#357085 Gun computer MkIV

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

Yeah i considered the code as well, which is why i stripped it back to a test sketch that does nothing but count the interrupts.

I'm only bothering to count 1 motor since they have the same power supply and are subject to the same braking from darts etc.

 

The M0 controller runs at 48Mhz, so shouldnt have any dramas, even assuming a high rpm count.

 

 

const byte interruptPin = 1;
int rpm=0;
int rpmcount=0;
int lastmillis=0;
 
void setup() {
  Serial.begin(9600);
  pinMode(interruptPin, INPUT_PULLUP);
  attachInterrupt(digitalPinToInterrupt(interruptPin), rpmup, RISING);
}
 
void loop() {
  if (millis() > lastmillis + 250){ 
      detachInterrupt(digitalPinToInterrupt(interruptPin)); //Disable interrupt when calculating
      rpm = rpmcount*240;
      rpmcount = 0;
      lastmillis = millis();
      Serial.println(rpm);
      attachInterrupt(digitalPinToInterrupt(interruptPin), rpmup, RISING); //enable interrupt
   }
  
}
 
void rpmup() {
  rpmcount=rpmcount+1;
}



#357080 Gun computer MkIV

Posted by Kingbob on 09 December 2016 - 10:25 PM in Modifications

Installation update. 

Have installed most things on the left of the shell. The connector you see on the right is so it can plug into the other side of the blaster. Makes it easier when being assembled/disassembled all the time.

On this side are the mag size sensors, LCD screen, joystick, button, mag insertion switch, buzzer, and micro controller.

 

HF01.JPG

 

The outside. 

Bit hard to make out, but the white overlay lines up with panel lines on the shell so it looks at least sort of part of it. The large round black bit is the joystick, and little black button above it.

HF02.JPG




#357024 Gun computer MkIV

Posted by Kingbob on 04 December 2016 - 09:39 PM in Modifications

Ayy!

You got the code for that?

I kinda undestand C.

 

-Montymarks

 

Not quite finished yet, still getting it how i want it, but its based on the version i used in my stampede, follow the link at the top to find that.

So far have changed the screen layout a bit, doesnt use the same motor drive and firing detection code though.

 

Will post the code once its done, but the Stampede version will show you most of it.




#357089 Gun computer MkIV

Posted by Kingbob on 10 December 2016 - 09:24 PM in Modifications

I'm using using millis to get the 4x/second calculation so when its working it will update the display 4x/second. Nothing to be gained by using micros.

 

I'm using an IR LED, which is matched to the IR transistor. (same manufacturer, same frequency etc). Too difficult to fit a laser diode in where I want it.

 

According to the datasheet for the transistor it has nice small trigger times as well, and even assuming a max speed of 30,000rpm, thats only 500/s, which both the transistor and microcontroller should be perfectly capable of handling. I made the hole in the flywheel longer so it has a greater period to detect the high of the LED per revolution, but that made no difference.

 

In theory, and by all the numbers, it SHOULD work! Thats why its so frustrating.

I'm going to go and buy a bunch of different IR transistors today from my local electronics shop, and try others. Maybe one will work.




#357016 Gun computer MkIV

Posted by Kingbob on 04 December 2016 - 08:33 AM in Modifications

I have a bunch of lipos in my parts box. Probably use a 2s 4000mAh 20C pack, had it spare for a while. At the moment the motors are stock so no real issue there. 

Havent decided whether i'll end up putting in some rhinos or go brushless.

 

Will run it all off the same motor, have a small 5V regulated power supply that i'll use to run the electronics. Wont draw much anyway.




#360177 Gun computer MkIV

Posted by Kingbob on 28 May 2017 - 08:27 PM in Modifications

Its a great setup for flinging darts in rapid succession, i'll give Hasbro that. But not for control.




#360166 Gun computer MkIV

Posted by Kingbob on 28 May 2017 - 03:46 AM in Modifications

Well the blaster is finished. All the counting, battery measuring, dart firing detection, mag size detection, single/triple/auto firing all working. Turns off the motors (via relay) when out of ammo to save battery, and all working properly.

 

And i dont like it :(

 

The electronics i've put in all work fine, the problem is the belt dart feeding mechanism, its too imprecise. What i mean is, if i have it in single or triple shot mode, the motors get turned off after a single round, or three rounds. Then get turned back on once I release the trigger ready for the next shot. That all works, but the position of the belt and the nubs that grab a dart are too unpredictable. It can push another dart in before it turns off, or it half pushes a dart that enters the flywheel cage but doesnt shoot, but then when i fire next, i get 2 rounds or similar. I just cant think of a way around it.

 

In a Rapidstrike or something with a more controllable pusher mechanism it'd work fine, but this hyperfire belt drive mechanism just doesnt lend itself to controllable firing.




#356982 Gun computer MkIV

Posted by Kingbob on 02 December 2016 - 01:43 AM in Modifications

The last of my parts arrived today, will start installation tomorrow :)




#360149 Gun computer MkIV

Posted by Kingbob on 27 May 2017 - 08:58 AM in Modifications

Moved the IR sensor, but still a bust. They 2 sensors are just too close and the darts are moving too fast. 

At 5cm apart they register with zero millisecond difference. Would work on a longer barrel but at such a short distance theres just no difference in time to measure :(




#360146 Gun computer MkIV

Posted by Kingbob on 27 May 2017 - 05:09 AM in Modifications

Got it all assembled today and started debugging. For the most part everything is working fine.

 

Have 2 issues:

I had set it up to measure the current draw of the whole system, but have discovered that sensor is only good up to about a 3A limit. I'm pretty sure the stock motors will exceed that even on alkalines, certainly when i put in a LiPo. I think i can rework it to be good up to 30A though, but need some components from ebay to do it so thats disabled for the moment.

 

Secondly, i had set it up to measure the speed of the dart. Had 2 IR sensors, one at the entry to the flywheel cage, other close to the tip of the barrel, with about 11cm between them. But ive found because of the rate of fire, it only works if i fire a single dart. Firing more than one results in the second dart triggering sensor 1, just before, or at the same time as, the first dart exits the barrel. This was messing up the calculations, either getting 0 speed, negative speed, or stupid speeds like 50m/s.

I might be able to get it to work by moving the first sensor to the exit of the flywheel cage, but it will reduce the distance and time between sensors, so may mean the result is less accurate, but will give it a go..




#360059 Gun computer MkIV

Posted by Kingbob on 23 May 2017 - 02:15 AM in Modifications

OK so i had some wiring issues with how it was installed, was having nightmares with the screen, and getting the IR/RPM sensors working, so i ripped the whole thing apart and re-assembled it properly. Much neater now and no issues.

 

On the left side of the shell there is the 1.8" screen, joystick, reset button, mag insertion switch, mag size sensors, buzzer, level converter, and of course the arduino.

On the right side, are relay, voltage sensor, dart IR sensor, RPM IR sensor, and power supply. For now its running off standard alkalines, but have replaced all the wiring so it will be getting a LiPo shortly.

 

The code is about 85% done. At the moment its tweaking things like checking the mag size sensors are set to select properly, make sure all the magazine insertion stuff is in the right order, and that the screen updates properly when things happen. All the code is there, mostly just the order things happen.

 

There are 2 IR sensors in the barrel, one at the dart insertion point, one at the exit. By measuring the time it takes to get between them, it should give an approximate dart velocity. However when only measured across 10cm, it may not be wholly accurate, but it looks cool :)

The RPM sensor is also working properly now. On alkalines with stock motors it gets around 11-12k rpm. However i'm measuring every 250ms and multiplying it out, so again its not 100% accurate, but pretty close.

 

The gear going in the left side:

HF03.JPG

 

 

And the right side installed. The flywheel enclosure and flywheel got a quick spray of black paint to minimise any IR reflections.

HF04.JPG




#358960 Gun computer MkIV

Posted by Kingbob on 01 April 2017 - 07:11 AM in Modifications

The wiring has been upgraded and it will use a LiPo, but i havent yet replaced the motors.

 

I actually havent done anything on this in ages, have a new job and have been flat out. But yeah, some rather, umm, interesting ideas.




#356629 Gun computer MkIV

Posted by Kingbob on 05 November 2016 - 08:50 AM in Modifications

Current diagram, though not everything is connected on the breadboard yet.

 

hyperfire01.jpg




#356599 Gun computer MkIV

Posted by Kingbob on 03 November 2016 - 06:23 AM in Modifications

Megas have been outclassed for a while now. Look at the arduino zero, zero pro, M0, M0 Pro etc. Half of them have built in wifi or bluetooth now. The new Primo even has NFC built in, and the new Star Otto has several times the grunt of a Mega. 

 

Could even use an ESP8266, they have 4MB flash and run at 80Mhz and built in wifi, but are a bit low on gpio ports unless i add an i2c expander.

 

I have a few Raspberry Pi Zero's too, thats got 512MB of RAM and a 1Ghz processor in a board not much bigger than an arduino nano. But my python skills are way rusty, and a nerf blaster that runs linux seems to be overkill :D




#356597 Gun computer MkIV

Posted by Kingbob on 02 November 2016 - 10:07 PM in Modifications

I might be able to add a muzzle velocity measurement as well. Use an IR sensor at each end of the barrel, and just measure the time between them breaking as the dart goes through.

Its a short barrel though, so may not be hugely accurate.

 

I'm also going to have another go at measuring the flywheel speed. I think the reason i had problems last time was simply the speed of the processor not being able to keep up with the interrupts from the sensor. The arduino nano i used has an atmega328 processor which runs at 16Mhz which isnt exactly zippy. This time i'm using a board with an ATSAMD21G18 ARM cortex M0 processor, which runs at 48Mhz. Hopefully this can keep up with the sensor. Also has an onboard JST power connector for a LiPo, and built in LiPo charger circuit if connected to USB.

And has way more flash and RAM which solves the graphics library issue i had previously.

 

I could add an ultrasonic sensor to the front, maybe tie it to a second screen on the top of the gun, do an Aliens style motion detector :D




#356596 Gun computer MkIV

Posted by Kingbob on 02 November 2016 - 09:54 PM in Modifications

I saw how you did that in the other thread and it was pretty clever. You could potentially accomplish the same thing with reed switches if you find that constant mechanical interfacing with those switches wears them out, or you can't make the assembly small enough.

 

You can mount small magnets between the ridges on your magazines that trip certain combinations of reed switches to denote magazine size.

 

Actually if you read all the way through, i got rid of the switches and used hall effect sensors with magnets.


Remember the runaway problems you had when powering on the blaster on the mk3? I just thought of something to help avoid thathe and may be easier then a pull down. You could try using a mag lock that let's everything power on but prevents pusher motor operation without a mag inserted, kinda like they normally work but it would still allow for motor rev without the mag.

 

I solved that, it was just that one of the switches had come loose from its mount and wasnt registering a press properly. Couple of drops of superglue and all good.




#356566 Gun computer MkIV

Posted by Kingbob on 02 November 2016 - 01:48 AM in Modifications

Hey all

 

So have been stupid busy the last few months and havent done much nerf work, but I scored a cheap Hyperfire on the weekend, so thats inspired me to do some more modding!

 

First was my basic MkI Arduino controlled Stryfe and Rapidstrike: http://nerfhaven.com...nd-rapidstrike/

Then my MkII with an OLED and extras: http://nerfhaven.com...hot-counter-v2/

And then the MkIII with a fully reworked Stampede: http://nerfhaven.com...controller-mk3/

 

Now its time to see what else I can add in to a MkIV !

 

I've already removed some of the locks and put in better wiring to the Hyperfire, but electronically it's still stock.

The obvious things i added in the previous guns will be there:

- Mag size detection

- Round counting

- Voltage display

- Current draw display

- Jam door open detection

- Safety switch

- Single shot, three shot, full auto shot selection

- Stopping shooting at 00 rounds

- Buzzer for safety/no ammo notification

 

I'll use a 1.8" colour LCD, so i might add a way to change the colour using a trimpot.

 

Any other suggestions for things to add in? The Hyperfire has a stack of room in the front end so I can fit all sorts of things in.




#356627 Gun computer MkIV

Posted by Kingbob on 05 November 2016 - 12:44 AM in Modifications

I've started prototyping it on breadboard, and poking around the guns insides to decide what will go where etc.

There is so much space in the front end of this gun its ridiculous. I could fit a lipo in the front and cut off the whole rear end!

 

I think shot detection in this one will have to be IR based since its full auto, obviously counting trigger pulls wont work.

So right after the flywheel unit i'll look at putting in an IR LED/Transistor pair to detect a dart passing by. If i can fit an IR pair at each end of the barrel tube, i might be able to do a dart speed calculation.

 

I've settled on using a Feather M0 Basic board from Adafruit. Ordered a couple a while back but hadnt gotten around to using them yet.




#356628 Gun computer MkIV

Posted by Kingbob on 05 November 2016 - 06:54 AM in Modifications

Since I already have code from the previous versions, i basically just have to adapt it to a new board with some different options.

So far, have the following working on the breadboard:

- LCD screen

- Hall effect sensors for magazine size detection

- Magazine insertion detection switch

- Joystick

- Buzzer

- A new "mode" switch for something else i might add

 

For now i wont add in a "safety" switch. Had one on the Stampede but thats because there was a switch built into the gun for it. Probably wont add a jam door switch detection mechanism either.

I've soldered up an IR LED/transistor pair, just need to code them up to work as the counting mechanism when a dart passes by.

 

mk4.JPG




#356720 Gun computer MkIV

Posted by Kingbob on 15 November 2016 - 01:37 AM in Modifications

I've tweaked the design a bit. I've added in a pot read into an analog input which will determine the color of the screen. Can set it to preferred color without adjusting code that way.

Had to add in a level shifter, the buzzer is a 5V device, but the Arduino M0 board i'm using runs at 3.3V so cant drive the buzzer by itself.

 

I was previously going to leave the firing mechanism alone, not arduino connected but changed my mind. So have added a switch in for the trigger, which will close a relay to drive the firing belt motor. Will let me stop it from running when out of ammo that way.

 

I have one single IO pin left, cant think of anything else to add, suggestions?

 

(btw i obviously havent drawn in the +V and GND connections in the diagram. CBF lol)

hyperfire_schem0.1.jpg




#356643 Gun computer MkIV

Posted by Kingbob on 06 November 2016 - 01:36 AM in Modifications

Yeah but it was cheaper to get them separate. Plus the gap wasnt wide enough on them.




#356956 Gun computer MkIV

Posted by Kingbob on 30 November 2016 - 06:08 AM in Modifications

Wow, yeah i'd never thought of using outrunners!

 

Impressive engineering work, but not quite my style. I like my blasters to appear minimally modified, the electronics should look like they're part of it, not quite so added on. But thats my personal preference. 

 

Now i'm off to look at outrunners :D




#357081 Preview: Rapidstrike Electronic Fire System

Posted by Kingbob on 09 December 2016 - 10:28 PM in Modifications

You could run brushless motors if you get a couple of small brushless controllers, and run the servo input on them from the Arduino.




#357172 Preview: Rapidstrike Electronic Fire System

Posted by Kingbob on 16 December 2016 - 08:50 AM in Modifications

Interesting, how are you getting the motor rpm?




#356987 Rate of Fire mod for Rapidstrike?

Posted by Kingbob on 02 December 2016 - 10:00 AM in Modifications

I think I'll just use a separate power source from the flywheel power source to keep things simple.

 Use one power source, but use something like this to get a separate voltage for the pusher..

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




#356626 N-Strike Elite Rapidstrike Acceleration Motors Problem.... Please Help

Posted by Kingbob on 05 November 2016 - 12:35 AM in General Nerf

Could be a wiring issue, or possibly the thermistor has failed.

 

Good opportunity to open it up and replace the rubbish wire!




#356981 Best blaster to Mod (fully auto) with PLENTY of space?

Posted by Kingbob on 02 December 2016 - 01:39 AM in Modifications

I've modded a Rapidstrike and im working on a Hyperfire, so of the 2 i'd go the Hyperfire for the amount of stuff you want to cram into it. It has a good amount of empty space in the orange section at the front, and if you cut out the insides of the battery box, you'll get a huge chunk of room in the rear too.

 

Theres not a lot of empty space in a Rapidstrike at all.




#356529 Stampede select fire

Posted by Kingbob on 01 November 2016 - 09:49 AM in Modifications

What you're proposing will work to drive the motor, but, the time to run the motor will vary by voltage. If you run it from a lipo it will turn faster so need to run less time.

Instead, use a switch to detect when the firing plunger has fired, and then stop the motor. Don't need to time anything then, can just run the motor until the switch is pressed.

I'd also put a pull down resistor on the arduino pin driving the transistor. Otherwise when the arduino turns on, the voltage on that pin might briefly go high and run the motor.
Also, think about using a h-bridge instead of transistor. Can run it from a pwm arduino pin and control the speed more accurately.



#351380 Stampede internals question

Posted by Kingbob on 07 February 2016 - 12:01 AM in Modifications

Ahh it is a 360, thought so.

 

The plastic gears that do the retracting and gearing of the motor seem like they might not last if the motor gets sped up with a few extra volts, are there any upgrade gear sets etc available anywhere?

 

Or, could look at replacing the mechanism altogether with a stepper, or RC servo.