• 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.

FSXA Getting accurate acceleration data

Messages
177
Country
unitedkingdom
Hi,

I'm attempting to create an INS using acceleration data from the sim, but I can not find any form of callback that is sync'd with FSX.

As a result my computed GS from the accelerations differs from the GS provided by the sim, I think, due to timing errors.

Does anyone know if it is possible to do this at all? I need to be sync'd with the update rate of acceleration data from the sim.

Another problem is I can not find any kind of FS based timer, so I have no accurate timing available for integrations. Did I overlook something?

Best regards,
Robin.
 
Last edited:
Robin, as to the second question, look at the sim variables
(E:Absolute Time,seconds) and
(E:Local Time, seconds)

Both are Float64 based variables, so there's a lot of decimal places from which to choose for timing! :D

Code:
  <Element>
    <Position X="113" Y="62"/>
    <FormattedText X="300" Y="35" Font="Glass Gauge" FontSize="10" LineSpacing="0" Adjust="Left" Color="White" Bright="Yes">
      <String>Absolute Time = %((E:Local time,seconds))%!20.8f!%</String>
    </FormattedText>
  </Element>
The main difference is that both Zulu Time and Local Time "reset" at midnight, whereas Absolute Time will not reset for many hundreds of years... :cool:
 
I did a test - SimConnect calls

OnRecvSimobjectDataBytype()

between 10 and 20 times per second.

It seems that FS is incapable of being used for this kind of computation. I don't see any way of getting a SIM_TIME time step for my computations, and apparently no way to be called at the same rate the accelerations are computed either.

Looks like I'm going to have to forget this idea completely. :(

Best regards,
Robin.
 
Could you not request absolute time at the same time as the acceleration values i.e. as part of the same data definition? That would give you a time stamp for the values and allow you to accurately* integrate the values to get velocity and distance travelled, which is left as an exercise for the reader.

*Not that accurately, but then if you want absolute accuracy you'd just call the GPS position values or the actual Lat and Long. Personally I spent a day tuning a Doppler nav system so it drifted at a decent rate!
 
Hi,

I'm attempting to create an INS using acceleration data from the sim, but I can not find any form of callback that is sync'd with FSX.

As a result my computed GS from the accelerations differs from the GS provided by the sim, I think, due to timing errors.

Why don't you directly use/display GS and Acceletation data provided by FS? Should be more than enough as a reference in an INS CDU display.

Tom
 
Because the ground speed returns from a INS might not necessarely match what your ground speed really is. Hence why INS systems have present position update systems implement along with precision velocity updates...
 
Because the ground speed returns from a INS might not necessarely match what your ground speed really is. Hence why INS systems have present position update systems implement along with precision velocity updates...

Sure. But in the OP case he has no choice but to use FS native variables for the calcs, simply because he doesn't have another source -ie a real INS accelerometer- available. Actually is the other way around, he will need to apply FS data a custom error factor to fake INS drifts.

Tom
 
Ehy not try using the built-in Windows high-resolution timer to get the time intervals between SIMCONNECT_RECV_ID_SIMOBJECT_DATA cases?
 
Why don't you directly use/display GS and Acceletation data provided by FS? Should be more than enough as a reference in an INS CDU display.

Tom

This is what I'm going to have to do. Sucks, but nothing I can do about it apparently. :(

@mgh: Using the Windows HPT is useless as well, because of errors due to the time it takes to make the request and get the data, and the fact that SimConnect is apparently completely out of sync with FSX itself so even that data is delayed by an unspecified amount of time. The timing error becomes so large as to be totally useless. If FS provided its own SIM_TIME value, this issue wouldn't exist, but FSX gives no hint as to how long between updates at all.

As it is, all my GS computations are approximately 1.4 times the FS provided value for GS, even when doing drag race style tests (acceleration/deceleration along the runway). If I could figure out why 1.4 times I might be able to see what it is doing, but it doesn't relate to any kind of unit conversion factor that I know of (e.g. it's not like I'm inadvertently computing m/s and comparing it to knots from the sim).

Best regards,
Robin.
 
Last edited:
Wow........

1 MPH = 1.46667 ft/sec

Code:
simconnect.AddToDataDefinition(DEFINITIONS.acdata, "GROUND VELOCITY", "knots", SIMCONNECT_DATATYPE.FLOAT64, 0, SimConnect.SIMCONNECT_UNUSED);

......is actually returning MPH!!! :eek:

Needless to say, the computation is now working.

It also explains why my computations are perpetually out when I fly the sim - I'm computing in knots, when the sim is actually in MPH!!!!!!!!!!

Best regards,
Robin.
 
Last edited:
@mgh: Using the Windows HPT is useless as well,...

No it isn’t. I use it in a hover application I’m (slowly) developing. I have a function GetInterval() that returns the time interval since it was called.

I use GetInterval() in my CallBack function reciept of message type SIMCONNECT_RECV_ID_SIMOBJECT_DATA and then my case REQUEST_SPEED_DATA when I know speed data has been recieved, I then update the speed data values and write them back to FSX.
 
Back
Top