Configuration¶
-
class
ingeniamotion.configuration.TYPE_SUBNODES(value)¶ An enumeration.
-
class
ingeniamotion.configuration.Configuration(motion_controller)¶ Configuration.
-
class
BrakeOverride(value)¶ Brake override configuration enum
-
release_brake(servo='default', axis=1)¶ Override the brake status to released in the target servo and axis.
-
enable_brake(servo='default', axis=1)¶ Override the brake status of the target servo and axis.
-
disable_brake_override(servo='default', axis=1)¶ Disable the brake override of the target servo and axis.
-
default_brake(servo='default', axis=1)¶ Disable the brake override of the target servo and axis, as
disable_brake_override().
-
load_configuration(config_path, axis=None, servo='default')¶ Load a configuration file to the target servo.
- Parameters
- Raises
FileNotFoundError – If configuration file does not exist.
- Return type
-
save_configuration(output_file, axis=None, servo='default')¶ Save the servo configuration to a target file.
-
store_configuration(axis=None, servo='default')¶ Store servo configuration to non-volatile memory.
-
restore_configuration(axis=None, servo='default')¶ Restore servo to default configuration.
-
set_max_acceleration(acceleration, servo='default', axis=1)¶ Update maximum acceleration register.
Warning
This function is deprecated. Please use “set_max_profile_acceleration” or “set_profiler” instead.
-
set_max_profile_acceleration(acceleration, servo='default', axis=1)¶ Update maximum profile acceleration register.
-
set_max_profile_deceleration(deceleration, servo='default', axis=1)¶ Update maximum profile deceleration register.
-
set_profiler(acceleration=None, deceleration=None, velocity=None, servo='default', axis=1)¶ Set up the acceleration, deceleration and velocity profilers. All of these parameters are optional, meaning the user can set only one if desired. However, At least a minimum of one of these parameters is mandatory to call this function.
- Parameters
- Raises
TypeError – Missing arguments. All the arguments given were None.
- Return type
-
set_max_velocity(velocity, servo='default', axis=1)¶ Update maximum velocity register.
-
set_max_profile_velocity(velocity, servo='default', axis=1)¶ Update maximum profile velocity register.
-
get_position_and_velocity_loop_rate(servo='default', axis=1)¶ Get position & velocity loop rate frequency.
-
get_current_loop_rate(servo='default', axis=1)¶ Get current loop rate frequency.
-
get_power_stage_frequency(servo='default', axis=1, raw=False)¶ Get Power stage frequency register.
- Parameters
- Return type
- Returns
Frequency in Hz if raw is
False, else, raw register value.- Raises
ValueError – If power stage frequency selection register has an invalid value.
TypeError – If some read value has a wrong type.
-
get_power_stage_frequency_enum(servo='default', axis=1)¶ Return Power stage frequency register enum.
-
set_power_stage_frequency(value, servo='default', axis=1)¶ Set power stage frequency from enum value. See :func: get_power_stage_frequency_enum.
- Parameters
- Raises
IMStatusWordError – If motor is enabled.
- Return type
-
get_status_word(servo='default', axis=1)¶ Return status word register value.
-
is_motor_enabled(servo='default', axis=1)¶ Return motor status.
-
is_commutation_feedback_aligned(servo='default', axis=1)¶ Return commutation feedback aligned status.
-
set_phasing_mode(phasing_mode, servo='default', axis=1)¶ Set phasing mode.
- Parameters
phasing_mode (
PhasingMode) – phasing mode.servo (
str) – servo alias to reference it.defaultby default.axis (
int) – servo axis.1by default.
- Return type
-
get_phasing_mode(servo='default', axis=1)¶ Get current phasing mode.
-
set_generator_mode(mode, servo='default', axis=1)¶ Set generator mode.
- Parameters
mode (
GeneratorMode) – generator mode value.servo (
str) – servo alias to reference it.defaultby default.axis (
int) – servo axis.1by default.
- Return type
-
set_motor_pair_poles(pair_poles, servo='default', axis=1)¶ Set motor pair poles.
-
get_motor_pair_poles(servo='default', axis=1)¶ Get motor pair poles.
-
get_sto_status(servo='default', axis=1)¶ Get STO register
-
is_sto1_active(servo='default', axis=1)¶ Get STO1 bit from STO register
-
is_sto2_active(servo='default', axis=1)¶ Get STO2 bit from STO register
-
check_sto_power_supply(servo='default', axis=1)¶ Get power supply bit from STO register
-
check_sto_abnormal_fault(servo='default', axis=1)¶ Get abnormal fault bit from STO register
-
get_sto_report_bit(servo='default', axis=1)¶ Get report bit from STO register
-
is_sto_active(servo='default', axis=1)¶ Check if STO is active
-
is_sto_inactive(servo='default', axis=1)¶ Check if STO is inactive
-
is_sto_abnormal_latched(servo='default', axis=1)¶ Check if STO is abnormal latched
-
change_tcp_ip_parameters(ip_address, subnet_mask, gateway, servo='default')¶ Change TCP IP parameters and store it.
-
store_tcp_ip_parameters(servo='default')¶ Store TCP IP parameters to non-volatile memory.
-
restore_tcp_ip_parameters(servo='default')¶ Restore TCP IP parameters to default values.
-
get_drive_info_coco_moco(alias)¶ Get product codes, revision numbers, firmware versions and serial numbers from COCO and MOCO.
-
static
get_subnode_type(subnode)¶ Get a subnode type depending on the axis number.
- Parameters
subnode (
int) – Axis number of the drive.- Return type
- Returns
Subnode type.
- Raises
ValueError – For negative subnode values.
-
get_product_code(alias, subnode)¶ Get the product code of a drive.
-
get_revision_number(alias, subnode)¶ Get the revision number of a drive.
-
get_serial_number(alias, subnode)¶ Get the serial number of a drive.
-
get_fw_version(alias, subnode)¶ Get the firmware version of a drive.
-
get_vendor_id(servo='default', axis=1)¶ Get the vendor ID of a drive.
-
change_baudrate(baud_rate, servo='default')¶ Change a CANopen device’s baudrate.
- Parameters
baud_rate (
CAN_BAUDRATE) – New baud rate value.servo (
str) – servo alias to reference it.defaultby default.
- Raises
ValueError – If the servo is not a CANopen device.
- Return type
-
change_node_id(node_id, servo='default')¶ Change a CANopen device’s node ID.
- Parameters
- Raises
ValueError – If servo is not a CANopen device.
- Return type
-
set_velocity_pid(kp, ki=0, kd=0, servo='default', axis=1)¶ Set velocity PID values in the target servo and axis.
-
set_position_pid(kp, ki=0, kd=0, servo='default', axis=1)¶ Set position PID values in the target servo and axis.
-
get_rated_current(servo='default', axis=1)¶ Get rated current in the target servo and axis.
-
set_rated_current(rated_current, servo='default', axis=1)¶ Set rated current in the target servo and axis.
-
get_max_current(servo='default', axis=1)¶ Get max current in the target servo and axis.
-
get_absolute_encoder_1_resolution(servo='default', axis=1)¶ Reads ABS1 encoder resolution in the target servo and axis.
-
get_absolute_encoder_2_resolution(servo='default', axis=1)¶ Reads ABS2 encoder resolution in the target servo and axis.
-
get_auxiliar_feedback(servo='default', axis=1)¶ Reads auxiliar feedbacks value in the target servo and axis.
- Parameters
- Return type
- Returns
Type of feedback configured
- Raises
TypeError – If some read value has a wrong type.
-
get_auxiliar_feedback_category(servo='default', axis=1)¶ Reads auxiliar feedbacks type {ABSOLUTE or INCREMENTAL} in the target servo and axis.
- Parameters
- Return type
- Returns
Category {ABSOLUTE, INCREMENTAL} of the selected feedback.
-
get_auxiliar_feedback_resolution(servo='default', axis=1)¶ Reads auxiliar feedbacks resolution in the target servo and axis.
-
get_commutation_feedback(servo='default', axis=1)¶ Reads commutation feedbacks value in the target servo and axis.
- Parameters
- Return type
- Returns
Type of feedback configured.
- Raises
TypeError – If some read value has a wrong type.
-
get_commutation_feedback_category(servo='default', axis=1)¶ Reads commutation feedbacks type {ABSOLUTE or INCREMENTAL} in the target servo and axis.
- Parameters
- Return type
- Returns
Category {ABSOLUTE, INCREMENTAL} of the selected feedback.
-
get_commutation_feedback_resolution(servo='default', axis=1)¶ Reads commutation feedbacks resolution in the target servo and axis.
-
get_digital_halls_resolution(servo='default', axis=1)¶ Reads digital halls pole pairs in the target servo and axis.
-
get_feedback_polarity(feedback, servo='default', axis=1)¶ Get target feedback polarity of the target servo and axis.
- Parameters
feedback (
SensorType) – target feedback.servo (
str) – servo alias to reference it.defaultby default.axis (
int) – axis that will run the test.1by default.
- Return type
- Returns
Feedback polarity
- Raises
TypeError – If some read value has a wrong type.
-
get_feedback_polarity_register_uid(feedback)¶ Returns feedback polarity register UID
- Parameters
feedback (
SensorType) – target feedback sensor.- Return type
- Returns
Register UID
-
get_feedback_resolution(feedback, servo='default', axis=1)¶ Reads target feedback resolution in the target servo and axis.
- Parameters
feedback (
SensorType) – target feedback.servo (
str) – servo alias to reference it.defaultby default.axis (
int) – axis that will run the test.1by default.
- Return type
- Returns
Resolution of target feedback.
-
get_incremental_encoder_1_resolution(servo='default', axis=1)¶ Reads incremental encoder 1 resolution in the target servo and axis.
-
get_incremental_encoder_2_resolution(servo='default', axis=1)¶ Reads incremental encoder 2 resolution in the target servo and axis.
-
get_position_feedback(servo='default', axis=1)¶ Reads position feedbacks value in the target servo and axis.
- Parameters
- Return type
- Returns
Type of feedback configured.
- Raises
TypeError – If some read value has a wrong type.
-
get_position_feedback_category(servo='default', axis=1)¶ Reads position feedbacks type {ABSOLUTE or INCREMENTAL} in the target servo and axis.
- Parameters
- Return type
- Returns
Category {ABSOLUTE, INCREMENTAL} of the selected feedback.
-
get_position_feedback_resolution(servo='default', axis=1)¶ Reads position feedbacks resolution in the target servo and axis.
-
get_reference_feedback(servo='default', axis=1)¶ Reads reference feedbacks value in the target servo and axis.
- Parameters
- Return type
- Returns
Type of feedback configured
- Raises
TypeError – If some read value has a wrong type.
-
get_reference_feedback_category(servo='default', axis=1)¶ Reads reference feedbacks type {ABSOLUTE or INCREMENTAL} in the target servo and axis.
- Parameters
- Return type
- Returns
Category {ABSOLUTE, INCREMENTAL} of the selected feedback.
-
get_reference_feedback_resolution(servo='default', axis=1)¶ Reads reference feedbacks resolution in the target servo and axis.
-
get_secondary_ssi_resolution(servo='default', axis=1)¶ Reads secondary SSI encoder resolution in the target servo and axis.
-
get_velocity_feedback(servo='default', axis=1)¶ Reads velocity feedbacks value in the target servo and axis.
- Parameters
- Return type
- Returns
Type of feedback configured
- Raises
TypeError – If some read value has a wrong type.
-
get_velocity_feedback_category(servo='default', axis=1)¶ Reads velocity feedbacks type {ABSOLUTE or INCREMENTAL} in the target servo and axis.
- Parameters
- Return type
- Returns
Category {ABSOLUTE, INCREMENTAL} of the selected feedback.
-
get_velocity_feedback_resolution(servo='default', axis=1)¶ Reads velocity feedbacks resolution in the target servo and axis.
-
homing_on_current_position(hom_offset, servo='default', axis=1)¶ Do current position homing.
-
homing_on_index_pulse(hom_offset, direction, index, timeout_ms, zero_vel, servo='default', axis=1, motor_enable=True)¶ Do homing on index pulse.
Note
Motor must be well phased before run any homing.
- Parameters
hom_offset (
int) – homing offset.direction (
int) – direction.1is positive,0is negative.index (
int) – select incremental encoder,0for incremental encoder 1,1for incremental encoder 2.timeout_ms (
int) – homing timeout in milliseconds.zero_vel (
int) – speed to search for the actual homing point, in mrev/s.servo (
str) – servo alias to reference it.defaultby default.axis (
int) – servo axis.1by default.motor_enable (
bool) – ifTruedo motor enable.Trueby default.
- Return type
-
homing_on_switch_limit(hom_offset, direction, switch, timeout_ms, lim_vel, zero_vel, servo='default', axis=1, motor_enable=True)¶ Do homing on switch limit.
Note
Motor must be well phased before run any homing.
- Parameters
hom_offset (
int) – homing offset.direction (
int) – direction.1is positive,0is negative.switch (
int) – switch index.timeout_ms (
int) – homing timeout in milliseconds.lim_vel (
int) – speed to search for the switch, in mrev/s.zero_vel (
int) – speed to search for the actual homing point, in mrev/s.servo (
str) – servo alias to reference it.defaultby default.axis (
int) – servo axis.1by default.motor_enable (
bool) – ifTruedo motor enable.Trueby default.
- Return type
-
homing_on_switch_limit_and_index_pulse(hom_offset, direction, switch, index, timeout_ms, lim_vel, zero_vel, servo='default', axis=1, motor_enable=True)¶ Do homing on switch limit and index pulse.
Note
Motor must be well phased before run any homing.
- Parameters
hom_offset (
int) – homing offset.direction (
int) – direction.1is positive,0is negative.switch (
int) – switch index.index (
int) – select incremental encoder,0for incremental encoder 1,1for incremental encoder 2.timeout_ms (
int) – homing timeout in milliseconds.lim_vel (
int) – speed to search for the switch, in mrev/s.zero_vel (
int) – speed to search for the actual homing point, in mrev/s.servo (
str) – servo alias to reference it.defaultby default.axis (
int) – servo axis.1by default.motor_enable (
bool) – ifTruedo motor enable.Trueby default.
- Return type
-
set_auxiliar_feedback(feedback, servo='default', axis=1)¶ Writes auxiliar feedbacks value in the target servo and axis.
- Parameters
feedback (
SensorType) – feedback sensor numberservo (
str) – servo alias to reference it.defaultby default.axis (
int) – axis that will run the test.1by default.
- Raises
IMStatusWordError – If motor is enabled.
- Return type
-
set_commutation_feedback(feedback, servo='default', axis=1)¶ Writes commutation feedbacks value in the target servo and axis.
- Parameters
feedback (
SensorType) – feedback sensor numberservo (
str) – servo alias to reference it.defaultby default.axis (
int) – axis that will run the test.1by default.
- Raises
IMStatusWordError – If motor is enabled.
- Return type
-
set_feedback_polarity(polarity, feedback, servo='default', axis=1)¶ Set target feedback polarity in the target servo and axis.
- Parameters
polarity (
FeedbackPolarity) – target polarity.feedback (
SensorType) – target feedback.servo (
str) – servo alias to reference it.defaultby default.axis (
int) – axis that will run the test.1by default.
- Return type
-
set_homing_mode(homing_mode, servo='default', axis=1)¶ Set homing mode.
- Parameters
homing_mode (
HomingMode) – homing mode.servo (
str) – servo alias to reference it.defaultby default.axis (
int) – servo axis.1by default.
- Return type
-
set_homing_offset(homing_offset, servo='default', axis=1)¶ Set homing offset configuration.
-
set_homing_timeout(timeout_ms, servo='default', axis=1)¶ Set homing timeout configuration.
-
set_position_feedback(feedback, servo='default', axis=1)¶ Writes position feedbacks value in the target servo and axis.
- Parameters
feedback (
SensorType) – feedback sensor numberservo (
str) – servo alias to reference it.defaultby default.axis (
int) – axis that will run the test.1by default.
- Raises
IMStatusWordError – If motor is enabled.
- Return type
-
set_reference_feedback(feedback, servo='default', axis=1)¶ Writes reference feedbacks value in the target servo and axis.
- Parameters
feedback (
SensorType) – feedback sensor numberservo (
str) – servo alias to reference it.defaultby default.axis (
int) – axis that will run the test.1by default.
- Raises
IMStatusWordError – If motor is enabled.
- Return type
-
set_velocity_feedback(feedback, servo='default', axis=1)¶ Writes velocity feedbacks value in the target servo and axis.
- Parameters
feedback (
SensorType) – feedback sensor numberservo (
str) – servo alias to reference it.defaultby default.axis (
int) – axis that will run the test.1by default.
- Raises
IMStatusWordError – If motor is enabled.
- Return type
-
class