Sign in to follow this  
Guest rkruijer

Engine failure

Recommended Posts

Hi,I would like to invoke an engine failure on a 4 engine piston aircraft from an XML gauge.Can somone tell me what to use to make one engine stop when a certain condition is met or by just clicking?Thanks for your help.Roelof

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi,There are many ways to provoke an engine failure.You need to setup some code logic with L:Var's and A:Var's so, that when a condition is met, the engine stops running.Some make an inflight restart possible, others need ground service.You need to code some timers.So, an example:Say you want to use oil temperature; limit=105 degrees.Then, when oil temp passes 105, a timer starts running.When the timer passes, say 5 minutes, the fuel valve goes off and the engine stops and the timer goes back to zero.When the timer is zero again, a restart is possible. etc.When in the meantime oil temp normalizes, the timer also goes back to zero (so proper engine management sets the failure risk to zero)You could use another timer, together with the first, and this one counts further when the condition is met again and when now some point is reached the engine quits definitely and restart is not possible anymore and only ground service can repair the problem.Now you see, you can use many parameters: to long high rpm'sto long high oil temp or oil pressto long low hyd press(L:Var's, own hyd sys)etc. etc.Some code, not real text:(A:oil temp,celsius) 105 > if{ (L:timer,number) 1 + (>L:timer,number) els{0 (>L:timer,number) }(L:timer,number) 1000 > if{ (A:Fuel valve,bool) if{ (>K:fuel valve toggle) } (L:timer,number) 1 - 0 max (>L:timer,number) }(L:timer,number) 0 == if{ restart possible }els{ restart not possible }Succes!I had and have a lot of fun to think about and code all those stuff.The sky and your imagination is the limit!Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Hi,Rounding Jan's perfect enumeration of easy modes to simulate an engine failure, you must fire a FUEL CUTOFF event with code to stop the engine :-) Tom

Share this post


Link to post
Share on other sites

As ever. Quick help is almost guaranteed from you gentlemen.I am on my way.Roelof

Share this post


Link to post
Share on other sites

Hi,My "problem" is, that after years and many A4's of coding to simulate the engine failures, hydraulic leak, generator disconnects, hot and cold oil, cabin alt failure, pneumatic leaks etc. etc., i fly so "good" by the numbers, that i never have had any failures anymore?!Sometimes boring or good ground crew.....Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Jan,I use date/time variables inside my Failures.xml gauge; so if a pilot has the bad luck (or good maybe?) to be in flight at a given "failure moment", the abnormal condition is going to catch him unexpectedly. Heck, even I forgot some of my programmed failures existed and was "surprised" with an emergency condition!.Tom

Share this post


Link to post
Share on other sites

He Tom,That is a good idea!You mean you can set a given day and time when it happens or is even that at random.An example?I used sometimes:(L:var1,enum) (>K:ZULU_DAY_SET) (L:var2,enum) (>K:ZULU_HOURS_SET) (L:var3,enum) (>K:ZULU_MINUTES_SET) (L:var4,enum) (>K:ZULU_YEAR_SET) Mostly i forgot to set the var's....Can you do it automatically?Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

>You mean you can set a given day and time when it happens or>is even that at random.Of course. For example, this is one of my gauge's comment:This gauge commands pseudo random failures.Failures from 08/06/2005 at 19.00Z to 08/06/2006 at 19.00Z Variables = 1054230895 to 1054756495 = 525.600 minutes = 8.760 hoursAnd in the code:(L:HydFail1, bool) ! if{ (P:Absolute time, minutes) int 1054657883 == (>L:HydFail1, bool) }(L:HydFail1, bool)if{ (L:L Hyd Qty,percent) 1 (L:L Hyd Press,psi) 270 / int * 2 + @SimFac1(1080) / - 0 max (>L:L Hyd Qty,percent) }Even I can use an XML Random function (custom) to add minutes to a starting reference, as to make it more uncertain.Tom

Share this post


Link to post
Share on other sites

I see, Can become a big surprise after a while!Revieuwing my code, something must happen 12-22-2010, 00:00:01...A little adaptation is necessary!Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Hi,Every time I ask a question I seem to stirr up a few things.Now that you people seem to be really into this can you tell me what the code would be for a click event to shut down engine number 2 for instance?For the purpose of testing that would be very useful to me.Thanks,Roelof

Share this post


Link to post
Share on other sites

Hi,You could try:(>K:MIXTURE2_LEAN) (>K:TOGGLE_FUEL_VALVE_ENG2)(>K:TOGGLE_ENGINE2_FAILURE) (>K:MAGNETO2_OFF) (>K:THROTTLE2_CUT) (>K:FUEL_SELECTOR_2_OFF) Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

>Hi,>>You could try:>>(>K:MIXTURE2_LEAN) >(>K:TOGGLE_FUEL_VALVE_ENG2)>(>K:TOGGLE_ENGINE2_FAILURE) >(>K:MAGNETO2_OFF) >(>K:THROTTLE2_CUT) >(>K:FUEL_SELECTOR_2_OFF) >>Jan>>"Beatus ille qui procul negotiis..."Thanks Jan,I understand that any of those will do the trick. When I'm done I will give the panel to my brother without telling him. (-: See if he can handle it with one engine less. He's is the kind of pilot that claims to have a rating for almost all FS aircraftRoelof

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this