foxsi / foxsi-4matter

Code for FOXSI-4 telemetry formatter.
https://foxsi.umn.edu/
1 stars 3 forks source link

Fix repeat readout of last DE frame; configure downlink MTU by `systems.json` #69

Closed thanasipantazides closed 3 days ago

thanasipantazides commented 2 weeks ago

Changes included

This PR changes two things:

  1. Fixes issue #68, part 1. The Formatter should no longer repeatedly read the last saved CdTe frame. The fix is described in issue #68 and in the v1.2.0 release notes.
  2. The maximum downlink packet size (related to Ethernet MTU) is now adapted based on values set in foxsi4-commands/systems.json, rather than being hard-coded at 2000 B. This should not actually change functionality over v1.2.0 until the downlink frame size is modified in the configuration file.

Issues

There are not known issues at this point, but these changes must be validated on the flight system.

thanasipantazides commented 4 days ago

I tested this PR today with a single CdTe detector, DE, and formatter. Things seemed to display normally in the GSE. I didn't try modifying MTU yet, but since the logger seems to be working I expect the MTU-related changes to the formatter have not introduced errors.

I get much smaller cdte_pc.log files for running the same amount of time in sparse mode after this change. I think this is a good sign; it may indicate we are not reading out old data over and over.

thanasipantazides commented 3 days ago

After that test I also tried modifying packet size limit (via systems.json's gse.ethernet_interface.max_payload_bytes) on both the Formatter and GSE. Everything still displayed normally (as far as I could tell) in the GSE. I had reduced max payload size to 1400 bytes, and saw significant improvement in data rate.

Here's a plot before the change, with packet size limit of 2000: mtu2000

Here's a plot after the change, with packet size limit of 1400: mtu1400

If you look after 200 s in either plot, photon counting data transfer has started.

thanasipantazides commented 3 days ago

Kris kindly produced these two plots of TI (detector local timestamp) versus detector event number. The first is before applying this PR (using the v1.2.0 code). You can see repeated readout of the last frame available, giving TI a sawtooth shape: cdte3_pc_v120

The next plot uses the code from this PR. You can see monotonic TI instead of sawtooth, which indicates the formatter does not repeatedly read the last available frame. cdte3_pc_v121_mtu1400

Also, the second plot used packet sizes of 1400 B for downlink.