An object-oriented Python library for interfacing with the MCM module by Janssen Precision Engineering via cacli.exe (provided on the Janssen website). Implements all functions except autocalibration (as it is interactive).
Linear positioner import syntax: from pyjanssen import MCM, FORWARD, BACKWARD
Rotational positioner import syntax: from pyjanssen import MCM, CW, CCW
Class MCM provides an object-oriented wrapper for cacli.exe
provided by Janssen Precision Engineering for control of their low temperature piezoelectric positioners
Example usage:
from pyjanssen import MCM, FORWARD, BACKWARD
m = MCM() # connect to the Janssen MCM using cacli.exe in current directory
m.move(1, FORWARD) # moves in positive direction
m.move(2, BACKWARD, frequency=10, step_size=50, temperature=293, steps=100, profile='PROFILE1') # moves in negative direction; sets new frequency, step_size, temperature, steps, and profile config
print(m.get_position(1)) # ask the MCM for the position of axis 1 (requires OEM2 module)
arguments: *device (default None) to specify specific MCM module if multiple returns: MCM instance
kwargs: exe (string) to specify path to cacli.exe if not in current directory server (bool) to specify use of cacli.exe in server mode (good for fast command responses) verbose (bool) to output commands and responses from cacli.exe for debugging
Not implemented (needs input/output)
returns: dictionary of STATUS
arguments: *pgain (default 300) returns: dictionary of STATUS
uses values from channel 1 when setting TEMP, TYPE
arguments: address returns: frequency for given address
arguments: address returns: dictionary of Version and Available Channels
kwargs: force
command to run ignoring servodrive
gets module information
arguments: address, *channel (default 1) returns: dictionary of TYPE and TAG
kwargs: force command to run ignoring servodrive
gets positioner information
arguments: address, *channel (default 1) returns: position (integer)
kwargs: force command to run ignoring servodrive
arguments: address, *channel (default 1) returns: raw encoder value (integer)
kwargs: force command to run ignoring servodrive
returns 'rvl' value from POS command
arguments: address returns: dictionary of FAILSAFE STATE and STATUS
kwargs: force command to run ignoring servodrive
gets status of address
arguments: address, direction, *channel (default 1), **kwargs returns: dictionary of STATUS
kwargs: frequency, step_size, temperature, steps, profile
takes address of module to move and direction (FORWARD, BACKWARD) as well as optional channel if using CADM module (not CADM2!) plus optional kwargs to set frequency/step size/temperature (these values are retained)
arguments: address returns: profile for given address reset_position(self, address, channel=1, **kwargs) arguments: address, *channel (default 1) returns: string
kwargs: force command to run ignoring servodrive
resets the position counter to 0
arguments: address, direction, *channel (default 1), **kwargs returns: dictionary of STATUS
kwargs: frequency, step_size, temperature, steps, profile
!! NOTE !! From the manual: The CADM2 module will perform an ‘automatic zero calibration’ upon power on to make sure the connected actuator will not move at an input voltage of o (zero) [V]14. However, this means that it is required to hold the input at 0 (zero) [V] during power on of the module (do not let the input float).
returns: dictionary of STATUS servodrive_find_end_stops(self, direction, filter, zero, **kwargs) arguments: direction, filter, zero returns: dictionary of STATUS
direction: FORWARD or BACKWARD filter: integer, 1-20, velocity polling delay (relative) zero: boolean, reset position after completion
arguments: *pos1, *pos2, *pos3 (set 0 if not connected) returns: dictionary of STATUS servodrive_status_position(self, **kwargs) returns: dictionary of STATUS, ENABLED, BUSY, POS1, POS2, POS3, ERR1, ERR2, ERR3
ENABLED is 0 (disabled), 1 (enabled), 2 (find end stop active) BUSY is 1 if minimizing error between setpoint and current point POSx is current position information for each ERRx is the difference between current position and target position
arguments: address, frequency
in Hz, between 0 and 600
arguments: address, profile
name of controller profile
arguments: address, step_size
in %, between 0 and 100
arguments: address, steps
number, between 0 and 50000
arguments: address, temperature
in K, between 0 and 300
arguments: address returns: step_size for given address
arguments: address returns: steps for given address
arguments: address returns: dictionary of STATUS
kwargs: force command to run ignoring servodrive
stops movement (Flexidrive only)
arguments: address returns: temperature for given address