Jump to content


Photo

Project StingRay modding log

Afterburner'd lipo-powered rayven with arduino integration.

18 replies to this topic

#1 RedFear

RedFear

    Member

  • Members
  • 58 posts

Posted 31 December 2014 - 03:45 PM

So I've decided to turn this thread into a build-thread to document every mod I have to perform along the way both physical, electrical, and programming wise to make this a reality. when it's all said and done, i'll be sure to re-update the first post to turn it into a mod guide on making one yourself and providing the parts list and arduino code to make it function.

latest update:

after noise issues and flywheel burning/grip issues, I've decided to swap over to worker wheels and a brushless setup. feed issues as well meant that I settled on a telescoping brass dart guide that will keep the two FWC's aligned properly. with all the trimming i have had to do on the FWC's, a few spacers have let me slightly cant the flywheels in both cages. The battery voltage has come down to 7.2 instead of the 3s that was installed initially due to the brushless motors' kv ratings. This reduces voltage regulation circuits and makes the overall circuit much more compact.

 

List of things I must finish:
- clearance boxes in the other half of the shell to clear the motors

- ammo counting program (possibly will run on a separate arduino nano from the main arduino due to memory constraints)

 

FtoJxHc.jpg

old updates:

Spoiler


Edited by RedFear, 14 October 2016 - 05:18 PM.

  • 0

#2 KaneTheMediocre

KaneTheMediocre

    Belligerent Asshole

  • Members
  • 613 posts

Posted 31 December 2014 - 06:14 PM

Are there things you think I should change, or add to make the overall modding go smoother? I'm using an arduino uno R3, but am not sure if it can handle all these inputs/outputs. Should I run more than 1 arduino? Should I be hardwiring more than arduino-program implementing things?

Hypothetical possibilites if there's enough pins/memory to implement:
-shot-by-shot fps monitoring
-clock/walkie-talkie function w/ bluetooth headset
-motor heat/wear monitoring


You probably won't need more than one arduino for pins. If you do need more pins, try the arduino mega.

http://arduino.cc/en...rduinoBoardMega

The radio and clock do not need to interact with the arduino. I don't think that the Arduino even knows what time it is when it turns on.

Shot by shot FPS measurement would be cool, but I don't see an easy way to do it without a lot of crap in front of the dart exit. If you start the measurement before the dart leaves any "barrel" that you have, your measurement won't properly account for darts dragging on their way out as they often do with flywheel blasters.

Perhaps a more useful measurement (and adjustment factor) would be motor RPM. If you wanted to improve accuracy a bit, you could monitor both motors and make sure they spin at exactly the same speed (or almost exactly the same speed if you are compensating for something else being out of whack). You mentioned two power levels, but I think the scope of this project justifies a continuous spectrum.
  • 0
RAINBOW CLAN FTW
I'm Purple

My Half-Baked MHA Site

#3 RedFear

RedFear

    Member

  • Members
  • 58 posts

Posted 31 December 2014 - 06:30 PM

by two power levels I meant that regulating the max voltage that the two stages get so that the rear is getting a lower voltage than the front to prevent dart-melting. as for variable voltage controlling... maybe the arduino can do it by changing the duty cycle of the signals sent to the transistors.
and thanks for giving me the assurance that the uno has enough pins. and as for fps shot by shot, I was thinking a pair of photo-gates at the base of the 2nd barrel and detecting the rising or falling edge of their signals for speed calculations.
as for wifi... it was just an idea.

Just as an idea.... what about a comparator on the arduino to sense when the motor is giving back-emf, so that when the accel trigger is released, it switches a relay to disconnect power and flip the polarity of the auxiliary capacitors, so that the motor acts as a generator to charge them up (regenerative braking if you will), and then as the motor nears zero back-emf, it switches the polarity again and reconnects to the power source? The left over energy from the motor is used to help charge the surge capacitors?

Edited by RedFear, 02 January 2015 - 12:59 PM.

  • 0

#4 jwasko

jwasko

    PowerBeard

  • Moderators
  • 1,021 posts

Posted 02 January 2015 - 08:33 PM

-regulate higher voltage to 2 power levels for the front/rear flywheel sets (11.1v in front and 7.2v in rear) to eliminate one of the batteries

If this voltage difference is going to be set, you may not need to use the arduino...try using some diodes between the battery pack and the rear motors to drop the voltage. This is what people do to slow down the rapidstrike's pusher motor on a 3S/11.1V battery, so I wonder if it would work here.

Edited by jwasko, 02 January 2015 - 08:34 PM.

  • 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


#5 RedFear

RedFear

    Member

  • Members
  • 58 posts

Posted 04 January 2015 - 03:59 AM

