From a939cfcd21ec47cab6ac9bdecaac8ca196fa8023 Mon Sep 17 00:00:00 2001 From: i-jey Date: Fri, 7 Mar 2025 15:48:37 -0800 Subject: [PATCH 1/3] Double the fast flow pneumatic module step size just so we can get up to speed faster. Set it back to normal once fast flow is done. --- ulc_mm_package/hardware/scope_routines.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ulc_mm_package/hardware/scope_routines.py b/ulc_mm_package/hardware/scope_routines.py index 1a821768b..01a6b6891 100644 --- a/ulc_mm_package/hardware/scope_routines.py +++ b/ulc_mm_package/hardware/scope_routines.py @@ -247,6 +247,7 @@ def flow_control_routine( flow_controller.set_alpha( processing_constants.FLOW_CONTROL_EWMA_ALPHA * 2 ) # Double the alpha, ~halve the half life + flow_controller.pneumatic_module.min_step_size *= 2 while True: img, timestamp = yield flow_val, syringe_can_move @@ -269,6 +270,7 @@ def flow_control_routine( if fast_flow: if flow_error is not None: if flow_error == 0: + flow_controller.pneumatic_module.min_step_size /= 2 return flow_val @init_generator From b2fa3e38abeebf7ab4631234e302ba5aadeea79d Mon Sep 17 00:00:00 2001 From: i-jey Date: Fri, 7 Mar 2025 15:49:14 -0800 Subject: [PATCH 2/3] fmt --- ulc_mm_package/neural_nets/neural_network_constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ulc_mm_package/neural_nets/neural_network_constants.py b/ulc_mm_package/neural_nets/neural_network_constants.py index 9c4e5bf6e..9f8c4f8ac 100644 --- a/ulc_mm_package/neural_nets/neural_network_constants.py +++ b/ulc_mm_package/neural_nets/neural_network_constants.py @@ -7,7 +7,7 @@ # ================ Autofocus constants ================ # -AF_PERIOD_S = 0.1 # (10 imgs/sec) +AF_PERIOD_S = 0.1 # (10 imgs/sec) AF_PERIOD_NUM = int( AF_PERIOD_S * ACQUISITION_FPS ) # Used for periodic (ie. EWMA) autofocus From 6ceaccaacda33a509c34a41731c88c360b0393ff Mon Sep 17 00:00:00 2001 From: i-jey Date: Fri, 7 Mar 2025 16:13:12 -0800 Subject: [PATCH 3/3] Add in a small check to CellFinder to ensure the motor is not in motion prior to starting --- ulc_mm_package/hardware/scope_routines.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ulc_mm_package/hardware/scope_routines.py b/ulc_mm_package/hardware/scope_routines.py index 01a6b6891..ccd9b98de 100644 --- a/ulc_mm_package/hardware/scope_routines.py +++ b/ulc_mm_package/hardware/scope_routines.py @@ -499,6 +499,11 @@ def find_cells_routine( except NoCellsFound: cell_finder.reset() + # Defensive check, ensure the motor isn't moving (say for example, + # if CellFinder was triggered by an OOF exception and SSAF just triggered a motor move) + while mscope.motor.is_locked(): + pass + while True: """ 1. Pull syringe for pull_time seconds (unless deliberately skipped)