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

adding basic functionality for KDC101 KCube. #162

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

edyoshikun
Copy link
Contributor

This PR adds the throlabs stages that use the KDC101 DC motors as well as controls for the KIM001 KCube for intertia piezo motors.


@property
@abstractmethod
def travel_range(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RENAME TO LIMITS

Copy link
Contributor

@AhmetCanSolak AhmetCanSolak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can those global declarations get into some smaller contexts @edyoshikun ?

@edyoshikun
Copy link
Contributor Author

@AhmetCanSolak I think the next step is actually making a single file KCUBE.py and having the global contexts (which I am assuming you mean the clr.AddReference(.dll)stuff (?)) live inside the class. For example, both KDC101 and KIM101 share some .dlls but defer on the motor/stage type they import, so we could have something like

clr.AddRefererence(THorlabsDevice.dll) #common to all thorlabs kcube devices

class KIM101():
    clr.AddReference(InertiaMotor.dll)  #unique to this device.

@AhmetCanSolak
Copy link
Contributor

@AhmetCanSolak I think the next step is actually making a single file KCUBE.py and having the global contexts (which I am assuming you mean the clr.AddReference(.dll)stuff (?)) live inside the class. For example, both KDC101 and KIM101 share some .dlls but defer on the motor/stage type they import, so we could have something like

clr.AddRefererence(THorlabsDevice.dll) #common to all thorlabs kcube devices

class KIM101():
    clr.AddReference(InertiaMotor.dll)  #unique to this device.

yes, and I loved the proposed solution. Thank you @edyoshikun !

@ieivanov
Copy link
Collaborator

I think it will be helpful to have a move_absolute method in the abstract class, matching move_relative as in dc5516d

@ieivanov
Copy link
Collaborator

ieivanov commented Jul 3, 2023

I find that the KIM101 stage works well initially, but errors out after several moves. With the stage on the mantis LS remote refocus arm this sequence of steps will error out:

for i in range(50):
    stage.move_relative(10)
    stage.move_relative(-10)

Reinitializing the stage allows it to move without error again. It seems like the error happens a set number of moves after init - it's possible that something gets backed up and we need to clear it.

For now I'm switching to using pylablib for controlling the stage - it seems to work reliably in my tests

@AhmetCanSolak
Copy link
Contributor

pylablib

pylablib is a little heavier dependency to have, but if it is the only thing working reliably we can consider introducing it as a dependency to coPylot @ieivanov .

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

Successfully merging this pull request may close these issues.

3 participants