c172p-team / c172p

A high detailed version of the Cessna 172P aircraft for FlightGear
GNU General Public License v2.0
79 stars 44 forks source link

Hydrodynamics: soften the bouncing behaviour with floats for 3.6? #326

Closed dany93 closed 9 years ago

dany93 commented 9 years ago

I say it again, I know nothing about float planes. All that I can say (from the videos, and the pilots who are still alive!) is that the current brutal bouncing behaviour cannot be the reality. Moreover, this will move people away, discourage them from practicing the floats, which would be a great pity. IMO, this anomaly must be softened for the 3.6 release.

I am trying to propose something which is, say, less far from reality in a first step. Like JSBSim, the hydrodynamics code contains many features which should enable a good simulation of many real behaviours. But I'm discovering it...

Here is a modified version where the behaviour is more soft. Also, I have increased a bit the side forces (for when you touch the water in crab). https://github.com/dany93/c172p-detailed/tree/hydro

I cannot say how much close to reality it is. I guess some of you will find it too easy, but I think that it is better than one which would repel users. Possibly, they will discover that it is more difficult when we have made it more realistic. But too late, they will have learnt to like it... Now, the aircraft is (too?) hard to overturn nose first. You have to touch water with at least 25 - 30 deg pitch down. I would have expected it more prone to overturn but, here too, I ignore the real behaviour. With the previous version, this overturn was, not only excessively brutal, but it also resulted from a very brutal rebound from the rear part of the floats. Still less realistic. If it is to happen, It should be from a plunging of the float nose.

I let you to test it if you wish and possibly choose if your prefer this version for the 3.6 release.

wlbragg commented 9 years ago

Cool, thanks dany93, I'll have my opinion for you by tomorrow morning CST. Thank you for taking it upon yourself to do this. I am in agreement that we need to soften the brutal effect, even if we loose a bit of reality elsewhere. My opinion so far was, I would rather have the brutal behavior rather than the complete lack of reality that it had without the hydro FDM.

onox commented 9 years ago

You're right about the fact that the bouncing behavior needs to be softened for 3.6. However, you have based your hydro branch on your c172-eng160-180hp branch. Please checkout master, then checkout a new branch (hydro-soft or something, just give it a new name) and then add that single commit to it.

Unless you meant hydro to be a temporary branch with the 180 HP engine added.

@andgi Could you take a look at @dany93's commit?

andgi commented 9 years ago

I think reducing the planing pitch and roll moments by 5 (0.01 to 0.002) is going a bit too far - I think it makes the water act too soft at fast planing speed. @dany93 How did you arrive at 0.002?

Reducing them by about 2 (0.01 to 0.005 or 0.004) leaves some character while still making it much more tolerant than before.

The added tables doesn't do anything in the normal operating range but perhaps lessens the risk of strange reactions when flipping over or nosing in (the planing moments are strong since hydro/qbar-u-psf grows quickly with speed)?

onox commented 9 years ago

I think 0.002 is indeed too soft. 0.005 is better.

dany93 commented 9 years ago

@andgi wrote

The added tables doesn't do anything in the normal operating range but perhaps lessens the risk of strange reactions when flipping over or nosing in (the planing moments are strong since hydro/qbar-u-psf grows quickly with speed)?

Yes and no. The added tables doesn't do anything in the normal operating range. The straightening up moment increases for small angles as your tables set it, as long as the floats still touch the water for, say, at least half their length for pitch or as long as the upper float still touches for roll.

But they are not here just to "lessens the risk of strange reactions when flipping over or nosing in". The straightening up moment is not constant beyond + / - 8 deg or 12 deg. It decreases. By mere physics laws, the straightening up moment (pitch or roll) starts from 0 at equilibrium, then increases only as long as about half length (pitch) or one the floats (roll) can still sink more into the water. As soon as the floats lift, this moment stabilizes then starts to decrease, to become 0 before 90 deg pitch or roll. More easy to understand for roll: when the higher float is high enough (roll 45 to 50 deg, less than 90 deg), the weight is at the vertical of the lower float and there is no straightening up moment at all. The same reasoning for pitch if only the tip of the float touches the water.

Beyond this angle, the straightening up moment cancels and the aircraft falls. Simplified case, not taking into account the lift force due to the wings: (EDIT : I had done a mistake in the scheme, fixed)

float-palne

