News:

Precision Simulator update 10.174 (26 April 2024) is now available.
Navburo update 13 (23 November 2022) is now available.
NG FMC and More is released.

Main Menu

Scenery Offsets

Started by mikeindevon, Sat, 15 Oct 2011 13:11

mikeindevon

I am building a scenery generator for PS13 that uses x-plane as the display software.  I have hit a snag with the airport data that I am sure somebody may be able to help.  I am using 747IPC v3.1 and have deleted the file offset.txt from c:\\PS13.

I then run the approach to EDDF 07R.  Looking at the PS13 screen, the plane lands properly on the centre line.  However, if I look at the data coming out of the Broker, the reported position is about 154 metres north of the runway centre.

If this is a "feature" of PS13, then I can manually adjust my offsets for x-plane to deal with it, but I am wondering if perhaps I have missed something.  The details are as follows:

The data for EDDF in 747EUR.APT is at file location 0xD48 and shows the following values for the 07R runway: Lat 32 15 00.  Converted to degrees this gives 50.0350 for the runway centre.  The Lon is 15 00 08 00 giving 8.5633 degrees.  The output from Broker (using notify IPC.latmin etc) passes a position Lat 50.036350  Lon 8.563331, which has the right Lon, but a Lat 0.001353 deg too large, that is too far north by about 154 metres.

Any info on this will be most appreciated.

Mike

Jeroen Hoppenbrouwers

Hi Mike,

You've hit a problem that many people already attacked in the past, and there has been a good solution worked out (after years).

PS1 internally uses 5 feet accuracy, but since all FMC display positions are in 0.1 minute precision, the internal database was also made at this precision. Remember that nobody ever thought of adding a scenery generator to PS1 when it was made.

0.1 minute may be enough to cause a few hundred meters offset.

There are two solutions. One is to add an offset file to your scenery generator and add offsets to all runway thresholds. This requires that you know which runway needs to be the reference point -- per airfield you may have several. Garry Richards is your man. He's on this Forum.

The other solution is built into IPC3, Ivan Ngeow's hack to equip PS1 with the sort of equivalent of MSFS FSUIPC. This hack internally moves PS1 positions to what its offset file dictates, so that the PS1 world shifts and overlays what you want it to be. If you use IPC3, which you likely do, this should be the way to go.

Note that the offsets for MSFS versus X-Plane may be different. There are ways to automatically diff them, so it is not a matter of endless experimentation.

Hope this helps,


Jeroen

mikeindevon

Hi Jeroen,
Thanks very much for the response.
QuotePS1 internally uses 5 feet accuracy, but since all FMC display positions are in 0.1 minute precision, the internal database was also made at this precision.

I don't fully understand what you mean by the "internal database" and how this is causing my problem.  What I have seen is that although the PS13 view window shows the plane at the runway centre, the output from Broker/747IPC gives a position 150m away from the centre as defined in the 747EUR.APT.  There seems to be some internal inconsistency between the internal position of the plane (as output by Broker presumably), the position of the runway in the file, and the drawing of the runway on the PS1 screen.

I do understand that the airport files are specified with a limited precision and that therefore the runways will not be exactly where they are in real life.  I have built an offset system to deal with that.  However, internally I would expect PS1 to fly accurately to the runway centre as defined.  If I can fully understand why not, perhaps I can build a system to correct for it.  

QuoteRemember that nobody ever thought of adding a scenery generator to PS1 when it was made.
I am not intending the remotest criticism of PS1: it was and remains a truly remarkable piece of software.

Status Report:
Progress on the x-plane interface has been good - I get a smooth flight at about 50fps and the offset mechanism is in place.  I should be able to put up a beta Windows version for anyone interested in a few weeks.  Cedric Groux, who developed part of the code, has provided a Linux version of the OS critical stuff: threads and comms.

Best wishes,

Mike

Garry Richards

#3
Hi Mike,

There is a correction you have to make to the latitude. Ivan provided this method. Here is the code from my offset generator:


      'Compute final runway centre latitude using longitude
      'by Ivan's method to match PS1's handling of file data
       Dim LonDeg As Double = PS1AirportRecord.RwyLonDeg
       Dim LonMin As Double = PS1AirportRecord.RwyLonMin
       If LonDeg < 0 And LonMin < -300 Then
              LonDeg -= 1
        ElseIf LonDeg >= 0 And LonMin > 300 Then
               LonDeg += 1
        End If
        Dim LonDiff As Double = LonDeg - LonFinal
        Dim K1 As Double = LonDiff * Cos(LatInit * DegToRad)
        Dim K2 As Double = K1 * Sin(LonDiff * DegToRad) / 2
        Dim LatFinal As Double = K2 * Sin(LatInit * DegToRad) + LatInit

Hope this helps.
Garry

Website: flightsim.garryric.com

Jeroen Hoppenbrouwers

Quote from: mikeindevonI don't fully understand what you mean by the "internal database" and how this is causing my problem.
PS1's internal database is the only reference for everything in the PS1 world. If you fly an ILS, both your instruments and the dots out of the window are generated via this database. If the database is rounded all over to 0.1 arc minute, both your ILS localiser and your runway lights will be rounded to 0.1 arc minute lat/long as well.

