The th_apt module

Module for Thorlabs APT motion controllers.


cmd_th_apt.init_th_apt(th_apt_id, conf_string)[source]

Initialize TH_APT motion controller chanel.

conf_string must contain the parameters:

  • bus: a conf_string for cmd_serial or cmd_tcp
  • chan: channel where the motor to control is attached

Deinitialize th_apt_id motion controller channel.

cmd_th_apt.config_th_apt(th_apt_id, pos_max, pos_min)[source]

Configure th_apt_id motion controller channel.


Invalidate th_apt_id motion controller channel.

cmd_th_apt.home_th_apt(th_apt_id, direction='r', velocity='1')[source]

Home th_apt_id channel by moving the motor to its home position. Do it in the reverse (r) or forward (r) direction with velocity.


Check if channel been homed.

cmd_th_apt.move_th_apt(th_apt_id, displacement, velocity, acceleration)[source]

Move channel by displacement mm with the specified velocity. A ramp up from zero with acceleration is used to get to velocity. Units are mm, mm/s and mm/s**2.


Get position of channel. Result is returned in mm.

cmd_th_apt.go_min_th_apt(th_apt_id, velocity, acceleration)[source]

Go to the minimum position defined during the configuration of the channel

cmd_th_apt.go_max_th_apt(th_apt_id, velocity, acceleration)[source]

Go to the maximum position defined during the configuration of the channel