Skip to content

Commit

Permalink
fix: pitch_flare_tweak
Browse files Browse the repository at this point in the history
revert changes to flightmodel

fine tune

fix

fine tune thea values 2

fine tune thea values 2

fixes

re-add pitch down

fine tune theta v3

fix

fix
  • Loading branch information
Revyn112 committed Jan 9, 2025
1 parent 12024ec commit 4f57fc3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,10 @@ yaw_moment_delta_rudder_mach_table = 0:0
yaw_moment_delta_aileron_mach_table = 0:0
yaw_moment_yaw_rate_mach_table = 0:0
yaw_moment_roll_rate_mach_table = 0:0
elevator_scaling_table = 0:1.5 ; scales control based on its deflection
aileron_scaling_table = 0:1.5 ; scales control based on its deflection
rudder_scaling_table = 0:1.5 ; scales control based on its deflection
aileron_load_factor_effectiveness_table = 0:1.5 ; scaling of roll_moment_delta_aileron versus gravity forces, G effects on aileron effectiveness, acts on roll_moment_delta_aileron
elevator_scaling_table = 0:1 ; scales control based on its deflection
aileron_scaling_table = 0:1 ; scales control based on its deflection
rudder_scaling_table = 0:1 ; scales control based on its deflection
aileron_load_factor_effectiveness_table = 0:1 ; scaling of roll_moment_delta_aileron versus gravity forces, G effects on aileron effectiveness, acts on roll_moment_delta_aileron
lift_coef_at_drag_zero = 0.1750
lift_coef_at_drag_zero_flaps=0.1
lift_coef_air_spoilers=-0.25
Expand Down
24 changes: 12 additions & 12 deletions hdw-a339x/src/wasm/fbw_a330/src/model/PitchNormalLaw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1412,11 +1412,11 @@ void PitchNormalLaw::step(const real_T *rtu_In_time_dt, const real_T *rtu_In_nz_
rtb_Switch_f = PitchNormalLaw_rtP.Constant_Value_p;
}

if ((*rtu_In_H_radio_ft <= 30.0) || (rtb_Switch_f == 1.0)) {
if ((*rtu_In_H_radio_ft <= 50.0) || (rtb_Switch_f == 1.0)) {
PitchNormalLaw_DWork.is_c2_PitchNormalLaw = PitchNormalLaw_IN_Flare_Active_Reduce;
rtb_in_flare = 1;
PitchNormalLaw_B.flare_Theta_c_deg = -2.0;
} else if ((*rtu_In_in_flight == 1.0) && (*rtu_In_H_radio_ft > 50.0) && (rtb_ManualSwitch == 0.0)) {
PitchNormalLaw_B.flare_Theta_c_deg = 0.0;
} else if ((*rtu_In_in_flight == 1.0) && (*rtu_In_H_radio_ft > 100.0) && (rtb_ManualSwitch == 0.0)) {
PitchNormalLaw_DWork.is_c2_PitchNormalLaw = PitchNormalLaw_IN_Flight;
rtb_in_flare = 0;
} else {
Expand All @@ -1428,23 +1428,23 @@ void PitchNormalLaw::step(const real_T *rtu_In_time_dt, const real_T *rtu_In_nz_
if (*rtu_In_in_flight == 0.0) {
PitchNormalLaw_DWork.is_c2_PitchNormalLaw = PitchNormalLaw_IN_Ground;
rtb_in_flare = 0;
PitchNormalLaw_B.flare_Theta_c_deg = -2.0;
PitchNormalLaw_B.flare_Theta_c_rate_deg_s = -1000.0;
} else if ((*rtu_In_in_flight == 1.0) && (*rtu_In_H_radio_ft > 50.0) && (rtb_ManualSwitch == 0.0)) {
//PitchNormalLaw_B.flare_Theta_c_deg = -2.0;
//PitchNormalLaw_B.flare_Theta_c_rate_deg_s = -1000.0;
} else if ((*rtu_In_in_flight == 1.0) && (*rtu_In_H_radio_ft > 100.0) && (rtb_ManualSwitch == 0.0)) {
PitchNormalLaw_DWork.is_c2_PitchNormalLaw = PitchNormalLaw_IN_Flight;
rtb_in_flare = 0;
} else {
rtb_in_flare = 1;
PitchNormalLaw_B.flare_Theta_c_deg = -2.0;
//PitchNormalLaw_B.flare_Theta_c_deg = -2.0;
}
break;

case PitchNormalLaw_IN_Flare_Prepare:
if ((*rtu_In_H_radio_ft <= 50.0) || (rtb_ManualSwitch == 1.0)) {
PitchNormalLaw_B.flare_Theta_c_rate_deg_s = -(std::fmax(-2.0, rtb_Y_j) + 2.0) / 8.0;
if ((*rtu_In_H_radio_ft <= 100.0) || (rtb_ManualSwitch == 1.0)) {
PitchNormalLaw_B.flare_Theta_c_rate_deg_s = 0.0;
PitchNormalLaw_DWork.is_c2_PitchNormalLaw = PitchNormalLaw_IN_Flare_Active_Armed;
rtb_in_flare = 1;
} else if ((*rtu_In_in_flight == 1.0) && (*rtu_In_H_radio_ft > 50.0) && (rtb_ManualSwitch == 0.0)) {
} else if ((*rtu_In_in_flight == 1.0) && (*rtu_In_H_radio_ft > 100.0) && (rtb_ManualSwitch == 0.0)) {
PitchNormalLaw_DWork.is_c2_PitchNormalLaw = PitchNormalLaw_IN_Flight;
rtb_in_flare = 0;
} else {
Expand All @@ -1453,8 +1453,8 @@ void PitchNormalLaw::step(const real_T *rtu_In_time_dt, const real_T *rtu_In_nz_
break;

case PitchNormalLaw_IN_Flight:
if ((*rtu_In_H_radio_ft <= 50.0) || (rtb_ManualSwitch == 1.0)) {
PitchNormalLaw_B.flare_Theta_c_rate_deg_s = -1000.0;
if ((*rtu_In_H_radio_ft <= 100.0) || (rtb_ManualSwitch == 1.0)) {
//PitchNormalLaw_B.flare_Theta_c_rate_deg_s = -1000.0;
PitchNormalLaw_B.flare_Theta_c_deg = rtb_Y_j;
PitchNormalLaw_DWork.is_c2_PitchNormalLaw = PitchNormalLaw_IN_Flare_Prepare;
rtb_in_flare = 0;
Expand Down

0 comments on commit 4f57fc3

Please sign in to comment.