Auto-brake enhancements: support for JSBSim aircraft, Airbus-style combined MAX/RTO modes, correct disengage behaviour and more disengage conditions.
This commit is contained in:
parent
d3f0b13a38
commit
4ccef76fc4
2 changed files with 52 additions and 5 deletions
|
@ -39,6 +39,7 @@ FGAutoBrake::FGAutoBrake() :
|
||||||
// default config, close to Boeing 747-400 / 777 values
|
// default config, close to Boeing 747-400 / 777 values
|
||||||
_configNumSteps = 4;
|
_configNumSteps = 4;
|
||||||
_configRTOStep = -1;
|
_configRTOStep = -1;
|
||||||
|
_configDisengageStep = 0;
|
||||||
_configMaxDecel = 11; // ft-sec-sec
|
_configMaxDecel = 11; // ft-sec-sec
|
||||||
_configRTODecel = 11; // ft-sec-sec
|
_configRTODecel = 11; // ft-sec-sec
|
||||||
_configRTOSpeed = 85; // kts
|
_configRTOSpeed = 85; // kts
|
||||||
|
@ -73,10 +74,12 @@ void FGAutoBrake::init()
|
||||||
SGPropertyNode_ptr config = _root->getChild("config", 0, true);
|
SGPropertyNode_ptr config = _root->getChild("config", 0, true);
|
||||||
config->tie("num-steps", SGRawValuePointer<int>(&_configNumSteps));
|
config->tie("num-steps", SGRawValuePointer<int>(&_configNumSteps));
|
||||||
config->tie("rto-step", SGRawValuePointer<int>(&_configRTOStep));
|
config->tie("rto-step", SGRawValuePointer<int>(&_configRTOStep));
|
||||||
|
config->tie("disengage-step", SGRawValuePointer<int>(&_configDisengageStep));
|
||||||
config->tie("rto-decel-fts-sec", SGRawValuePointer<double>(&_configRTODecel));
|
config->tie("rto-decel-fts-sec", SGRawValuePointer<double>(&_configRTODecel));
|
||||||
config->tie("max-decel-fts-sec", SGRawValuePointer<double>(&_configMaxDecel));
|
config->tie("max-decel-fts-sec", SGRawValuePointer<double>(&_configMaxDecel));
|
||||||
config->tie("rto-engage-kts", SGRawValuePointer<double>(&_configRTOSpeed));
|
config->tie("rto-engage-kts", SGRawValuePointer<double>(&_configRTOSpeed));
|
||||||
|
|
||||||
|
|
||||||
// outputs
|
// outputs
|
||||||
_root->tie("target-decel-fts-sec",
|
_root->tie("target-decel-fts-sec",
|
||||||
SGRawValueMethods<FGAutoBrake,double>(*this, &FGAutoBrake::getTargetDecel));
|
SGRawValueMethods<FGAutoBrake,double>(*this, &FGAutoBrake::getTargetDecel));
|
||||||
|
@ -170,6 +173,12 @@ void FGAutoBrake::updateEngaged(double dt)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!throttlesAtIdle()) {
|
||||||
|
SG_LOG(SG_AUTOPILOT, SG_INFO, "auto-brake, throttles not at idle, disengaing");
|
||||||
|
disengage();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// update the target deceleration; note step can be changed while engaged
|
// update the target deceleration; note step can be changed while engaged
|
||||||
if (_rto) {
|
if (_rto) {
|
||||||
_targetDecel = _configRTODecel;
|
_targetDecel = _configRTODecel;
|
||||||
|
@ -189,6 +198,11 @@ bool FGAutoBrake::shouldEngage()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!throttlesAtIdle()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
SG_LOG(SG_AUTOPILOT, SG_INFO, "Autobrake, should enage");
|
SG_LOG(SG_AUTOPILOT, SG_INFO, "Autobrake, should enage");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -205,10 +219,22 @@ bool FGAutoBrake::shouldEngageRTO()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_weightOnWheelsNode->getBoolValue()) {
|
if (!_weightOnWheelsNode->getBoolValue()) {
|
||||||
|
if (airborne()) {
|
||||||
|
SG_LOG(SG_AUTOPILOT, SG_INFO, "FGAutoBrake: RTO, airbone, disengaging");
|
||||||
|
_rtoArmed = false;
|
||||||
|
_armed = false;
|
||||||
|
_step = _configDisengageStep;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return throttlesAtIdle();
|
if (throttlesAtIdle()) {
|
||||||
|
SG_LOG(SG_AUTOPILOT, SG_INFO, "FGAutoBrake: RTO, throttles at idle, will engage");
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// RTO arming case
|
// RTO arming case
|
||||||
if (speed > _configRTOSpeed) {
|
if (speed > _configRTOSpeed) {
|
||||||
|
@ -228,12 +254,19 @@ void FGAutoBrake::disengage()
|
||||||
|
|
||||||
SG_LOG(SG_AUTOPILOT, SG_INFO, "FGAutoBrake: disengage");
|
SG_LOG(SG_AUTOPILOT, SG_INFO, "FGAutoBrake: disengage");
|
||||||
_engaged = false;
|
_engaged = false;
|
||||||
|
_fcsBrakeControl = 0.0;
|
||||||
_armed = false;
|
_armed = false;
|
||||||
_rtoArmed = false;
|
_rtoArmed = false;
|
||||||
_targetDecel = 0.0;
|
_targetDecel = 0.0;
|
||||||
|
_step = _configDisengageStep;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FGAutoBrake::throttlesAtIdle()
|
bool FGAutoBrake::airborne() const
|
||||||
|
{
|
||||||
|
return !_weightOnWheelsNode->getBoolValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FGAutoBrake::throttlesAtIdle() const
|
||||||
{
|
{
|
||||||
SGPropertyNode_ptr e;
|
SGPropertyNode_ptr e;
|
||||||
const double IDLE_THROTTLE = 0.05; // 5% margin for idle setting
|
const double IDLE_THROTTLE = 0.05; // 5% margin for idle setting
|
||||||
|
@ -244,7 +277,6 @@ bool FGAutoBrake::throttlesAtIdle()
|
||||||
}
|
}
|
||||||
} // of engines iteration
|
} // of engines iteration
|
||||||
|
|
||||||
SG_LOG(SG_AUTOPILOT, SG_INFO, "FGAutoBrake: throttles at idle");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,7 +295,16 @@ void FGAutoBrake::setRTO(bool aRTO)
|
||||||
if (aRTO) {
|
if (aRTO) {
|
||||||
// ensure we meet RTO selection criteria:
|
// ensure we meet RTO selection criteria:
|
||||||
if (!_weightOnWheelsNode->getBoolValue()) {
|
if (!_weightOnWheelsNode->getBoolValue()) {
|
||||||
SG_LOG(SG_AUTOPILOT, SG_WARN, "auto-brake: cannot select RTO mode, no weight on wheels");
|
// some systems combine RTO with a standard step, selecting RTO if on
|
||||||
|
// the ground. Handle that case by setting _rto = false, and letting
|
||||||
|
// setStep() do the rest of the work as normal.
|
||||||
|
if ((_configRTOStep > 0) && (_configRTOStep <= _configNumSteps)) {
|
||||||
|
// RTO is combined with a normal step, select that
|
||||||
|
} else {
|
||||||
|
SG_LOG(SG_AUTOPILOT, SG_WARN, "auto-brake: cannot select RTO mode, no weight on wheels");
|
||||||
|
}
|
||||||
|
|
||||||
|
_rto = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,12 @@ private:
|
||||||
* Helper to determine if all throttles are at idle
|
* Helper to determine if all throttles are at idle
|
||||||
* (or have reverse thrust engaged)
|
* (or have reverse thrust engaged)
|
||||||
*/
|
*/
|
||||||
bool throttlesAtIdle();
|
bool throttlesAtIdle() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper to determine if we're airbone, i.e weight off all wheels
|
||||||
|
*/
|
||||||
|
bool airborne() const;
|
||||||
|
|
||||||
// accessors, mostly for SGRawValueMethods use
|
// accessors, mostly for SGRawValueMethods use
|
||||||
void setArmed(bool aArmed);
|
void setArmed(bool aArmed);
|
||||||
|
@ -94,6 +99,7 @@ private:
|
||||||
|
|
||||||
int _configNumSteps;
|
int _configNumSteps;
|
||||||
int _configRTOStep;
|
int _configRTOStep;
|
||||||
|
int _configDisengageStep;
|
||||||
double _configMaxDecel; ///< deceleration (in ft-sec^2) corresponding to step=numSteps
|
double _configMaxDecel; ///< deceleration (in ft-sec^2) corresponding to step=numSteps
|
||||||
double _configRTODecel; ///< deceleration (in ft-sec^2) to use in RTO mode
|
double _configRTODecel; ///< deceleration (in ft-sec^2) to use in RTO mode
|
||||||
double _configRTOSpeed; ///< speed (in kts) for RTO mode to arm
|
double _configRTOSpeed; ///< speed (in kts) for RTO mode to arm
|
||||||
|
|
Loading…
Add table
Reference in a new issue