Welcome, Guest. Please login or register.
Did you miss your activation email?

News:
Precision Simulator update 10.156 (3 July 2022) is now available.
Navburo update 12 (18 November 2021) is now available.
NG FMC and More is released.

Author Topic: Quick elevation transition for PSX.NET P3D ExternalSim  (Read 4524 times)

Hardy Heinlin

  • Moderator
  • Join date: May 2009
  • Posts: 13152
    • Aerowinx
When loading a situation that starts on the ground, you'll notice the visuals will take a while to settle due to PSX receiving a ground elevation value from P3D and slowly slewing to correct. My recommendation, once it has settled, is to re-save the situation file. This has the effect of changing this parameter in the situation file:
Elev=-999999
to
Elev=2890
(Basic 003 - On ground and cleared for engine start.situ)

This will ensure the next time you load the situation, it'll be in the right place immediately.

I have a little request - when my external scenery generator injects ground elevation back into PSX (Qi198 "Elev") and the aircraft is on the ground, there is a little comedy where the aircraft bounces for 5-30 seconds and makes noises. When all is settled, the situation can be saved to persist the new elevation.

I should probably make a video of this for you.

I'm just wondering if PSX, whilst the Boost Air/Ground variable is set to Ground, could detect the change from -9999 Elev to >-9999 Elev, and inhibit the bouncing noises and Fatal Damage/malfunction detection until settled at the new elevation.

Hi Mark,

in order to keep VisualPSX and XView compatible with the next PSX update, I want to add an option instead of a hard modification. The option is this:

If Qi198 sends to PSX a value between -999998 and -999991, PSX will read this as a special signal. This signal is optional and it needs to be sent only once before injecting normal elevation values. PSX will read the last digit 1..8 and respectively apply a special time frame of 1 to 8 seconds within which the following normal elevation injections are copied to PSX's internal world promptly without inertia, noise and crash detection. A time frame of 1 second is probably sufficient. But more flexibility will not hurt to allow tests with other values.

Does this make sense?


Cheers,

|-|ardy

Mark

  • Join date: Nov 2014
  • Posts: 371
Re: Quick elevation transition for PSX.NET P3D ExternalSim
« Reply #1 on: Thu, 14 Jul 2016 11:30 »
Hi Hardy,

This absolutely makes sense, I originally wanted to suggest you create another variable that would take some kind of inhibit signal (as per your suggestion - it could take in a number from 1 to 8 for inhibit duration) but didn't want to step on your toes.

If you're considering adding this ability for me to control the duration - fantastic, I'd be happy with -999998 to -999991 or another variable. Being a fellow programmer, my preference would be to keep the Qi198 as it is by using a separate variable for inhibit duration (this keeps Qi198 easy to explain and 'clean'), but I can imagine the extra effort required for this. As a consumer of variables, it's easy for me to use either method.

Thought: I'm unsure if you store *all* variables in situation files, but if so, you could store my hypothetical variable as a 0 or -1 to mean 'ignore this setting'.

Thanks,
Mark

Hardy Heinlin

  • Moderator
  • Join date: May 2009
  • Posts: 13152
    • Aerowinx
Re: Quick elevation transition for PSX.NET P3D ExternalSim
« Reply #2 on: Thu, 14 Jul 2016 11:38 »
Am I right if I assume this effect is particularly a nuisance when the injected elevation is lower than the PSX elevation, as it makes the parked aircraft airborne?

The new code is already implemented in Qi198 and the timer seems to work. As Qi198 didn't just provide pure elevation data but also the -9999999 signal, the additional signal now doesn't really degrade any purity, I would say. In my code it just extends the signal part of the function.

What I still have to do is keeping the aircraft on the ground while the injected elevation pulls the ground further down ...


|-|ardy

Mark

  • Join date: Nov 2014
  • Posts: 371
Re: Quick elevation transition for PSX.NET P3D ExternalSim
« Reply #3 on: Thu, 14 Jul 2016 11:46 »
At the moment PSX.NET P3D ExternalSim allows the aircraft to go above or below the ground.
I've been told it's particularly interesting at Denver airport.

