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()
.
-
check_configuration
(config_path, axis=None, servo='default')¶ Check if the drive is configured in the same way as the given configuration file. Compares the value of each register in the given file with the corresponding value in the drive.
- Parameters
- Raises
FileNotFoundError – If configuration file does not exist.
ValueError – If a configuration file from a subnode different from 0 is attempted to be loaded to subnode 0.
ValueError – If an invalid subnode is provided.
ILConfigurationError – If the configuration file differs from the drive state.
- Return type
-
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
-
get_max_velocity
(servo='default', axis=1)¶ Get the maximum velocity.
-
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.default
by default.axis (
int
) – servo axis.1
by 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.default
by default.axis (
int
) – servo axis.1
by 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
(servo='default')¶ Get product codes, revision numbers, firmware versions and serial numbers from COCO and MOCO.
-
static
get_subnode_type
(axis)¶ Get a subnode type depending on the axis number.
- Parameters
axis (
int
) – Axis number of the drive.- Return type
- Returns
Subnode type.
- Raises
ValueError – For negative subnode values.
-
get_product_code
(servo='default', axis=1)¶ Get the product code of a drive.
-
get_revision_number
(servo='default', axis=1)¶ Get the revision number of a drive.
-
get_serial_number
(servo='default', axis=1)¶ Get the serial number of a drive.
-
get_fw_version
(servo='default', axis=1)¶ 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.default
by 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_commutation_mode
(servo='default', axis=1)¶ Get commutation mode in the target servo and axis.
- Parameters
- Return type
- Returns
Commutation mode.
- Raises
TypeError – If some read value has a wrong type.
-
set_commutation_mode
(commutation_mode, servo='default', axis=1)¶ Set commutation mode in the target servo and axis.
- Parameters
commutation_mode (
CommutationMode
) – target commutation mode.servo (
str
) – servo alias to reference it.default
by default.axis (
int
) – servo axis.1
by default.
- Return type
-
get_bus_voltage
(servo='default', axis=1)¶ Get Bus voltage.
-
get_pos_to_vel_ratio
(servo='default', axis=1)¶ Get the position-to-velocity ratio.
-
set_pos_to_vel_ratio
(pos_to_vel_ratio, servo='default', axis=1)¶ Set the position-to-velocity ratio.
-
configure_filter
(signal, number, filter_type=None, frequency=None, q_factor=None, gain=None, servo='default', axis=1)¶ Configure a filter.
- Parameters
signal (
FilterSignal
) – Signal to be filtered.number (
FilterNumber
) – Filter number (1 or 2).filter_type (
Optional
[FilterType
]) – Filter type.servo (
str
) – servo alias to reference it.default
by default.axis (
int
) – servo axis.1
by default.
- Return type
-
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.default
by default.axis (
int
) – axis that will run the test.1
by 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.default
by default.axis (
int
) – axis that will run the test.1
by 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.1
is positive,0
is negative.index (
int
) – select incremental encoder,0
for incremental encoder 1,1
for 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.default
by default.axis (
int
) – servo axis.1
by default.motor_enable (
bool
) – ifTrue
do motor enable.True
by 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.1
is positive,0
is 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.default
by default.axis (
int
) – servo axis.1
by default.motor_enable (
bool
) – ifTrue
do motor enable.True
by 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.1
is positive,0
is negative.switch (
int
) – switch index.index (
int
) – select incremental encoder,0
for incremental encoder 1,1
for 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.default
by default.axis (
int
) – servo axis.1
by default.motor_enable (
bool
) – ifTrue
do motor enable.True
by 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.default
by default.axis (
int
) – axis that will run the test.1
by 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.default
by default.axis (
int
) – axis that will run the test.1
by 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.default
by default.axis (
int
) – axis that will run the test.1
by 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.default
by default.axis (
int
) – servo axis.1
by 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.default
by default.axis (
int
) – axis that will run the test.1
by 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.default
by default.axis (
int
) – axis that will run the test.1
by 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.default
by default.axis (
int
) – axis that will run the test.1
by default.
- Raises
IMStatusWordError – If motor is enabled.
- Return type
-
class