Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ls372 custom pid update #753

Merged
merged 4 commits into from
Sep 16, 2024
Merged

Ls372 custom pid update #753

merged 4 commits into from
Sep 16, 2024

Conversation

mjrand
Copy link
Contributor

@mjrand mjrand commented Sep 12, 2024

Fixed the slow response time the custom PID had to going under the setpoint after it was above the setpoint for a long time.

Description

Updated the I term in the custom_PID function so it could no longer go negative.
Being above the setpoint for a long time would cause the I value to become very negative.
It would take a long time for the custom_PID to overcome that large negative value so the PID would be effectively off for that time.

Motivation and Context

This issue was prominent after IV curves when the IV curves would heat the whole focal plane above the setpoint
The PID could take upwards of 30 mins to come back online after IV curves because of this.
The custom PID should respond in <5 minutes now, depending on the I value it is set to.
It is not perfect but this relatively simple solution doesn't affect normal PID operations and should improve functionality a lot.

How Has This Been Tested?

I tested this code on both satp1 and satp2.

For satp2 I simple heated the FPA and then dropped the setpoint to something very low.
The FP was above the setpoint for a few minutes while the FPA cooled. The PID then responded nearly instantly after the FPA dipped below the setpoint and turned the heater on immediately (slowly because the I value was untuned and low).

On satp1 I ran multiple IVs with the updated code. The new custom_PID function turned back on immediately after the IVs were finished and resumed a normal PID operating temperature in < 5minutes after they were done (instead of the ~30 minutes without the changes). I also ran a test scan for 15 minutes with the new custom_PID function to make sure the changes did not affect the operation. The custom_PID operated normally as intended during the scans.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Copy link
Member

@BrianJKoopman BrianJKoopman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding and testing this. I merged in #687, which had one docstring update that was missing here. Will merge shortly.

@BrianJKoopman BrianJKoopman merged commit 7bd5e80 into main Sep 16, 2024
4 checks passed
@BrianJKoopman BrianJKoopman deleted the ls372-custom-pid-update branch September 16, 2024 16:18
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.

3 participants