So I'd say it's a nuisance either way. If you are finding it would be easier to only deal with the above-ground situation then I can probably add code into my software to prevent the aircraft model from going below the ground.

Hardy Heinlin

  • Moderator
  • Join date: May 2009
  • Posts: 13152
    • Aerowinx
Re: Quick elevation transition for PSX.NET P3D ExternalSim
« Reply #4 on: Thu, 14 Jul 2016 12:23 »
May P3D sometimes take more than 8 seconds to load scenery and the associated local elevation?

Mark

  • Join date: Nov 2014
  • Posts: 371
Re: Quick elevation transition for PSX.NET P3D ExternalSim
« Reply #5 on: Thu, 14 Jul 2016 12:54 »
May P3D sometimes take more than 8 seconds to load scenery and the associated local elevation?

Easily. There is something in our favor though:

P3D tends to load scenery in a progressive way - it'll load a very rough terrain model (so the ground elevation will be near, but not at, it's true value), then slowly load more detailed terrain. As long as I can send repeat Qi198 updates during the 1-8 second period then that's ok.
(Reason: the ground elevation I send will probably change over this 1-8 second period as P3D loads progressively more detailed terrain models. There is value in using the initial rough terrain model ground elevation - it presents a good starting point for PSX to begin slewing towards)

The initial ground elevation value should arrive at PSX within 8 seconds (though this will vary depending on the user's PC capability. If you're implementing another variable, then being able to go higher than 8 seconds may have value as a user-settable option in my software).

From the perspective of PSX.NET P3D ExternalSim, I will probably be looking to send the 'special' command at these points (this is a rough guess, please make any suggestions):

- When it first loads and receives the first ground elevation value from P3D
- When lat/lon changes massively in a short time frame
- When I receive 'load3' from PSX

Mark

  • Join date: Nov 2014
  • Posts: 371
Re: Quick elevation transition for PSX.NET P3D ExternalSim
« Reply #6 on: Thu, 14 Jul 2016 13:14 »
Hi Hardy, here is a partial extract from a log that shows typical behavior of the ground elevation data during P3D load at EGLL. You can see a gradual improvement in the ground elevation accuracy as P3D loads progressively more accurate terrain models.

