AirsoftMechanics.com
September 08, 2010, 12:39:38 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to the NEW AirsoftMechanics.com Discussion Forums!
 
   Home   Help Login Register  
Poll
Question: You are in a realy bad spot on your local game.  The choice is, do you wish 50 more shots at the very real risk of doing $50 worth of damage to your gun?
I need those 50 rounds NOW!!  So the heck with the $50 in damaged parts! - 30 (31.3%)
Time to just "stop" now!!  I will live to fight another day with the gun I have not all busted up... - 66 (68.8%)
Total Voters: 94

Pages: [1] 2 3 ... 26
  Print  
Author Topic: Computerized AEG Controller (Read 37175 times)
Gandolf
High Voltage Guru
Global Moderator
Colonel
*

Reputation Power: 98
Reputation: Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.
[view reputation]

Offline Offline

Posts: 1593



WWW
« on: May 30, 2007, 11:19:03 PM »

Hi All,

Pulling together stuff from the Active Breaking, Control Circuit, Controlled Stop Point, and 3 Round Burst threads...

I sketched up a design for a computer controller for an AEG.:

http://team-titanium.com/~airsoft/Computerized-AEG-Controller/Computerized-AEG-Controller-01.jpg

Sort of like the old one from four months ago, but know I think I know enough to actually make it work  Grin

Q1, Q2, R1, R2 are pretty much old hat for the active breaking and relay MOSFETs now.

R3, R4, U2 buffers the micro-controller output to nicely drive the FETs.  It eliminates a bunch of little transistors and resistors in a box the size of a small fly.

U1 is a small 100 amp current transducer:

http://www.allegromicro.com/en/Products/Part_Numbers/0752/0752-100.pdf

An expensive part, but it has nice isolated signals and does 50kHz!  I think I will do some signal conditioning like a slope detector on the output signal.  Still thinking on that...

U3 is an Atmel ATTINY44 (or something like) micro-controller that will run the whole show.  It seems to have the power to do everything and is super small.  The data sheet for it is 233 pages!!

http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf

A tiny low voltage drop regulator and cap supply the +5V.  The same one the BASIC Stamps use but in a smaller package.

The trigger is wired as a normal switch signal to the processor now.  S2 is a tough, small, and cheap rotary encoder switch is used to select the functions.

http://rocky.digikey.com/WebLib/CTS/Web%20photos/288T232R161A2,%20288T232R161A1.jpg

LED D1 can do red, green, yellow, and flash and stuff as an indicator if needed.

R5 and R6 let the processor measure battery voltage too.

I think it could sell in the $70 range so not bad at all...

The features could include:

Active and intelligent braking with speed control.
Speed control in general.
Under voltage cutoff for the LiPo folks.
Burst fire any way you want it even with variable ROF.
Semi to full auto automatically switched over if you hold the trigger down in semi and all kinds of tricks like that.
Dry fire cutoff since the gun runs faster without BB's
Jammed BB cutoff.
Over current shutdown if the gun draws abnormal current from what the computer has learned it should.
No spring compression in any mode.
Precocking with gentle start up when fired to limit wear.
and on and on...

The cool thing is that the features are all "just firmware"!!  The hardware never changes since the stuff to do everything is already there.  I am not quite sure how to upgrade the program in the field yet.  AEGs might have USB ports soon ;-))  But it would be cool to add new features or improvements just buy downloading a new program into the gun!

So that's what I am thinking about...

This would all be totally open source and Public Domain stuff!  It is much better that many people can work in it and suggest ways to make it better than trying to keep anything secret.  Layout is not critical and it can be wired on a proto board just fine.  All the parts are available in big DIP packages too.  The parts can also be had in super small packages to actually fit into a gun so it is pretty easy and versatile.  I think it can easily be the size of the SW-AB-LONG switch I have now (0.5 x 0.6 x2.0)

It will be cool!!  Any thoughts, suggestions, etc. are more than welcome!

Gandolf
« Last Edit: February 19, 2008, 08:17:27 PM by RiotSC » Logged
jay
Imperial Overlord
Administrator
Lieutenant
*

Reputation Power: 113
Reputation: jay is awe-inspiring!jay is awe-inspiring!jay is awe-inspiring!jay is awe-inspiring!jay is awe-inspiring!jay is awe-inspiring!jay is awe-inspiring!jay is awe-inspiring!jay is awe-inspiring!jay is awe-inspiring!jay is awe-inspiring!jay is awe-inspiring!
[view reputation]

