qmi.instruments.newport.smc_100pp

Instrument driver for the Newport SMC100PP motion controller.

Classes

Newport_SMC100PP(context, name, transport, ...)

Instrument driver for the Newport SMC100PP servo motion controller.

class qmi.instruments.newport.smc_100pp.Newport_SMC100PP(context: QMI_Context, name: str, transport: str, serial: str, actuators: Dict[int | None, LinearActuator], baudrate: int = 57600)

Instrument driver for the Newport SMC100PP servo motion controller.

get_micro_step_per_full_step_factor(controller_address: int | None = None) float

Get the micro-step per full step factor of the motor configuration.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

Returns:

The micro-step per full step factor as float.

Return type:

factor

set_micro_step_per_full_step_factor(factor: int, controller_address: int | None = None) None

Set the micro-step per full step factor of the motor configuration.

Parameters:
  • factor – Micro-step per full step factor.

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

get_motion_distance_per_full_step(controller_address: int | None = None) float

Get the motion distance per motor’s full step.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

Returns:

Motion distance as float.

Return type:

m_dist

set_motion_distance_per_full_step(m_dist: float, controller_address: int | None = None) None

Set the motion distance per motor’s full step.

Parameters:
  • m_dist – Motion distance per motor’s full step.

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

get_base_velocity(controller_address: int | None = None) float

Get the profile generator base velocity.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

Returns:

Base velocity as float.

Return type:

base_velocity

set_base_velocity(base_velocity: float, persist: bool | None = False, controller_address: int | None = None) None

Set the profile generator base velocity. It must not be larger than the maximum velocity set by VA command.

Parameters:
  • base_velocity – New profile generator base velocity.

  • persist – Flag to indicate if the velocity should be persisted to the controller’s memory, so it is still available after powering down the controller. When not persisted, the maximum base velocity that can be set is the one stored in the controller’s memory.

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

close() None

Close the connection to the instrument hardware and release associated resources.

When this method returns, the instrument must not be used again unless it is first re-opened by calling the open() method.

Subclasses can extend this method if they have specific resources to close. If they do, they should call super().close() as a last statement.

property controller_address: int | None

Address of the controller that needs to be controlled.

force_unlock() None

Forcefully unlock the remote object.

This unlocks the object, regardless of who owns the lock. This allows you to unlock an object if the locking proxy has been destroyed without unlocking.

Use this with care.

Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.

get_acceleration(controller_address: int | None = None) float

Get the acceleration of the actuator in preset unit/s^2, so if the encoder unit is mm, then the returned value is in mm/s^2.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

Returns:

Encoder increment value.

get_analog_input_value(controller_address: int | None = None) float

Get the analog input value.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

Returns:

Analog input value in Volts.

get_backlash_compensation(controller_address: int | None = None) float

Get the backlash value in encoder units.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

classmethod get_category() str | None

Return the optional name of the category this object belongs to.

A category name is a free-form string that has no special significance. Its purpose is to distinguish between groups of RPC objects that fulfill similar roles.

get_controller_rs485_address() int

Get the controller’s RS-485 address. Controller address is always 1 for this command.

Returns:

Controller’s axis number for new RS485 address.

Return type:

rs485_address

get_error(controller_address: int | None = None) Tuple[str, str]

Get the currently memorised error.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

Returns:

A tuple containing the error code and the human-readable error message.

get_home_search_timeout(controller_address: int | None = None) float

Get the timeout for the home search.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

Returns:

The timeout in seconds.

get_home_search_type(controller_address: int | None = None) int

Get the type of HOME search used with the OR command.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

get_hysteresis_compensation(controller_address: int | None = None) float

Get the hysteresis value in encoder units.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

get_idn(controller_address: int | None = None) QMI_InstrumentIdentification

Read instrument type and version and return QMI_InstrumentIdentification instance.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

Returns:

QMI_InstrumentIdentification with the information of the instrument.

get_jerk_time(controller_address: int | None = None) float

Get the jerk time of the actuator.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

Returns:

Jerk time in seconds.

Return type:

jerk_time

get_motion_time(displacement: float, controller_address: int | None = None) float

Get the motion time for a relative move.

Parameters:
  • displacement – Displacement from current position (relative move size).

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

Returns:

Motion time for a relative move in seconds.

get_name() str

Return the name of this object.

Returns:

name attribute.

get_negative_software_limit(controller_address: int | None = None) float

Get the negative software limit.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

Returns:

Controller’s negative software limit.

Return type:

neg_sw_limit

get_peak_current_limit(controller_address: int | None = None) float

Get the controller’s maximum or peak output current limit to the motor.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

get_position(controller_address: int | None = None) float

Get the actual position of the actuator according to the encoder value.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

Returns:

Current position in encoder units.

get_positioner_error_and_state(controller_address: int | None = None) Tuple[List[str], str]

