Closed rerpha closed 2 years ago
still to do:
When we patch this over to WISH we could consider removing the homing routines for anything beyond axis 3/C as they make the pause during code checking longer. Setting them to empty quotes seems to shorten this time!
old driver fix (not sure if this works yet, still need to test) - https://github.com/ISISComputingGroup/EPICS-galil/pull/65
ORC db seems to be updating dist and vel every couple of seconds due to an RBV scan causing lots of copy processes (we could change this to CPP if the value hasn't changed?) though it doesn't seem to be causing any issues, and certainly not jolting
Hooray, it's fixed! tested on the real device today, reproduced the jolting and offsetting, then patched over the new DLLL with user var checking and it now seems to be fine after several IOC restarts
fix has been applied to galil-old but may still need to be merged from https://github.com/ISISComputingGroup/EPICS-galil/tree/check_uservar_val_change to the new driver
Looks good, thanks for the thorough documentation of the issue & investigation!
The WISH collimator is jolting and then offsetting where it oscillates which suggests either 0 is being set incorrectly or motor steps are being missed. Previously it was thought this could be caused by an incorrect home signal (and after a maintenance rotation) but we narrowed it down to a config change/ IOC restart. The actual db is ok, especially after #7025 however something lower-level is going on.
Acceptance Criteria
Extra Information
Things we tested:
userdef_records8.db
coming fromgalildb.cmd
After using our testbed Galil with a rotary dial on to simulate a collimator we found the issue after several days of narrowing down the issue.
userdef_records8.db
sets lots of user variables per axis for diagnostic/debugging purposes, but it does so all at once. I tested this by doing the same thing with a python script as follows:i got the names of these vars by adding some print statements in the Galil driver and seeing what was being set on startup. There are several
PINI
s in theuserdef_records
db file which are responsible for this. Weirdly polling these variables and usingMG _{var}
doesn't cause the same issue!This caused the jolting and then offset oscillation. Freddie's PR to disable setting these if unchanged fixes the issue as does disabling the userdef record db load. This is the fix, as it stops the setting of variables https://github.com/ISISComputingGroup/EPICS-galil/compare/check_uservar_val_change
I also tried setting the vars to 0 twice to simulate what was going on on my machine and this also caused the same behaviour - I think this is just related to var/operand sets if done too quickly. We wouldn't have seen this anywhere else as we don't have any constantly moving, position-critical axes on site.
There is also another issue where loading the controller code (or even just checking the code is unchanged) pauses the thread, which is responsible for the oscillation in this instance, even when a quiet start is requested. We don't really care too much as it's very unlikely WISH will be taking data AND changing config/restarting the IOC. After the code checking the thread happily resumes and swings the correct angle etc.
We should patch the change made in Freddie's PR over to WISH and make it permanent as it affects both the old and new Galil driver, though this may be more difficult to do in the old one if it's handled by the Galil DLL
TL,DR; setting loads of user vars on the Galil controller seems to cause a thread to have unexpected behaviour and jolt/miss motor steps.