Closed rthom91 closed 2 days ago
It looks like the issue has already been solved in the dev version.
It looks like the issue has already been solved in the dev version.
Did you check the Simvars in question ? seeing as the issue wasnt what the FCU shows but what is written to the Simvar which can be seen in the tooltips
Mea culpa, it looks like the mach value is converted to speed before being given to the AP. Edit: I am working on it
Hey ! I am trying to solve the issue, at first it looks simple: I can change this part of the code (fbw-a32nx\src\base\flybywire-aircraft-a320-neo\html_ui\Pages\VCockpit\Instruments\Airliners\FlyByWire_A320_Neo\FCU\A320_Neo_FCU.js):
// get current target speed
let targetSpeed = (isMachActive || this.selectedValue < 1)
? SimVar.GetGameVarValue("FROM MACH TO KIAS", "number", this.selectedValue)
: this.selectedValue;
// clamp speed into valid range
targetSpeed = this.clampSpeed(targetSpeed);
// set target speed
if (targetSpeed !== this.targetSpeed) {
Coherent.call("AP_SPD_VAR_SET", 0, targetSpeed).catch(console.error);
this.targetSpeed = targetSpeed;
}
// detect mismatch
if (Simplane.getAutoPilotAirspeedHoldValue() !== this.targetSpeed) {
Coherent.call("AP_SPD_VAR_SET", 0, targetSpeed).catch(console.error);
}
into
if (isMachActive || this.selectedValue < 1){
targetMach = this.clampMach(this.selectedValue); // clamp into valid range
if (targetMach !== this.targetMach) {
// set target mach
Coherent.call("AP_MACH_VAR_SET", 0, Math.round(targetMach * 100).catch(console.error));
this.targetMach = targetMach;
}
if (Simplane.getAutoPilotMachHoldValue() !== this.targetMach) {
Coherent.call("AP_MACH_VAR_SET", 0, Math.round(targetMach * 100).catch(console.error));
}
} else {
targetSpeed = this.clampSpeed(this.selectedValue); // clamp into valid range
if (targetSpeed !== this.targetSpeed) {
// set target speed
Coherent.call("AP_SPD_VAR_SET", 0, targetSpeed).catch(console.error);
this.targetSpeed = targetSpeed;
}
// detect mismatch
if (Simplane.getAutoPilotAirspeedHoldValue() !== this.targetSpeed) {
Coherent.call("AP_SPD_VAR_SET", 0, targetSpeed).catch(console.error);
}
}
(the mach is multiplied by 100 as indicated here : https://docs.flightsimulator.com/html/Programming_Tools/Event_IDs/Aircraft_Autopilot_Flight_Assist_Events.htm)
But that makes the module crash (only dashed lines). I have some beginner's questions:
console.log
logs into the debug console ?)Coherent.call
? Thanks for any help !
EDIT: the idea is to not convert mach into speed before sending it to the autopilot, so it does clamp the value to knots limits.
Mea culpa, it looks like the mach value is converted to speed before being given to the AP. Edit: I am working on it
Correct, the AP currently only uses AUTOPILOT AIRSPEED HOLD VAR
, which is set by the FCU converted from the selected mach.
Anyways, the current legacy FCU is planned to be replaced by a totally new implementation with #7587, which will then also no longer use the sim's default AP variables.
EDIT: the idea is to not convert mach into speed before sending it to the autopilot, so it does clamp the value to knots limits.
This will not work, we use our own AP which, as I said, currently just reads the sim's default variables. It expects to receive the speed target in CAS. (Note, this is not correct IRL, where the FCU will send selected mach and CAS seperately as A429 words, but that is not currently implemented, and will be corrected in #7587.)
Mea culpa, it looks like the mach value is converted to speed before being given to the AP. Edit: I am working on it
Correct, the AP currently only uses
AUTOPILOT AIRSPEED HOLD VAR
, which is set by the FCU converted from the selected mach. Anyways, the current legacy FCU is planned to be replaced by a totally new implementation with #7587, which will then also no longer use the sim's default AP variables.EDIT: the idea is to not convert mach into speed before sending it to the autopilot, so it does clamp the value to knots limits.
This will not work, we use our own AP which, as I said, currently just reads the sim's default variables. It expects to receive the speed target in CAS. (Note, this is not correct IRL, where the FCU will send selected mach and CAS seperately as A429 words, but that is not currently implemented, and will be corrected in #7587.)
So that effectively means, that these simvars will be useless once that implementation comes into effect ? If so then this is a "Not planned" then right ?
So that effectively means, that these simvars will be useless once that implementation comes into effect ?
Yep, they won't be used anymore and possible not even exist (since I might completely disable the sim AP in the configs, which might result in these not being defined by the sim anymore).
If so then this is a "Not planned" then right ?
The PR is still some time away. Should this be needed for some reason, then I don't see why this couldn't get a fix if it's not too big.
Yep, they won't be used anymore and possible not even exist (since I might completely disable the sim AP in the configs, which might result in these not being defined by the sim anymore).
We should look into using the managed mode so we can override the vars, for the benefit of third party tools.
Aircraft Version
Stable
Build info
Describe the bug
AUTOPILOT MACH HOLD VAR is being held back by AUTOPILOT AIRSPEED HOLD VAR. MACH does not drop below 0.15 (100 knots) or higher than 0.61 (399 knots).
Expected behavior
MACH simvar should go to 0.10 min and 0.99 max.
Steps to reproduce
https://www.youtube.com/watch?v=SxHnrRToAeA
References (optional)
No response
Additional info (optional)
No response
Discord Username (optional)
No response