Offline Offline

Posts: 242



WWW
« Reply #1 on: May 30, 2007, 11:43:10 PM »

Quote from: Gandolf

This would all be totally open source and Public Domain stuff!  It is much better that many people can work in it and suggest ways to make it better than trying to keep anything secret.  Layout is not critical and it can be wired on a proto board just fine.  All the parts are available in big DIP packages too.  The parts can also be had in super small packages to actually fit into a gun so it is pretty easy and versatile.  I think it can easily be the size of the SW-AB-LONG switch I have now (0.5 x 0.6 x2.0)

It will be cool!!  Any thoughts, suggestions, etc. are more than welcome!


It will be really cool to have a nice stable platform for open-source "firmware" development.  I'm sure we'll see plenty of inventive functionality put into the firmware  Cyclops

-Jay
Logged

Freedom Isn't Free.  It Is Cleverly Stolen and Summarily Hidden From Sight.

G3 SG1
G3 SAS Custom
CA M15A4 RIS
KWA USP Compact
bongopukerat
Private
**

Reputation Power: 0
Reputation: bongopukerat has no influence.
[view reputation]

Offline Offline

Posts: 10


« Reply #2 on: May 30, 2007, 11:59:58 PM »

All that just blows my mind.  I would have to buy at least one or more.  $70 seems totally worth it too.

Are you saying the rof could be controlled on full auto?  I would love that.  I would get a pretty high voltage battery, maybe an 11.1v lithium, just to have the gasgun-like trigger response but not have the rof to tear apart your gun. 

The semi to full auto is also a cool idea.  Sort of like the aug but with a slightly longer delay?  That'd be sweet to have semi, burst, and full auto.  Could you get really creative and have different types of full auto?  One slower to just lay down a constant cover fire, and the other a lot faster for intense situations?

Is the next step to order the pieces and try and put together a working one?
Logged
jay
Imperial Overlord
Administrator
Lieutenant
*

Reputation Power: 113
Reputation: jay is awe-inspiring!jay is awe-inspiring!jay is awe-inspiring!jay is awe-inspiring!jay is awe-inspiring!jay is awe-inspiring!jay is awe-inspiring!jay is awe-inspiring!jay is awe-inspiring!jay is awe-inspiring!jay is awe-inspiring!jay is awe-inspiring!
[view reputation]

Offline Offline

Posts: 242



WWW
« Reply #3 on: May 31, 2007, 08:56:18 AM »

Quote from: bongopukerat
Are you saying the rof could be controlled on full auto?  I would love that.  I would get a pretty high voltage battery, maybe an 11.1v lithium, just to have the gasgun-like trigger response but not have the rof to tear apart your gun. 

Controlling the ROF boils down to having PWM output on the uP, which the ATTINY44 looks to be capable of.

Quote from: bongopukerat
The semi to full auto is also a cool idea.  Sort of like the aug but with a slightly longer delay?  That'd be sweet to have semi, burst, and full auto.  Could you get really creative and have different types of full auto?  One slower to just lay down a constant cover fire, and the other a lot faster for intense situations?

You can literally be as creative as you want here.. like Gandolf said, it's all software.  You could even add a sensor to your trigger to control ROF based on trigger pressure or position. 

-Jay


Logged

Freedom Isn't Free.  It Is Cleverly Stolen and Summarily Hidden From Sight.

G3 SG1
G3 SAS Custom
CA M15A4 RIS
KWA USP Compact
RiotSC
AEG Gear Specialist
Administrator
General
*

Reputation Power: 255
Reputation: RiotSC is awe-inspiring!RiotSC is awe-inspiring!RiotSC is awe-inspiring!RiotSC is awe-inspiring!RiotSC is awe-inspiring!RiotSC is awe-inspiring!RiotSC is awe-inspiring!RiotSC is awe-inspiring!RiotSC is awe-inspiring!RiotSC is awe-inspiring!RiotSC is awe-inspiring!RiotSC is awe-inspiring!
[view reputation]

Offline Offline

Posts: 2219



« Reply #4 on: May 31, 2007, 12:24:03 PM »

