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

Commit

Permalink
Merge pull request #1341 from DiamondLightSource/1338_panda_improvements
Browse files Browse the repository at this point in the history
Panda improvements
  • Loading branch information
DominicOram authored Apr 30, 2024
2 parents 1eaa245 + 08a5ca8 commit ceebe9f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/hyperion/device_setup_plans/setup_panda.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ def setup_panda_for_flyscan(

table = get_seq_table(parameters, exposure_distance_mm)

LOGGER.info(f"Setting PandA sequencer values: {str(table)}")

yield from bps.abs_set(panda.seq[1].table, table, group="panda-config")

yield from bps.abs_set(
Expand All @@ -174,6 +172,10 @@ def setup_panda_for_flyscan(
# Values need to be set before blocks are enabled, so wait here
yield from bps.wait(group="panda-config", timeout=GENERAL_TIMEOUT)

LOGGER.info(f"PandA sequencer table has been set to: {str(table)}")
table_readback = yield from bps.rd(panda.seq[1].table)
LOGGER.debug(f"PandA sequencer table readback is: {str(table_readback)}")

yield from arm_panda_for_gridscan(panda)


Expand All @@ -183,6 +185,7 @@ def arm_panda_for_gridscan(panda: HDFPanda, group="arm_panda_gridscan"):
yield from bps.abs_set(panda.counter[1].enable, Enabled.ENABLED.value, group=group) # type: ignore
yield from bps.abs_set(panda.pcap.arm, PcapArm.ARMED.value, group=group) # type: ignore
yield from bps.wait(group=group, timeout=GENERAL_TIMEOUT)
LOGGER.info("PandA has been armed")


def disarm_panda_for_gridscan(panda, group="disarm_panda_gridscan") -> MsgGenerator:
Expand Down
7 changes: 7 additions & 0 deletions src/hyperion/experiment_plans/flyscan_xray_centre_plan.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import dataclasses
from time import time
from typing import TYPE_CHECKING, Any, List, Union

import bluesky.plan_stubs as bps
Expand Down Expand Up @@ -196,13 +197,19 @@ def do_fgs():
yield from bps.wait()
LOGGER.info("kicking off FGS")
yield from bps.kickoff(gridscan, wait=True)
gridscan_start_time = time()
LOGGER.info("Waiting for Zocalo device queue to have been cleared...")
yield from bps.wait(
ZOCALO_STAGE_GROUP
) # Make sure ZocaloResults queue is clear and ready to accept our new data
LOGGER.info("completing FGS")
yield from bps.complete(gridscan, wait=True)

# Remove this logging statement once metrics have been added
LOGGER.info(
f"Gridscan motion program took {round(time()-gridscan_start_time,2)} to complete"
)

yield from do_fgs()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
)

PANDA_SETUP_PATH = (
"/dls_sw/i03/software/daq_configuration/panda_configs/flyscan_base.yaml"
"/dls_sw/i03/software/daq_configuration/panda_configs/flyscan_pcap_ignore_seq.yaml"
)


Expand Down
2 changes: 1 addition & 1 deletion src/hyperion/parameters/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class DocDescriptorNames:
@dataclass(frozen=True)
class HardwareConstants:
OAV_REFRESH_DELAY = 0.3
PANDA_FGS_RUN_UP_DEFAULT = 0.16
PANDA_FGS_RUN_UP_DEFAULT = 0.17


@dataclass(frozen=True)
Expand Down

0 comments on commit ceebe9f

Please sign in to comment.