Get the positioner error and the current state of the controller.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

get_positive_software_limit(controller_address: int | None = None) float

Get the positive software limit.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

Returns:

Controller’s positive software limit.

Return type:

pos_sw_limit

get_rms_current_averaging_time(controller_address: int | None = None) float

Get the controller’s averaging period for rms current calculation.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

get_rms_current_limit(controller_address: int | None = None) float

Get the controller’s rms output current limit to the motor.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

get_setpoint(controller_address: int | None = None) float

Get the set-point position of the actuator according to the encoder value.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

Returns:

Set-point position in encoder units.

get_signals() list[SignalDescription]

Return a list of signals that can be published by this object.

Returns:

List consisting of qmi_signals attributes.

get_stage_identifier(controller_address: int | None = None) str

Read stage identifier.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

Returns:

The stage identifier.

get_ttl_input_value(controller_address: int | None = None) int

Get the TTL input value. The returned decimal number represents the binary word made of all 4 inputs, where bit 0 is input 1, bit 1 is input 2, bit 2 is input 3, and bit 3 is input 4.

The TTL input value is 1 when the corresponding voltage on the pin is larger than 2.4 volts, and it is 0 when the corresponding voltage is below 0.8 volt. When the voltage is between these two values, the result is unreliable and can be 1 or 0.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

Returns:

TTL input value in bits. E.g. ‘5’ means input 0 and 2 are high, all others are low.

get_ttl_output_value(controller_address: int | None = None) int

Get the TTL output value. The returned decimal number represents the binary word made of all 4 outputs, where bit 0 is output 1, bit 1 is output 2, bit 2 is output 3, and bit 3 is output 4.

A 1 represents closed collector output transistor of the output. A 0 represents open collector output transistor of the output.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

Returns:

TTL output value in bits. E.g. ‘3’ means TTL outputs 1 & 2 are closed and outputs 3 & 4 open.

get_velocity(controller_address: int | None = None) float

Get the velocity of the actuator in unit/s, so if the encoder unit is mm, then the returned value is in mm/s.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

Execute the home search. This is needed before any motion commands can be executed. It finds an origin position for the actuator. Can be done only in NOT REFERENCED state.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

is_in_configuration_state(controller_address: int | None = None) bool

Get the CONFIGURATION state of the controller.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

Returns:

Boolean indicating if the controller is in CONFIGURATION state (True) or not (False).

Return type:

state

is_in_disable_state(controller_address: int | None = None) bool

Get the DISABLE or READY state of the controller.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

Returns:

Boolean to indicate state is DISABLE (True) or READY (False)

Return type:

state

is_locked() bool

Query if the remote object is locked.

Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.

is_open() bool

Return True if the instrument is open (ready for interaction).

lock(timeout: float = 0.0, lock_token: str | None = None) bool

Lock the remote object. If timeout is given, try every 0.1s within the given timeout value. The remote object can be locked with an optional custom lock token by giving a string into lock_token keyword argument.

If successful, this proxy is the only proxy that can invoke RPC methods on the remote object; other proxies will receive an “object is locked” response. The return value indicates if the lock was granted; a denied lock means the object was already locked by another proxy.

Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.

move_absolute(position: float, controller_address: int | None = None) None

Perform an absolute move. This command can take several seconds to finish. However, it is not blocking. Use other methods such as get_positioner_error_and_state to query the state of the controller.

Parameters:
  • position – New position to move to, in encoder units. Must be within actuator’s travel range.

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

move_relative(displacement: float, controller_address: int | None = None) None

Perform a relative move from the current position.

Parameters:
  • displacement – Displacement from current position.

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

open() None

Connect to the instrument hardware.

When this method returns, the instrument must be ready for interaction via calls to instrument-specific methods.

Subclasses can extend this method to implement instrument-specific initialization. If they do, they should call super().open() as a last statement.

release_rpc_object() None

Give a warning if the instrument is removed while still open.

reset(controller_address: int | None = None) None

Reset the instrument. Equivalent to a power-up.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

set_acceleration(acceleration: float, persist: bool = False, controller_address: int | None = None) None

Set the acceleration at which the actuator moves. Can be set only in CONFIGURATION, READY and DISABLE states.

Parameters:
  • acceleration – Acceleration in preset unit/s^2. The unit depends on the encoder resolution, which is usually set to 1mm.

  • persist – Flag to indicate if the acceleration should be persisted to the controller’s memory, so it is still available after powering down the controller. When not persisted, the maximum allowable acceleration that can be set is the one stored in the controller’s memory.

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

set_backlash_compensation(backlash_comp: float, controller_address: int | None = None) None

Set the backlash compensation of a controller.

Parameters:
  • backlash_comp – backlash compensation in encoder units.

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

set_configuration_state(state: bool, controller_address: int | None = None) None

