Motion¶
-
class
ingeniamotion.motion.Motion(motion_controller)¶ Motion.
-
current_direct_ramp(target_value, time_s, servo='default', axis=1, init_value=0, interval=None)¶ Given a target value and a time in seconds, changes the current direct set-point linearly following a ramp. This function is blocked until target reached.
- Parameters
target_value (float) – target value of the ramp.
time_s (float) – duration of the ramp, in seconds.
servo (str) – servo alias to reference it.
defaultby default.axis (int) – servo axis.
1by default.init_value (float) – initial value of the ramp.
0by default.interval (float) – time interval between register writes, in seconds.
Noneby default, no interval.
-
current_quadrature_ramp(target_value, time_s, servo='default', axis=1, init_value=0, interval=None)¶ Given a target value and a time in seconds, changes the current quadrature set-point linearly following a ramp. This function is blocked until target reached.
- Parameters
target_value (float) – target value of the ramp.
time_s (float) – duration of the ramp, in seconds.
servo (str) – servo alias to reference it.
defaultby default.axis (int) – servo axis.
1by default.init_value (float) – initial value of the ramp.
0by default.interval (float) – time interval between register writes, in seconds.
Noneby default, no interval.
-
fault_reset(servo='default', axis=1)¶ Fault reset.
-
get_actual_position(servo='default', axis=1)¶ Returns actual position register.
-
get_actual_velocity(servo='default', axis=1)¶ Returns actual velocity register.
-
get_operation_mode(servo='default', axis=1)¶ Return current operation mode.
- Parameters
- Returns
Return current operation mode.
- Return type
-
internal_generator_constant_move(offset, servo='default', axis=1)¶ Move motor in internal generator configuration with generator mode constant.
-
internal_generator_saw_tooth_move(direction, cycles, frequency, servo='default', axis=1)¶ Move motor in internal generator configuration with generator mode saw tooth.
-
motor_disable(servo='default', axis=1)¶ Disable motor.
-
motor_enable(servo='default', axis=1)¶ Enable motor.
-
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.
defaultby default.axis (int) – servo axis.
1by default.target_latch (bool) – if
Truedoes target latch at the end.Trueby default.blocking (bool) – if
True, the function is blocked until the target position is reached.Falseby default.
-
set_current_direct(current, servo='default', axis=1)¶ Set direct current set point to a target servo and axis, in A.
-
set_current_quadrature(current, servo='default', axis=1)¶ Set quadrature current set point to a target servo and axis, in A.
-
set_internal_generator_configuration(op_mode, servo='default', axis=1)¶ Set internal generator configuration.
Note
This functions affects the following drive registers: motor pair poles, operation mode, phasing mode and commutation feedback. This is an advanced-user oriented method, you could lose your drive configuration, use it at your own risk.
- Parameters
op_mode (OperationMode) – select Current or Voltage operation mode for internal generator configuration.
servo (str) – servo alias to reference it.
defaultby default.axis (int) – servo axis.
1by default.
-
set_operation_mode(operation_mode, servo='default', axis=1)¶ Set operation mode to a target servo and axis.
- Parameters
operation_mode (OperationMode) – operation mode, any of
OperationMode.servo (str) – servo alias to reference it.
defaultby default.axis (int) – servo axis.
1by 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.
defaultby default.axis (int) – servo axis.
1by default.target_latch (bool) – if
Truedoes target latch at the end.Trueby default.blocking (bool) – if
True, the function is blocked until the target position is reached.Falseby default.
-
set_voltage_direct(voltage, servo='default', axis=1)¶ Set direct voltage set point to a target servo and axis, in V.
-
set_voltage_quadrature(voltage, servo='default', axis=1)¶ Set quadrature voltage set point to a target servo and axis, in V.
-
target_latch(servo='default', axis=1)¶ Active target latch.
-
voltage_direct_ramp(target_value, time_s, servo='default', axis=1, init_value=0, interval=None)¶ Given a target value and a time in seconds, changes the voltage direct set-point linearly following a ramp. This function is blocked until target reached.
- Parameters
target_value (float) – target value of the ramp.
time_s (float) – duration of the ramp, in seconds.
servo (str) – servo alias to reference it.
defaultby default.axis (int) – servo axis.
1by default.init_value (float) – initial value of the ramp.
0by default.interval (float) – time interval between register writes, in seconds.
Noneby default, no interval.
-
voltage_quadrature_ramp(target_value, time_s, servo='default', axis=1, init_value=0, interval=None)¶ Given a target value and a time in seconds, changes the voltage quadrature set-point linearly following a ramp. This function is blocked until target reached.
- Parameters
target_value (float) – target value of the ramp.
time_s (float) – duration of the ramp, in seconds.
servo (str) – servo alias to reference it.
defaultby default.axis (int) – servo axis.
1by default.init_value (float) – initial value of the ramp.
0by default.interval (float) – time interval between register writes, in seconds.
Noneby default, no interval.
-
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.
defaultby default.axis (int) – servo axis.
1by 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
Noneit will wait forever .Noneby default.interval (float) – interval of time between actual position reads, in seconds.
Noneby default.
-
wait_for_velocity(velocity, servo='default', axis=1, error=0.1, timeout=None, interval=None)¶ Wait until actual velocity is equal to a target velocity, with an error.
- Parameters
velocity (float) – target velocity, in rev/s.
servo (str) – servo alias to reference it.
defaultby default.axis (int) – servo axis.
1by default.error (int) – allowed error between actual velocity and target velocity, in counts.
timeout (int) – how many seconds to wait for the servo to reach the target velocity, if
Noneit will wait forever.Noneby default.interval (float) – interval of time between actual velocity reads, in seconds.
Noneby default.
-