Skip to content

Fixed output saturation and trigger-related bugs - #82

Open
hanklong99 wants to merge 1 commit into
mainfrom
boxcar_full_rate
Open

Fixed output saturation and trigger-related bugs#82
hanklong99 wants to merge 1 commit into
mainfrom
boxcar_full_rate

Conversation

@hanklong99

Copy link
Copy Markdown
Contributor
  1. Reset the accumulator after the completion of the current frame.
  2. Updated the boxcar counter logic to prevent false triggering when no trigger events are present.
  3. Fixed a minor output bug.

1. Reset the accumulator after the completion of the current frame.
2. Updated the boxcar counter logic to prevent false triggering when no trigger events are present.
3. Fixed a minor output bug.
@hanklong99

Copy link
Copy Markdown
Contributor Author

The primary issue was that the output could saturate rapidly because the accumulator was not being reset after the completion of the current frame. This issue can be reproduced by setting Control3 to a value greater than 2, applying a DC signal to InA, and setting Control5 to 1.

A second issue was that the boxcar could still be triggered after a boxcar reset and before the first valid trigger was received. Although this behavior was not particularly problematic, as it disappeared once valid triggers were present, it has now been corrected by modifying the counter reset logic.

In addition, OutB is now explicitly reset to zero before being updated with new data. This prevents residual values from previous events from being retained in the output, ensuring that OutB no longer exhibits memory effects from earlier acquisitions.

@paulc-li paulc-li assigned jobintv95 and unassigned indira500 Jul 17, 2026
@jobintv95

jobintv95 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@hanklong99 Thanks for updating the scripts.

  1. I was able to test and verify that the accumulator resets after the correct number of pulses in.
  2. Not sure how to test the Reset behavior for first valid trigger. Can you provide a way to verify this?
  3. The OutB zeros code checks out and is 0 whenever the reset is pressed.

@hanklong99

Copy link
Copy Markdown
Contributor Author

Thanks @jobintv95

For the 2nd point, disable all signals entering the Boxcar Averager, including both the trigger and pulse signals. Set all control registers to 0, except for Control2, which should be set to 2 or any value greater than 0. The Boxcar Averager OutputB signal should then show the erroneous gate signals.

@jobintv95

jobintv95 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@hanklong99 yep that checks out.
All the bugs in this PR have been verified and resolved in the new version.
@paulc-li This is ready to merge. I don't have merge capabilities 😓

@jobintv95 jobintv95 assigned paulc-li and unassigned jobintv95 Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants