Skip to content

Ticket 5220 #70

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Ticket 5220 #70

wants to merge 2 commits into from

Conversation

Tom-Willemsen
Copy link
Member

@Tom-Willemsen Tom-Willemsen commented Jun 17, 2025

ISISComputingGroup/IBEX#5220

This currently causes a lot of failures - I then propose to run the following script on each instrument to correct the failures:

import aioca
import asyncio
import os

prefix = os.environ["MYPVPREFIX"]


async def change_enc_sync_tol(controller, motor):
    pv = f"{prefix}MOT:MTR{controller:02d}{motor:02d}"

    iocname, eres, mres, ueip, enc_sync_tol = await aioca.caget([
        f"{pv}_IOCNAME",
        f"{pv}.ERES",
        f"{pv}.MRES",
        f"{pv}.UEIP",
        f"{pv}_MOT_ENC_SYNC_TOL_SP",
    ], throw=False)

    if isinstance(iocname, str) and iocname.startswith("GALIL") and ueip and enc_sync_tol == 0:
        value = max(eres, mres)
        if value != 0.0:
            print(f"Changing {pv}_MOT_ENC_SYNC_TOL_SP from {enc_sync_tol} to {value}")
            await aioca.caput(f"{pv}_MOT_ENC_SYNC_TOL_SP", value)
        else:
            print(f"Problem: max(ERES, MRES) is zero on closed-loop axis {pv}")


async def change_all_motors_on_controller(controller):
    await asyncio.gather(*[change_enc_sync_tol(controller, motor) for motor in range(1, 8+1)])


async def change_all_controllers():
    await asyncio.gather(*[change_all_motors_on_controller(controller) for controller in range(1, 16+1)])


if __name__ == "__main__":
    asyncio.run(change_all_controllers())

@FreddieAkeroyd
Copy link
Member

Maybe set to max(eres,mres) ? Though it would not cause a problem just eres, i was wondering if eres < mres then you may get a resync message printed every time you do a move giving a false indication of a problem.

@FreddieAkeroyd
Copy link
Member

The check only catches GALIL with IOC currently running, if we keep an eye on it probably good enough to catch all eventually. An alternative would be to check autosave files on the instrument disks.

@Tom-Willemsen
Copy link
Member Author

  • Script above updated to use max(eres, mres).
  • Yes it only catches running IOCs, there's not a neat way for configchecker to check autosave files currently as they're not pushed to e.g. git. My feeling was that this was sufficient as the check runs daily, but if you feel checking autosaves is better can investigate doing e.g. checking over SSH.

@FreddieAkeroyd
Copy link
Member

All looks good to me. Just the question of if we roll it out everywhere now, or just to the ones that historically have issues (SANS, REFLECTOMETRY, possibly ENGINEERING) and we monitor how it goes.

A useful addition if we don't roll out everywhere now might be to look at drift and warn if over a certain amount, though as noted in ISISComputingGroup/IBEX#8759 we'd currently need to ignore servos as the drift value is misleading there at the moment.

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.

2 participants