-
Notifications
You must be signed in to change notification settings - Fork 2
LARMOR: Bench limits drift #2184
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
Comments
Rob first noticed the problem on Monday (13th March) and again on Tuesday (14th). Is there anything in the logs on these days that might point to the problem? |
Do you know which Galil the problem is on? |
Rotating bench is |
There a number of messages of the form
But that might be the Galil just ignoring a request to move beyond its limit switch. I don't see any smoking guns, but I'm not so familiar with what constitutes 'normal' Galil output. |
The above message seems pretty common throughout the logs so is unlikely to be the culprit. |
Autosave files indicate only the high limit (MOT:MTR0401.DHLM) has been changed since 6th March so I don't see any problems there. |
This may need someone to go down to Larmor to examine the problem in person. |
As mentioned by @GDH-ISIS, Rob has been known to change globals.txt which may make the problem the same as #2180, though the problem should only arise if the Galil macros were removed, not just because the file was changed. We should take a closer look at the workflow that led to the problem. We could also run a local simulation of Larmor's setup to see if the issue can be reproduced with simulated motors. |
In relation to limits not being applied correctly, I do not believe the limits for a Galil motor are the problem. The issue is more refined - the Galil does not know where the motor is. I have confirmed this on ALF using LabVIEW as a diagnostic. If an encoder is defined and operational, the motor must be told where it is before the move is actioned. This is already done in the LabVIEW driver. This issue is amplified much more when an offset is present on an axis, particularly with an absolute encoder (as on IMAT and ZOOM). |
Bring this forward into Sprint 2017_03_09. |
Had a chat with Rob, he has been adjusting offsets to compensate for drift. The formula used for homeval means it is specified in user rather than dial coordinates, however if the direction used in the calculation does not match that used in the motor record you could get offset applied twice etc. (to test: do HOMER and HOMEF give different results?) |
Ok, dirm should be synced to the value used in the motor record, it is done so via a separate closed_loop DB record |
Galil 5 homing over time, I note for example GALIL_05-20161216.log:[2016-12-16 11:48:12] sevr=info Poll services: applying motor G raw home position -762000 So a difference of 4000 motor / 1000 encoder - homeval has remained unchanged according to autosave, the offset has changed from 8.5 in December to 9.5 in march which correlates with the 1000 |
Not sure on the calculation here - I can not quite make sense of it. Clearly I could be wrong of course, but at the risk of making myself look a fool ....
|
The homeval looks to be applied in user coordinates, userVAL = raw * res * DIR + OFFset with userVal being the homeval. If DIR is not the same in when the IOC defines position and when the motor record back calculates it, then I think you'd get a shift of twice the homeval in the readback? If homeval is zero it looks like this is treated as a special case, Rob has axes with both zero and non-zero homevals, he said he though all axes were drifting, but maybe that is not the case. I believe DIR is being propogated correctly though. |
Currently homing with a homeval != 0 will re-assert the homeval in user coordinates, so if homeval is 10 and Rob decides to apply an offset of .1 to make the readback 10.1, then next time he homes it will go back to 10 and he'll need to increase the offset to 0.2 to get the previous 10.1 He said he was currently setting the offset back to 0 before he homed, which would be consistent with working around this behaviour. If homeval is zero the Galil driver ignores the offset when doing DP/DE, so the user offset is then what you want the home position to look like in user space. Maybe using a direct offset approach is a better way to do home positions than using homeval? Or to make homeval in dial coordinates (i.e. minus any offset) so a user can apply an additional offset, though is this confusing that homeval isn't homeval? homeval will be 0.0 if unspecified, so i can see the reasoning for ignoring the offset in that case in the galil driver, |
Rob has confirmed this series of eventsHi Rob, Would this describe your situation: Home bench – it stops at a position of 30.0 say. The axes can have a “home value” (the 30.0) associated with them, it seems this is applied in user rather than dial coordinates and so will include/absorb any offset. However if the “home value” is 0 (unset) it is applied in raw/dial coordinates and so the offset is preserved and in fact the offset becomes the user readback at the home position Regards, Freddie |
The behaviour has now be confirmed on Demo. Use the dummy homing routines;
Alternate behaviour:
It is not clear what the correct behaviour is here. Should the home val be the value when a home is done or should it be offset (which is an EPICS thing). (NB a homeval of 0 indicates that it has never been set hence why this logic is implemented) The options for resolving this ticket are:
Discussion with users need to take place to verify what behaviour is needed. |
Impeded while @FreddieAkeroyd discusses with Galil author. NB this is not affected by update to Galil drivers. |
Having exchanged a few emails with Mark Clift (Galil driver author), we are coming to the conclusion that dial coordinates for HOMEVAL is the best approach. This does mean that if an OFF is set then the readback at the home position will be "HOMEVAL + OFF" rather than "HOMEVAL", but it does avoid the situation we currently have of an OFF being gobbled up by the homeval logic and so creating a perceived "drift". Are we happy with this? |
OK final decision is to set HOMEVAL=0 for all cases and use the offset to mange differences between dial and user coordinates.
|
This is consistent with HOMEVAL being in DIAL coordinates and a HOMEVAL of 0 currently has this behaviour with the existing driver |
see #2471 is this now done? |
I think homeval=0 solves the problem, moving to review |
We got this email from Rob:
Having investigated, it doesn't seem related to #2180. I note that in the GALIL_07 logs there is the message:
I wonder if the homing is causing the drift, though can offer no explanation as to why this might be occurring now and not previously.
@kjwoodsISIS has asked for more information from Rob about the context under which this problem occurred.
The text was updated successfully, but these errors were encountered: