AirsoftMechanics.com
September 08, 2010, 12:29:53 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  
Pages: 1 [2] 3 4 ... 11
  Print  
Author Topic: Lion Software (Read 4996 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
« Reply #15 on: November 07, 2009, 09:34:52 AM »

The EEPROM writing works fine with optimization -0s but it does not work with optimization -01.

So the optimization in the WINAVR or GCC compiler is the problem.

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 #16 on: November 07, 2009, 07:25:02 PM »

Hi,

Everything is working now!  Even the EEPROM stuff.  I just went back to optimization -Os and fixed the few issues there and all is good.  I read into how the GCC optimizations work but it was way beyond me...  But I take back everything thing I said about optimization -Os.  Apparently the only things worse than it are any of the other optimizations!  Cheesy

Here is the latest code with everything working and even pre-cocking now!  Cyclops  Cyclops

http://extreme-fire.com/Lion/20091107/

I made a pre-cocking movie too to show how it works:



Gandolf
Logged
skag187
Major
*

Reputation Power: 21
Reputation: skag187 barely matters.skag187 barely matters.
[view reputation]

Offline Offline

Posts: 718


evil inside


« Reply #17 on: November 07, 2009, 08:20:27 PM »

 that made my day

great video
Logged

just say no to lego airsoft builds
hunterseeker5
Exceptional Service
General
*

Reputation Power: 104
Reputation: hunterseeker5 is leading the good life!hunterseeker5 is leading the good life!hunterseeker5 is leading the good life!hunterseeker5 is leading the good life!hunterseeker5 is leading the good life!hunterseeker5 is leading the good life!hunterseeker5 is leading the good life!hunterseeker5 is leading the good life!hunterseeker5 is leading the good life!hunterseeker5 is leading the good life!hunterseeker5 is leading the good life!
[view reputation]

Offline Offline

Posts: 2126



« Reply #18 on: November 07, 2009, 09:52:21 PM »

that made my day too....
Logged

Get the parts serious airsoft mechanics use:
HSarmory.webs.com

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 #19 on: November 14, 2009, 07:09:59 PM »

Hi,

I'll post this under "software" since that is now where this whole game is at!!

Here are the current codes:

http://extreme-fire.com/Lion/20091114/SW-Lion-1010.c

http://extreme-fire.com/Lion/20091114/Lion.h
http://extreme-fire.com/Lion/20091114/lioneeprom.h
http://extreme-fire.com/Lion/20091114/LionLCD.h

The new  lioneeprom.h  is like the 'librarian' for the EEPROM storage.  It knows where to stick it and where to find it.  Since I have the EEPROM working now, I have not used the LCD display much...  Easier just to pull the whole data file out to check things.

ATMEL's Studio 4 likes to store the HEX file in this format:

http://extreme-fire.com/Lion/20091114/out1.hex

Sort of a PITA realy...  It does not import into a spreadsheet well as far as I can find.  A GCC program could convert it very nicely though into a very comprehensive text file...

I played with microphone pickups some.  Peizo sensors seem way too biased into the high frequencies:



Lot of noise there.  But it was set right against the mechbox.  

The Wideband accelerometer gave this:



That slow negative valley (~5mS) is the piston traveling forward at 7.9mV/G...  The top spike (~16mS) is when it hits the end.  So that is -126G and +380G!!  You would "think" that would be easy to detect  Cheesy  Cheesy  Cheesy  Cheesy  Cheesy  Cheesy  Cheesy

The far later spike (t + 40mS) is very prevalent and I think it is the spring bouncing around or something....

But really, "just the software" seems to rule far better....  I don't think external sensors are going to be very needed unless you are doing something really special...

This is cool!

My worst case test system:



Now that's an 'airsoft gun' a "REAL scientist" can relate too!!!   Cheesy  Cheesy  LOTs of wires, measurements, and data!!!  Cyclops  Cyclops

Let me tell ya though...  Tamiya connectors SUCK big time!!!  Get ride of them on the first upgrade!!  Cyclops  Always solder all joints as possible too.  In this setup, the heating of the Tamiya connectors and the power crimped blue spade connectors is way bad...   Tongue

Now this is cool!!!

With all those bad connections and wires all over the place giant voltage spiking rules!!!

Here one can see the spikes set off by the PWM power limiter and normal PWM:



If we drill into just one spike we see...



The spikes are clamped totally at +23.2V and - 0.3v.  The super uber TVSs that clamp so fast you need a quantum physics paper just to predict their speed!!  Cheesy  The scope is set to a full 10nS peak detect here in the big picture too.  But "NOTHING" is getting through!!!  I think this is a major key into why Panther platform's real failures due to "electronic weakness" is simply zero!!!!!!!!!!!!!!!!!!!!!!!!!!!!

We can estimate the power dissipated in the TVSs:

The back spike is ziltch compared to the forward spike...

The forward spike is:

Say 38A at 23V for 2.3uS or  38 x 23 x 0.0000023 =  2mW/each.  At 10kHz that is 20W!!!

Thank goodness they are rated at 1500W  Cheesy  Cheesy  Cheesy  Cheesy

In my test case here though under PWM they are dumping a lot of power into the unit.  But in a real gun with far far less inductive wire it is a don't care(let alone the low duty cycle).  But it does show the massive problems those giant TVSs are solving for us!!!  Cyclops

So I need to work on user programing stuff next...   Huh?  Huh?

Gandolf
« Last Edit: November 14, 2009, 07:38:08 PM by Gandolf » Logged
skag187
Major
*

Reputation Power: 21
Reputation: skag187 barely matters.skag187 barely matters.
[view reputation]

Offline Offline

Posts: 718


evil inside


« Reply #20 on: February 27, 2010, 07:30:12 PM »

so whats new with the Lion?
how goes the development?
when do we get em?
Logged

just say no to lego airsoft builds
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 #21 on: February 27, 2010, 10:11:19 PM »

Quote
so whats new with the Lion?
how goes the development?
when do we get em?

Not much at all "new"...  Tongue  I have been pretty swamped with orders and zero time for new stuff...  Sad

Quote
how goes the development?

Very good!!  I have been sending out prototypes to "real" programming gurus to see what they can make of it!!  A few snags so far  Tongue But working on that...

It is a really tough 'slow time' right now.  But no time at all to 'back off'  Cheesy

Quote
when do we get em?

GOK...  (God only knows)...  It was a big hardware leap that seemed fairly simple really...  But the software side to make it cool super is taking longer...

I don't think at all that we bit off more than we can chew...  But it is a "giant" chunk of meat that we need to work out  Cyclops

Newer high voltage 3034 FET things have also added new opportunities......

It is always hard to say when to "pull the trigger"....  But if the product is in major flux...  You need to wait it out always...

Gandolf
« Last Edit: February 27, 2010, 10:26:16 PM by Gandolf » Logged
skag187
Major
*

Reputation Power: 21
Reputation: skag187 barely matters.skag187 barely matters.
[view reputation]

Offline Offline

Posts: 718


evil inside


« Reply #22 on: March 04, 2010, 09:35:21 AM »

I don't suppose there is/will be any sort of SDK for it would there?

or is all of the software like one huge txt file?
Logged

just say no to lego airsoft builds
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 #23 on: March 04, 2010, 05:47:17 PM »

Quote
I don't suppose there is/will be any sort of SDK for it would there?

or is all of the software like one huge txt file?


There are five text (C) files really  Cheesy

http://extreme-fire.com/Lion/Lion-1020/

But all the *.h files just have hardware interface functions or do common tasks.  Sort of like "toy boxes"  Grin

That makes the main program far simpler and easier for C programming types to play with.

The whole "real" program of the moment is right here!!

Code:
//MAIN OPERATING LOOP//

CycleLoop:

//  Loop time control
//  Sync cycles to Real Clock every 1mS
while (CycleTime == RealClock) {;}  //  Hold till next clock cycle
CycleTime = RealClock;  

//  Find motor run time
if (MotorStatus == 1) {MotorRunTime = RealClock - MotorStartTime;} else {MotorRunTime = MotorStopTime - MotorStartTime;}

//  Find pre-cocking time
if ((BrakeStatus == 0) && (MotorStatus == 0) && (TriggerCounter == 5))
{PrecockTime = MotorRunTime - PrecockTriggerDelay; ShotTime = MotorRunTime;}


//  Error Handling
if (Error > 0) {LED(2);} else {LED(1);}
if (Error > 1) {StoreHistory(1,Error); Alert(Error); Error = 0;}
// 1 = Voltage droop
// 2 = Voltge droop shutdown
// 3 = Over peak current
// 4 = Over running current

//  Check for excessive battery voltage loss and running current
CheckActivePowerLimit();
CheckMotorRunningCurrent();
CheckShutdownConditions();

//  Check for Trigger
TriggerVoltage = (GetVoltage(Trigger,0) * 5 / 4);  //  Correct for 5K protection Resistor
if (TriggerVoltage >= 6500) {TriggerONDebounce++;} else {TriggerONDebounce = 0;}
if (TriggerVoltage <= 4500) {TriggerOFFDebounce++;} else {TriggerOFFDebounce = 0;}
//  Turn motor on
if ((TriggerONDebounce >= 3)  && (MotorStatus == 0)  && (Error == 0))
{TurnMotorOn(MotorSpeed); TriggerCounter++; TriggerStatus = 1;}
//  Power Start
if ((MotorStatus == 1) && (RealClock <= MotorStartTime + 10)) {MotorPWM(255);}
if ((MotorStatus == 1) && (RealClock > MotorStartTime + 10)) {MotorPWM(MotorSpeed);}
//  Turn motor off
if ((TriggerOFFDebounce >= 3)  && (MotorStatus == 1) && (TriggerStatus == 1) && (RealClock >= (MotorStartTime + 20)) && (ShotTime < (MotorRunTime + PrecockTime + 10)))
{PrecockStartTime = RealClock; TriggerStatus = 0;}

if ((RealClock >= PrecockStartTime + PrecockTime) && (MotorStatus == 1) && (TriggerStatus == 0)) {MotorPWM(0); Brake(1);}  //  Stop Motor
if ((RealClock >= BrakeStartTime + 100) && (BrakeStatus == 1) && (TriggerStatus == 0)) {Brake(0);}  //  Turn off brake


// OutputLCD();


goto CycleLoop;

return(0);
} //  End of Main