Code: [Select]
14/07/2016 - 13:08:15: ExternalSim: Open
14/07/2016 - 13:08:15: ExternalSim: Create
14/07/2016 - 13:08:15: System: Starting ExternalSim
14/07/2016 - 13:08:15: ExternalSim: Reset
14/07/2016 - 13:08:15: Ground Elevation(m): 53.6141848004049   (Note: This is one of the points at which I would send the special command as it's the very first ground elevation data from P3D)
14/07/2016 - 13:08:15: Ground Elevation(m): 53.614084802745
14/07/2016 - 13:08:16: Ground Elevation(m): 53.6139670266318
14/07/2016 - 13:08:16: Ground Elevation(m): 53.613844607444
14/07/2016 - 13:08:16: Ground Elevation(m): 29.5537678728943
14/07/2016 - 13:08:17: Ground Elevation(m): 24.1326880801334
14/07/2016 - 13:08:17: Ground Elevation(m): 24.1326412931061
14/07/2016 - 13:08:18: Ground Elevation(m): 24.1326069256122
14/07/2016 - 13:08:18: Ground Elevation(m): 24.1325762860991
14/07/2016 - 13:08:18: Ground Elevation(m): 24.1325445791794
14/07/2016 - 13:08:19: Ground Elevation(m): 24.1325251459149
14/07/2016 - 13:08:19: Ground Elevation(m): 24.1325050083301
14/07/2016 - 13:08:19: Ground Elevation(m): 27.2453408736052
14/07/2016 - 13:08:20: Ground Elevation(m): 27.2452484896712
14/07/2016 - 13:08:20: Ground Elevation(m): 27.2451568581426
14/07/2016 - 13:08:20: Ground Elevation(m): 24.6846177262162
14/07/2016 - 13:08:21: Ground Elevation(m): 24.6846094365787
14/07/2016 - 13:08:21: Ground Elevation(m): 24.684600829436
14/07/2016 - 13:08:21: Ground Elevation(m): 24.6845943005852
14/07/2016 - 13:08:22: Ground Elevation(m): 24.6845826021646
14/07/2016 - 13:08:22: Ground Elevation(m): 24.6845778203434
14/07/2016 - 13:08:23: Ground Elevation(m): 24.6845743075957
14/07/2016 - 13:08:23: Ground Elevation(m): 24.6845708036779
14/07/2016 - 13:08:23: Ground Elevation(m): 24.6845677795428
14/07/2016 - 13:08:23: Ground Elevation(m): 24.6845648194154
14/07/2016 - 13:08:24: Ground Elevation(m): 24.6845623628532
14/07/2016 - 13:08:24: Ground Elevation(m): 24.6845598635754
14/07/2016 - 13:08:24: Ground Elevation(m): 24.6845580936686
14/07/2016 - 13:08:25: Ground Elevation(m): 24.6845562804019
14/07/2016 - 13:08:25: Ground Elevation(m): 24.6845544322594
14/07/2016 - 13:08:25: Ground Elevation(m): 24.6845527544226
14/07/2016 - 13:08:26: Ground Elevation(m): 24.6845514327287
14/07/2016 - 13:08:26: Ground Elevation(m): 24.6845498148979
14/07/2016 - 13:08:26: Ground Elevation(m): 24.6845488185404
14/07/2016 - 13:08:27: Ground Elevation(m): 24.6845478129066
14/07/2016 - 13:08:27: Ground Elevation(m): 24.68454683865
14/07/2016 - 13:08:27: Ground Elevation(m): 24.6845461600304
14/07/2016 - 13:08:28: Ground Elevation(m): 24.6845454258228
14/07/2016 - 13:08:28: Ground Elevation(m): 24.6845448041862
14/07/2016 - 13:08:29: Ground Elevation(m): 24.6845436447609
14/07/2016 - 13:08:29: Ground Elevation(m): 24.6845431137499
14/07/2016 - 13:08:30: Ground Elevation(m): 24.6845427636638
14/07/2016 - 13:08:30: Ground Elevation(m): 24.6845424412302
14/07/2016 - 13:08:30: Ground Elevation(m): 24.6845421231863
14/07/2016 - 13:08:31: Ground Elevation(m): 24.6845418585428
14/07/2016 - 13:08:31: Ground Elevation(m): 24.6845415319388
14/07/2016 - 13:08:31: Ground Elevation(m): 24.6845415319388
14/07/2016 - 13:08:32: Ground Elevation(m): 24.6845415319388
14/07/2016 - 13:08:32: Ground Elevation(m): 24.6845415319388
14/07/2016 - 13:08:32: Ground Elevation(m): 24.6845415319388
14/07/2016 - 13:08:33: Ground Elevation(m): 24.6845415319388
14/07/2016 - 13:08:33: Ground Elevation(m): 24.6845415319388
14/07/2016 - 13:08:33: Ground Elevation(m): 24.6845415319388
14/07/2016 - 13:08:33: Ground Elevation(m): 24.6845415319388
14/07/2016 - 13:08:34: Ground Elevation(m): 24.6845415319388
14/07/2016 - 13:08:34: Ground Elevation(m): 24.6845415319388
14/07/2016 - 13:08:34: Ground Elevation(m): 24.6845415319388
14/07/2016 - 13:08:35: Ground Elevation(m): 24.6845415319388
14/07/2016 - 13:08:35: Ground Elevation(m): 24.6845415319388

Hardy Heinlin

  • Moderator
  • Join date: May 2009
  • Posts: 13152
    • Aerowinx
Re: Quick elevation transition for PSX.NET P3D ExternalSim
« Reply #7 on: Thu, 14 Jul 2016 13:16 »
The timer will also inhibit PSX's LNAV/VNAV engagement for takeoff and the internal ground-to-air trigger which also affects the reset of the PNF's rollout related calls and other stuff. This stuff is pretty sensitive to microscopic inflight events; if you let PSX slew for a while and it gets inflight during the slew, a higher timer value may help. I think I'll use the last 2 digits so that you can set 1 - 89 seconds.

It also sends the Qi "CrashInhib" with 3000 milliseconds. So if you have been sending a crash inhibit time, you need not send it anymore.

Mark

  • Join date: Nov 2014
  • Posts: 371
Re: Quick elevation transition for PSX.NET P3D ExternalSim
« Reply #8 on: Thu, 14 Jul 2016 13:33 »
I think I'll use the last 2 digits so that you can set 1 - 89 seconds.

Yes, this makes sense, from a few runs of P3D generating the log file I showed in the previous post, I can see the ground elevation tends to settle in 15-17 seconds for me. My computer has a mid-to high specification of CPU/SSD.

It also sends the Qi "CrashInhib" with 3000 milliseconds. So if you have been sending a crash inhibit time, you need not send it anymore.

That's good!

I did another test where I went from sitting on the runway at TNCC, then loaded the 03 Approach 007 - Denver situation.

Code: [Select]
14/07/2016 - 13:29:48: Ground Elevation(m): 8.7941926905591
14/07/2016 - 13:29:48: Ground Elevation(m): 8.7941926905591
14/07/2016 - 13:29:48: Ground Elevation(m): 8.7941926905591
14/07/2016 - 13:29:49: Ground Elevation(m): 8.7941926905591
14/07/2016 - 13:29:49: Ground Elevation(m): 8.7941926905591
14/07/2016 - 13:29:49: Ground Elevation(m): 8.7941926905591
14/07/2016 - 13:29:50: Ground Elevation(m): 8.7941926905591
14/07/2016 - 13:29:50: Ground Elevation(m): 8.7941926905591
14/07/2016 - 13:29:50: Ground Elevation(m): 8.7941926905591
14/07/2016 - 13:29:50: Ground Elevation(m): 8.7941926905591
14/07/2016 - 13:29:52: Ground Elevation(m): 1621.40900230408       Note: At this point I would need to detect the 'load3' variable from PSX
14/07/2016 - 13:29:52: Ground Elevation(m): 1621.47965621948
14/07/2016 - 13:29:53: Ground Elevation(m): 1621.57597923279
14/07/2016 - 13:29:53: Ground Elevation(m): 1621.67285346985
14/07/2016 - 13:29:53: Ground Elevation(m): 1621.77579879761
14/07/2016 - 13:29:54: Ground Elevation(m): 1621.86165428162
14/07/2016 - 13:29:54: Ground Elevation(m): 1621.94054985046
14/07/2016 - 13:29:54: Ground Elevation(m): 1622.03302764893
14/07/2016 - 13:29:55: Ground Elevation(m): 1573.61283874512
14/07/2016 - 13:29:55: Ground Elevation(m): 1573.74105834961
14/07/2016 - 13:29:56: Ground Elevation(m): 1573.85628509521
14/07/2016 - 13:29:56: Ground Elevation(m): 1574.69606018066
14/07/2016 - 13:29:56: Ground Elevation(m): 1574.84313964844
14/07/2016 - 13:29:57: Ground Elevation(m): 1577.87854003906
14/07/2016 - 13:29:57: Ground Elevation(m): 1578.07269287109
14/07/2016 - 13:29:57: Ground Elevation(m): 1572.35595703125
14/07/2016 - 13:29:58: Ground Elevation(m): 1572.12268066406
14/07/2016 - 13:29:58: Ground Elevation(m): 1572.09765625
14/07/2016 - 13:29:58: Ground Elevation(m): 1572.52593994141
14/07/2016 - 13:29:59: Ground Elevation(m): 1572.93884277344
14/07/2016 - 13:29:59: Ground Elevation(m): 1573.30322265625
14/07/2016 - 13:29:59: Ground Elevation(m): 1573.64288330078
14/07/2016 - 13:30:00: Ground Elevation(m): 1573.96716308594
14/07/2016 - 13:30:00: Ground Elevation(m): 1574.32348632813
14/07/2016 - 13:30:00: Ground Elevation(m): 1573.67626953125
14/07/2016 - 13:30:01: Ground Elevation(m): 1574.27099609375
14/07/2016 - 13:30:01: Ground Elevation(m): 1574.88110351563
14/07/2016 - 13:30:01: Ground Elevation(m): 1575.53308105469
14/07/2016 - 13:30:02: Ground Elevation(m): 1576.11584472656
14/07/2016 - 13:30:02: Ground Elevation(m): 1576.69689941406
14/07/2016 - 13:30:02: Ground Elevation(m): 1577.27795410156
14/07/2016 - 13:30:02: Ground Elevation(m): 1577.85900878906
14/07/2016 - 13:30:03: Ground Elevation(m): 1585.0791015625
14/07/2016 - 13:30:03: Ground Elevation(m): 1585.57958984375
14/07/2016 - 13:30:03: Ground Elevation(m): 1586.12548828125
14/07/2016 - 13:30:04: Ground Elevation(m): 1586.67016601562
14/07/2016 - 13:30:04: Ground Elevation(m): 1587.21166992188
14/07/2016 - 13:30:04: Ground Elevation(m): 1587.75610351562
14/07/2016 - 13:30:05: Ground Elevation(m): 1586.74159856229
14/07/2016 - 13:30:05: Ground Elevation(m): 1587.3662109375
14/07/2016 - 13:30:05: Ground Elevation(m): 1587.7255859375
14/07/2016 - 13:30:06: Ground Elevation(m): 1588.083984375
14/07/2016 - 13:30:06: Ground Elevation(m): 1588.4482421875
14/07/2016 - 13:30:06: Ground Elevation(m): 1588.7685546875
14/07/2016 - 13:30:07: Ground Elevation(m): 1589.12890625
14/07/2016 - 13:30:07: Ground Elevation(m): 1589.38818359375
14/07/2016 - 13:30:07: Ground Elevation(m): 1589.56396484375
14/07/2016 - 13:30:08: Ground Elevation(m): 1589.84228515625
14/07/2016 - 13:30:08: Ground Elevation(m): 1590.15869140625
14/07/2016 - 13:30:08: Ground Elevation(m): 1589.7138671875
14/07/2016 - 13:30:09: Ground Elevation(m): 1590.115234375       Note: The terrain is fully loaded by now, the value is changing because PSX isn't in motion freeze.
14/07/2016 - 13:30:09: Ground Elevation(m): 1590.470703125
14/07/2016 - 13:30:09: Ground Elevation(m): 1590.82421875

Hardy Heinlin

  • Moderator
  • Join date: May 2009
  • Posts: 13152
    • Aerowinx
Re: Quick elevation transition for PSX.NET P3D ExternalSim
« Reply #9 on: Thu, 14 Jul 2016 13:56 »
OK, here's the first beta:

http://aerowinx.com/board/index.php?topic=3685.0

Examples:

-9999900 = no effect

-9999901 = 1 second

-9999920 = 20 seconds

-9999999 = external elevation data disconnected


Cheers,

|-|ardy

Mark

  • Join date: Nov 2014
  • Posts: 371
Re: Quick elevation transition for PSX.NET P3D ExternalSim
« Reply #10 on: Thu, 14 Jul 2016 21:36 »
Thanks Hardy, I'll give it a go.

First step for me before trying your 10.0.9 beta was to find a way to consistently reproduce the problem and I've finally found the right combination of loading certain situations that triggers it for me. So I thought you might like to see a couple of private videos of what happens as I know you have probably never seen it before:

Either this happens:
https://www.youtube.com/watch?v=z4wMw-uG7iY
or this happens:
https://www.youtube.com/watch?v=mUWspxsIA2E

Now I'll add the code in to send -999920 and do the same combination of loading certain situations and see what happens.

jcomm

  • Join date: Dec 2011
  • Location: LPMT
  • Posts: 1638
Re: Quick elevation transition for PSX.NET P3D ExternalSim
« Reply #11 on: Thu, 14 Jul 2016 22:08 »
My wife knows very well that remark from Sara :-)

