Arduino Airsoft Controller with Display

Have questions about a SparkFun product or board? This is the place to be.

Moderator: phalanx

Re: Arduino Airsoft Controller with Display

Postby Mee_n_Mac » Tue Mar 13, 2012 4:51 am

StaticDet5 wrote:I'll post up in a bit, when I try out dkulinski's software. I need to do a quick "project check" to make sure nothing was disturbed in the last couple of days, and then I'll get to it.


If this is the motor current sampling, I'd be curious to see a plot of a typical cycle.

I have a couple of questions ... what kind of battery rating (A-hr) is typically used and how many shots does this normally allow ? I'll assume a 0.2 g weight but what's a typical velocity for that weight in an AEG ? Lastly you've mentioned a spring rating. What force does it take to compress a spring ? I'm curious as to how the efficiency compares to gas pistol. (80 shots w/0.2 g @ ~350 fps)
Mee_n_Mac
 
Posts: 4324
Joined: Thu Apr 28, 2011 4:10 pm

Re: Arduino Airsoft Controller with Display

Postby leodi » Tue Mar 13, 2012 6:08 am

Battery rating is from 1.2A/h to 3A/h nimh. Lipo is 15 / 20C with same A/h, the number of shoots depends of the spring, if you press the trigger in semi or automatic, the temparature...
THe typical velocity is 280 to 400fps with 0.2g plastic ball, depends of the spring and the pressure leaks.

I don't know (and I never seen any number on the web) what force it takes to compress a spring, but it's impossible (for me) with our hand (between the thumb and the medium finger).

For a typical cycle, I don't know how to read it but : http://www.france-airsoft.fr/forum/inde ... &p=1911128

first : one press in semi
second : auto
others : one press in semi
leodi
 
Posts: 9
Joined: Thu Mar 08, 2012 6:33 am

Re: Arduino Airsoft Controller with Display

Postby StaticDet5 » Tue Mar 13, 2012 1:20 pm

I've got some batteries as low as 600mA/h, they're typically for smaller AEG's, or AEP (Airsoft Electric Pistols).
The new battery I just received is 11.1v 2400mA/h, and rated at "30C", which (supposedly) means it is capable of discharging at thirty times the capacity rating of the battery (30*2400mA/H = 72 amps). I take these ratings with a grain of salt, though.

My experience with new batteries is typically to plan 2 shots per 1-4 milliamps. As the battery ages, this number goes down. As the spring co-efficient increases, this number goes down. It sounds like an insane amount until you realize that many people carry around 300 round mags. On any game lasting less than a day, I tend to carry around two fully charged batteries.

If you're doing it right, you'll come home with a fair amount of charge left. But when things go wrong, you're dumping amps as fast as you can :lol:

If I come across an old spring, I'd be happy to send it to you. If it's not labeled, it's difficult for me to use it, and I just don't have time to rig up a testing rig. They're pretty stiff springs. To be honest, when I first heard about AEG's from my friend, I told him he was full of it, and the engineering issues would destroy the mechbox in short order. It's pretty decent tech, when done right.

dkulinski, I need to play with your software a little. I'm freezing my computer (7gigs of RAM should handle this!) when I do a ten second burst. I can't seem to get good output with the Arduino serial monitor.

The good news: The day I had to stop, because the AEG sound was making my puppy nuts, I didn't get to try the last software revision for burst fire. It works 80% of the time, firing a three round burst. Sometimes it throws one more cycle. I need to play with my sensing limits, I think. If I get that tuned, just right, it'll catch the burst every time.

In that vein, I realized that I can have a "double check" on the firing cycle, once the chrony is implemented. If three rounds are "seen" by the barrel, before the gearbox is done cycling, I can stop the motor MOSFET. I need to examine it closely, but I think the timings work out.

I'm going to futz with the code a little bit, but I need to knock off soon and exhaust the dogs.
Static
StaticDet5
 
Posts: 205
Joined: Tue Oct 12, 2010 8:08 am

Re: Arduino Airsoft Controller with Display

Postby dkulinski » Tue Mar 13, 2012 1:25 pm

You may need to run PuTTY and use it to monitor your serial connection. You can tell it to log all output to a file.

Dan
dkulinski
 
Posts: 216
Joined: Tue Apr 05, 2011 12:36 pm

Re: Arduino Airsoft Controller with Display

