• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FS2004 Using or Simulating more than one Direction Indicator

tgibson

Resource contributor
Messages
11,875
Country
us-california
Hi all,

I am trying to develop a gauge simulating a Polar Path Compass, one of the first instruments designed to fly grid navigation in polar regions in the 1950's. I have the gauge "working", but it currently follows true headings instead of actual grid headings.

So the idea of the Polar Path Compass (PPC) is that it uses a low drift directional gyro (DG) which is slaved to a fluxgate unit which automatically corrects for drift. This is used in the lower latitudes, and is called SLAVED mode. This is no different from any Electro Mag Slaved compass.

But in Polar regions the fluxgate cannot correct for drift due to low magnetic strength and wildly variable magnetic variation. So you change the PPC to DG mode, which uses only the directional gyro. Since gyro drift is dependent on your latitude (at 0 latitude the drift is essentially 0), there is an adjustment knob which you set to your current latitude, and this constantly corrects for the amount of drift at this latitude. You reset this as your latitude changes.

OK, so finally to my question! The current direction indicator is set to Type 3 in the aircraft.cfg file (Electro-Mag Slaved Compass). This is correct for SLAVED mode and works fine. But when the user throws the PPC into DG mode, I need to use a Type 2 system (Electric Gyro). The FS2004 SDK says you can define more than one direction indicator, and I've done this:

[direction_indicators]
direction_indicator.0=3,0
direction_indicator.1=2,0

So how do I specify this second direction indicator in my gauge? Do you use an index, and if so, where does it get placed into the variable? My current directional gyro indicator uses the following variable:

(A: Plane Heading Degrees Gyro, radians) /-/

Can this be changed to read from direction indicator #2? Or do I need to use something like

(A:Heading Indicator,degrees) dnor

The other part of my question is that can this be simulated instead? This constant heading should result in essentially a great circle route. Is there a variable or code that will allow the plane to fly a great circle route without the pilot making constant heading changes (without filing a GPS flight plan)?

Thanks,
 
Last edited:
OK, I think I found my first answer:

(A: Plane Heading Degrees Gyro:2, radians) /-/

seems to work OK. Now if that can simulate great circle routes and be tied into the autopilot control...
 
I don't know about how to use two heading indicators but using an index would be the first thing I'd try.
The other part of my question is that can this be simulated instead? This constant heading should result in essentially a great circle route. Is there a variable or code that will allow the plane to fly a great circle route without the pilot making constant heading changes (without filing a GPS flight plan)?
If it is purely about polar flights how about simply subtracting longitude from true heading?
When you fly heading 0 at 0 latitude your grid heading is 0 - = 0.
This will take you over the pole where your latitude will switch to 180 as will your true heading.
180 - 180 = 0 so your grid heading will not change.

Another option is to do some vector math.
Calculate the direction of the aircraft's tail-nose axis using it's latitude, longitude and true heading.
Then compare that vector to a reference vector (which represents the gyro) to get the heading.

How about using the GPS' GeoCalc functions?
Project a point halfway around the world and calculate the bearing to it.
 
Tom,
This bit of nastiness
bearing = fmod(atan2(sin(lon2-lon1)*cos(lat2),cos(lat1)*sin(lat2)-sin(lat1)*cos(lat2)*cos(lon2-lon1)),2*PI);
will return the Great Circle direction from lat1, lon1 to lat2, lon2, in radians, true.
It is then a matter of converting the result to degrees, magnetic.
It would probably take me about 20 minutes to build a gauge to do all the calculations and conversions for you.

Doug

-
 
Hi,

Thanks for the help. Doug, thanks for the offer. The problem is that I do not have a lat and lon for a destination - you are flying in a certain direction, but not to a specific destination. You should fly the great circle track for the current heading you are on. Perhaps projecting a point around the world as Jeroen says might be the answer to that? But that point would need to be recalculated each time the pilot or the AP changes the desired heading.

Jeroen, those sound great but I'll need to do a lot of reading before understanding that enough to be able to code a gauge from it. :)
 
Unfortunately, I can't get the 2 direction indicators to be "different". If I set the first one (.0) to a simple Electric Gyro, then all gyros work as they should - they do not correct for magvar. But if I set the first one as a slaved electro mag and the second one as a simple gyro, they all act like a slaved gyro. Grrr....
 
More testing shows that the 2 indicators approach will not work without fudging, because when set as a simple gyro it does not follow a great circle course. There is a slow deviation away from the curved course (the aircraft goes straight on the GPS and does not follow the great circle curve).

So it will have to be simulated.
 
Indeed Jeroen's idea about adding the longitude delta from the heading works well, thanks!

When DG mode is engaged, save the current longitude. To get final heading, add the *difference* between the original and current longitudes. For some reason a fudge factor needs to be added to make the conversion as accurate as possible.

Thanks,
 
Back
Top