If this voltage difference is going to be set, you may not need to use the arduino...try using some diodes between the battery pack and the rear motors to drop the voltage. This is what people do to slow down the rapidstrike's pusher motor on a 3S/11.1V battery, so I wonder if it would work here.

Yeah I think i'm just going to go with using the arduino and keeping the voltage at both the same. just varying the duty cycle to achieve the same effect. and possibly get a potentiometer for the arduino to read from to adjust both front/rear duty cycles in unison.

Edited by RedFear, 04 January 2015 - 03:59 AM.

  • 0

#6 Technician Gimmick

Technician Gimmick

    Member

  • Members
  • 28 posts

Posted 07 January 2015 - 10:53 PM

Hello RedFear,

Major undertaking here, but fun fun and more fun! I'll give you all the advice I can from my experiences working with nerf and arduino stuff.

-to use 20 amp transistors to drive the front/rear set of flywheels (to take out electrical arc wear on switch contacts)

I have used IRF530 MOSFETs (which are basically transistors) to control the motors before. They are good for giving you a variable voltage based on the frequency (duty cycle) signal coming from the arduino and they are rated for 22A. Plus, the price is right. To learn more about them check out this video. It was very insightful to me when I started.

-sense if magazine is empty,

You have many options for sensing if ammo is available to be fired. I'd go with Ir Sensors. They're cheap and there are plenty of tutorials out there on how to use them with Arduinos.

and type of magazine inserted (different brush contacts on different magazine types)

Now for this one, I thought long and hard about, and decided on magnetic reed switches. These are what I'm currently using the the TR-27, and they have been, and continue to be very reliable. Plus, the mod for the mag is super simple. All you need do is glue magnets to the mags in specific places to identify them to the arduino. I highly recommend this method.

and display ammo counter/ammo empty on oled display