Postby Mee_n_Mac » Tue Mar 13, 2012 11:51 pm

StaticDet5 wrote:If I come across an old spring, I'd be happy to send it to you. If it's not labeled, it's difficult for me to use it, and I just don't have time to rig up a testing rig. They're pretty stiff springs.


Thx but no need to. I was just curious as to how long a battery might last in an AEG and to compare to my case. In an AEG all the kinetic energy in all the BBs comes from the battery, with it's electrical energy getting transformed a few times along the way. 100 0.2 g BBs that left the barrel at ~330 fps have a total energy of 100 J. W/o any efficieny losses that would also be 100 watts for 1 second. Or 10 amps out of a 10V battery for 1 sec. Or some differing combo thereof. In my case the power comes from the compressed O2, the battery only releases that stored energy. I pushed on the gas valve with my thumb. It travels perhaps a few mm and is stiff but does depress with finger pressure. I'm not sure how much energy it'll take to fire 100 shots and how long a single or double AA (or AAA) battery would last. I'll have to get a proper tool to measure the spring rate. And figure out a good way to time the present gas flow.
'
Mee_n_Mac
 
Posts: 4324
Joined: Thu Apr 28, 2011 4:10 pm

Re: Arduino Airsoft Controller with Display

Postby StaticDet5 » Thu Mar 15, 2012 8:11 am

I've just been blown away this morning.

leodi sent me a link to his version of the schematics, code, etc. He's set everything up using Fritzing http://fritzing.org/. I'd encourage anyone who works on projects like this to check it out. The first glance simplicity of it blew me away. I'm going to take some time today to try and learn it (I still haven't made much progress with Eagle).

leodi, I'd encourage you to post the link to your project file, or please let me do it (It's definitely your work, but I'd be happy to show it off). Many thanks for introducing me to Fritzing.

dkulinski, thanks for mentioning PuTTY. I haven't seen it before, and it's going to be very useful to me.
I had some initial problems with the log file, because I got unexpected results. I haven't played with the code, at all, because I wanted to hear your impression, first.

From what I see, it's displaying the timing, but no sensor readings.
My test procedure is to run the terminal window for approximately 1-2 seconds, and then trigger the AEG. With this test code, it does not stop firing when the trigger is released. I'm not familiar enough with interrupt loops to begin troubleshooting the code, only make wild-assed-guesses. Can you "over-interrupt", where the interrupt condition triggers the loop before the interrupt action has completed?

Thank you again folks. I was almost dreading working on this today, because I was thinking that I needed to really tackle the display issue at this point. I was getting demoralized on that issue.
Attachments
AmpTest1log.log
First log file from PuTTY
(14.43 KiB) Downloaded 8 times
Static
StaticDet5
 
Posts: 205
Joined: Tue Oct 12, 2010 8:08 am

Re: Arduino Airsoft Controller with Display

Postby Mee_n_Mac » Thu Mar 15, 2012 8:51 am

I'll have to chek the code but it appears the log is a time plus an A/D reading from the current sensor I presume. A simple plot of that follws below. I see a motor off period(s), a motor on with sector gear not engaged period and a motor on and gear engaged period. Is the time in millis and was there only a single shot ? It appears the A/D is biased around 511 counts. Is there anyway the A/D counts are somehow complemented ?

AmpTest1.jpg
Plot of above AmpTest1Log


ps - I deleted the first sample and time (very large!) and thereafter it appears time increments by 4 (?millisecs?) each entry/sample.

pps - Perhaps the initial current spike is the motor turn-on transient and there's no real difference in current btw the sector gear engaged and not engaged ? I'd like to see a continuous log of a 3 shot burst. Then again if the time is in msecs, I am seeing multiple shots ???
Mee_n_Mac
 
Posts: 4324
Joined: Thu Apr 28, 2011 4:10 pm

Re: Arduino Airsoft Controller with Display

Postby leodi » Thu Mar 15, 2012 9:49 am

The fritzing file : http://dl.dropbox.com/u/66734965/Share% ... no/m16.fzz
/!\ It's a non-tested version /!\

I put the lastests StaticDet5's posted code, but I think he improved it since then.

If someone want to help for this I can share the read/write access via dropbox.

The rate of fire is ~25bbs / s, the plot image seems to be a ~30/40bb shot in auto mode. The jump at the beginning was to "start" the motor.

The refresh rate is 0.004s
The ROF is 0.04s

