gefs-plugins / fmc-requirejs

Flight Management Computer for GeoFS (third party plugin)
http://geo-fs.com
GNU Affero General Public License v3.0
12 stars 5 forks source link

Altitude Restrictions Within Waypoints #5

Closed ERAUAir1533 closed 7 years ago

ERAUAir1533 commented 7 years ago

I don't know if this is just me or not, but whenever I use altitude restrictions (the altitude set at waypoint) with VNAV, and it comes time to descend, the FMC (only ver. 52) forces a nosedive on my aircraft (more than -6000 feet per minute) and even when I try to regain control by turning Autopilot++ off, I can't regain control until I switch my controls over from keyboard to mouse. If you need anymore details on this, please feel free to contact me on FB.

harryxue1999 commented 7 years ago

Yes, we are aware of this bug as other people have reported too. In the mean time I recommend reverting back to 0.5.1-beta until the issue is solved.

ERAUAir1533 commented 7 years ago

Roger that. We will revert back to version 51. thanks!

harryxue1999 commented 7 years ago

@Qantas94Heavy Maybe it is time to fix Autopilot's V/S mode input problem.

harryxue1999 commented 7 years ago

OK, @ERAUAir1533 it would be great if you can recreate the problem with console logs.

ERAUAir1533 commented 7 years ago

I apologize for the delayed response. Here are the logs! From what I can tell, it seems like the values for the descent are incorrect, but I don't know. I'll leave it to you to find out. 😄 fmc error 2 fmc error

harryxue1999 commented 7 years ago

Ok, these seem to be the debug log of autopilot (not your fault: production version of FMC does not have debug). Please recreate the bug after you paste the following line to the console: fmc.require('debug').log=a=>console.log(a);

harryxue1999 commented 7 years ago

Better if the debug log is in text format. You can create a gist

harryxue1999 commented 7 years ago

Hi, I have found the problem with this bug.

If you are interested, basically V/S is set to a -Infinity value when the activated waypoint and the waypoint with the next altitude restriction is the same. This is because a certain statement in the VNAV logic did not reflect on the change in the route distance algorithm, a problem which makes the distance 0. Then a function to calculate climbrate returns the -Infinity value because any negative none zero number divided by 0 is -Infinity.

With this bug fixed I have also fixed existing bugs with speed control and KIAS/Mach switching bug.

Thanks for submitting this bug report!