Severson-Group / AMDC-Firmware

Embedded system code (C and Verilog) which runs the AMDC Hardware
http://docs.amdc.dev/firmware
BSD 3-Clause "New" or "Revised" License
33 stars 6 forks source link

Validate that the `v1.3` codebase still correctly logs data for non-integer sampling rates #404

Closed npetersen2 closed 4 months ago

npetersen2 commented 5 months ago

Per this discussion: https://github.com/Severson-Group/AMDC-Firmware/pull/401#discussion_r1648072962

The new v1.3 codebase easily allows non-integer sampling rates for the control task. We have updated the scheduler to handle this by keeping track of time using double type variables. This seems to be working well.

However, the logging system still uses uint32_t types to keep track of time. I have a feeling this will lead to logging issues for some configurations of system sample rates.

Before we release v1.3, we need to make a comprehensive test suite to verify that logging actually works for different settings. For example, set up a sinusoid at 1/10 the control rate in the code, then log it and check the output data still looks as it should. Do this for a range of sample rate settings and log settings.

codecubepi commented 4 months ago

Hey @npetersen2 and @codecubepi of the future!

For the v2 codebase, to avoid weird time checks in the logging system, the v2 logging system will not support logging at a given frequency, only a ratio of the samples (every sample, every other, every third, etc) much like how the timing manager runs the scheduler at a ratio of the PWM carrier.

codecubepi commented 4 months ago

Closing with merge of #408