Servo

class ingenialink.servo.SERVO_FLAGS[source]

Status Flags.

CS_FOLLOWS = 4

(CST/CSV/CSP) follow command value.

FERR = 8

(CST/CSV/CSP/PV) following error.

HOMING_ATT = 4

(Homing) attained.

HOMING_ERR = 8

(Homing) error.

IANGLE_DET = 16

Initial angle determination finished.

ILIM_ACTIVE = 2

Internal limit active.

IP_ACTIVE = 4

(IP) active.

PP_SPACK = 4

(PP) SP acknowledge.

PV_VZERO = 4

(PV) Vocity speed is zero.

TGT_REACHED = 1

Target reached.

class ingenialink.servo.SERVO_MODE(value)[source]

Operation Mode.

CSP = 8

Cyclic sync position mode.

CST = 10

Cyclic sync torque mode.

CSV = 9

Cyclic sync velocity mode.

HOMING = 6

Homing mode.

IP = 7

Interpolated position mode.

OLS = 1

Open loop (scalar mode).

OLV = 0

Open loop (vector mode).

PP = 2

Profile position mode.

PT = 5

Profile torque mode.

PV = 4

Profile velocity mode.

VEL = 3

Velocity mode.

class ingenialink.servo.SERVO_STATE(value)[source]

State.

DISABLED = 1

Switch on disabled.

ENABLED = 4

Enabled.

FAULT = 7

Fault.

FAULTR = 6

Fault reactive.

NRDY = 0

Not ready to switch on.

ON = 3

Power switched on.

QSTOP = 5

Quick stop.

RDY = 2

Ready to be switched on.

class ingenialink.servo.SERVO_UNITS_ACC(value)[source]

Acceleration Units.

DEG_S2 = 3

Degrees/second^2.

MM_S2 = 5

Millimeters/second^2.

M_S2 = 6

Meters/second^2.

NATIVE = 0

Native.

RAD_S2 = 2

Radians/second^2.

REV_S2 = 1

Revolutions/second^2.

UM_S2 = 4

Micrometers/second^2.

class ingenialink.servo.SERVO_UNITS_POS(value)[source]

Position Units.

DEG = 3

Degrees.

M = 6

Meters.

MM = 5

Millimeters.

NATIVE = 0

Native.

RAD = 2

Radians.

REV = 1

Revolutions.

UM = 4

Micrometers.

class ingenialink.servo.SERVO_UNITS_TORQUE(value)[source]

Torque Units.

MN = 1

Millinewtons*meter.

N = 2

Newtons*meter.

NATIVE = 0

Native

class ingenialink.servo.SERVO_UNITS_VEL(value)[source]

Velocity Units.

DEG_S = 4

Degrees/second.

MM_S = 6

Millimeters/second.

M_S = 7

Meters/second.

NATIVE = 0

Native.

RAD_S = 3

Radians/second.

RPM = 2

Revolutions per minute.

RPS = 1

Revolutions per second.

UM_S = 5

Micrometers/second.

class ingenialink.servo.Servo(net, servo_id=None, dict_f=None)[source]

Servo.

Parameters
  • net (Network) – Network instance.

  • id (int) – Servo id.

Raises

ILCreationError – If the servo cannot be created.

connect_ecat(ifname, slave)[source]

Connect drive through SOEM communications.

Parameters
  • ifname – Interface name.

  • slave – Slave number.

Returns

Result code.

Return type

int

destroy()[source]

Destroy servo instance.

Returns

Result code.

Return type

int

property dict

Obtain dictionary of the servo.

Returns

Current dictionary of the servo.

Return type

dict

dict_load(dict_f)[source]

Load dictionary.

Parameters

dict_f (str) – Dictionary.

dict_storage_read(new_path, subnode=0)[source]

Read all dictionary registers content and put it to the dictionary storage.

Parameters

new_path (str) – Dictionary.

dict_storage_write(dict_f, subnode=0)[source]

Write current dictionary storage to the servo drive.

Parameters
  • dict_f (str) – Dictionary.

  • subnode (int, optional) – Subnode.

disable(subnode=1)[source]

Disable PDS.

disturbance_write_data(channel, dtype, data_arr)[source]

Write disturbance data.

Parameters
  • channel (int) – Channel identifier.

  • dtype (int) – Data type.

  • data_arr (array) – Data array.

emcy_subscribe(cb)[source]

Subscribe to emergency messages.

Parameters

cb – Callback

Returns

Assigned slot.

Return type

int

emcy_unsubscribe(slot)[source]

Unsubscribe from emergency messages.

Parameters

slot (int) – Assigned slot when subscribed.

enable(timeout=2.0, subnode=1)[source]

Enable PDS.

Parameters
  • timeout (int, float, optional) – Timeout (s).

  • subnode (int, optional) – Subnode.

property errors

Obtain drive errors.

Returns

Current errors.

Return type

dict

fault_reset(subnode=1)[source]

Fault reset.

Parameters

subnode (int, optional) – Subnode.

get_reg(reg, subnode)[source]

Obtain Register object and its identifier.

Parameters
  • reg (Register, str) – Register.

  • subnode (int) – Subnode.

Returns

Actual Register instance and its

identifier.

Return type

tuple (Register, string)

get_state(subnode=1)[source]

Obtain state of the servo.

Parameters