Hardy Heinlin

  • Moderator
  • Join date: May 2009
  • Posts: 13152
    • Aerowinx
Re: Quick elevation transition for PSX.NET P3D ExternalSim
« Reply #12 on: Fri, 15 Jul 2016 04:01 »
Hi Mark,

what I see in your videos is pretty similar to what I saw in my test configuration: I simply injected a higher or lower elevation while the aircraft was on the ground. The problem was solved for me by first injecting a timer value.


Regards,

|-|ardy

Mark

  • Join date: Nov 2014
  • Posts: 371
Re: Quick elevation transition for PSX.NET P3D ExternalSim
« Reply #13 on: Fri, 15 Jul 2016 10:02 »
I simply injected a higher or lower elevation while the aircraft was on the ground.

Very good point. Sorry; my brain has not been functioning at 100% this week.

Mark

  • Join date: Nov 2014
  • Posts: 371
Re: Quick elevation transition for PSX.NET P3D ExternalSim
« Reply #14 on: Fri, 15 Jul 2016 11:39 »
Hardy,

Quick question - What's the official name of this feature?

(I'm intending to add a configuration option in my software for the timer, with a default of 20 seconds, so people on abnormally fast or slow PCs can decrease or increase the timeout)

Hardy Heinlin

  • Moderator
  • Join date: May 2009
  • Posts: 13152
    • Aerowinx
Re: Quick elevation transition for PSX.NET P3D ExternalSim
« Reply #15 on: Fri, 15 Jul 2016 11:53 »
Hmm ... perhaps:

Elevation reset time

Vertical inertia inhibit time

Quick vertical repositioning time

...


:-)

