Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FGTurbine don't start windmilling until powered up at least once #494

Closed
1 of 3 tasks
Octal450 opened this issue Aug 13, 2021 · 25 comments
Closed
1 of 3 tasks

FGTurbine don't start windmilling until powered up at least once #494

Octal450 opened this issue Aug 13, 2021 · 25 comments

Comments

@Octal450
Copy link

Octal450 commented Aug 13, 2021

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

Describe the issue

The engine stays at 0% N1/N2 and does not windmill unless it is started at least one time

What is the current behavior?

To reproduce start a simulation with FGTurbine but do not start one of the engines (example, in a twinjet, start only 1 engine), then takeoff and accelerate. Notice the engine stays at 0% N1 and N2. Then if you engage the starter and then shut down to get slightly rotation, then it seeks the windmill value properly

What is the expected behavior?

Engine should always windmill when off

What is the motivation / use case for changing the behavior?
So that he will work realistic

Please tell us about your environment:

  • OS: Windows 10 Pro x64
  • JSBSim version: 1.18 (FGFS next)

Other information

Should also point out, when you do start the engine, it spools down fast as if it was at 0 before the start attempt.

@seanmcleod
Copy link
Member

Taking an initial look at the code in FGTurbine, it looks like windmilling is only implemented as part of the engine shutting down, i.e.

