simonsobs / socs

Simons Observatory specific OCS agents.
BSD 2-Clause "Simplified" License
12 stars 12 forks source link

hwp-pmx: reset protection code in clear_alarm #641

Closed ykyohei closed 6 months ago

ykyohei commented 6 months ago

Description

Minor debug of hwp-pmx. We need to reset the protection code (self.prot) in clear_alarm task. This was implemented in the previous version of agent (following link), but I forgot to include this self.prot reset when we refactored the hwp-pmx agent to be TimoutLock less.

https://github.com/simonsobs/socs/blob/288fb5c2cac25d554bcfa161e6fb455b7eee1fd5/socs/agents/hwp_pmx/agent.py#L129

Types of changes

Checklist:

jlashner commented 6 months ago

Seems like this could also be done by allowing prot to be set back to 0 in the acq function: https://github.com/simonsobs/socs/blob/288fb5c2cac25d554bcfa161e6fb455b7eee1fd5/socs/agents/hwp_pmx/agent.py#L297-L298

Is there a reason we don't do that? It's generally preferable to read from hardware when possible instead of setting value directly in the agent.

ykyohei commented 6 months ago

Agree that it's generally preferable to read from hardware. But this is intentional.

When the pmx protection is triggered, pmx outputs protection code only once, you will get 0 from the second queries. However, pmx remains in protected state. If you run clear_alarm, pmx will go back to the normal state. If there is still problem, pmx will output protection code again, but only once.

For this reason, we made the agent to have self.prot for monitoring purposes.