jcomm

  • Join date: Dec 2011
  • Location: LPMT
  • Posts: 1638
Re: Quick elevation transition for PSX.NET P3D ExternalSim
« Reply #16 on: Fri, 15 Jul 2016 18:59 »
Will this update to the variables interfere with other injectors, namely XView ?

Hardy Heinlin

  • Moderator
  • Join date: May 2009
  • Posts: 13152
    • Aerowinx
Re: Quick elevation transition for PSX.NET P3D ExternalSim
« Reply #17 on: Fri, 15 Jul 2016 19:01 »
No.

The time value must be explicitly injected, otherwise it behaves as usual.

Mark

  • Join date: Nov 2014
  • Posts: 371
Re: Quick elevation transition for PSX.NET P3D ExternalSim
« Reply #18 on: Sat, 28 Oct 2017 22:31 »
Edit: Now resolved.

I'm finally using this new functionality but having issues:

I start at somewhere like EGLL with Qi198=8300 continually injected. No problems.
Clicking Rwy 15 Takeoff at VQPR on the re-positioning page, ExternalSim stops all Qi198 injections for 15 seconds whilst the scenery generator stabilises.
(This 15 second inhibit action is triggered by either load1 or StartPiBaHeAlTaPos)
The scenery generator eventually reports a stable 2316m ground elevation.
ExternalSim then injects Qi198=-9999910 followed by Qi198=759833.
(The second injection occurs about 200ms later and from this point, Qi198=759833 is injected continuously at a reasonable rate)