There actually has been a lot of work this week!  There is now a 20.0V capable Lion version as an experiment for those that can't get enough LiPO batteries stuffed into their guns.  Two other real programmer types are also working on things.   And I am working on getting another care package to a guy in Japan.

I am not sure they are all totally interested in airsoft though.  A low voltage super extreme well protected half bridge with giant CPU ability and open source attracts some other users too  Cyclops

Gandolf
Logged
octoberust
Captain
*

Reputation Power: 27
Reputation: octoberust barely matters.octoberust barely matters.
[view reputation]

Offline Offline

Posts: 482



« Reply #24 on: March 04, 2010, 09:01:34 PM »

 Whaaat kind of users? Wink
Logged

"Every day above ground is a good day" -Me.
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 #25 on: March 04, 2010, 10:10:59 PM »

Whaaat kind of users? Wink

A lot of "PH.d" and "Dr." 'university' types Cheesy

The lion is actually a very hard line low voltage but super current application 1/2 H-bridge.  Giant computer control!!!  It is also very well tested in the background.  That will attract "others"!  It's TVS protection is a bit ahead of them!!  Grin

They are 'up to something'  Cheesy

They keep a darn good eye on us "ground feeders" for when we hit 'pay dirt'!!!   Cheesy  Cheesy  Cheesy

