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

PandA grid scans: Safeguard against varying smargon speed #1474

Closed
olliesilvester opened this issue Jul 5, 2024 · 3 comments · Fixed by #1498
Closed

PandA grid scans: Safeguard against varying smargon speed #1474

olliesilvester opened this issue Jul 5, 2024 · 3 comments · Fixed by #1498
Assignees

Comments

@olliesilvester
Copy link
Contributor

olliesilvester commented Jul 5, 2024

Our current panda setup is meant to do the following:

  1. At the start of a row, wait for a GPIO signal from the motion controller
  2. After encoder counts go above a position, enable a PULSE block which sends perioidic triggers (period = deadtime+exposure time)
  3. After encoder counts goes above another postiion, disable this PULSE block so no more triggers are sent
  4. Other stuff not relevant to this issue

This assumes that the PandA is going at exactly the right speed by the time we get to bullet point 2. If we are going too quickly or too slowly, the number of triggers received may be off by a tiny amount. The last time we tested the panda, we saw an occasional missing trigger. We concluded that this was either down to what has just been described, or due to lost encoder counts due to accelerating the smargon too quickly.

We should instead do the following:

  • When Hyperion sets up the PandA, calculate how many triggers are expected and send it over to the panda
  • The PandA should wait for the GPIO signal, then wait for encoder counts to go above an initial value, and then periodically send out triggers until the expected number of triggers have been sent. This can all be done on the sequencer table, we don't need to use the CLOCK or PULSE blocks
  • Other stuff not relevant to this issue

This will rule out missing triggers from the smargon going at the slight wrong speed. If the speed is wrong, we will still get the triggers, but they will be in a weird place (and this will be obvious from data collection). When PVT scans are working, it will setup the panda in a similar way, but it will be nice to do it here first so we can compare the times of panda scans using the motion controller and using the ophyd-async flyscan

Acceptance Criteria

Do the above, and update documentation https://github.com/DiamondLightSource/hyperion/wiki/PandA-constant%E2%80%90motion-scanning

@olliesilvester olliesilvester changed the title PandA grid scans: Get the SEQ table to handle repeats and PULSE width PandA grid scans: Safeguard against varying smargon speed Jul 5, 2024
@dperl-dls
Copy link
Collaborator

dperl-dls commented Jul 15, 2024

  • need position capture to get statistics about the solution here (separate ticket)

@olliesilvester says this is medium (the rest of us think large)

@olliesilvester and @DominicOram are banned from doing this ticket so other people can get some panda experience

@olliesilvester
Copy link
Contributor Author

See #1485 for the PCAP part

@rtuck99 rtuck99 self-assigned this Jul 18, 2024
rtuck99 added a commit that referenced this issue Jul 22, 2024
…internally rather than using

clock generator.

* Add saved new panda layout inc. screehshot.
* Update unit tests
rtuck99 added a commit to DiamondLightSource/dodal that referenced this issue Jul 23, 2024
rtuck99 added a commit to DiamondLightSource/dodal that referenced this issue Jul 23, 2024
rtuck99 added a commit that referenced this issue Jul 24, 2024
rtuck99 added a commit that referenced this issue Jul 24, 2024
@DominicOram
Copy link
Collaborator

Waiting on testing time on the beamline - better to do with beam

rtuck99 added a commit to DiamondLightSource/dodal that referenced this issue Aug 6, 2024
rtuck99 added a commit to DiamondLightSource/dodal that referenced this issue Aug 6, 2024
rtuck99 added a commit that referenced this issue Aug 7, 2024
…internally rather than using

clock generator.

* Add saved new panda layout inc. screehshot.
* Update unit tests
rtuck99 added a commit that referenced this issue Aug 7, 2024
rtuck99 added a commit that referenced this issue Aug 7, 2024
rtuck99 added a commit to DiamondLightSource/dodal that referenced this issue Aug 7, 2024
* (DiamondLightSource/hyperion#1474) Add cli tool to save pandas

* (DiamondLightSource/hyperion#1474) fixes to save_panda script

* Add unit test for saving the panda

* Make pyright happy

* Changes to make command more specific to pandas

* Add additional unit test coverage of argument parsing, force option

* Fix CI test failure due to polluting the environment

* Construct only the necessary devices when saving the panda

* Additional code coverage
rtuck99 added a commit that referenced this issue Aug 7, 2024
* (#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

* (#1474) move save-panda to dodal

* (#1474) Tidy up documentation

* Make pyright happy

* Remove redundant comment from tests

* (#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
olliesilvester pushed a commit to olliesilvester/mx-bluesky that referenced this issue 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
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants