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

Updates & Fixes for Thorlabs APT, APTMotorController #334

Merged
merged 9 commits into from
Mar 18, 2022

Conversation

trappitsch
Copy link
Contributor

Add backlash correction property to APTMotorController.

Currently, my stage finishes the first move correctly, with a correct package being returned. The second move then fails with an OS Error since the wrong package is returned. Need to figure out where this issue is coming from and how to fix it. That will be part of this PR as well.

@coveralls
Copy link

coveralls commented Mar 15, 2022

Coverage Status

Coverage increased (+0.001%) to 99.484% when pulling 72f7316 on trappitsch:Thorlabs_APT into 9af0cc9 on Galvant:main.

14 bytes of data are expected according to the manual. Therefore, the
`expect_data_len` must be set to 14 in order to clean out the buffer.
@untzag
Copy link

untzag commented Mar 15, 2022

(not an InstrumentKit user, just a fan)

Just want to mention that we've tried to implement a complete sans-io protocol [1]. Our dream was to have one implementation of the protocol that several projects could benefit from, shared debugging resources etc. It's a very lightweight dependency. Might be beneficial to you.

[1] https://pypi.org/project/thorlabs-apt-protocol/

@scasagrande
Copy link
Contributor

@untzag We'll have to take a look!! Thanks for pointing it out

Data that is returned are "made up" but might be somehow reasonable...
@trappitsch
Copy link
Contributor Author

Thanks @untzag, this looks very interesting, need to spend some more time on it!

Cannot test with my hardware (KDC101), but notes added after manual
@trappitsch
Copy link
Contributor Author

Looks like this fixes the issue I had and closes #335. Main new feautres / fixes:

  • Add possibility to set / get backlash correction for APTMotorController.MotorChannel (incl. tests)
  • Fix package error after moving, no data was expected but is sent by the controllers. Tests were adjusted and new implementation is working with a KDC101 controller plus a PRM1-Z8 stage.

@trappitsch trappitsch marked this pull request as ready for review March 15, 2022 19:49
``OSError`` otherwise. Devices that work according to the
manual are: TSC001, KSC101, BSC10x, BSC20x, LTS150, LTS300,
MLJ050, MLJ150, TIM101, KIM101.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this note since the status_bits is not working with the KDC101, and according to the manual should not work with it.

apt.channel[0].backlash_correction = corr

corr_received = apt.channel[0].backlash_correction
unit_eq(corr_received, corr, abs=1e-3)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now using the extended unit_eq

@scasagrande
Copy link
Contributor

FYI github actions is struggling right now, so I'll rerun when I see that it is clear : https://www.githubstatus.com/

@scasagrande scasagrande merged commit 8894ca0 into instrumentkit:main Mar 18, 2022
@trappitsch trappitsch deleted the Thorlabs_APT branch March 18, 2022 15:47
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

Successfully merging this pull request may close these issues.

4 participants