pystages.tic

class pystages.tic.Tic

Very basic driver class for Polulu Tic Stepper Motor controller, connected in USB.

Variables:

poll_interval – Interval between successive state polling for some long motor operations.

__init__()
Parameters:

num_axis – The number of axis of the stage, can be updated or set after initialization of the object.

block_read(command: TicCommand, offset, length) bytes

Read data from the device.

Parameters:
  • command – Command code.

  • offset – Data offset.

  • length – Data length.

go_home(direction: TicDirection, wait: bool = True)

Run the homing procedure. :param direction: Homing direction. :param wait: If True, wait for homing procedure end.

home(wait=False)

Triggers a Home command.

Parameters:

wait – Optionally waits for move operation to be done.

property is_moving: bool

Because there is no specific command to get the current moving state of the Tic, and the positioning/homing is always blocking, this function returns False in all cases.

property position: Vector

Motor position, in steps.

Getter:

Returns current target position.

Setter:

Set target position and wait until position is reached.

quick(command: TicCommand)

Send a quick command with no data.

Parameters:

command – Command.

set_setting(command: TicCommand, data, offset)

Set setting data.

Parameters:
  • command – Command code.

  • data – Value to be written.

  • offset – Write offset.

write_32(command: TicCommand, data: int)

Write 32 bits.

Parameters:
  • command – Command code.

  • data – Value to be written.

write_7(command: TicCommand, data: int)

Write 7 bits.

Parameters:
  • command – Command.

  • data – Value to be written.

class pystages.tic.TicDirection(value)

Possible directions for homing

FORWARD = 1
REVERSE = 0
class pystages.tic.TicVariable(value)

Variables which can be read using GET_VARIABLE command. https://www.pololu.com/docs/0J71/7

ACTING_TARGET_POSITION = (42, 4, True)
AGC_BOTTOM_CURRENT_LIMIT = (87, 1, False)
AGC_CURRENT_BOOST_STEP = (88, 1, False)
AGC_FREQUENCY_LIMIT = (89, 1, False)
AGC_MODE = (86, 1, False)
ANALOG_READING_RX = (69, 2, False)
ANALOG_READING_SCL = (63, 2, False)
ANALOG_READING_SDA = (65, 2, False)
ANALOG_READING_TX = (67, 2, False)
CURRENT_LIMIT = (74, 1, False)
CURRENT_POSITION = (34, 4, True)
CURRENT_VELOCITY = (38, 4, True)
DECAY_MODE = (75, 1, False)
DEVICE_RESET = (50, 1, False)
DIGITAL_READINGS = (71, 1, False)
ENCODER_POSITION = (57, 4, True)
ERRORS_OCCURRED = (4, 4, False)
ERROR_STATUS = (2, 2, False)
INPUT_AFTER_AVERAGING = (77, 2, False)
INPUT_AFTER_HYSTERESIS = (79, 2, False)
INPUT_AFTER_SCALING = (81, 4, True)
INPUT_STATE = (76, 1, False)
LAST_HP_DRIVER_ERRORS = (255, 1, False)
LAST_MOTOR_DRIVER_ERROR = (85, 1, False)
MAX_ACCELERATION = (30, 4, False)
MAX_DECELERATION = (26, 4, False)
MAX_SPEED = (22, 4, False)
MISC_FLAGS = (1, 1, False)
OPERATION_STATE = (0, 1, False)
PIN_STATES = (72, 1, False)
PLANNING_MODE = (9, 1, False)
RC_PULSE_WIDTH = (61, 2, False)
STARTING_SPEED = (18, 4, False)
STEP_MODE = (73, 1, False)
TARGET_POSITION = (10, 4, True)
TARGET_VELOCITY = (14, 4, True)
TIME_SINCE_LAST_STEP = (46, 4, False)
UP_TIME = (53, 4, False)
VIN_VOLTAGE = (51, 2, False)