DiamondLightSource / mx-bluesky

Bluesky plans, plan stubs, and utilities for MX beamlines
https://diamondlightsource.github.io/mx-bluesky/
Apache License 2.0
0 stars 2 forks source link

Tell robot when to dry/soak #666

Open DominicOram opened 3 hours ago

DominicOram commented 3 hours ago

The robot needs to occasionally dry/soak so that it cleans off any ice that has built up on the gripper. This operation takes ~95s and the robot can't be used in that time. The current logic for this is that every 90 minutes the robot will internally set a flag to say "after the next load dry" and will then dry on the next load. This was good behaviour when we knew a collection would take >90s. However, when we start skipping bad samples this assumption will not be true any more. e.g. the worst case is:

  1. Robot sets internal flag to say it's time for a dry
  2. We load
  3. Robot starts drying
  4. We find the pin is too short/long (this takes ~5s)
  5. We now have to wait ~90s for the robot

To improve this we should instead trigger the dry/load on the robot once we know we're going to perform a long operation e.g. after we have done an XRC for a native collection and know that we will have diffraction. However, we will also want to make sure the robot does still do a dry/soak at some point even if we are not doing any native collections. Therefore the logic will look something like:

  1. Hyperion sets a "good opportunity for dry" PV on the robot after the first successful XRC of a native collection
  2. The robot checks if it's been 90 minutes since the last dry, if so it will do a dry
  3. If the robot doesn't see this PV being set after 120 minutes of still not drying it will just dry on the next load

Acceptance Criteria

graeme-winter commented 3 hours ago

I'll note for the record that this is a very nice problem to have

DominicOram commented 3 hours ago

I'll note for the record that this is a very nice problem to have

Yh, it's potentially a case of me getting to deep into trying to optimise but worth noting down as it shouldn't be that hard