10 refresh per shot, with a limited code executed by the arduino, do you think it will be ok with a complexe software on the arduino ? Or the serial transfert rate was a limiting factor ?
leodi
 
Posts: 9
Joined: Thu Mar 08, 2012 6:33 am

Re: Arduino Airsoft Controller with Display

Postby StaticDet5 » Thu Mar 15, 2012 10:17 am

I'm limited in my computer usage. I still haven't gotten either one of my computers to work well. I can't get audio into this system, as the sound card appears compromised. My goal within the next week is to get an audio file (The gearbox discharges are clearly visible spikes) with a serial log. We'll be able to see the gearbox cycle with the electrical cycle. I think I was seeing individual motor coils energizing when I was playing with the serial outputs, very early on in this project.

The gearbox ran for at least 20 shots, before I "safed" it, and the plot is the . I think that first peak is the initial drive current to break the inertia of the motor (start spinning it up to speed). Incidentally, what software are you using to generate the plot? I'm looking for something to give me the above output. Simple and easy.

I gotta go out and exercise for a bit, get my physical therapy going. I'll try to get some more work done today.
Static
StaticDet5
 
Posts: 205
Joined: Tue Oct 12, 2010 8:08 am

Re: Arduino Airsoft Controller with Display

Postby dkulinski » Thu Mar 15, 2012 11:22 am

Alright my code outputs the ADC reading, a tab and then the time in milliseconds. I am going to study this a bit.

Dan
dkulinski
 
Posts: 216
Joined: Tue Apr 05, 2011 12:36 pm

Re: Arduino Airsoft Controller with Display

Postby Mee_n_Mac » Thu Mar 15, 2012 11:26 am

OK so it's msecs for time and it appears the gearing is such that the spring load on the motor is inconsequential, thus there's no large current difference between the spring being compressed and not.

I used Excel to chart the data.
Mee_n_Mac
 
Posts: 4324
Joined: Thu Apr 28, 2011 4:10 pm

Re: Arduino Airsoft Controller with Display

Postby dkulinski » Thu Mar 15, 2012 11:38 am

I have a similar chart in Google Spreadsheets. I am creating a couple more so I can look at per shot statistics. The current data is very dense.
dkulinski
 
Posts: 216
Joined: Tue Apr 05, 2011 12:36 pm

Re: Arduino Airsoft Controller with Display

Postby dkulinski » Thu Mar 15, 2012 12:02 pm

aeg_readings(1).png


And here is the smaller chart. For a sense of scale, this is about half a second of fire time. What worries me about this is just how noisy it is. I am wondering if that is due to the PWM signal used to drive the motor or just noise on the lines.

At 25 shots per second we are looking at 40 milliseconds between shots but looking at the chart (use the link below to explore the google doc, the chart takes a moment to load) this looks to be firing about 20 shots per second.

Each rest period seems to get to about 615 on the ADC readings. All in all, pretty informative and I will see about adding some more features to the chart.

Dan
dkulinski
 
Posts: 216
Joined: Tue Apr 05, 2011 12:36 pm

Re: Arduino Airsoft Controller with Display

Postby Mee_n_Mac » Thu Mar 15, 2012 12:02 pm

StaticDet5 wrote:(The gearbox discharges are clearly visible spikes)


I'm not so sure about that. The timing of the drops doesn't look right to me. I did an FFT on the data and hoped to see a large component that would be near the cyclic rate, about 24 Hz. I don't see that. I do see something at low frequencies ... perhaps 2.5 Hz. And of course a large DC component that corresponds to the 512 average. I'll have to look at it more.

:?:
Mee_n_Mac
 
Posts: 4324
Joined: Thu Apr 28, 2011 4:10 pm

Re: Arduino Airsoft Controller with Display

Postby dkulinski » Thu Mar 15, 2012 12:08 pm

Hey now, quit bringing science into this conversation! :) I have never used FFTs, I will defer to Mee_n_Mac's superior skills! One thing I did notice is that above 640 on the ADC readings it is VERY noisy. If you discard the values above 640 do you see a pattern?

Dan
Last edited by dkulinski on Thu Mar 15, 2012 12:21 pm, edited 1 time in total.
dkulinski
 
Posts: 216
Joined: Tue Apr 05, 2011 12:36 pm

PreviousNext

Return to SparkFun Product Questions

Who is online

Users browsing this forum: No registered users and 6 guests