Package: pyjanssen
pyjanssenAn object-oriented Python library for interfacing with the MCM module by Janssen Precision Engineering via cacli.exe (provided onthe Janssen website). Implements all functions except autocalibration (as it is interactive).UsageLinear positioner import syntax:from pyjanssen import MCM, FORWARD, BACKWARDRotational positioner import syntax:from pyjanssen import MCM, CW, CCWClass MCM provides an object-oriented wrapper forcacli.exeprovided by Janssen Precision Engineering for control of their low temperature piezoelectric positionersExample usage:frompyjanssenimportMCM,FORWARD,BACKWARDm=MCM()# connect to the Janssen MCM using cacli.exe in current directorym.move(1,FORWARD)# moves in positive directionm.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 configprint(m.get_position(1))# ask the MCM for the position of axis 1 (requires OEM2 module)API ReferenceMCM(device=None, **kwargs)arguments: *device (default None) to specify specific MCM module if multiple
returns: MCM instancekwargs: 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 debuggingautocalibrate(self, address, channel, **kwargs)Not implemented (needs input/output)disable_servodrive(self)returns: dictionary of STATUSenable_servodrive(self, pgain=300, **kwargs)arguments: *pgain (default 300)
returns: dictionary of STATUSuses values from channel 1 when setting TEMP, TYPEfrequency(self, address)arguments: address
returns: frequency for given addressget_description(self, address, **kwargs)arguments: address
returns: dictionary of Version and Available Channelskwargs:forcecommand to run ignoring servodrive
gets module informationget_information(self, address, channel='1', **kwargs)arguments: address, *channel (default 1)
returns: dictionary of TYPE and TAGkwargs: force command to run ignoring servodrivegets positioner informationget_position(self, address, channel=1, **kwargs)arguments: address, *channel (default 1)
returns: position (integer)kwargs: force command to run ignoring servodriveget_position_raw(self, address, channel=1, **kwargs)arguments: address, *channel (default 1)
returns: raw encoder value (integer)kwargs: force command to run ignoring servodrivereturns 'rvl' value from POS commandget_status(self, address, **kwargs)arguments: address
returns: dictionary of FAILSAFE STATE and STATUSkwargs: force command to run ignoring servodrivegets status of addressmove(self, address, direction, channel=1, **kwargs)arguments: address, direction, *channel (default 1), **kwargs
returns: dictionary of STATUSkwargs: frequency, step_size, temperature, steps, profiletakes 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)profile(self, address)arguments: address
returns: profile for given address
reset_position(self, address, channel=1, **kwargs)
arguments: address, *channel (default 1)
returns: stringkwargs: force command to run ignoring servodriveresets the position counter to 0select_analogue_input(self, address, direction, channel=1, **kwargs)arguments: address, direction, *channel (default 1), **kwargs
returns: dictionary of STATUSkwargs: 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).servodrive_emergency_stop(self, **kwargs)returns: dictionary of STATUS
servodrive_find_end_stops(self, direction, filter, zero, **kwargs)
arguments: direction, filter, zero
returns: dictionary of STATUSdirection: FORWARD or BACKWARD
filter: integer, 1-20, velocity polling delay (relative)
zero: boolean, reset position after completionservodrive_go_to(self, pos1=0, pos2=0, pos3=0, **kwargs)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, ERR3ENABLED 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 positionset_frequency(self, address, frequency)arguments: address, frequencyin Hz, between 0 and 600set_profile(self, address, profile)arguments: address, profilename of controller profileset_step_size(self, address, step_size)arguments: address, step_sizein %, between 0 and 100set_steps(self, address, steps)arguments: address, stepsnumber, between 0 and 50000set_temperature(self, address, temperature)arguments: address, temperaturein K, between 0 and 300step_size(self, address)arguments: address
returns: step_size for given addresssteps(self, address)arguments: address
returns: steps for given addressstop(self, address, **kwargs)arguments: address
returns: dictionary of STATUSkwargs: force command to run ignoring servodrivestops movement (Flexidrive only)temperature(self, address)arguments: address
returns: temperature for given address