ISISComputingGroup / ISISComputingGroup/IBEX
IPS: improve SNL logic
- Dominant language
- No language data
- Stars
- 6
- Forks
- 2
- Avg merge
- 16h 40m
- Merged PRs (30d)
- 2
Description
The `cryomagnet.st` SNL for the IPS has two instances of `epicsThreadSleep(heater_delay_time);` which is a long delay and discourgaed. Ideally this should be replaced by a new intermediate state and the `delay` function.
Using a direct `delay` in the same `when` would not currently work as heater_delay_time > 30, so either a new state would be needed or the other `when` needs to be changed to always be > heater_delay_time.
Also the current logic
```
when(heater == 0 || heater == 2)
{
epicsThreadSleep(heater_delay_time);
…
}
```
doesn’t check that `(heater == 0 || heater == 2)` is still the case after the sleep.
After checking with @Tom-Willemsen
There must be at least $(heater_wait_time) (currently 60s requested by cryogenics) between the heater turning on and the new setpoint being sent. If this wait doesn't happen the magnet may quench as the switch will not have properly warmed/cooled by the time we set the setpoint.
Any new states need also to be recorded at https://github.com/ISISComputingGroup/EPICS-ioc/blame/master/IPS/IPS-IOC-01App/Db/ips.db#L821 Suggested names might be "turn heater on" and then "wait for heater on" and likewise for the heater off sequence. These will also need updating in the tests probably.
The IPS hardware rejects a new setpoint if the heater isn't on so there isn't currently an issue that we would hit with the hardware, however in the spirit of defensive programming it might be better to also double check in software, that way we can log that the heater switched off unexpectedly which could be useful for diagnostics. Also it might be useful to check for and log an alarm on the heater status readback (and assume it's not set correctly if there is an alarm).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.