subnode (int, optional) – Subnode.

Returns

Servo state and state flags.

Return type

tuple

homing_start()[source]

Start the homing procedure.

homing_wait(timeout)[source]

Wait until homing completes.

Notes

The homing itself has a configurable timeout. The timeout given here is purely a ‘communications’ timeout, e.g. it could happen that the statusword change is never received. This timeout should be >= than the programmed homing timeout.

Parameters

timeout (int, float) – Timeout (s).

property info

Obtain servo information.

Returns

Servo information.

Return type

dict

property mode

Obtains Operation mode.

Returns

Current operation mode.

Return type

SERVO_MODE

property name

Obtain servo name.

Returns

Name.

Return type

str

property net

Obtain servo network.

Returns

Current servo network.

Return type

Network

property ol_frequency

Get open loop frequency.

Returns

Open loop frequency (mHz).

Return type

float

property ol_voltage

Get open loop voltage.

Returns

Open loop voltage (% relative to DC-bus, -1…1).

Return type

float

property position

Get actual position.

Returns

Actual position.

Return type

float

property position_res

Get postion resolution.

Returns

Position resolution (c/rev/s, c/ppitch/s).

Return type

int

raw_read(reg, subnode=1)[source]

Raw read from servo.

Parameters

reg (Register) – Register.

Returns

Otained value

Return type

int

Raises

TypeError – If the register type is not valid.

raw_write(reg, data, confirm=True, extended=0, subnode=1)[source]

Raw write to servo.

Parameters
  • reg (Register) – Register.

  • data (int) – Data.

  • confirm (bool, optional) – Confirm write.

  • extended (int, optional) – Extended frame.

Raises

TypeError – If any of the arguments type is not valid or unsupported.

read(reg, subnode=1)[source]

Read from servo.

Parameters

reg (str, Register) – Register.

Returns

Otained value

Return type

float

Raises

TypeError – If the register type is not valid.

reload_errors(dict_f)[source]

Force to reload all dictionary errors.

Parameters

dict_f (str) – Dictionary.

reset()[source]

Reset servo.

Notes

You may need to reconnect the network after reset.

state_subs_stop(stop)[source]

Stop servo state subscriptions.

Parameters

stop (int) – start: 0, stop: 1.

Returns

Result code.

Return type

int

state_subscribe(cb)[source]

Subscribe to state changes.

Parameters

cb – Callback

Returns

Assigned slot.

Return type

int

state_unsubscribe(slot)[source]

Unsubscribe from state changes.

Parameters

slot (int) – Assigned slot when subscribed.

store_all(subnode=1)[source]

Store all servo current parameters to the NVM.

Parameters

subnode (int, optional) – Subnode.

store_app()[source]

Store all servo current application parameters to the NVM.

store_comm()[source]

Store all servo current communications to the NVM.

property subnodes

Obtain number of subnodes.

Returns

Current number of subnodes.

Return type

int

switch_on(timeout=2.0)[source]

Switch on PDS.

This function switches on the PDS but it does not enable the motor. For most application cases, you should only use the enable function.

Parameters

timeout (int, float, optional) – Timeout (s).

property torque

Get actual torque.

Returns

Actual torque.

Return type

float

property units_acc

Acceleration units.

Type

SERVO_UNITS_ACC

units_factor(reg)[source]

Obtain units scale factor for the given register.

Parameters

reg (Register) – Register.

Returns

Scale factor for the given register.

Return type

float

property units_pos

Position units.

Type

SERVO_UNITS_POS

property units_torque

Torque units.

Type

SERVO_UNITS_TORQUE

units_update()[source]

Update units scaling factors.

Notes

This must be called if any encoder parameter, rated torque or pole pitch are changed, otherwise, the readings conversions will not be correct.

property units_vel

Velocity units.

Type

SERVO_UNITS_VEL

property velocity

Get actual velocity.

Returns

Actual velocity.

Return type

float

property velocity_res

Get velocity resolution.

Returns

Velocity resolution (c/rev, c/ppitch).

Return type

int

wait_reached(timeout)[source]

Wait until the servo does a target reach.

Parameters

timeout (int, float) – Timeout (s).

write(reg, data, confirm=True, extended=0, subnode=1)[source]

Write to servo.

Parameters
  • reg (Register) – Register.

  • data (int) – Data.

  • confirm (bool, optional) – Confirm write.

  • extended (int, optional) – Extended frame.

Raises

TypeError – If any of the arguments type is not valid or unsupported.

ingenialink.servo.connect_ecat(ifname, dict_f, slave=1)[source]

Connect the drive through SOEM communications.

Parameters
  • ifname – Interface name.

  • dict_f – Dictionary path.

  • slave – Slave number.

Returns

Servo and Network.

Return type

tuple

ingenialink.servo.lucky(prot, dict_f=None, address_ip=None, port_ip=23, protocol=1)[source]

Obtain an instance of the first available Servo.

Parameters
  • prot (NET_PROT) – Network protocol.

  • dict_f (str, optional) – Dictionary.

Returns

  • Network: Servo network instance.

  • Servo: Servo instance.

Return type

tuple

ingenialink.servo.servo_is_connected(address_ip, port_ip=1061, protocol=1)[source]

Obtain boolean with result of search a servo into ip.

Parameters

address_ip – IP Address.

Returns

bool