Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YZ depth scan - X voltage jumps to Vmin #513

Open
michaelb1886 opened this issue May 7, 2019 · 1 comment
Open

YZ depth scan - X voltage jumps to Vmin #513

michaelb1886 opened this issue May 7, 2019 · 1 comment

Comments

@michaelb1886
Copy link
Contributor

What is affected by this bug?

v0.10
depth scanning
confocal_logic

When does this occur?

Scanning in XZ yields the expected behaviour (the Y voltage is kept fixed and XZ is rastered)
However, changing to YZ in the confocal settings dialog and perform a depth scan the X voltage is not held constant. It jumps to Vmin in the return path section! This is not great for the nano-positioners. The below plots are the measured voltages going to my nanopositioner. I also noticed a dark strip at the left edge of the YZ scan image - this is because the nanopositioner is jumpy wildly to the edge of the scan range and less photons are measured.

image

Where on the platform does it happen?

Defining the return line in confocal_logic.py in the _scan_line method at line 800. The definition of return line for the x axis image[self._scan_counter, 0, 1] * np.ones(self._return_YL.shape) was not at the self._current_x position. For some reason it was a the minimum X limit.

How do we replicate the issue?

Scan depth in YZ.

Expected behavior (i.e. solution)

Changed from line 800 in confocal_logic.py to

                if n_ch <= 3:
                    return_line = np.vstack([
                            self._current_x * np.ones(self._return_YL.shape),
                            self._return_YL,
                            image[self._scan_counter, 0, 2] * np.ones(self._return_YL.shape)
                        ][0:n_ch])
                else:
                    return_line = np.vstack([
                            self._current_x * np.ones(self._return_YL.shape),
                            self._return_YL,
                            image[self._scan_counter, 0, 2] * np.ones(self._return_YL.shape),
                            np.ones(self._return_YL.shape) * self._current_a
                        ])

With this change the scanning behaviour is now as expected for a YZ scan.
image

Other Comments

I understand that the confocal scanning is going through a rewrite phase at the moment, but this is a pretty nasty bug as it isn't physically great for the nanopositioners.

@diamond2nv
Copy link

maybe this fix is more original-way:

            # make a line to go to the starting position of the next scan line
            if self.depth_img_is_xz or not self._zscan:
                if n_ch <= 3:
                    return_line = np.vstack([
                        self._return_XL,
                        image[self._scan_counter, 0, 1] * np.ones(self._return_XL.shape),
                        image[self._scan_counter, 0, 2] * np.ones(self._return_XL.shape)
                    ][0:n_ch])
                else:
                    return_line = np.vstack([
                            self._return_XL,
                            image[self._scan_counter, 0, 1] * np.ones(self._return_XL.shape),
                            image[self._scan_counter, 0, 2] * np.ones(self._return_XL.shape),
                            np.ones(self._return_XL.shape) * self._current_a
                        ])
            else:
                if n_ch <= 3:
                    return_line = np.vstack([
                            image[self._scan_counter, 0, 0] * np.ones(self._return_YL.shape),
                            self._return_YL,
                            image[self._scan_counter, 0, 2] * np.ones(self._return_YL.shape)
                        ][0:n_ch])
                else:
                    return_line = np.vstack([
                            image[self._scan_counter, 0, 0] * np.ones(self._return_YL.shape),
                            self._return_YL,
                            image[self._scan_counter, 0, 2] * np.ones(self._return_YL.shape),
                            np.ones(self._return_YL.shape) * self._current_a
                        ])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants