TheDeanLab / navigate

navigate - open source light-sheet microscope controls
https://thedeanlab.github.io/navigate/
Other
32 stars 7 forks source link

fix MP285 #1006

Closed annie-xd-wang closed 1 month ago

AdvancedImagingUTSW commented 1 month ago

@samcal06 - your job is to try to test out the MP285 on CT-ASLM-V2 tomorrow. See if you can cause a bug to show up. If so, report back here tomorrow with the results, terminal output, and log files. We can discuss more tomorrow.

samcal06 commented 1 month ago

@annie-xd-wang - Just checked and it did not throw any errors on the terminal as well as on the logs. Went through all the debug, error, and info logs and nothing there. However, when on Continuous Scan, when using the Stage Control on the computer, it doesn't move the desired distance and it does move desired distance when Continuous Scan is off. For example, when acquiring Continuous Scan, if I wanted to move 500um, it moves <400um. Sometimes between 50-100um at a time when I want to move 500um. Just depends if clicking Stop between movements. Sometimes hitting Stop multiple times helps reset it and goes back to desired distance.

AdvancedImagingUTSW commented 1 month ago

Just to follow up. The distance the stage travels when in the continuous mode is variable. Sometimes it hits the target, sometimes it doesn't. It seems to be interrupted by the frame capture.

The widget displays the desired step size in the continuous mode. However, when you hit the stop button, and navigate requests the stage position from the controller, it is updated and often shown to be the wrong position. This is pretty evident when you have a sample on the microscope too. Sometimes it moves a large distance, other times it moves a short distance.

When the microscope is not actively acquiring, the stage moves the desired step size every time.

AdvancedImagingUTSW commented 1 month ago

(base) C:\Users\Kevin>conda activate navigate

(navigate) C:\Users\Kevin>navigate
2024-10-02 16:34:23,143 - model - ERROR - MP285: Haven't received any responses from MP285! Please check the stage device!
2024-10-02 16:34:23,143 - model - ERROR - MP285: MP285 unreceived bytes: 1
2024-10-02 16:34:23,534 - model - ERROR - MP285: Haven't received any responses from MP285! Please check the stage device!
2024-10-02 16:34:23,534 - model - ERROR - MP285: MP285 unreceived bytes: 2
2024-10-02 16:34:23,940 - model - ERROR - MP285: Haven't received any responses from MP285! Please check the stage device!
2024-10-02 16:34:23,940 - model - ERROR - MP285: MP285 unreceived bytes: 15
Exception in thread live Data:
Traceback (most recent call last):
  File "C:\Users\Kevin\.conda\envs\navigate\lib\threading.py", line 980, in _bootstrap_inner
    self.run()
  File "C:\Users\Kevin\.conda\envs\navigate\lib\threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\Kevin\Documents\GitHub\navigate\src\navigate\model\model.py", line 953, in run_data_process
    self.end_acquisition()  # Need this to turn off the lasers/close the shutters
  File "C:\Users\Kevin\Documents\GitHub\navigate\src\navigate\model\model.py", line 859, in end_acquisition
    self.active_microscope.end_acquisition()
  File "C:\Users\Kevin\Documents\GitHub\navigate\src\navigate\model\microscope.py", line 477, in end_acquisition
    self.move_stage({"f_abs": self.central_focus})
  File "C:\Users\Kevin\Documents\GitHub\navigate\src\navigate\model\microscope.py", line 777, in move_stage
    return self.stages[axis].move_axis_absolute(
  File "C:\Users\Kevin\Documents\GitHub\navigate\src\navigate\model\devices\stages\sutter.py", line 218, in move_axis_absolute
    return self.move_absolute(move_dictionary, wait_until_done)
  File "C:\Users\Kevin\Documents\GitHub\navigate\src\navigate\model\devices\stages\sutter.py", line 249, in move_absolute
    getattr(self, f"stage_{self.axes_mapping[axis]}_pos")
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'
Exception in thread live Data:
Traceback (most recent call last):
  File "C:\Users\Kevin\.conda\envs\navigate\lib\threading.py", line 980, in _bootstrap_inner
    self.run()
  File "C:\Users\Kevin\.conda\envs\navigate\lib\threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\Kevin\Documents\GitHub\navigate\src\navigate\model\model.py", line 953, in run_data_process
    self.end_acquisition()  # Need this to turn off the lasers/close the shutters
  File "C:\Users\Kevin\Documents\GitHub\navigate\src\navigate\model\model.py", line 859, in end_acquisition
    self.active_microscope.end_acquisition()
  File "C:\Users\Kevin\Documents\GitHub\navigate\src\navigate\model\microscope.py", line 477, in end_acquisition
    self.move_stage({"f_abs": self.central_focus})
  File "C:\Users\Kevin\Documents\GitHub\navigate\src\navigate\model\microscope.py", line 777, in move_stage
    return self.stages[axis].move_axis_absolute(
  File "C:\Users\Kevin\Documents\GitHub\navigate\src\navigate\model\devices\stages\sutter.py", line 218, in move_axis_absolute
    return self.move_absolute(move_dictionary, wait_until_done)
  File "C:\Users\Kevin\Documents\GitHub\navigate\src\navigate\model\devices\stages\sutter.py", line 249, in move_absolute
    getattr(self, f"stage_{self.axes_mapping[axis]}_pos")
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'