Csaba Halász wrote > ---------------------- > revision 1.3 > date: 2008/12/04 18:47:49; author: mfranz; state: Exp; lines: +1 -1 > Allow negative thrust. This allows a single recoil or vibration > thruster to accelerate in both directions. THROTTLE input still > clamps to 0/1 by default. (OK'ed by Andy) > ---------------------- > > This change breaks PistonEngine (via PropEngine). > > Line 156: _mp *= _minMP + (1 -_minMP) * _throttle; > > _mp is going to be negative. > > Line 172: float T = temp * Math::pow(_mp/pressure, 2.0/7.0); > > T is going to be, guess what, NaN! And that ends up in fuel flow, that > goes into fuel level, that affects cg, that affects > acceleration/speed/position and that affects everything else (not an > exhaustive list). Was kind of tedious to track this down backwards ;) > Anybody know a way to set a breakpoint that activates whenever an > operation results in NaN? (Maybe should have asked that earlier, lol) > > We could work around this by first doing the square and then the 7th > root, but I am not sure negative throttle makes any sense here, and > could still cause trouble elsewhere. > Probably a better solution would be to re-add the [0,1] clamp for the > throttle specifically for PistonEngine (and any other engine that > chokes on negative throttle). > Arguably, a negative throttle setting shouldn't make it to yasim if > the given configuration is known not to handle it, so one could say it > is a bug elsewhere (in this case the nasal scripts for the hurricane). > > Also, this part gave me shivers: > > if(_omega == 0.0) > _omega = 0.001; // hack to get around reports of NaNs somewhere... > > On a different note, when MP is enabled I see random corruption of the > OSG database search path list. Happens infrequently (about 1 in 20), > hard to reproduce it. >
OK, this takes me back a bit, about 4 years in fact. This problem is being caused by the action of the "Boost Controller" that simulates the action of the Boost Controller on the Merlin engine which acts to reduce the throttle setting to prevent the supercharger boost pressure exceeding a preset value - either "normal" or "combat". These values vary on different marks of the Merlin. Thus the boost control is similar in purpose to the wastegate of a turbocharger, but different in method. The Boost Controller always produces negative values, and is damped, so if the throttle is closed quickly the total value input to the THROTTLE value can briefly be negative. This hasn't mattered up to Melchior's patch, because THROTTLE in YASim was clamped to positive values. Hope this helps in outlining the background. Vivian ------------------------------------------------------------------------------ _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel