Reference PI C-863 from micro-manager

I’m using three PI M11x.1DG1 stages with C-863 Controller via COM ports from micro-manager.

It seems that every time I shut down the control PC (often, since the camera requires to be started before the PC), the stages need to be re-referenced before they’re recognized by micro-manager.

My current workflow is to start PC, open micro-manager, see if it connects to the camera (it’s picky), if not restart camera and PC.
If yes, close micro-manager, open PIMikromove, start up stages (one by one).
Close PIMikromove, open micro-manager.

I tried to reference the stages from within micromanager by following the instructions here:

but only get it to work for xy via the axes list. Homing for z by creating a group / preset doesn’t seem to work (it’s not doing anything).

Further, depending on how the stages were referenced, the absolute positions displayed in micro-manager differ (because the “zero” position changes?). This is also described here, albeit without solution:

What is the “best” way to reference all three C-863 controller / M11x.1DG1 stages (ie least clicks, reproducible absolute positions)?

I thought about a start-up macro on the PI controller, but there would be issues in case of eg a power loss while a sample is mounted.

can you provide “core” log files with debugging enabled for a minimal session - i.e. only with the homing for the z-stage?

I think I’m already failing before homing the stage, but when setting up the group and preset for homing.

Log of the session is here. There’s a lot of entries when it’s connecting to the camera and the other stages. If it helps, I can also setup a new config with only the z-stage.

CoreLog20210111T111734_pid2976.txt (164.3 KB)

During the session, I tried to redefine the group and preset for z-stage homing, (starting at line 1255), however whenever I close the window, it’s deleting REF and writes 0 instead (line 1295 in the log?). Skimming further down the log, there’s also an error in line 1417 [ERR,Core:dev:StageZ_controller] Cannot get value of property "Joystick 1" [ Error in device "StageZ_controller": Unknown error in the device (1) ]

And config file, in case it’s needed:
MMConfig_STEDLS_stages_System.txt (7.3 KB)

Please delete this property: “Property,PIZStage,Alternative Homing Command,REF” or leave empty or set it to “FRF”

The homing property for z-stages is kind of a “hack”. Since there is no homing method in the API for z-stages, we use this property as “command”. So when you change it to some command, the action is triggered. But there is no method implemented for reading a value. So micro-manager will display “0”.

The error message for the joystick seems to be caused by the homing command - which failed.

Thank you so much for finding the mistake I made in my setup - again!