Skip to content

Commit

Permalink
feat(athr/fadec) improved reverse thrust limit based on TOGA limit
Browse files Browse the repository at this point in the history
  • Loading branch information
aguther committed Apr 7, 2024
1 parent 7b7e42b commit 1b87777
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
1. [EFB] Added missing localization for SimBridge related settings in SimOptions page - @implasmatbh (Plasma)
1. [FWC] Implement non-cancellable master warning for overspeed and gear not down - @tracernz (Mike)
1. [EFB] Checklist restructure to add more capabilities and use json configs - @frankkopp (Frank Kopp)
1. [ATHR/FADEC] Improved reverse thrust limit - @aguther (Andreas Guther)

## 0.11.0

Expand Down
4 changes: 2 additions & 2 deletions fbw-a32nx/docs/Configuration/ModelConfiguration.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@

[autothrust]
; !! WARNING CHANGE AT YOUR OWN RISK !!
; sets the target N1 for full reverse
;thrust_limit_reverse = -45.0
; sets the target N1 in percentage of TOGA limit for full reverse
;thrust_limit_reverse_percentage_toga = 0.8

; !! WARNING CHANGE AT YOUR OWN RISK !!
; if enabled, thrust limits IDLE, CLB and TOGA are taken from local variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ minor = 0

[GENERALENGINEDATA]
engine_type = 1 ; 0=Piston, 1=Jet, 2=None, 3=Helo-Turbine, 4=Rocket, 5=Turboprop
min_throttle_limit = -0.2 ; Minimum percent throttle. Generally negative for turbine reverser
min_throttle_limit = -1.0 ; Minimum percent throttle. Generally negative for turbine reverser
master_ignition_switch = 0
starter_type = 2 ; 0=Electric, 1=Manual, 2=Bleed Air
max_contrail_temperature = -39.724
Expand Down
2 changes: 1 addition & 1 deletion fbw-a32nx/src/systems/instruments/src/EWD/N1Limit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class N1Limit extends DisplayComponent<N1LimitProps> {
});

sub.on('autoThrustLimit').whenChanged().handle((l) => {
this.autoThrustLimit = l;
this.autoThrustLimit = Math.abs(l);
});

sub.on('thrustLimitType').whenChanged().handle((l) => {
Expand Down
11 changes: 6 additions & 5 deletions fbw-a32nx/src/wasm/fbw_a320/src/FlyByWireInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,11 @@ void FlyByWireInterface::loadConfiguration() {

// --------------------------------------------------------------------------
// load values - autothrust
autothrustThrustLimitReverse = INITypeConversion::getDouble(iniStructure, "AUTOTHRUST", "THRUST_LIMIT_REVERSE", -45.0);

// initialize local variable for reverse
idAutothrustThrustLimitREV->set(autothrustThrustLimitReverse);
autothrustThrustLimitReversePercentageToga =
INITypeConversion::getDouble(iniStructure, "AUTOTHRUST", "THRUST_LIMIT_REVERSE_PERCENTAGE_TOGA", 0.8);

// print configuration into console
std::cout << "WASM: AUTOTHRUST : THRUST_LIMIT_REVERSE = " << autothrustThrustLimitReverse << std::endl;
std::cout << "WASM: AUTOTHRUST : THRUST_LIMIT_REVERSE_PERCENTAGE_TOGA = " << autothrustThrustLimitReversePercentageToga << std::endl;

// --------------------------------------------------------------------------
// load values - flight controls
Expand Down Expand Up @@ -2407,6 +2405,9 @@ bool FlyByWireInterface::updateAutothrust(double sampleTime) {
idThrottlePosition3d_1->set(idThrottlePositionLookupTable3d.get(thrustLeverAngle_1->get()));
idThrottlePosition3d_2->set(idThrottlePositionLookupTable3d.get(thrustLeverAngle_2->get()));

// update reverser thrust limit
idAutothrustThrustLimitREV->set(idAutothrustThrustLimitTOGA->get() * autothrustThrustLimitReversePercentageToga);

// set client data if needed
if (!autoThrustEnabled || !autopilotStateMachineEnabled || !flyByWireEnabled) {
ClientDataLocalVariablesAutothrust ClientDataLocalVariablesAutothrust = {
Expand Down
2 changes: 1 addition & 1 deletion fbw-a32nx/src/wasm/fbw_a320/src/FlyByWireInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class FlyByWireInterface {
bool wasPaused = false;
bool wasInSlew = false;

double autothrustThrustLimitReverse = -45;
double autothrustThrustLimitReversePercentageToga = 0.0;

bool flightDirectorConnectLatch_1 = false;
bool flightDirectorConnectLatch_2 = false;
Expand Down
4 changes: 2 additions & 2 deletions fbw-a32nx/src/wasm/fbw_a320/src/model/Autothrust_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ Autothrust::Parameters_Autothrust_T Autothrust::Autothrust_P{

0.0,

-20.0,
-100.0,

-2.0,

0.0,

-20.0,
-100.0,


{ 1.8, 1.8, 1.0, 1.2, 1.2 },
Expand Down

0 comments on commit 1b87777

Please sign in to comment.