Adding an OLED is very hard. If you've been following my post on the TR-27, you know I've been in the process for a while. I've concluded it can be done. However not with the Atmega328. See arduino's board comparisons to know which boards have which micro controllers on them. The Atmega328 only has 32kb of flash memory, and I used nearly all of it to control the OLED I chose for my project. This of course left me with no room for the programming needed to control the blaster. Even if I trimmed down my code, bluetooth or wifi would be completely out of the question. This is why I've moved to using the Atmega2560 micro controller. It has 256kb of flash. Problem is that there aren't many physically small boards out there using the Atmega2560. (Which is why I'm working on designing my own board.)

-monitor and display battery voltage and safety cutoff when low voltage with BEC and 7-segment displays

There are some really simpleLiPo voltage monitors out there that have an audible alarm when the battery gets low. It would be a really easy addon without adding all the headache of designing everything you'd need for the arduino to do it.

-regulate higher voltage to 2 power levels for the front/rear flywheel sets (11.1v in front and 7.2v in rear) to eliminate one of the batteries

Rather than have 2 power levels, it would be simpler to just set a lower duty cycle on the rear flywheels to lower the voltage to what you need.
Side note warning


-servo-actuated fire selection

That should be pretty easy. Arduinos will control servos pretty easily.

energy from the motor is used to help charge the surge capacitors?

Personally I don't think this is necessary. I've thought about it, but the only benefit would be if 11.1v isn't enough to push your motor up to speed quick enough. And this will all depend on the specs for your motor. You will really need to find the manufacture's specifications for your motor in order to see how much current (AMPS) you need to supply. And to get an idea about what will destroy your motor.

-display startup/ready/status animations and warning monitoring on oled display (oled placed right above 7 segment displays as telemetry/ ammo counter)

This is pretty much just a question of programming. I've always thought it would be cool to know the total number of darts that have been through the blaster.

-use micro-sd card for oled bitmaps/animations/necessary stored data

This one is up to you. I want to get into SD and micro SD cards working with arduino, but I haven't started this yet. If you go with the Atmega2560, you shouldn't need SD cards for storage.

"-have usb and charging hookup flush mounted to the blaster (no removing batteries, just plug blaster into to charge or program)" (apparently I've used up all the quote blocks I nerfhaven will let me use.)

This one is not advised. Not via USB anyway. First, most USB ports only supply 200ma at 5V which would be an incredibly slow charge for an 11.1v Lipo. But more importantly is that charging a Lipo battery is very delicate. I've heard from others that you should just rely on an external charger. If you could mount a good single throw, triple pole switch somewhere to disconnect the battery from any circuitry that might interfere with charging, it could work nicely.


Good luck and again, feel free to throw me any questions you may have as you go. :)

God Bless! - Gimmick
  • 0

#7 MAV13

MAV13

    Member

  • Members
  • 129 posts

Posted 08 January 2015 - 12:04 AM

Adding an LCD isn't particularly difficult IMO, there's no good place to mount it really but the coding itself isn't that difficult. Although I can see how the memory issue could come into play if you're doing ambitious stuff like Bluetooth and wi-fi. Bonus, if you do put in the LCD you could integrate the voltage monitor you wanted into the display. All you would need is a simple voltage divider. My code has little bitmaps like a cell phone for each battery level. If you want you can PM me for a rough draft of my code. Good luck!
  • 0

#8 RedFear

RedFear

    Member

  • Members
  • 58 posts

Posted 08 January 2015 - 01:41 AM

Hello RedFear,

Major undertaking here, but fun fun and more fun! I'll give you all the advice I can from my experiences working with nerf and arduino stuff.


I have used IRF530 MOSFETs (which are basically transistors) to control the motors before. They are good for giving you a variable voltage based on the frequency (duty cycle) signal coming from the arduino and they are rated for 22A. Plus, the price is right. To learn more about them check out this video. It was very insightful to me when I started.


You have many options for sensing if ammo is available to be fired. I'd go with Ir Sensors. They're cheap and there are plenty of tutorials out there on how to use them with Arduinos.


Now for this one, I thought long and hard about, and decided on magnetic reed switches. These are what I'm currently using the the TR-27, and they have been, and continue to be very reliable. Plus, the mod for the mag is super simple. All you need do is glue magnets to the mags in specific places to identify them to the arduino. I highly recommend this method.


Adding an OLED is very hard. If you've been following my post on the TR-27, you know I've been in the process for a while. I've concluded it can be done. However not with the Atmega328. See arduino's board comparisons to know which boards have which micro controllers on them. The Atmega328 only has 32kb of flash memory, and I used nearly all of it to control the OLED I chose for my project. This of course left me with no room for the programming needed to control the blaster. Even if I trimmed down my code, bluetooth or wifi would be completely out of the question. This is why I've moved to using the Atmega2560 micro controller. It has 256kb of flash. Problem is that there aren't many physically small boards out there using the Atmega2560. (Which is why I'm working on designing my own board.)


There are some really simpleLiPo voltage monitors out there that have an audible alarm when the battery gets low. It would be a really easy addon without adding all the headache of designing everything you'd need for the arduino to do it.


Rather than have 2 power levels, it would be simpler to just set a lower duty cycle on the rear flywheels to lower the voltage to what you need.

Side note warning



That should be pretty easy. Arduinos will control servos pretty easily.


Personally I don't think this is necessary. I've thought about it, but the only benefit would be if 11.1v isn't enough to push your motor up to speed quick enough. And this will all depend on the specs for your motor. You will really need to find the manufacture's specifications for your motor in order to see how much current (AMPS) you need to supply. And to get an idea about what will destroy your motor.


This is pretty much just a question of programming. I've always thought it would be cool to know the total number of darts that have been through the blaster.


This one is up to you. I want to get into SD and micro SD cards working with arduino, but I haven't started this yet. If you go with the Atmega2560, you shouldn't need SD cards for storage.

"-have usb and charging hookup flush mounted to the blaster (no removing batteries, just plug blaster into to charge or program)" (apparently I've used up all the quote blocks I nerfhaven will let me use.)

This one is not advised. Not via USB anyway. First, most USB ports only supply 200ma at 5V which would be an incredibly slow charge for an 11.1v Lipo. But more importantly is that charging a Lipo battery is very delicate. I've heard from others that you should just rely on an external charger. If you could mount a good single throw, triple pole switch somewhere to disconnect the battery from any circuitry that might interfere with charging, it could work nicely.


Good luck and again, feel free to throw me any questions you may have as you go. :)

God Bless! - Gimmick

in regards to this message, thank you very much for your insight. as for charging the battery, i'm actually going to have the balance and battery charge plugs hanging out inside the battery tray area so that I can open that up and charge from there. I have an external charger that's pretty decent. and as for the USB, that's not for charging. the port is going to be for addidional programming after physical installation.

and if i am to use an atmega2560, which arduino-compatible boards have that chip on them?
  • 0

#9 MAV13

MAV13

    Member

  • Members
  • 129 posts

Posted 08 January 2015 - 10:17 AM

Arduino Megas have something like 4x more pins so they will always be pretty big unless you design and print a custom board. You'd definitely need an external housing if you were looking to put one in a Rayven. Unless you are planning to do some extra Bluetooth or wifi stuff or something like that, you won't need the extra memory. For example, mine has code for fire control, a mission timer, voltage monitoring, dart counting, jam detection, a big but super cool library for extra features on push button switches, and the code for the LCD with all the associated libraries and I still have 12K of the 32K left.
  • 0

#10 RedFear

RedFear

    Member

  • Members
  • 58 posts

Posted 14 January 2015 - 01:16 AM

IT FITS!
Posted Image
gonna have a USB-b plug on the back with some extra padding to cover the hard areas on the stock.
  • 0

#11 MAV13

MAV13

    Member

  • Members
  • 129 posts

Posted 14 January 2015 - 11:55 AM

Where are you going to put a servo with that there? I figured it could fit in that space but you'd still need to stuff a servo somewhere.
  • 0

#12 RedFear

RedFear

    Member

  • Members
  • 58 posts

Posted 14 January 2015 - 01:29 PM

Where are you going to put a servo with that there? I figured it could fit in that space but you'd still need to stuff a servo somewhere.

Gonna stuff the servo in the spot where the trigger crank lever rotates from. Cutting a hole in the shell and then making a mounting box to drop it into. it should retain space on the inside for my dual h-bridge controller, wiring, micro-sd card chip, and lipo battery.

First post updated. all future updates will be edited into the first post.

Edited by RedFear, 25 January 2015 - 05:25 AM.

  • 0

#13 RedFear

RedFear

    Member

  • Members
  • 58 posts

Posted 25 January 2015 - 05:25 AM

My apologies for the double post. I would however like to make the progress on this blaster known. Updates in first post.

Finally finished writing the rough arduino code, though not yet tested. click spoiler for code.
Spoiler

Edited by RedFear, 27 January 2015 - 02:10 PM.

  • 0

#14 RedFear

RedFear

    Member

  • Members
  • 58 posts

Posted 24 July 2016 - 01:52 AM

It's been for-evahhh

But here's where it is now. I've taken out a lot of the functionality from before, like the optical sensors and the  oled display and ammo counting, but i'll add those back at some point in the future. just not now. Most of what i've done is making it functional first. After that, housing covers for the exposed parts. I still need to make some vents on the top shroud area and install a tiny PC fan there to cool the motor mosfets, and get a OLED shroud together for the OLED display that will be un-used for the time being.

ttXqvJK.jpg

m9Dormz.jpg


  • 0

#15 DjOnslaught

DjOnslaught

    Member

  • Members
  • 350 posts

Posted 24 July 2016 - 09:32 AM

If your keeping the lipo in when charging you need a way to vent the excess heat that will be generated by the charging process. I noticed your charging connectors are in the battery tray, maybe venting the heat threw there somehow.
  • 0

#16 RedFear

RedFear

    Member

  • Members
  • 58 posts

Posted 24 July 2016 - 01:52 PM

The amount of heat from this lipo pack is fairly low. I have been using low-amperage balance charging with an electronic smart charger, which means the pack barely gets warm while charging.
I am much more concerned about Mosfet heat from the motor drivers.

High charge heat occurs when you fast charge lipo packs.

 

Arduino Code available here:

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


Edited by RedFear, 26 September 2016 - 07:04 AM.

  • 0

#17 RedFear

RedFear

    Member

  • Members
  • 58 posts

Posted 08 October 2016 - 11:00 PM

Apologies in advance for the double post.

 

I have an update to this project that is fairly major.

after noise issues and flywheel burning/grip issues, I've decided to swap over to worker wheels and a brushless setup. feed issues as well meant that I settled on a telescoping brass dart guide that will keep the two FWC's aligned properly. with all the trimming i have had to do on the FWC's, a few spacers have let me slightly cant the flywheels in both cages. The battery voltage has come down to 7.2 instead of the 3s that was installed initially due to the brushless motors' kv ratings. This reduces voltage regulation circuits and makes the overall circuit much more compact.

 

List of things I must finish:
- clearance boxes in the other half of the shell to clear the motors

- ammo counting program (possibly will run on a separate arduino nano from the main arduino due to memory constraints)

 

FtoJxHc.jpg


Edited by RedFear, 11 October 2016 - 05:50 AM.

  • 0

#18 udsaxman

udsaxman

    Member

  • Members
  • 10 posts

Posted 13 October 2016 - 09:02 PM

Dude! use out-runners for the first stage!  Dropping to 2s wont help anything to be honest, i run my outrunner demolisher at 4s.


  • 0

#19 RedFear

RedFear

    Member

  • Members
  • 58 posts

Posted 14 October 2016 - 05:16 PM

it's for the sake of running my esc's near 100% throttle, as that actually keeps heat down compared to low throttle.

additionally, the kv rating of the motors is what dfetermined my battery choice, and the smaller inrunner motors were chosen such that i would not have to replicate and match flywheel balances for modded flywheels fitted over outrunner motors. the motors themselves have plenty of torque and the extra torque of outrunners was not neccesary. in addition, there's the fabrication of a custom FWC pair that would hold outrunners which i did not wish to do.

 

each application is different. my 9000kv motors spin at around 32k rpm for the first stage and 64k rpm on their final stage. additionally the servo i use is a HV servo, and 7.2v is the highest voltage it is rated for to provide good torque and speed of actuation.

 

i designed and calculated around the overall match of the sysem's components servo, which led to the motor/ESC/servo/battery selections


  • 0


2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users