Jump to content

Need help exporting the magnetic heading using DCS-Bios


Recommended Posts

Posted (edited)

Hello

Several weeks ago I began designing my own flight instrument panel, expecting to use it with several modules. It is now nearly complete :

20240511-195328.jpg

To drive the compass I would have liked to use the magnetic heading. However some modules, for instance the F-16, do not appear to export this parameter.

Am I missing something ? Is there a way around to otherwise export the magnetic heading ? (I thought about using the true heading, exported through the common data set, with the mag var. to retrieve the magnetic heading but the mag var seems to not be exported either).

Thank you in advance for your answers.

Edited by Bacab
  • Like 1
Posted

Magnetic compasses don't account for magnetic variation - you do that in flight planning, adjusting the course to take the magnetic variation into account.

That said, I use Matric represent some of the instruments and switches for the P-51 on an iPad. The instrument data is exported from DCS BIOS to DCS Matric to Matric. I had to come up with (I believe) Javascript formulas to take the raw data and convert it into a digital readout. For the magnetic compass I used this formula: return Math.round(value/182.041667,3). Value is the raw DNS BIOS reading, 182.041667 is the number of times 360 goes into the maximum DCS BIOS value for the compass and the three represent the number of digits. Round just rounds up to the next whole number.

 

Posted

Thank you for your answer but I am not sure you understand what I am trying to do.

Since DCS Bios export the true heading for all aircrafts but not the magnetic heading (for instance for the F-16, yes for the P-51 you have access to the magnetic heading), I was trying to find a way to convert this true heading to a magnetic heading (the link between the two being the magnetic variation). However since the magnetic variation is not exported as it seems, this solution can't be done.

So the question is : is there a way to get the heading value from the F-16, F-18 and AV-8BNA ? Or to otherwise retrieve the actual magnetic variation.

Posted

Hi Bacab

If you have a look into the DcsBios export tools like Bort or so, there are no outputs of the F-16 HSI. The standby compass is not even a part of those tools. So at the time there seems to be no possibility for direct export.

You have to do math to get the mag heading or wait until the respective DcsBios F-16 lua files are expanded accordingly.

 

Regards, Vinc

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted (edited)

@Bacab

For the math you may use the values from the ...\DCS World OpenBeta\Mods\aircraft\F-16C\Cockpit\Scripts\Instruments\StandbyCompass.lua file.

The deviation is layed down in radians, so I think it would be possible to calculate something usefull.

 

Regards, Vinc

 

Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted (edited)

I've got a test output of the F-16 Standby compass heading working.
I'm not sure how it will get into the main DCS-BIOS, though.

One thing to note is that it's the actual "floating ball" data, so it lags and wobbles about a bit.  I'm not sure if that's what you want, but I think it's all there is available.

Edited by No1sonuk
Typo
Posted (edited)

Thank you very much for the help. I would have preferred the heading from the EHSI but i understand from what I read it currently behaves like a screen and it can't be exported as a gauge. I will test the whole thing today and keep you updated.

PS: I have seen your talk on git hub. I can tell you the F-5 compass is also reversed. However it is very easy to solve, so not a big deal.

Edited by Bacab
Posted

TBF, I didn't go looking for any other parameters. 

The physical gauges use those "argument  numbers" as part of the cockpit animation.

DCS giving the heading argument a value from 0 to 1 sets the rotation angle of the compass ball.  DCS-BIOS translates 0 to 1 into 0 to 65535 to make small steps easier.

Something that might be worth considering is to get the true heading from the common data and compare it to the standby compass at the beginning to get the variation, then apply that to the true data from there to get a stable reading.

Posted
On 5/29/2024 at 11:12 AM, No1sonuk said:

TBF, I didn't go looking for any other parameters. 

The physical gauges use those "argument  numbers" as part of the cockpit animation.

DCS giving the heading argument a value from 0 to 1 sets the rotation angle of the compass ball.  DCS-BIOS translates 0 to 1 into 0 to 65535 to make small steps easier.

Something that might be worth considering is to get the true heading from the common data and compare it to the standby compass at the beginning to get the variation, then apply that to the true data from there to get a stable reading.

This is a good solution that I will try on the F-16, F-18 and AV-8. I will try it as soon as my build is finish : I have just eradicated the last bug from the software and I am in the process of finalising the box that contains all my flight instruments. Once that is done I will try the solution you offer.

On a side note, just in case someone is interested in building a compass for DCS Bios :

- A-10C: export the HSI heading, values are reversed so 360° to 180° is 0 to 32 768. Displays the magnetic heading

- AJS-37: export the CI heading, the exported values are in degrees. Displays the true heading

- F-86: export the heading value, the exported values are in degrees. Displays the magnetic heading

-L-39: export the HSI heading, values are NOT reversed so 360° to 180° is 65535 to 32 768. Displays the true heading

-M2000C: export the HSI heading, values are NOT reversed so 360° to 180° is 65535 to 32 768. Displays the magnetic heading

-MiG-21: export the HSI heading, values are reversed so 360° to 180° is 0 to 32 768. Displays the true heading

-All WWII aircrafts: export the DI GAUGE (directional gyro) instead of the compass. Their compass are too wobbly (and not accurate at start so you can't rely on them to deduce the magnetic variation) so it will lead to erratic, very fast movements, of the stepper motor which the stepper does not like at all ! Though it is not a direct reading of the magnetic heading it is generally synced to the magnetic heading at start and before all navigation and their output is a lot more stable. All values are between 0 and 65535 but I have not played enough with them to sort if they are reversed or not (they don't seem to be reversed though).

-UH-1H: export the GMC heading, values are NOT reversed so 360° to 180° is 0 to 32 768. Displays the magnetic heading (if manually sync)

Thank you for your help.

  • Like 1
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...