The straightening up roll moment does not increase with speed. The planing force increases, but the total force due to planing + buoyancy is constant, equal to the weight at first approximation.

A bit more complicated for pitch because the application of the force moves with the pitch angle. That is which makes the pitch reactions too brutal when the rear part of the floats briefly touches the water.

Was it your question?

dany93 commented 9 years ago

@onox someguy has some issues with this 160 - 180 hp version. http://forum.flightgear.org/viewtopic.php?f=4&t=25157&p=248188#p248188

andgi commented 9 years ago

@dany93 I see. Yes, the original model certainly disclaims everything beyond the range of the buoyancy data. I wonder if the tables for approximately extending this range shouldn't rather be in the buoyancy moment terms (then including an approximation of the hydro/float/height-agl-ft dependency). The planing moment terms OTOH could be further constrained since planing is not possible in many of the situations where there is a buoyancy moment - this is a limitation of using the buoyancy terms as the primary input for the planing terms.

dany93 commented 9 years ago

I was just looking at your code.

  <fcs_function name="hydro/planing-pitch-moment-lbsft">
   <documentation>
    Pitch moment due to planing. Guessed.
   </documentation>
   <function>
    <product>
     <value>0.004</value> <!-- ini 0.01 -->
     <property>hydro/qbar-u-psf</property>
     <property>hydro/buoyancy-pitch-moment-lbsft</property>

