Skip to content

Commit

Permalink
Piston shall not send negative powers to thrusters
Browse files Browse the repository at this point in the history
This happens when the engine is off: internal friction (static_friction_HP which is negative) is accounted for but the engine does not produce power so this internal friction is not counteracted resulting in an overall negative power. A better fix in the long term should therefore be to ignore static_friction_HP while the engine is not started.
  • Loading branch information
bcoconni committed Dec 6, 2020
1 parent 5530ed2 commit bcd3f98
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/models/propulsion/FGPiston.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,10 @@ void FGPiston::Calculate(void)
}

LoadThrusterInputs();
Thruster->Calculate(HP * hptoftlbssec);
// Filters out negative powers.
// TODO: static_friction_HP should not be taken into account while the engine
// is not started.
Thruster->Calculate(max(HP * hptoftlbssec, 0.));

RunPostFunctions();
}
Expand Down

0 comments on commit bcd3f98

Please sign in to comment.