Their help is always "golden"!!!  They have a giant eye over such things to help keep us on the best track to take forward!! Wink

No worries...  Us "super switchers" may get a little outside attention.  But they all "feed back" to us too!!!!

It's all super good!!   Cheesy

I hope one day "one", may 'take off' with it all!!! 

Then, I might truely be able to "retire" Cheesy Cheesy Cheesy

Gandolf


Logged
octoberust
Captain
*

Reputation Power: 27
Reputation: octoberust barely matters.octoberust barely matters.
[view reputation]

Offline Offline

Posts: 482



« Reply #26 on: March 05, 2010, 04:57:58 PM »

 I don't completely understand the applications in the computer realm you are talking about (always willing to learn) but I hope you find and develope, with great success, the product that will be your "retirement" solution. Best to ya! Grin
Logged

"Every day above ground is a good day" -Me.
Aranarth
Newbie
*

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

Offline Offline

Posts: 3


WWW
« Reply #27 on: March 12, 2010, 02:02:46 AM »

Gandolf, would it be any help for you if i create a "minimizer" for the program-code? It would kick out all comments and empty lines and unnecessary whitespaces through which you can gain more programming-space.
Logged
vattern
Private
**

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

Offline Offline

Posts: 9


« Reply #28 on: March 12, 2010, 02:13:01 AM »

The compiler already does all of this, only the actual code gets converted to a hex file for programming
Logged
Aranarth
Newbie
*

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

Offline Offline

Posts: 3


WWW
« Reply #29 on: March 12, 2010, 02:16:42 AM »

Oh, yeah I could have thought of that. I just didn't cause at my daily work I have to deal with code that doesn't get compiled.
Logged
Pages: 1 [2] 3 4 ... 11
  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!