Wow, this may just be the thing to revolutionize the industry as a whole.  It will certainly open up a lot of possibilities.  Looks like one of those things that would make me want to go back to software hacking.  Cheesy  On the side note, would it be too much trouble to add components required to interact with brushless motors?  Or is it better off to keep such circuit separate?  It would certainly be nice to integrate everything into a compact package.  Smiley
Logged
Bench
Recognition
Corporal
*

Reputation Power: 4
Reputation: Bench has no influence.
[view reputation]

Offline Offline

Posts: 83


« Reply #5 on: May 31, 2007, 12:56:40 PM »

You could even add a sensor to your trigger to control ROF based on trigger pressure or position. 

Yep, this is what I need... the ability to spray more bullets as my adrenaline rises! Cheesy
Logged
Gandolf
High Voltage Guru
Global Moderator
Colonel
*

Reputation Power: 98
Reputation: Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.
[view reputation]

Offline Offline

Posts: 1593



WWW
« Reply #6 on: May 31, 2007, 11:56:28 PM »

Hi,

Quote
Are you saying the rof could be controlled on full auto?  I would love that.
It could automatically fire in tune with the Star Spangled Banner, or a tune from you favorite music group.  The computer can control the motor speed, position, and timing.  I suppose some experiments could determine what types of firing modes were truly useful.  It could also be used with higher voltage batteries but standard gearing so a 12V battery could run an 8.4 volt gun.  Lots of things we have not imagined too  Cyclops

Quote
You could even add a sensor to your trigger to control ROF based on trigger pressure or position. 
Just like a variable speed power drill!  Just have to find a nice drill style switch that fit the gun.

Quote
On the side note, would it be too much trouble to add components required to interact with brushless motors?
If the brushless motors have there own controller, you could probably just get rid of the MOSFETs and current sensing power section and keep the computer chip and most of the firmware and controls as is.  It might be much easier since the brushless motor's speed and such should be known already by its own computer.

I changed the schematic a little but minor stuff that I'll post when I get it updated.  Mostly worked on figuring out how to program them and the hookups for the programmer today.  I think I can get an LED to flash and stuff tomorrow.  Then I'll see if I can breadboard the thing up and start tying things out.

I am thinking it might be best to leave the computer chip in the 14 pin big DIP package and put it into a socket.  Then software upgrades would just be a matter of plugging in a new chip.  That would be far better than any field programming thing.  People could even sell chips with proprietary features only they can figure out  Smiley  Since the hardware is set and very simple, The chip could be programed in many ways.  The chips only cost $1.59 each in quantities of 25 so they are almost free...

Gandolf


Logged
Gandolf
High Voltage Guru
Global Moderator
Colonel
*

Reputation Power: 98
Reputation: Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.
[view reputation]

Offline Offline

Posts: 1593



WWW
« Reply #7 on: June 02, 2007, 05:11:29 PM »

Hi,

I updated the controller schematic:

http://team-titanium.com/~airsoft/Computerized-AEG-Controller/Computerized-AEG-Controller-02.jpg

I just moved R3 and R4 down to where they should be, put in the phase detector Rx and Cx, and grounded the switches since the chip has pull up resistors.  There really is not much at all to the circuit.  Smiley

I am starting to really like the $10 switch and $5 knob combination even if they are really expensive and take up a lot of chip pins:

http://team-titanium.com/~airsoft/Computerized-AEG-Controller/SelectorSwitch.JPG

It just has that perfect "military gun feel" and you know exactly what mode your in without thinking too much about it...

Spent a lot of time figuring out the Dragon programmer thing.

http://team-titanium.com/~airsoft/Computerized-AEG-Controller/Dragon.JPG

Had to make some jumpers and solder on a header.  Still need to get a ZIF socket.  This was a giant help figuring it out:

http://www.instructables.com/id/EVM00HSXH6EZ7C8ZID/?ALLSTEPS

But just use color heat shrink from Radio Shack and the far cheaper DK# WM2512-ND sockets for the jumpers rather than all their cables and headers...

Also note that the dragon uses a big USB type B connector like on the right here rather than the usual flat style:

http://upload.wikimedia.org/wikipedia/commons/b/b7/USB_TypeAB_Diagram.svg

Probably want to order one on-line for $3 rather than pay $20 for one at Best Buy  Evil

So I can communicate with the chip now.  Beware of the programming lock fuses on the chip when messing around.  Atmel's Studio4 likes to set them automatically so you can't reprogram it and it is complicated trying to reset them.