double FGTurbine::Off(void)
{
Running = false;
FuelFlow_pph = Seek(&FuelFlow_pph, 0, 1000.0, 10000.0);
// some engines have inlets that close when they are off. So, if a flag is true disable windmilling
if (disableWindmill == false) {
N1 = Seek(&N1, in.qbar/10.0, N1/2.0, N1/N1_spindown);
N2 = Seek(&N2, in.qbar/15.0, N2/2.0, N2/N2_spindown);
} else {
N1 = Seek(&N1, 0, N1/2.0, N1/N1_spindown);
N2 = Seek(&N2, 0, N2/2.0, N2/N2_spindown);
}

That's the only reference to windmilling in FGTurbine excluding the lookup to see if windmilling is disabled.

if (el->FindElement("disable-windmill"))
disableWindmill = el->FindElementValueAsBoolean("disable-windmill");

@bcoconni
Copy link
Member

Yes, but the variable phase is initialized to tpOff:


so FGTurbine::Off should be called even if the engine has not yet been started:
switch (phase) {
case tpOff: thrust = Off(); break;
case tpRun: thrust = Run(); break;
case tpSpinUp: thrust = SpinUp(); break;
case tpStart: thrust = Start(); break;
case tpStall: thrust = Stall(); break;
case tpSeize: thrust = Seize(); break;
case tpTrim: thrust = Trim(); break;
default: thrust = Off();

However phase is not initialized in the constructor so that might be the cause of the problem.

@Octal450, does the issue vanish if you initialize phase = tpOff in the FGTurbine constructor ?

@Octal450
Copy link
Author

I'll try my best to test this tonight or tomorrow. A little low on time.

Thanks Bertrand!
Josh

@Octal450
Copy link
Author

Hi @bcoconni, no difference.
Looks like the switch default is Off() anyways

Added phase = tpOff; to the constructor below disableWindmill in the latest on FlightGear next and recompiled and rebuilt.

Kind Regards,
Josh

@seanmcleod
Copy link
Member

For testing I modified scripts\b737_runway_new.xml and added the following so that only one engine is running, then set a breakpoint in FGTurbine::Off() to see what was happening as the aircraft accelerated.

    <event name="Set active engine">
      <description>Only make one of the engines active</description>
      <condition>simulation/sim-time-sec ge 19.0</condition>
      <set name="propulsion/active_engine" value="0"/>
      <notify/>
    </event>

So first off FGTurbine::Off() is being called, and the windmill section is being executed.

  if (disableWindmill == false) {
    N1 = Seek(&N1, in.qbar/10.0, N1/2.0, N1/N1_spindown);
    N2 = Seek(&N2, in.qbar/15.0, N2/2.0, N2/N2_spindown);
  }

However the issue is that the accel - N1/2.0 and the decel - N1/N1_spindown parameters to Seek() are 0 since N1 starts off with a value of 0.

@seanmcleod
Copy link
Member

So do we add a check for N1/N2 being 0 and use something like N1_spinup for say 0 >= N1 < 15 and then switch to N1/2.0 for the acceleration?

@seanmcleod
Copy link
Member

@Octal450 @bcoconni any suggestions in terms of a realistic spin up acceleration figure to use when N1 = 0 and the engine is off? I guess N1_spinup may be too large since I assume that's based on the APU starting up the engine?

@Octal450
Copy link
Author

Sorry I've been away from home for my medical reasons.

Can you be more specific, is the value for starting the engine? I've already found the values are pretty wrong by default for that
If you mean for windmilling the speed is already acceptable when after start & shutdown then moving to get it to windmill. So I really think the biggest problem right now is getting it to do that (the root of this issue)

I will play with the actual values regarding the other issue (windmill value) and let you know on that when I get the chance.

Kind Regards,
Josh

@seanmcleod
Copy link
Member

The particular issue at the moment is that when N1 = 0, applies to N2 as well, and the engine is in the off state then the third argument to Seek is the acceleration value to be used in order to seek from it's current value to the target value, in this case in.qbar/10.0.

  if (disableWindmill == false) {
    N1 = Seek(&N1, in.qbar/10.0, N1/2.0, N1/N1_spindown);
    N2 = Seek(&N2, in.qbar/15.0, N2/2.0, N2/N2_spindown);
  }

So since N1 is 0, the acceleration value N1/2.0 is also 0, so N1 never advances towards in.qbar/10.0.

@seanmcleod
Copy link
Member

Just a reminder to possibly address issue #195 at the same time when we fix this issue.

@Octal450
Copy link
Author

Octal450 commented Oct 8, 2021

Yes sir, I am currently awaiting responses from real pilot, and possibly from a mechanic.

Kind Regards,
Josh

@bcoconni
Copy link
Member

Alternatively we could add a shift to N1/2.0 and N2/2.0 such as N1/2.0+0.1 so that the resulting value is never 0.0

@Octal450
Copy link
Author

I would suggest don't shift, clamp. And maybe 0.01. 0.1 is enough to show up on most aircraft displays.

Kind Regards,
Josh

@seanmcleod
Copy link
Member

Just to be clear the addition of 0.1 that @bcoconni is suggesting is to the acceleration value as opposed to some direct N1/N2 value to be displayed.

So for example if N1 was say currently 0.5 then the acceleration value previously would've been 0.25 and now it would be 0.35.

@Octal450
Copy link
Author

Ah I understand, thanks.
Josh

@bcoconni
Copy link
Member

Yes and the constant 0.1 I mentioned is completely arbitrary. I guess this needs some testing before selecting a value.

@bcoconni
Copy link
Member

I'd suggest this issue being merged with #195 as I understand they tightly linked.

I'd suggest to close #195 and keep this one open, what do you think ?

@seanmcleod
Copy link
Member

I'd suggest that we add the 0.1 increment to the acceleration value, push a commit for that and close this issue, and leave #195 open until we get some data to decide on what the target value should be for N1/N2 under windmilling conditions.

@Octal450
Copy link
Author

I agree.

I will test this and see if I can figure it out shortly on my build FGFS.

Kind Regards,
Josh

@seanmcleod
Copy link
Member

I did do a local test earlier today with the 0.1 shift, running the 737 script with the aircraft accelerating down the runway with only 1 engine started and confirmed that the non-running engine's N1 increased and matched qbar/10.0

@bcoconni
Copy link
Member

PR #509 has been pushed to the code base.
Please test the latest code from the master branch and let us know if that fixes the issue.

@Octal450
Copy link
Author

Compiling now with the fix.

@Octal450
Copy link
Author

Fixed, works perfectly, thank you gents!

Kind Regards,
Josh

@bcoconni
Copy link
Member

FYI the fix is now available on the FlightGear next branch.

@Octal450
Copy link
Author

Thank you kindly!

Josh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants