Crash Detection #819
Replies: 9 comments 3 replies
-
Ah, taking a further look I see that structural contact points are modelled as Lines 87 to 105 in 6e0b852 |
Beta Was this translation helpful? Give feedback.
-
It seems it's raining NaNs these days 😆 : 3 issues reported within a week or so. I agree we can't leave the current situation unchanged and I was also thinking about how the dreaded crash induced NaNs should be handled. One option should be to restore the integration suspension as you suggest. I am not sure why this was commented out in 2014. Given the detection thresholds (in the millions) I can barely imagine a situation where these thresholds would be reached but one would want to continue the simulation ? Alternatively, I was considering addressing the issue by comparing the amount of deformation energy (i.e. Disclaimer: regarding this kinetic/deformation energy idea, this is just a vague idea as I have not much investigated the concept. So take it for what it is i.e. some intuition or gut feeling. |
Beta Was this translation helpful? Give feedback.
-
Yep, when I saw those figures I was surprised they were so large. I'm sure there are a lot of extreme bounces that don't even get reported as a crash. I wonder what FlightGear do, do they have their own crash detection logic? Or do they let aircraft bounce into space? I was assuming the crash detection code would use some rough maximum vertical speed, maybe say twice the typical maximum landing gear VS that airliners say for example have to be certified to handle at maximum landing weight? What I'm wondering is whether we should add say another element to FDM developers could then also specify a lower rating for the nose wheel gear compared to the main landing gear. Also FDM developers could specify a much lower rating for structural contact points. For FDMs that don't include the new element we go with some default for gear and structural contact points. |
Beta Was this translation helpful? Give feedback.
-
My suggestion was that if the designer didn't specify the new |
Beta Was this translation helpful? Give feedback.
-
There was a time, maybe 15 years ago, when we had some crash detection added to JSBSim, but one of the FlightGear/JSBSim users had a fit because this broke his "crash animation" which he had worked very hard on. As far as I know this was the only reason for not halting integration after crashing. The user was Gerard Robin, a.k.a. "grtux", and I believe he retired from simming soon thereafter. I don't know if any of his crash animation code is still in use. I'll ask at the FlightGear forum. |
Beta Was this translation helpful? Give feedback.
-
I searched through various files/history, Flightgear mailing list & forum, and then actually crash testing various aircraft with JSBSim (with Unreal Engine) with SuspendIntegrationUsing
And then stops calling JSBSim if crashed is true.
But "Crash Detected: Simulation FREEZE" message is no longer created by JSBSim, it was removed in a commit from 2016, 944647c
JSBSim's Crash detectionJSBSim's
As @dpculp said, Flightgear aircraft authors created various visuals and physical damaged states that produce broken wings or broken gear struts. The c172p, p51d, shuttle, and many others have a damage system where the wings can be broken off. These systems appear to use JSBSim Forcing JSBSim to halt simulation will no doubt cause complaints from FlightGear users. Which is sort of ironic because FlightGear currently looks for JSBSim crash detection, but "Crash Detected: Simulation FREEZE." message has not existed for a few years. And fixing that Message would possibly cause complaints 😥 Moving OnIf there are any updates to Crash Detection, I'd suggest at the least using a property bool which enables/disables Crash Detection or enables/disables the stopping of sim due to Crash Detected. This way if JSBSim defaults to stop on crash in a future update, FlightGear, or each JSBSim user, can easily disable Crash Detect for their needs. There's also the possibility of using using more than one Crash Detector. Then users can disable/enable ones that work better for different situations. For example high speed craft might make better use of one algorithm than another. Besides all of that, Crash Detection seems more like a last chance catch, where something else shouldn't be happening in the first place? Is the issue more due to each Aircraft, how users might initialize some extreme/wrong values, frequency/time steps of the sim, or is there some small issue in the core physics model? I'm not suggesting there is an issue, merely thinking of all reason. Extra DetailsAfter reading through topics, it's seem that each aircraft model's coefficients have an effect on their stability which then increase or decrease the chance of causing some NaNs. Both in aerodynamic data and contact point data. 787-8 can trigger a Crash Detected with no NaNs, by striking the ground while banking and pitched down, the aircraft bounces but not too extreme and continues flying as normal. This aircraft does produce NaNs occasionally depending on the angle of impact, etc. F15 I wasn't able to trigger a Crash Detected. It either got stuck in the ground, fly through/below the ground, or bounced semi-realistically. It doesn't seem to produce many or any NaNs with impacts. Edit: I can produce NaNs in a nose dive impact, similar to the c172p. C172P It's difficult to produce any NaNs with impacts but it was possible. Usually in a Nose Dive Impact w Original JSBSim c172p "Left Tip":
FlightGear Team's c172p "Left Tip"":
If we can reliable crash/impact a model into the ground that causes NaNs nearly every time, maybe that would help find a root cause & solution. I think with the c172p it might provide reliable crashes with NaNs due to hitting the ground at a certain/angle speed in a nose dive. Edit: Yes I can repeatedly crash the c172p, in the same manner, reliably causing NaNs, and Crash Detected is not always triggered. I wonder if half of the words in my comment were pointless. 😅. I'll maybe investigate later and share if I find anything interesting. |
Beta Was this translation helpful? Give feedback.
-
No need to apologize. I definitely prefer these sorts of comments compared to comments that are trying to explain an issue the user is having with so, so, so little information you have to be a mind reader to try and figure out the issue they're having 😉
Yep, doesn't seem like a very robust communication mechanism relying on some specific string output to the console. Suggest we create a new property in JSBSim that we set which then FlightGear and FDM users can use to trigger whatever they want to do when a crash is detected in JSBSim. In addition to a property that is set when a crash is detected we can have another property that controls what JSBSim does when a crash is detected, e.g. does it suspend integration or not etc.
Take a look at the crash detection code I posted a link to originally. Note how extreme most of the checks are, hence the reason you sometimes don't get a crash detection for an impact that obviously in the real world would be a crash with no bouncing. Lines 554 to 566 in 6e0b852 Hence the reason I suggested we change the crash detection logic. I suggested one approach, @bcoconni suggested a different approach. Someone on the FlightGear forum posted the following with regards to my suggestion of using some descent velocity to decide whether the gear would be broken and use that as a crash detection.
|
Beta Was this translation helpful? Give feedback.
-
While looking into something else I came across this diagram. The red boundary line is the structural design envelope for the F/A-18E/F aircraft. |
Beta Was this translation helpful? Give feedback.
-
Some more background info on landing gear strength for commercial airliners. https://www.boeing.com/commercial/aeromagazine/articles/qtr_3_07/article_03_3.html
|
Beta Was this translation helpful? Give feedback.
-
Given the number of reports with aircraft hitting the ground very hard and then rebounding with extreme velocities based on massive spring compression in the gear and sometimes ending up with NaNs a while after the massive bounce I took a look at the crash detection logic.
So first off it looks like we need two timesteps with WOW before the crash detection function is called.
jsbsim/src/models/FGLGear.cpp
Lines 416 to 420 in 6e0b852
So my first question is, since when I searched for the word 'crash' in the source code the only references I found were in
FGLGear
what about crash detection when the gear isn't down? There are reports printed for contact points hitting the ground but does that mean no crash detection in that case?Now in terms of the actual crash detection function.
jsbsim/src/models/FGLGear.cpp
Lines 554 to 566 in 6e0b852
So
fdmex->SuspendIntegration()
has been commented out, so the only effect of crash detection is to write a crash comment to the console, the sim continues, potentially outputting NaNs later on etc.Looking through the history for
FGLGear
I see the integration suspension was commented out by @jonsberndt in 2014 -a1360ba
With a commit comment that is a question - "Turned off suspension of integration in landing gear model is this a good thing for everyone?"
Which is what I'm basically querying 😉
My gut feel is it would be better to stop. @jonsberndt, @bcoconni, @agodemar can you remember the advantages/pros for not suspending integration?
Beta Was this translation helpful? Give feedback.
All reactions