QuoteWhat I have seen is that although the PS13 view window shows the plane at the runway centre, the output from Broker/747IPC gives a position 150m away from the centre as defined in the 747EUR.APT.  There seems to be some internal inconsistency between the internal position of the plane (as output by Broker presumably), the position of the runway in the file, and the drawing of the runway on the PS1 screen.
It smells like you may already see the offset applied by IPC. Please confirm: are you running WinPS1, i.e. the special version we made that wraps PS1 for DOS into a WinPS1 shell so that it can survive in XP? If so, you have a complete offset engine aboard. This engine is driven by the offset file in the IPC3 directory somewhere. If you take that offset file out, all positions should drop back to the original figures.

The Broker, 100% certain, does not interfere with values of any variable.

If you use just plain PS1 and only the Broker keys that are updated at 1 Hz, the previous is not true, and you are looking at flat PS1 positions.


Jeroen

Hardy Heinlin

#5
Quote from: Jeroen HoppenbrouwersPS1's internal database is the only reference for everything in the PS1 world. If you fly an ILS, both your instruments and the dots out of the window are generated via this database. If the database is rounded all over to 0.1 arc minute, both your ILS localiser and your runway lights will be rounded to 0.1 arc minute lat/long as well.
Just in case the readers misunderstand this 0.1 rounding in the old PS1: Rounded is the runway centerpoint. The locations of the runway lights and ILS antennas are computed based on the runway heading, length, width and on this rounded runway centerpoint.

I.e. runway dots and antennas, on the other hand, don't sit on this 0.1 grid, they can sit at arc minute 0.00456 whatever as they are computed by a floating point sine function, they always lead exactly to the runway -- to the PS1 runway. The problem is the rounding of the runway centerpoint. Only this centerpoint sits on the 0.1 grid. (That's what Jeroen actually meant :-))


|-|

Mariano

#6
I am running IPC3.1 and for a while I have been noticing that if I save a PS1 situation with the aircraft on the runway (by setting EDDF07R in the New Position/Time menu, for example) and load that situation at a later time, the aircraft loads not on the runway centerline, but away, somewhere else on the airport.

I am not running Visual PS1 or any other external scenery add-ons. I just run WinPS1 (IPC3.1) with Marcus' latest database. I do use Edit Airport and PS1's "SIMU" function to keep the airports I fly in and out of updated to current charts.

I've also noticed that when flying a coupled ILS with zero wind, the aircraft keeps banking back and forth (shallowly but continuously) in order to stay on the localizer all the way until touchdown and that also, it leaves the glideslope (high) a bit too early.

Could using Edit Airport be causing these discrepancies? Is there, maybe, any way I could edit these runways/airports so that airplane behaves more "stable" during a calm, ILS approach? (maybe by rounding lat/longs to a certain number?)

I kept thinking editing airports with Edit Airport was causing the problem. I've also noticed that I don't have an offset file in my IPC folder (unlike what Jeroen pointed out.) I did have an offset.txt file in my main PS folder, but since I am not running any external scenery programs, I took it out. I did later temporarily put it back in to see if the problems would go away, but they did not.

Oddly, these two issues also manifest themselves at airports I did not edit myself.

Thank you in advance for any suggestions,

Mariano

mikeindevon

QuotePlease confirm: are you running WinPS1, i.e. the special version we made that wraps PS1 for DOS into a WinPS1 shell so that it can survive in XP?
I believe I am running the right stuff - 747IPV v3.1 WinPS1 and 747 Broker - all according to the tabs at the bottom of the screen.

QuoteThis engine is driven by the offset file in the IPC3 directory somewhere. If you take that offset file out, all positions should drop back to the original figures.
I have already taken out offset.txt.  It was in the PS13 directory.  I can't see anything in the 747IPC directory with that name.

Garry wrote:
QuoteThere is a correction you have to make to the latitude. Ivan provided this method.
Thanks Garry - this looks the business.  I'll convert it to c++ and give it a whirl.

Mike

mikeindevon

Hi Garry,

Thanks for the info.  I have coded up your snippet in Excel just to test, and it still doesn't provide the right answer.  I wondered if there was a bit more code to go with it.

I assume LonDeg and LonMin are the values computed directly from the .APT file, but I am not certain exactly what LonFinal is or LatInit.  These names suggest a bit of earlier processing.

Just to be clear, I am happy with my code for computing the offsets between x-plane and PS, my problem is simply with the plane landing off the runway as defined in the file.  

From your code it seems that the issue relates to PS1 not handling angles with minutes greater than 30 properly.  If I knew exactly what the problem was geometrically, I could reverse engineer the maths.

I have deleted offset.txt from c:/PS13 - do you know of anything else I have to do?

Mike

Garry Richards

Hi Mike,

Yes, there is another condition. Sorry I forgot to include it. These lines go before the previous snippet:

'Get final runway centre longitude
Dim LonFinal As Double = CDbl(PS1AirportRecord.RwyLonDeg _
+ PS1AirportRecord.RwyLonMin / 600)
PS1AirportRunways(RunwayIndex).RwyLon = LonFinal 'runway centre

'Get initial runway centre latitude, converting signed byte value
Dim LatDeg As Short = PS1AirportRecord.RwyLatDeg
If LatDeg > 90 Then
      LatDeg -= CShort(256)
End If
Dim LatInit As Double = CDbl(LatDeg + PS1AirportRecord.RwyLatMin / 600)


Hope that fixes it.
Garry

Website: flightsim.garryric.com

ivan