So I need to order some parts for DigiKey still to make anything really work.  At first I'll see if I can program it to just be a simple breaking MOSFET switch by taking the trigger signal and simply passing it on the the FET controls.  Then I'll see if I can run the selector switch and LED.  From then on, it should just be programming.

Gandolf





:

Logged
k_man
Exceptional Service
Sergeant
*

Reputation Power: 6
Reputation: k_man has no influence.
[view reputation]

Offline Offline

Posts: 151


« Reply #8 on: June 02, 2007, 06:33:22 PM »

Yes, HVP, high voltage programming.
With such a small pin count I will be making use of this feature.
It does give me one more I/O pin.

You can even do HVP with ISP as long as that I/O is able to tolerate 12v. Wink
Logged
Gandolf
High Voltage Guru
Global Moderator
Colonel
*

Reputation Power: 98
Reputation: Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.
[view reputation]

Offline Offline

Posts: 1593



WWW
« Reply #9 on: June 02, 2007, 07:58:34 PM »

I put most of the programming pins on the selector switch so they can be completely open for ISP.

Filled out more details on the schematic too now:

http://team-titanium.com/~airsoft/Computerized-AEG-Controller/Computerized-AEG-Controller-03.jpg

With a positive selector switch, I don't think the LED is needed so I took it out.  PB2 and PB3 or unused at the moment.  I rescaled the resistors for a bit higher voltage battery too.

Gandolf
Logged
k_man
Exceptional Service
Sergeant
*

Reputation Power: 6
Reputation: k_man has no influence.
[view reputation]

Offline Offline

Posts: 151


« Reply #10 on: June 02, 2007, 11:12:38 PM »

I must have missed that class  Embarrassed

How would one use a slope detector instead of an adc?
Logged
Gandolf
High Voltage Guru
Global Moderator
Colonel
*

Reputation Power: 98
Reputation: Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.
[view reputation]

Offline Offline

Posts: 1593



WWW
« Reply #11 on: June 02, 2007, 11:57:00 PM »

Hi K_man,

Quote
How would one use a slope detector instead of an adc?

A single voltage signal is split in two.  One half goes directly into the comparator's positive input.  The other half goes to a RC low pass filter and then on to the comparator's negative input.

If the signal is increasing in voltage, the signal from the RC filter will lag behind.  So the positive input will have a greater voltage than the negative input and the output will be positive.

If the signal is decreasing in voltage, the signal from the RC filter will still lag behind.  So the positive input will have a lesser voltage than the negative input and the output will be negative.

So by delaying the signal to one side of the comparator, we get a positive output when the signal is increasing and a negative output when the signal is going down.

In my schematic (Rev. 1.2), I take the analog signal from the current sensor and feed it directly to the positive input of the internal comparator.  I also put that signal through the Rx and Cx filter which lags the voltage behind in time.  That signal goes to the negative input of the comparator.  So if the signal is rising, the direct connection will have a higher voltage than the delayed signal and the comparator will be positive.  If the signal is falling, The positive input will be more negative than the delayed delayed signal and the comparator will output negative.

I am then hoping to detect and time when the comparator switches to count motor poles, speed, position, etc.  It will look for the up and down swings in the motor current:

http://team-titanium.com/~airsoft/AEGER/TEK00001.gif

I will have to experiment some to find the Rx and Cx values just using an op-amp and a scope for a comparator.  I should get a square wave that is the same frequency as the bumps in the motor current.  Usually the R value is say 1K and the C is pretty tiny since the delayy can be pretty small.

At least, that is the "plan"  Wink  Let me know if it is still not clear and I'll make pictures or something.


I programed the ATTINY44 with the WINAVR LED demo and the LED is going bright and dim right now  Grin  Also played with the AVR Studio4 debugging and trace stuff.  It is actually real cool!!  So I hope to be able to program it to do something eventually.  Cyclops  Feeding the trigger signal straight though to the MOSFET should only take me a few days to figure out  Cheesy  But I'll get faster once I have learned a little bit and once I try to remember something about C programming Huh?

Gandolf

Logged
Gandolf
High Voltage Guru
Global Moderator
Colonel
*

Reputation Power: 98
Reputation: Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.
[view reputation]

Offline Offline

Posts: 1593



WWW
« Reply #12 on: June 04, 2007, 02:34:35 PM »

Hi,

Just some updates.

The latest schematic is here:

