From 299f53957cd4f0cfd4a7baa112c61cac95a1a63d Mon Sep 17 00:00:00 2001 From: Reto Trappitsch Date: Tue, 15 Mar 2022 10:58:58 -0400 Subject: [PATCH 1/2] Add backlash correction to motor commands for APTMotorController --- .../tests/test_thorlabs/test_thorlabs_apt.py | 59 +++++++++++++++++++ instruments/thorlabs/thorlabsapt.py | 51 ++++++++++++++++ 2 files changed, 110 insertions(+) diff --git a/instruments/tests/test_thorlabs/test_thorlabs_apt.py b/instruments/tests/test_thorlabs/test_thorlabs_apt.py index d1ed659f..39026360 100644 --- a/instruments/tests/test_thorlabs/test_thorlabs_apt.py +++ b/instruments/tests/test_thorlabs/test_thorlabs_apt.py @@ -1174,6 +1174,65 @@ def test_apt_mc_position(init_kdc101): ) +def test_apt_mc_backlash_correction(init_kdc101): + """Get / set backlash correction.""" + with expected_protocol( + ik.thorlabs.APTMotorController, + [ + init_kdc101[0], + ThorLabsPacket( + message_id=ThorLabsCommands.MOT_REQ_GENMOVEPARAMS, + param1=0x01, + param2=0x00, + dest=0x50, + source=0x01, + data=None, + ).pack(), + ThorLabsPacket( + message_id=ThorLabsCommands.MOT_SET_GENMOVEPARAMS, + param1=None, + param2=None, + dest=0x50, + source=0x01, + data=struct.pack(" Date: Tue, 15 Mar 2022 11:09:03 -0400 Subject: [PATCH 2/2] Extend tests for full coverage --- instruments/tests/test_thorlabs/test_thorlabs_apt.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/instruments/tests/test_thorlabs/test_thorlabs_apt.py b/instruments/tests/test_thorlabs/test_thorlabs_apt.py index 39026360..0e377c42 100644 --- a/instruments/tests/test_thorlabs/test_thorlabs_apt.py +++ b/instruments/tests/test_thorlabs/test_thorlabs_apt.py @@ -1196,6 +1196,14 @@ def test_apt_mc_backlash_correction(init_kdc101): source=0x01, data=struct.pack("