GeekyDeaks / sim-to-motec

Simple scripts to convert sim telemetry to MoTeC i2 log files
37 stars 5 forks source link

Damper export AMS2 #14

Open TE0815PaVeL opened 2 weeks ago

TE0815PaVeL commented 2 weeks ago

Hey, i found out that the damper export isn´t the same as in secondmonitor. i tried different frequencies but it doesn´t work correctly. so far, which freq. is output from ams2?

GeekyDeaks commented 1 week ago

Hi! When I last investigated this, it appeared to be correlated to the frame rate. It was a while ago I looked though. There is a sequence number in the shared memory that you can use to determine the number of updates by dividing it by 2. From the header file (https://github.com/GeekyDeaks/sim-to-motec/blob/main/stm/ams2/SharedMemory.h)

// Sequence Number to help slightly with data integrity reads
volatile unsigned int mSequenceNumber;          // 0 at the start, incremented at start and end of writing, so odd when Shared Memory is being filled, even when the memory is not being touched