http://team-titanium.com/~airsoft/Computerized-AEG-Controller/Computerized-AEG-Controller-04.jpg

I found that DigiKey really does sell the currents sensors after all as part number 620-1108-ND.  Allegro just likes to update their part numbers all the time...  In fact...  I see there is a "755" series now...  I guess it will be 756 tomorrow  Cheesy

http://dkc3.digikey.com/PDF/T072/P0853.pdf

The values for Cx and Rx look like 10nF and 4.7K ohms from computer simulations so I'll try that first.

Not much will change now until I have a chance to actually try it out...

Gandolf

Logged
k_man
Exceptional Service
Sergeant
*

Reputation Power: 6
Reputation: k_man has no influence.
[view reputation]

Offline Offline

Posts: 151


« Reply #13 on: June 04, 2007, 02:47:58 PM »

Slope explination makes sense.
No need for a full adc if all we want is the slope :p

It does tie up 2 pins but with a 14 pin uP rather than an 8 pin, I guess we can spare 2.  Wink
Logged
Gandolf
High Voltage Guru
Global Moderator
Colonel
*

Reputation Power: 98
Reputation: Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.
[view reputation]

Offline Offline

Posts: 1593



WWW
« Reply #14 on: June 04, 2007, 05:01:16 PM »

Hi,

FYI.

Allegro also makes very interesting Hall effect gear tooth sensors in a very small package.

http://www.allegromicro.com/en/Products/Part_Numbers/1642/1642.pdf

http://www.allegromicro.com/en/Products/Categories/Sensors/ats.asp

http://www.allegromicro.com/en/Products/Part_Numbers/0643/index.asp

These might be useful for many things or as a "plan B" if the current/voltage sense needs help.

Quote
No need for a full adc if all we want is the slope :p

Just a digital signal now with timing information  Grin  But we might want to pull analog too for over current sensing.  If the thing draws over 100 amps we need to start timing to shut it down if the motor is shorted or something.  We can still use analog too if we want though.  The idea is to make it as versatile as possible so the computer has all the information possible.  How that information is used is just a software problem  Smiley

We can even calculate the real power the battery is delivering.  If it is 400 watts that is fine.  But if it is 4000 watts, we had better turn it off!!  I was thinking it would "try twice" into a fault or error condition when the trigger is pulled.  So it would have a distinctive "click -click" sound telling the user that the computer senses a short or other problem.  The computer talking back to the user is sort of a rough point...

Maybe we could pulse modulate the motor to actually "talk"!!  I have seen that done (it's spooky  Shocked), but I am not sure the processors we use could do "too much" of that ;-))  Might have to use the ATTINY84 or something ;-))  Need a sexy female voice  Grin  That sounds funny, but it really is fairly easy to do!!  Your ready to take that great shot so your aiming...  you squeeze the trigger...  and that little sexy lady's voice in the motor says "I'm sorry, you out of ammo..." Cheesy  That would be worth it all in laughs right there!!  Trust me, it CAN be done  Wink



My good pal Steve Conner is real good at it!!





If it can be done at 400,000 volts, we can do it at 8.4  Wink  A talking AEG motor is fairly simple and that would be a big wake up call that AEG control has become "different".  The next step will be to link it with blue tooth to your infrared system on your helmet so the AEG motor will say things like "There is a large 37 C thermal object 147 degrees behind your right at 27.6 meters..."  I have done it with the Rabbit controllers, but they have 512K of RAM  Roll Eyes  I think Radio Shack and a few others have simpler text to voice chips for $10...  Future stuff.  Right now, I just hope to read the trigger signal pin and repeat it to the FET drive pin  Cheesy

Quote
It does tie up 2 pins but with a 14 pin uP rather than an 8 pin, I guess we can spare 2.  Wink

There are the 20 pin and "UP" pin packages too, but I have two pins I don't know what to do with now.  I want to use the full size 14 pin DIP so software is easy to change.  But that is a big chunk of plastic that takes up a lot of room.  I still hope to keep it in the 5/8 inch diameter x 2 inch long size though.  If it needs to be smaller, we'll just have to count on Psyphyer to put it all on a dime  Grin  I am too old, blind, and shaky to solder stuff as small as he can!!  Tongue

Gandolf

« Last Edit: June 04, 2007, 05:07:49 PM by Gandolf » Logged
Pages: [1] 2 3 ... 26
  Print  
 
Jump to:

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!