Motion

class ingeniamotion.motion.Motion(motion_controller)

Motion.

class OperationMode(value)

Operation Mode Enum

VOLTAGE = 0
CURRENT_AMPLIFIER = 1
CURRENT = 2
CYCLIC_CURRENT = 34
VELOCITY = 3
PROFILE_VELOCITY = 19
CYCLIC_VELOCITY = 35
POSITION = 4
PROFILE_POSITION = 20
CYCLIC_POSITION = 36
CYCLIC_POSITION_S_CURVE = 68
PVT = 180
HOMING = 275
CONTROL_WORD_REGISTER = 'DRV_STATE_CONTROL'
OPERATION_MODE_REGISTER = 'DRV_OP_CMD'
POSITION_SET_POINT_REGISTER = 'CL_POS_SET_POINT_VALUE'
VELOCITY_SET_POINT_REGISTER = 'CL_VEL_SET_POINT_VALUE'
CURRENT_QUADRATURE_SET_POINT_REGISTER = 'CL_CUR_Q_SET_POINT'
ACTUAL_POSITION_REGISTER = 'CL_POS_FBK_VALUE'
ACTUAL_VELOCITY_REGISTER = 'CL_VEL_FBK_VALUE'
target_latch(servo='default', axis=1)

Active target latch.

Parameters
  • servo (str) – servo alias to reference it. default by default.

  • axis (int) – servo axis. 1 by default.

set_operation_mode(operation_mode, servo='default', axis=1)

Set operation mode to a target servo and axis.

Parameters
  • operation_mode (int) – operation mode, any of OperationMode.

  • servo (str) – servo alias to reference it. default by default.

  • axis (int) – servo axis. 1 by default.

motor_enable(servo='default', axis=1)

Enable motor.

Parameters
  • servo (str) – servo alias to reference it. default by default.

  • axis (int) – servo axis. 1 by default.

motor_disable(servo='default', axis=1)

Disable motor.

Parameters
  • servo (str) – servo alias to reference it. default by default.

  • axis (int) – servo axis. 1 by default.

move_to_position(position, servo='default', axis=1, target_latch=True, blocking=False)

Set position set point to a target servo and axis, in counts.

Parameters
  • position (int) – target position, in counts.

  • servo (str) – servo alias to reference it. default by default.

  • axis (int) – servo axis. 1 by default.

  • target_latch (bool) – if True does target latch at the end. True by default.

  • blocking (bool) – if `True, the function is blocked until the target position is reached. False by default.

set_velocity(velocity, servo='default', axis=1, target_latch=True, blocking=False)

Set velocity set point to a target servo and axis, in rev/s.

Parameters
  • velocity (float) – target velocity, in rev/s.

  • servo (str) – servo alias to reference it. default by default.

  • axis (int) – servo axis. 1 by default.

  • target_latch (bool) – if True does target latch at the end. True by default.

  • blocking (bool) – if `True, the function is blocked until the target position is reached. False by default.

set_current_quadrature(current, servo='default', axis=1)

Set quadrature current set point to a target servo and axis, in A.

Parameters
  • current (float) – target quadrature current, in A.

  • servo (str) – servo alias to reference it. default by default.

  • axis (int) – servo axis. 1 by default.

wait_for_position(position, servo='default', axis=1, error=20, timeout=None, interval=None)

Wait until actual position is equal to a target position, with an error.

Parameters
  • position (int) – target position, in counts.

  • servo (str) – servo alias to reference it. default by default.

  • axis (int) – servo axis. 1 by default.

  • error (int) – allowed error between actual position and target position, in counts.

  • timeout (int) – how many seconds to wait for the servo to reach the target position, if None it will wait forever . None by default.

  • interval (float) – interval of time between actual position reads, in seconds. None by default.

wait_for_velocity(velocity, servo='default', axis=1, error=0.1, timeout=None, interval=None)

Wait until actual position is equal to a target position, with an error.

Parameters
  • velocity (float) – target velocity, in rev/s.

  • servo (str) – servo alias to reference it. default by default.

  • axis (int) – servo axis. 1 by default.

  • error (int) – allowed error between actual position and target position, in counts.

  • timeout (int) – how many seconds to wait for the servo to reach the target position, if None it will wait forever . None by default.

  • interval (float) – interval of time between actual position reads, in seconds. None by default.