What occurs is that the aircraft oscillates in altitude wildly for a few seconds (you may be able to confirm this in the boost output) and then settles at a high altitude above VQPR.
(I'm going to guess here, and say it's 2316m above!)

What is note worthy is that the scenery generator oscillates between outputting 2316m and -1m, I would guess that PSX is driving the aircraft 'underground' (from the perspective of the scenery generator) which causes it to output -1m. I will see if I can inhibit this 'going underground' behaviour to see if it helps.

Thoughts?
« Last edit: Sun, 29 Oct 2017 19:33 by Mark »

Mark

  • Join date: Nov 2014
  • Posts: 371
Re: Quick elevation transition for PSX.NET P3D ExternalSim
« Reply #19 on: Sat, 28 Oct 2017 23:00 »
Edit: Now resolved.

Ok, so I changed the logic slightly and now the behaviour is a little nicer (but still bad):

I start at somewhere like EGLL with Qi198=8300 continually injected. No problems.
Clicking Rwy 15 Takeoff at VQPR on the re-positioning page, ExternalSim stops all Qi198 injections for 15 seconds whilst the scenery generator stabilises. It also injects Qi198=-9999930 at this point.
The scenery generator eventually reports a stable 2316m ground elevation.
ExternalSim then starts injecting Qi198=759833.

What occurs now is that the aircraft just slews nicely to a very high altitude above VQPR. Then it starts falling out of the sky as there is no airspeed. Fatal damage.
« Last edit: Sun, 29 Oct 2017 19:33 by Mark »