Skip to content
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

Create a device for XPRESS3 AreaDetector #473

Closed
4 tasks
stan-dot opened this issue Apr 26, 2024 · 15 comments · Fixed by #524 or DiamondLightSource/hyperion#1434
Closed
4 tasks

Create a device for XPRESS3 AreaDetector #473

stan-dot opened this issue Apr 26, 2024 · 15 comments · Fixed by #524 or DiamondLightSource/hyperion#1434
Assignees
Labels
enhancement New feature or request python Pull requests that update Python code

Comments

@stan-dot
Copy link
Contributor

stan-dot commented Apr 26, 2024

For SWIFT / i20-1 beamline for the initial tests with bluesky and blueapi.

Acceptance Criteria

  • Have the device runnable with plans from its directory

Steps

@stan-dot stan-dot added enhancement New feature or request python Pull requests that update Python code labels Apr 26, 2024
@DominicOram
Copy link
Contributor

There is already an xpress3 mini, which has a very similar interface, in https://github.com/DiamondLightSource/dodal/tree/main/src/dodal/devices/xspress3_mini. Could we replace what's there with an ophyd_async one?

@stan-dot
Copy link
Contributor Author

looked into it, sounds very feasible

@Relm-Arrowny
Copy link
Contributor

Relm-Arrowny commented Apr 29, 2024

As far as we can tell xspress3 has more channels and that is about it. For book keeping mini and standard datasheet can be find here:
Mini
xspress3

@Relm-Arrowny
Copy link
Contributor

I had a quick stab at making xpress3 mini, there are two, three things I am not sure about and need to get back to it:

  1. what is ArmingSignal(Signal) for?
  2. what is the best way to replace arm_status.wait inside arm and self.arm in stage as AsyncStatus does not have wait like Status:
  def arm(self) -> Status:
        LOGGER.info("Arming Xspress3Mini detector...")
        self.trigger_mode_mini.put(TriggerMode.BURST.value)
        arm_status = await_value_in_list(self.detector_state, self.detector_busy_states)
        self.erase.put(EraseState.ERASE.value)
        arm_status &= self.acquire.set(AcquireState.ACQUIRE.value)
        arm_status.wait(self.ARM_STATUS_WAIT)
        return await_value(self.acquire, 0)
  1. I also could not locate the ERASE signal in express3 epic pv so I am not sure what it does, I am guessing it clear the busy state?
  2. Is there some example plan where it is use? I am quite confuse with the arm_status as it wait for the busy status for the detector.

Current state will probably work but it does not wait correctly.

@DominicOram
Copy link
Contributor

DominicOram commented May 10, 2024

  1. what is ArmingSignal(Signal) for?

Arming the detector takes time therefore we would like to do it asynchronously in the plan. At the time of writing the previous code you could not run stage asynchronously so the workaround was create a signal you could set to high then wait on that set to finish. I believe you could now just replace all of the arm with stage and remove the ArmingSignal.

  1. what is the best way to replace arm_status.wait inside arm and self.arm in stage as AsyncStatus does not have wait like Status:

Basically in ophyd_async anywhere you see a signal.wait you can replace it with an await so:

        arm_status &= self.acquire.set(AcquireState.ACQUIRE.value)
        arm_status.wait(self.ARM_STATUS_WAIT)

just becomes:

await self.acquire.put(AcquireState.ACQUIRE.value)
  1. I also could not locate the ERASE signal in express3 epic pv so I am not sure what it does, I am guessing it clear the busy state?

I think the PV exists for xspress3 too:

$ caget BL20I-EA-DET-06:ERASE
BL20I-EA-DET-06:ERASE          

I'm not 100% sure what it does, the reason we set it is probably because we just copied what GDA does when arming, we should understand it and document it though. Best to talk to more spectroscopy people or maybe controls? @iain-hall?

  1. Is there some example plan where it is use? I am quite confuse with the arm_status as it wait for the busy status for the detector.

Yep, see https://github.com/DiamondLightSource/hyperion/blob/main/src/hyperion/experiment_plans/optimise_attenuation_plan.py

Current state will probably work but it does not wait correctly.

Great, do you have a branch?

@Relm-Arrowny
Copy link
Contributor

Great, do you have a branch?
yes, https://github.com/DiamondLightSource/dodal/tree/473-create-a-device-for-xpress3-areadetector

@stan-dot
Copy link
Contributor Author

Pls make a draft PR

@stan-dot
Copy link
Contributor Author

we need more details on how is xpress3 used at i20-1

@Relm-Arrowny
Copy link
Contributor

This is currently at the point where it can replace express and express mini with only signal and triggering functionally, we need to bring interested party to find out how express will be use.
The other issue is we have no hardware to test and I kind of know I10 is getting one in the next few months. So this is currently on ice.

@DominicOram
Copy link
Contributor

The other issue is we have no hardware to test and I kind of know I10 is getting one in the next few months. So this is currently on ice.

What exactly would you like to test? I can find some testing time on i03 probably

@stan-dot
Copy link
Contributor Author

@Relm-Arrowny we could add another issue for i10 to do later and merge this just for the devices that are out there now, like i03

@Relm-Arrowny
Copy link
Contributor

I think the bottle neck for this is probably gathering use case for the extra functionally.

The other issue is we have no hardware to test and I kind of know I10 is getting one in the next few months. So this is currently on ice.

What exactly would you like to test? I can find some testing time on i03 probably

As for test, for now the only untested part is the triggering, I was more thinking if this is not needed now, I can have an express3 that I can play with extensively in a few month time.

@Relm-Arrowny
Copy link
Contributor

@Relm-Arrowny we could add another issue for i10 to do later and merge this just for the devices that are out there now, like i03

That is possible, but it wouldn't really add anything to the exiting xpress mini other than changing it to ophyd-aysnc.

@DominicOram
Copy link
Contributor

That is possible, but it wouldn't really add anything to the exiting xpress mini other than changing it to ophyd-aysnc.

This is valuable in itself. I would suggest we get your PR merged with the goal just being to ensure behaviour is the same and then we can look at wider usecases later.

As for test, for now the only untested part is the triggering, I was more thinking if this is not needed now, I can have an express3 that I can play with extensively in a few month time.

Ok, once your PR is merged I can test on i03 that it still all works as before, would you like to come down for the test?

@Relm-Arrowny
Copy link
Contributor

That is possible, but it wouldn't really add anything to the exiting xpress mini other than changing it to ophyd-aysnc.

This is valuable in itself. I would suggest we get your PR merged with the goal just being to ensure behaviour is the same and then we can look at wider usecases later.

As for test, for now the only untested part is the triggering, I was more thinking if this is not needed now, I can have an express3 that I can play with extensively in a few month time.

Ok, once your PR is merged I can test on i03 that it still all works as before, would you like to come down for the test?

Okie, let me clean up the draft PR. I would love to see the test if it is convenient, if nothing else I would like to see how it done and may be ask some question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python Pull requests that update Python code
Projects
Archived in project
3 participants