Set the NOT REFERENCED or CONFIGURATION state of the controller. If the controller is not in the either state, then an exception is raised in the _check_error. NOTE: In this state the parameters are stored in the flash memory of the controller.

Parameters:
  • state – False for setting the configuration state from CONFIGURATION to NOT REFERENECED or True for setting the configuration state from NOT REFERENECED to CONFIGURATION.

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

set_controller_rs485_address(rs485_address: int) None

Set the controller’s RS-485 address. Controller address is always 1 for this command.

Parameters:

rs485_address – Controller’s axis number for new RS485 address.

set_disable_state(state: bool, controller_address: int | None = None) None

Set the DISABLE or READY state of the controller from the READY or DISABLE state, respectively. If the controller is not in the either state, then an exception is raised in the _check_error. NOTE: In this state the parameters are stored in the flash memory of the controller.

Parameters:
  • state – True for setting state from READY to DISABLE, False for vice versa.

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

set_home_search_timeout(timeout: float | None = None, controller_address: int | None = None) None

Set the timeout for the home search.

Parameters:
  • timeout – Optional timeout in seconds. If not set, it defaults DEFAULT_HOME_SEARCH_TIMEOUT

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

set_home_search_type(home_search_type: int, controller_address: int | None = None) None

Set the type of HOME search used with the OR command.

Parameters:
  • home_search_type – New type of HOME search used with the OR command.

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

set_hysteresis_compensation(hysteresis_comp: float, controller_address: int | None = None) None

Set the hysteresis compensation of a controller.

Parameters:
  • hysteresis_comp – hysteresis compensation in encoder units.

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

set_jerk_time(jerk_time: float, persist: bool = False, controller_address: int | None = None) None

Set the jerk time at which the actuator accelerates.

Parameters:
  • jerk_time – Jerk time in seconds.

  • persist – Flag to indicate if the jerk time should be persisted to the controller’s memory, so it is still available after powering down the controller. When not persisted, the maximum allowable jerk time that can be set is the one stored in the controller’s memory.

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

set_negative_software_limit(neg_sw_limit: float, persist: bool = False, controller_address: int | None = None) None

Set the negative software limit.

Parameters:
  • neg_sw_limit – Controller’s negative software limit.

  • persist – Flag to indicate if the software limit should be persisted to the controller’s memory, so it is still available after powering down the controller. When not persisted, the negative software limit is the one stored in the controller’s memory.

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

set_peak_current_limit(current_limit: float, controller_address: int | None = None) None

Set the controller’s maximum or peak output current limit to the motor.

Parameters:
  • current_limit – Controller’s maximum or peak output current limit to the motor in [A].

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

set_positive_software_limit(pos_sw_limit: float, persist: bool = False, controller_address: int | None = None) None

Set the positive software limit.

Parameters:
  • pos_sw_limit – Controller’s positive software limit.

  • persist – Flag to indicate if the software limit should be persisted to the controller’s memory, so it is still available after powering down the controller. When not persisted, the positive software limit is the one stored in the controller’s memory.

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

set_rms_current_averaging_time(averaging_time: float, controller_address: int | None = None) None

Set the controller’s averaging period for rms current calculation.

Parameters:
  • averaging_time – Controller’s averaging period for rms current calculation in [s].

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

set_rms_current_limit(current_limit: float, controller_address: int | None = None) None

Set the controller’s maximum or rms output current limit to the motor.

Parameters:
  • current_limit – Controller’s maximum or rms output current limit to the motor in [A].

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

set_ttl_output_value(ttl_output_value: int, controller_address: int | None = None) None

Get the TTL output value. The value is a binary word made of all 4 outputs, where bit 0 is output 1, bit 1 is output 2, bit 2 is output 3, and bit 3 is output 4.

A 1 closes the open collector output transistor of the output. A 0 blocks the open collector output transistor of the output.

Parameters:
  • ttl_output_value – New TTL output value.

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

set_velocity(velocity: float, persist: bool = False, controller_address: int | None = None) None

Set the velocity at which the actuator moves.

Parameters:
  • velocity – Velocity in unit/s. The unit depends on the encoder resolution, which is usually set to 1mm.

  • persist – Flag to indicate if the velocity should be persisted to the controller’s memory, so it is still available after powering down the controller. When not persisted, the maximum allowable velocity that can be set is the one stored in the controller’s memory.

  • controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

stop_motion(controller_address: int | None = None) None

Stop the motion of the actuator by decelerating it. Works on DISABLE, READY and MOTION states.

Parameters:

controller_address – Optional address of the controller that needs to be controlled. By default, it is set to the initialised value of the controller address.

unlock(lock_token: str | None = None) bool

Unlock the remote object.

Without optional parameters, this is only allowed by the proxy that initially locked the object. By giving the lock token as an input parameter, the specific object locked by this token can be unlocked. The return value indicates if the unlocking was successful.

Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.