Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug - Autopilot auto speed inconsistent behavior #304

Open
jojo2357 opened this issue May 29, 2023 · 3 comments
Open

Bug - Autopilot auto speed inconsistent behavior #304

jojo2357 opened this issue May 29, 2023 · 3 comments
Assignees
Labels
bug Something isn't working Component: Systems Systems related

Comments

@jojo2357
Copy link

When flying a procedure, the autopilot will only sometimes set the speed to the procedure's restriction, and never keep it there.

To reproduce

Load this procedure file (note that it intentionally has the wrong runway names to be consistent with fg, if yours are correct, use these procedures) into fg.

Start on 26R, get ready to blast off.

In the flight computer, load the NIITZ3 departure. Proceed to take off. As soon as possible, engage ap, flaps up, gear up, and begin an ap-managed climb to 4k'.

Fly past RUDYY to observe error.

Expected behavior

The ap should, imo, hold 230kt while flying the intercept in order to meet the speed constraint at RUDYY.

I would also expect this sort of behavior to take place on decent, but except for when reaching (decel) or 10k', the ap keeps the accelerator welded to the floor.

Actual behavior

The plane sets a target speed of 250kt, intercepts the radial, and then sets the speed to 230kt until passing RUDYY.

What am I using?

  • OS: Pop!_OS 22.04 LTS
  • FlightGear version: 2020.4 (note: on 2020.3.18, the ap didnt change the speed setpoint at all, that aircraft revision was 20220908)
  • A320 Version: .version says 20230122
@jojo2357 jojo2357 added the bug Something isn't working label May 29, 2023
@merspieler merspieler added the Component: Systems Systems related label May 30, 2023
@merspieler
Copy link
Collaborator

Can confirm this issue, seen it in plenty of departures and arrivals.

@merspieler
Copy link
Collaborator

Got it fixed for SID, STAR is WIP...

@merspieler
Copy link
Collaborator

Note: https://forum.flightgear.org/viewtopic.php?p=419111#p419111 flikekoralle wants to continue working on it.
patch I gave them as a starting point:

diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas
index 78e5b597..b2585db6 100644
--- a/Nasal/FMGC/FMGC.nas
+++ b/Nasal/FMGC/FMGC.nas
@@ -978,6 +978,27 @@ var ManagedSPD = maketimer(0.25, func {
       
          if (waypoint != nil) {
             constraintSpeed = flightPlanController.flightplans[2].getWP(FPLN.currentWP.getValue()).speed_cstr;
+            if ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and flightPlanController.flightplans[2].getWP(FPLN.currentWP.getValue()).wp_role == "sid") {
+               i = FPLN.currentWP.getValue();
+               while (flightPlanController.flightplans[2].getWP(i).wp_role == "sid") {
+                  if (flightPlanController.flightplans[2].getWP(i).speed_cstr != nil and flightPlanController.flightplans[2].getWP(i).speed_cstr > 100) {
+                     constraintSpeed = flightPlanController.flightplans[2].getWP(i).speed_cstr;
+                     break;
+                  }
+                  i = i + 1;
+               }
+            }
          }
          
          if ((Modes.PFD.FMA.pitchMode == " " or Modes.PFD.FMA.pitchMode == "SRS") and (FMGCInternal.phase == 0 or FMGCInternal.phase == 1)) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Component: Systems Systems related
Projects
None yet
Development

No branches or pull requests

3 participants