Is camera/stage mapping supported for delta-stage motion system?

The problem I am having is that camera/stage mapping fails. Here is what I’m doing and my setup:

I have some onion membrane on the delta stage microscope on a slide, in focus, in view (camera has been calibrated earlier). This is the image I have as per below (no cover slip atm nor immersion oil … still in the mail). The objective is 100x magnification. I can move the stage around, all 3 motors move when I change the Z height (all motors are working). Moving in XY results in diagonal movement, hence wishing to do the mapping calibration. I’ve set the stage as SangaStage Delta in settings.

I have tried the camera/stage mapping procedure with 100, 10, and 1 as step size but it fails every time.

Here is the log output:

1/10/2022 4:07:05 pm
ERROR: Traceback (most recent call last):
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/labthings/actions/thread.py", line 255, in wrapped
    self._return_value = f(*args, **kwargs)
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/flask/ctx.py", line 158, in wrapper
    return f(*args, **kwargs)
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/camera_stage_mapping.py", line 295, in post
    return self.extension.calibrate_xy()
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/camera_stage_mapping.py", line 189, in calibrate_xy
    cal_x: dict = self.calibrate_1d((1, 0, 0))
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/camera_stage_mapping.py", line 182, in calibrate_1d
    result: dict = calibrate_backlash_1d(tracker, move, direction_array)
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/camera_stage_mapping/camera_stage_calibration_1d.py", line 227, in calibrate_backlash_1d
    raise e
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/camera_stage_mapping/camera_stage_calibration_1d.py", line 211, in calibrate_backlash_1d
    res = fit_backlash(linear_moves)
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/camera_stage_mapping/camera_stage_calibration_1d.py", line 129, in fit_backlash
    raise ValueError("The fit didn't look successful")
ValueError: The fit didn't look successful

Looking a little further, I notice that only 2 of the motors move when this procedure is running. The image tends to go out of focus when it is running. So at a glance I’m guessing that delta stages aren’t supported yet?

Thanks for your time :smile:

I might have to modify the code so that when the calibration fails, it does return it to where it was when it started. Atm it leaves it somewhere else, and puts the shown coordinates out of sync with where it actually is.

1 Like

Just noticed that 3 motors moved this time.

I’m also trying it with a little cross hair slide, but mapping fails too.

The camera calibration should work for the Delta Stage. Are you using the Delta Stage optics module? It has the camera at the correct rotation so that the x and y axis in the software align correctly, rather than at diagonals. Sometimes I find it can be trial and error with finding a sample which works best for the calibration code.

Hi Samuel,

Yes, I am using the delta stage optics module. Maybe I’ve got the motors swapped? I’ve abitrarily connected them in no particular order and assumed that the mapping would figure out which is which, as I haven’t seen it documented anywhere.

Is there a particular order that must be followed?
Thanks !

ah yes there is, if you look at step 4 in the assembly instructions, motor a goes to x,b to y and c to z.

Fantastic! The ol’ RTFM solution :joy:I should have read it more carefully. Thank you!

I’ve discovered one of my motors is not moving sometimes which is adding to the problem. I’m confident this will resolve once that is fixed.

EDIT: yep, I had a wire in the wrong place for one of the drivers. All motors are now working, and camera mapping completed successfully!

Fantastic! Thanks so much for posting your solution, it’s really useful for the next time we have the same problem :slight_smile: I was going to add that the camera stage mapping should work (because, by my reckoning, even swapping the motors around will only change rotation/direction of the coordinate system, which will be calibrated out). That said, backlash won’t work quite the same way in a delta stage, so I could believe the errors accumulate and mean it won’t calibrate quite so nicely…

Still, if it works, that’s brilliant. Have fun!

1 Like

thanks, the next step is figuring out how to optimize for optical sectioning… that’s a whooole nother kettle of fish.

1 Like