Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

1474 panda gridscan smargon speed #1498

Merged
merged 9 commits into from
Aug 7, 2024
Merged

Conversation

rtuck99
Copy link
Contributor

@rtuck99 rtuck99 commented Jul 24, 2024

Fixes #1474

Corresponding save-panda cli utility:
Link to dodal PR (if required): DiamondLightSource/dodal#702

To test:

  1. Panda gridscans can be captured
  2. tests pass

Copy link
Contributor

@olliesilvester olliesilvester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good, but the main comments:

  • I don't think we need a separate pulse block. I also think we can combine the 'wait for position and send one pulse' and 'send all other pulses' steps.

  • I know this was me originally, but I think we should try making the deadtime equal to what it says in the eiger manual, 100 ns

  • I haven't looked at the yaml file in massive detail, but we should make sure the position part of this sequencer table is ignored now, like in /dls_sw/i03/software/daq_configuration/panda_configs/flyscan_pcap_ignore_seq.yaml. This was previously causing a race condition in the panda ioc, which has apparently been fixed now, but still better to be safe.

Comment on lines 50 to 55
3. Send out the remaining x_steps - 1 triggers every time_between_steps_ms
4. Wait for physical trigger from motion script to mark change of direction
5. Wait for POSA (X2) to be less than X_START + X_STEP_SIZE * x_steps + exposure distance, then
send 1 trigger
6. Send the remaining x_steps - 1 triggers every time_between_steps_ms
7. Go back to step one.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. Send out the remaining x_steps - 1 triggers every time_between_steps_ms
4. Wait for physical trigger from motion script to mark change of direction
5. Wait for POSA (X2) to be less than X_START + X_STEP_SIZE * x_steps + exposure distance, then
send 1 trigger
6. Send the remaining x_steps - 1 triggers every time_between_steps_ms
7. Go back to step one.
3. Send out the remaining x_steps - 1 triggers every time_between_steps_ms, then stop sending triggers
4. Wait for physical trigger from motion script to mark change of direction
5. Wait for POSA (X2) to be less than X_START + X_STEP_SIZE * x_steps + exposure distance, then
send 1 trigger
6. Send the remaining x_steps - 1 triggers every time_between_steps_ms
7. Go back to step one.

src/hyperion/device_setup_plans/setup_panda.py Outdated Show resolved Hide resolved
@rtuck99 rtuck99 force-pushed the 1474_panda_gridscan_smargon_speed branch from bd58549 to 41a6bec Compare August 7, 2024 08:15
@rtuck99
Copy link
Contributor Author

rtuck99 commented Aug 7, 2024

Have simplified the sequence table but not removed the pulse generator or reduced the deadtime as discussed

@rtuck99 rtuck99 marked this pull request as ready for review August 7, 2024 10:40
Copy link
Contributor

@olliesilvester olliesilvester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is in a testable state for tomorrow! I have a few more comments, but they're mostly nits

7:Go back to step one.

1. Wait for physical trigger from motion script to mark start of scan / change of direction
2. Wait for POSA (X2) to be greater than X_START and send x_steps triggers every time_between_steps_ms
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
2. Wait for POSA (X2) to be greater than X_START and send x_steps triggers every time_between_steps_ms
2. Wait for POSA (X2) to be greater than X_START and send triggers every time_between_steps_ms, until x_steps triggers have been sent

@@ -127,7 +135,6 @@ def setup_panda_for_flyscan(

Args:
panda (HDFPanda): The PandA Ophyd device
config_yaml_path (str): Path to the yaml file containing the desired PandA PVs
parameters (PandAGridScanParams): Grid parameters
initial_x (float): Motor positions at time of PandA setup
exposure_time_s (float): Detector exposure time per trigger
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing sample_velocity_mm_per_s here

@@ -139,7 +146,14 @@ def setup_panda_for_flyscan(
Yields:
Iterator[MsgGenerator]
"""
yield from load_device(panda, config_yaml_path)
assert parameters.x_steps > 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert parameters.x_steps > 0
assert parameters.x_steps > 0, "panda grid scan must have x_steps > 0

Copy link
Contributor

@olliesilvester olliesilvester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to merge now I think, after that missing docstring is added

@rtuck99 rtuck99 merged commit 3eabba5 into main Aug 7, 2024
4 checks passed
@rtuck99 rtuck99 deleted the 1474_panda_gridscan_smargon_speed branch August 7, 2024 15:59
olliesilvester pushed a commit to olliesilvester/mx-bluesky that referenced this pull request Aug 23, 2024
* (DiamondLightSource/hyperion#1474) Configure panda sequencer table to generate trigger sequence internally rather than using
clock generator.

* Add saved new panda layout inc. screehshot.
* Update unit tests

* (DiamondLightSource/hyperion#1474) move save-panda to dodal

* (DiamondLightSource/hyperion#1474) Tidy up documentation

* Make pyright happy

* Remove redundant comment from tests

* (DiamondLightSource/hyperion#1474) load the .yaml device layout as a module resource

* Fix CI unit test failure due to bluesky event loop not running

* Simplify the sequencer table as per PR comment

* Update docstring
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PandA grid scans: Safeguard against varying smargon speed
2 participants