Skip to content

Commit

Permalink
feat(ap): Tuning of A380X Autoland (#8999)
Browse files Browse the repository at this point in the history
feat(ap): Tuning of A380X Autoland #8999
  • Loading branch information
aguther authored Oct 5, 2024
1 parent 9415799 commit c389590
Show file tree
Hide file tree
Showing 72 changed files with 4,664 additions and 4,935 deletions.
4 changes: 1 addition & 3 deletions fbw-a380x/src/wasm/fbw_a380/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,9 @@ clang++ \
"${DIR}/src/model/FacComputer_data.cpp" \
"${DIR}/src/model/FacComputer.cpp" \
"${DIR}/src/model/look1_binlxpw.cpp" \
"${DIR}/src/model/look2_binlcpw.cpp" \
"${DIR}/src/model/look2_binlxpw.cpp" \
"${DIR}/src/model/look2_pbinlxpw.cpp" \
"${DIR}/src/model/mod_mvZvttxs.cpp" \
"${DIR}/src/model/mod_2RcCQkwc.cpp" \
"${DIR}/src/model/mod_OlzklkXq.cpp" \
"${DIR}/src/model/MultiWordIor.cpp" \
"${DIR}/src/model/rt_modd.cpp" \
"${DIR}/src/model/rt_remd.cpp" \
Expand Down
20 changes: 13 additions & 7 deletions fbw-a380x/src/wasm/fbw_a380/src/FlyByWireInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1858,7 +1858,7 @@ bool FlyByWireInterface::updateFac(double sampleTime, int facIndex) {
idFacCenterOfGravity[facIndex]->set(Arinc429Utils::toSimVar(facsBusOutputs[facIndex].center_of_gravity_pos_percent));
idFacSideslipTarget[facIndex]->set(Arinc429Utils::toSimVar(facsBusOutputs[facIndex].sideslip_target_deg));
idFacSlatAngle[facIndex]->set(Arinc429Utils::toSimVar(facsBusOutputs[facIndex].fac_slat_angle_deg));
idFacFlapAngle[facIndex]->set(Arinc429Utils::toSimVar(facsBusOutputs[facIndex].fac_flap_angle));
idFacFlapAngle[facIndex]->set(Arinc429Utils::toSimVar(facsBusOutputs[facIndex].fac_flap_angle_deg));
idFacDiscreteWord2[facIndex]->set(Arinc429Utils::toSimVar(facsBusOutputs[facIndex].discrete_word_2));
idFacRudderTravelLimitCommand[facIndex]->set(Arinc429Utils::toSimVar(facsBusOutputs[facIndex].rudder_travel_limit_command_deg));
idFacDeltaRYawDamperVoted[facIndex]->set(Arinc429Utils::toSimVar(facsBusOutputs[facIndex].delta_r_yaw_damper_deg));
Expand Down Expand Up @@ -2121,8 +2121,10 @@ bool FlyByWireInterface::updateAutopilotStateMachine(double sampleTime) {
autopilotStateMachineInput.in.data.cruise_altitude = idFmgcCruiseAltitude->get();
autopilotStateMachineInput.in.data.throttle_lever_1_pos = thrustLeverAngle_1->get();
autopilotStateMachineInput.in.data.throttle_lever_2_pos = thrustLeverAngle_2->get();
autopilotStateMachineInput.in.data.gear_strut_compression_1 = simData.gear_animation_pos_1;
autopilotStateMachineInput.in.data.gear_strut_compression_2 = simData.gear_animation_pos_2;
autopilotStateMachineInput.in.data.gear_strut_compression_1 =
std::max(simData.contact_point_compression_1 * 0.5 + 0.5, simData.contact_point_compression_3 * 0.5 + 0.5);
autopilotStateMachineInput.in.data.gear_strut_compression_2 =
std::max(simData.contact_point_compression_2 * 0.5 + 0.5, simData.contact_point_compression_4 * 0.5 + 0.5);
autopilotStateMachineInput.in.data.zeta_pos = simData.zeta_pos;
autopilotStateMachineInput.in.data.flaps_handle_index = flapsHandleIndexFlapConf->get();
autopilotStateMachineInput.in.data.is_engine_operative_1 = simData.engine_combustion_1;
Expand Down Expand Up @@ -2471,8 +2473,10 @@ bool FlyByWireInterface::updateAutopilotLaws(double sampleTime) {
autopilotLawsInput.in.data.acceleration_altitude_go_around_engine_out = fmAccelerationAltitudeGoAroundEngineOut->valueOr(0);
autopilotLawsInput.in.data.throttle_lever_1_pos = thrustLeverAngle_1->get();
autopilotLawsInput.in.data.throttle_lever_2_pos = thrustLeverAngle_2->get();
autopilotLawsInput.in.data.gear_strut_compression_1 = simData.gear_animation_pos_1;
autopilotLawsInput.in.data.gear_strut_compression_2 = simData.gear_animation_pos_2;
autopilotLawsInput.in.data.gear_strut_compression_1 =
std::max(simData.contact_point_compression_1 * 0.5 + 0.5, simData.contact_point_compression_3 * 0.5 + 0.5);
autopilotLawsInput.in.data.gear_strut_compression_2 =
std::max(simData.contact_point_compression_2 * 0.5 + 0.5, simData.contact_point_compression_4 * 0.5 + 0.5);
autopilotLawsInput.in.data.zeta_pos = simData.zeta_pos;
autopilotLawsInput.in.data.flaps_handle_index = flapsHandleIndexFlapConf->get();
autopilotLawsInput.in.data.is_engine_operative_1 = simData.engine_combustion_1;
Expand Down Expand Up @@ -2686,8 +2690,10 @@ bool FlyByWireInterface::updateAutothrust(double sampleTime) {
autoThrustInput.in.data.bx_m_s2 = simData.bx_m_s2;
autoThrustInput.in.data.by_m_s2 = simData.by_m_s2;
autoThrustInput.in.data.bz_m_s2 = simData.bz_m_s2;
autoThrustInput.in.data.gear_strut_compression_1 = simData.gear_animation_pos_1;
autoThrustInput.in.data.gear_strut_compression_2 = simData.gear_animation_pos_2;
autoThrustInput.in.data.gear_strut_compression_1 =
std::max(simData.contact_point_compression_1 * 0.5 + 0.5, simData.contact_point_compression_3 * 0.5 + 0.5);
autoThrustInput.in.data.gear_strut_compression_2 =
std::max(simData.contact_point_compression_2 * 0.5 + 0.5, simData.contact_point_compression_4 * 0.5 + 0.5);
autoThrustInput.in.data.flap_handle_index = flapsHandleIndexFlapConf->get();
autoThrustInput.in.data.is_engine_operative_1 = simData.engine_combustion_1;
autoThrustInput.in.data.is_engine_operative_2 = simData.engine_combustion_2;
Expand Down
2 changes: 1 addition & 1 deletion fbw-a380x/src/wasm/fbw_a380/src/fac/Fac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ base_fac_bus Fac::getBusOutputs() {
output.center_of_gravity_pos_percent.SSM = Arinc429SignStatus::FailureWarning;
output.sideslip_target_deg.SSM = Arinc429SignStatus::FailureWarning;
output.fac_slat_angle_deg.SSM = Arinc429SignStatus::FailureWarning;
output.fac_flap_angle.SSM = Arinc429SignStatus::FailureWarning;
output.fac_flap_angle_deg.SSM = Arinc429SignStatus::FailureWarning;
output.rudder_travel_limit_command_deg.SSM = Arinc429SignStatus::FailureWarning;
output.delta_r_yaw_damper_deg.SSM = Arinc429SignStatus::FailureWarning;
output.estimated_sideslip_deg.SSM = Arinc429SignStatus::FailureWarning;
Expand Down
5 changes: 5 additions & 0 deletions fbw-a380x/src/wasm/fbw_a380/src/interface/SimConnectData.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ struct SimData {
double wheelRpmRightBlg;
double wheelRpmLeftWlg;
double wheelRpmRightWlg;
double contact_point_compression_0;
double contact_point_compression_1;
double contact_point_compression_2;
double contact_point_compression_3;
double contact_point_compression_4;
};

struct SimInput {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,11 @@ bool SimConnectInterface::prepareSimDataSimConnectDataDefinitions() {
result &= addDataDefinition(hSimConnect, 0, SIMCONNECT_DATATYPE_FLOAT64, "WHEEL RPM:2", "RPM");
result &= addDataDefinition(hSimConnect, 0, SIMCONNECT_DATATYPE_FLOAT64, "WHEEL RPM:3", "RPM");
result &= addDataDefinition(hSimConnect, 0, SIMCONNECT_DATATYPE_FLOAT64, "WHEEL RPM:4", "RPM");
result &= addDataDefinition(hSimConnect, 0, SIMCONNECT_DATATYPE_FLOAT64, "CONTACT POINT COMPRESSION", "PERCENT");
result &= addDataDefinition(hSimConnect, 0, SIMCONNECT_DATATYPE_FLOAT64, "CONTACT POINT COMPRESSION:1", "PERCENT");
result &= addDataDefinition(hSimConnect, 0, SIMCONNECT_DATATYPE_FLOAT64, "CONTACT POINT COMPRESSION:2", "PERCENT");
result &= addDataDefinition(hSimConnect, 0, SIMCONNECT_DATATYPE_FLOAT64, "CONTACT POINT COMPRESSION:3", "PERCENT");
result &= addDataDefinition(hSimConnect, 0, SIMCONNECT_DATATYPE_FLOAT64, "CONTACT POINT COMPRESSION:4", "PERCENT");

return result;
}
Expand Down
4 changes: 2 additions & 2 deletions fbw-a380x/src/wasm/fbw_a380/src/model/A380LateralDirectLaw.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef RTW_HEADER_A380LateralDirectLaw_h_
#define RTW_HEADER_A380LateralDirectLaw_h_
#ifndef A380LateralDirectLaw_h_
#define A380LateralDirectLaw_h_
#include "rtwtypes.h"
#include "A380LateralDirectLaw_types.h"
#include <cstring>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef RTW_HEADER_A380LateralDirectLaw_private_h_
#define RTW_HEADER_A380LateralDirectLaw_private_h_
#ifndef A380LateralDirectLaw_private_h_
#define A380LateralDirectLaw_private_h_
#include "rtwtypes.h"
#include "A380LateralDirectLaw_types.h"
#endif
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef RTW_HEADER_A380LateralDirectLaw_types_h_
#define RTW_HEADER_A380LateralDirectLaw_types_h_
#ifndef A380LateralDirectLaw_types_h_
#define A380LateralDirectLaw_types_h_
#endif

Loading

0 comments on commit c389590

Please sign in to comment.