Camera Stage Calibration Data not being saved

Hi,
I am setting up my microscope and while it seems to save the lens shading correction it doesn’t seem to save the camera stage calibration. Every time I log in, it asks me to save it again.

When I run it I see it moving the x axis, but nothing else. It seems to complete and flashes a notification in green. I click finish but when I reboot it asks me to calibrate again due to missing data.

Is there any way to see if it is completing successfully, or turn on more debug information? I have VNC-ed onto the pi and the openflexure logs seem quite bare.

Any help would be greatly appreciated!

Are you using a v1 camera? I had similar issue until I swap it for the v2 camera.

I just checked and it is a v2.1 camera. Is that okay?

It should work then, are you sure your motors are wired in the right order? You can try to move them with arrow keys on the keyboard.

I’m seeing a similar problem. Each time I connect I see this. I’ve run calibration like 10 times now.

Each time when I hit Next I see that my Lens shading is all good.

Exploring further to see why, I use ofm serve so that I can see the debug output in an SSH session. I actually wish this debut output was available in the desktop app. It would be super helpful especially during long tasks like the scan, because it let’s you know stuff is still happening, rather than being frozen, which happens a lot to me, i.e. I just ran out of disk space on my 8GB flash drive while doing a scan.

Anyway, I click this button to calibrate…

Here’s the start of the SSH output

And ultimately it fails with this error.

I finally ran a new image which was some tape with some dust on it. That seemed to work, so it’s the image and possibly the contrast in it that’s critical to get the calibration to work.

Here’s the output that finally looks successful.

Yes!!! I finally can double click the image to have it move on the screen.

Thank you Jlauer! I am now getting somewhere with debugging mode. It seems to be crashing when it moving the x axis to its extremes. I am using vitron o-rings and 3 amps on the stepper motor power supply but it cannot seem to push the stage any further. Should I unwind the gears to the loosest position before I start the calibration?

INFO:root:Loading /home/pi/openflexure/settings/microscope_configuration.json…
INFO:root:Loading /home/pi/openflexure/settings/microscope_settings.json…
INFO:root:Calibrating X axis:
INFO:root:Moving the stage until we see motion…
INFO:root:Moving the stage to the edge of the field of view…
ERROR:root:Moved the stage by [77824. 0. 0.] but saw no motion.
ERROR:root:Traceback (most recent call last):

I was wondering the same thing for the calibration. Where should you start your stage position? Here’s the way I think about it, but I’m just a newbie as I just got mine built last night after waiting for parts to arrive.

I presume this is position 0 for the Y stepper motor. It’s the position when you build the microscope, i.e. you can slip the nut through the window with the nut holder.


Then I can see this as position 25000 (with X-Y steps of 200 which I believe is the default)


And this seems to be position 50000 on the Y


This intuitively makes me think start your calibration at X and Y of 25000 so you’re in the middle of the range of motion, i.e. you’re centered on the stage.

For the Z I just try to get the item in focus before calibration. I think the author uses image recognition to figure out shifts of the image left/right and that becomes critical for whether this calibration fails or not, thus your error. So best to post what image is in your camera for help.

1 Like

I finally got the right length screws for the gears and could properly start the calibration. I set it up as you recommended and now calibrates for the x-axis but every time it stops on the y-axis at 2/2

INFO:root:Moving the stage forwards to measure backlash (2/2)
The fit didn’t look successful

I will keep playing around and see if it is the reference image, I am using a bunch of eyelashes so the movement so the movement is very clear:

Did you resolve this in the end? I have the same issue, it moves in X for a while then finishes, without ever moving Y or Z.

Motors are connected correctly and run as expected from python commands in terminal. Using a sangaboard v0.2, raspberrypi model 3 and raspberry pi camera v2.

Edit: Now it no longer moves at all, either in the movement tab or during the calibration.

Hey, so I kinda got it to work. The first thing is to log into the pi and restart the server in debug mode using: ofm serve

That will allow you to see what the calibration is doing. If it is only moving X then it is not successfully calibrating that axis. It only calibrates x and y during stage calibration

I needed to get a more detailed slide and to center the stage before I started. Even then it took several attempts before it completed. Annoyingly it still asks me to calibrate even after successful completion. Still it seems to be working well now.