I do not understand for the product of qbar-u-psf x buoyancy-pitch-moment-lbsft (maybe that's me!!) Wouldn't it be better to calculate the buoyancy force and the planing forces on each float for the current state, do a sum, then calculate the moments? Their sum is at first view the weight force minus the air lift force. I guess that you already take this into account. Not so simple, the inertial forces also play a role. After that, calculating the moment would be easy for the roll. Not so easy for the pitch because the application of the resultant forces moves with pitch. An estimation like your current one with the angle seems enough.

If you prefer working with moments, the buoyancy moment with angle is progressively replaced with the planing moment, with an addition of each contribution.

I know I am not quite clear, that is my current state of reflection.

andgi commented 9 years ago

@dany93 The planing moment terms are just guesses. The product is there to increase its strength with u-velocity^2 as you do with the aerodynamic moment terms (yes, I'm aware the static buoyancy moment is not a coefficient). What the static buoyancy moment terms do have is implicit information on which part of the floats that are in the water. Lacking other sources for that information I use them as input to the planing moments - without that information the induced pitch moment would be hard to compute from the force[*]. (For roll it would be easier since the floats are narrow and widely apart - but the basic configuration here came from the monohull MTB.)

A more physical simulation of planing would need information on where and at what angle the fore- and after-body planing surfaces cut the water surface - but that kind of model is still some way off for me.

[*] I suppose one could get some kind of representative location by dividing the buoyancy moments by the buoyancy force (since these should be well in tune unlike the guessed planing forces and moments). Perhaps that is a possible way to go.

dany93 commented 9 years ago

A more physical simulation of planing would need information on where and at what angle the fore- and after-body planing surfaces cut the water surface - but that kind of model is still some way off for me.

I agree that it is too difficult. However, I think that your current estimation with angle (proportionality up to 8 or 12 deg) can give very acceptable results. The more difficult is in the planing contribution to the moment. It can be considered as proportional to qbar-u-psf as long as it replaces the buoyancy, not beyond. (??) At further thought, the planing forces can be very strong with speed. I am lost... And no longer know what to suggest.

With its imperfections, I think that your current model can give very interesting results, but I still think that the planing contribution to the moment is too strong (even with 0.005 instead of 0.002 coefficients). This gives hectic movements, much more brutal than those I expect by intuition or from the videos. A fake illusion of the likely real difficulty. But that's my opinion, I will bend if most of you have a different view. Do not worry.

andgi commented 9 years ago

@dany93 I think "as long as it replaces the buoyancy, not beyond" is a too static/equilibrium centred view - in a stable/"steady" state that will be the outcome (and is, I think), but the large moments and forces occur as part of dynamic processes when a part of a float plunges deeper than its equilibrium position and then I would expect the planing force and moments to easily exceed those generated by buoyancy in the same state. Compare with "normal" aerodynamics (and water skiing?) where the buoyancy contribution is commonly ignored (water is denser than air but the dynamic pressure is correspondingly higher too).

dany93 commented 9 years ago

I agree. Thus my edited corrections.

The more difficult is in the planing contribution to the moment. It can be considered as proportional to qbar-u-psf as long as it replaces the buoyancy, not beyond. (??) At further thought, the planing forces can be very strong with speed. I am lost... And no longer know what to suggest.

I am writing at the same time that I am thinking about it...

dany93 commented 9 years ago

I have created a new branch hydro-soft-160hp https://github.com/dany93/c172p-detailed/tree/hydro-soft-160hp Starting from the current Juanvvc master (160 hp) Added my hydrodynamics changes.

I have put the values for pitch and roll planing moments at 0.004. Do you consider this acceptable? If not, I'll change for 0.005.

After this, is this the usual way (Pull Request from my hydro-soft-160hp branch to Juanvvc master)? I don't understand too much the use of the "version-3.6" branch, and the possible merge towards 3.6

onox commented 9 years ago

@dany93 Ignore version-3.6 branch. Just create a PR for master once @andgi is OK with the changes.

andgi commented 9 years ago

For me 0.004 is fine. Please, go ahead.

dany93 commented 9 years ago

@andgi (and who wants) To soften this too (IMO) brutal rebound from the rear part of the floats in planing, what would you think of something like this? https://github.com/dany93/c172p-detailed/tree/hydro (see the table for 12 and 45 pitch-deg)

  <fcs_function name="hydro/planing-pitch-moment-lbsft">
   <documentation>
    Pitch moment due to planing. Guessed.
   </documentation>
   <function>
    <product>
     <value>0.004</value> <!-- ini 0.01 -->
     <property>hydro/qbar-u-psf</property>
     <property>hydro/buoyancy-pitch-moment-lbsft</property>

    <table>
      <independentVar lookup="row">hydro/float/pitch-deg</independentVar>
      <tableData>
        -90  0  
        -45  0.7
        -8   1                
        0.0  1
        12   0.1
        45   0.07
        90   0
      </tableData>
     </table>

    </product>
   </function>
  </fcs_function>

It is (much?) more pleasant if we keep a good control of the pitch angle, without losing its reactivity if we wrongly let the yoke at neutral or with a bit of nose down at touching the water. Also, it enables a better control of the pitch up angle when planing for takeoff.

tigert commented 9 years ago

Hmm. There is one issue: If you water-land the amphibian with gear down, you just slow down really fast but everything ends up just fine.

Not like https://www.youtube.com/watch?v=NBkzh0LKe5I

This was flipping over like on the video with the earlier more "lively" hydrodynamics though.

wlbragg commented 9 years ago

If you water-land the amphibian with gear down, you just slow down really fast but everything ends up just fine.

Sad, I liked the results of flipping if you made the mistake of gear down in water.

onox commented 9 years ago

Me too. Could we partially revert PR #330? What is causing the current behavior? The table that uses hydro/float/pitch-deg? (See https://github.com/Juanvvc/c172p-detailed/pull/330/files or https://github.com/Juanvvc/c172p-detailed/issues/326#issuecomment-114821380)

andgi commented 9 years ago

It might be better to tweak the planing pitch moment for negative pitch instead. As I think @dany93 observed, going over in pitch was caused by an unstable oscillation in pitch: disturbance down - rebound up and reaching a higher pitch angle fast - a strong rebound down which caused the nose over.

One possibility is switching from 1 to -1 for -8 deg in the table here: https://github.com/Juanvvc/c172p-detailed/blob/master/Systems/c172p-hydrodynamics.xml#L790 which makes the planing pitch moment reinforce a pitch down below -4 deg. It needs to be test flown as extensively as possible to ensure that it doesn't impact normal operations. I think it should not, though I can imagine it causing problems in waves but these are not an "official" feature yet.

IRL such a reinforcement of pitch down would be due to the increasing drag as the floats nose in. In the model the planing pitch moment is proportional to the buoyancy pitch moment which would be nose up when the front of the floats dip in, leading to the need for the sign reversal.

dany93 commented 9 years ago

@andgi

One possibility is switching from 1 to -1 for -8 deg in the table here: https://github.com/Juanvvc/c172p-detailed/blob/master/Systems/c172p-hydrodynamics.xml#L790

I agree that the pitching moment due to water is too hard. The aim of this table was to decrease it beyond -8° / +12°, down to cancel it at +/-90°. Beyond +/-45°, there is almost no straighthening up moment because the CG is almost at vertical of the contacts. However, I think that inverting the sign is too much, there is no reason that the pitching moment from the water "attracts" the plane beyond -4° pitch down. Decreasing the numbers in the table to soften these moments, maybe yes, negative, no. The flipping is due to drag in water and inertia in a first step, then (at larger pitch down, when only the tip of the float touches the water) due to decrease, not inversion, of the straightening up moment.

I just discovered your last phrase:

IRL such a reinforcement of pitch down would be due to the increasing drag as the floats nose in. In the model the planing pitch moment is proportional to the buoyancy pitch moment which would be nose up when the front of the floats dip in, leading to the need for the sign reversal.

For IRL I completely agree. For the sign, I don't know. A balance to be found?

@onox

Could we partially revert PR #330? What is causing the current behavior? The table that uses hydro/float/pitch-deg? (See https://github.com/Juanvvc/c172p-detailed/pull/330/files or #326 (comment))

If you try to get this flipping over from a rebound by the rear part of the floats, it is the wrong way. The flipping over must come from the drag of the wheels into water, or / and the drag from the front part of the floats when plunged. Maybe by having the rear wheels more out of the pontoons when down? (see the video) I do not know how or where the drag from water on the plunged wheels is set.

Weird: With the current values, I have this flipping over (due to the wheels in the water) on the sea (Longitude -90, Latitude 0, Altitude 0). Not in the San-Francisco Bay.... ???? fps effect? (60 fps on the sea, 30 - 40 on the San-Francisco Bay) (Unchecking "Damage" can help for these tests)

Worst: even by deleting my table for pitch and re-entering the initial value (<value>0.01</value> instead of 0.004)

  <fcs_function name="hydro/planing-pitch-moment-lbsft">
   <documentation>
    Pitch moment due to planing. Guessed.
   </documentation>
   <function>
    <product>
     <value>0.01</value> <!-- 0.004 dany, ini 0.01 -->
     <property>hydro/qbar-u-psf</property>
     <property>hydro/buoyancy-pitch-moment-lbsft</property>

    <!-- <table>
      <independentVar lookup="row">hydro/float/pitch-deg</independentVar>
      <tableData>
        -90  0  
        -45  0.7
        -8   1                
        0.0  1
        12   1
        45   0.7
        90   0
      </tableData>
     </table> -->

    </product>
   </function>
  </fcs_function>

I do not have the flipping over in San-Francisco Bay...

andgi commented 9 years ago

@dany93 I think the "wheeled gears in water" drag as we get it is hard-coded in JSBSim. For the sign reversal, remember that the planing drag term computed in the drag channel is applied at the Hydro RP, i.e. it doesn't add a significant nose down moment by itself - that moment has to come from the pitch moment channel. In an ideal world by multiplying the drag with the moment arm for the equivalent acting point but we don't have that so the inverse of the buoyancy moment might stand in for the cases when the float is not level. Planing as such only happens for a rather limited set of pitch angles so from only the planing perspective the table should have 0 much earlier than +/-90 deg. OTOH, the drag would lead to a significant nose down moment in both the positive and negative cases, which would speak for inverting the sign for negative pitch in the approximation we have for qbar dependent pitch moment.

dany93 commented 9 years ago

@andgi I agree. Hence my phrase

For the sign, I don't know. A balance to be found?

I tried to decrease the pitch moment, e.g. https://github.com/Juanvvc/c172p-detailed/issues/326#issuecomment-114821380 and https://github.com/Juanvvc/c172p-detailed/issues/326#issuecomment-114252580 (0.002, your comment) but that did not bring much enthusiasm. I also tried this for the front part with no success for flipping over in case of float plunging, but I didn't go up to trying negative values.

andgi commented 9 years ago

Having tried a few different locations (SP01, SP07, EFHN and ESGP) with the current code I only failed to nose over in a wheels down landing at EFHN, but the reaction there was still strong and broke the wing.

How consistent are these failures to nose over on a wheels down landing in water? Could head wind be a factor as it reduces the water speed on touch down? Or the water material?

The "wheel in water" drag that pitches the aircraft down and possibly over (or causes it to oscillate and rebound over like in the high speed runs) is hard coded in JSBSim so AFAIK we have little control over it.

There are certainly many aspects of the float hydrodynamics that could be improved (e.g. the pitch moment due to drag in extreme attitudes; strength of moments in planing attitudes; ...) but 4 days before the final release might not be the best time to explore them.