org.mbari.siam.foce.devices.elmo.base
Class Elmo

java.lang.Object
  extended by org.mbari.siam.foce.devices.elmo.base.Elmo
Direct Known Subclasses:
ElmoSolo

public abstract class Elmo
extends java.lang.Object

Base class for Elmo motor controllers.


Field Summary
protected  byte[] _doubleBuf
           
protected  byte[] _intBuf
           
protected  byte[] _junk32
          Buffer for reading disposable input
protected static org.apache.log4j.Logger _log4j
          Log4j logger
protected  byte[] _longBuf
           
protected  int _serialMode
          Serial port mode.
protected  gnu.io.SerialPort _serialPort
          Serial port for Elmo control I/O
protected  java.io.InputStream _serialRx
          Serial port input stream
protected  java.io.OutputStream _serialTx
          Serial port output stream
protected  byte[] _stringBuf
           
protected  byte[] _terminator
          Response terminator (as byte array)
protected  java.lang.String _terminatorString
          Response terminator (as String)
static int BUF128
          Buffer size (128)
static int BUF32
          Buffer size (32)
static java.lang.String CMD_ABSOLUTE_POSITION
          Get/Set absolute position
static java.lang.String CMD_ACCELERATION
          Get/Set acceleration
static java.lang.String CMD_ARM_HOMING_PROCESS
          Arm homing process
static java.lang.String CMD_BEGIN_MOTION
          Begin motion
static java.lang.String CMD_COMMUTATION_ARRAY
          Get/Set commutation array parameters
static java.lang.String CMD_CONT_CURRENT_LIMIT
          Get/set continuous active current limit Max value=MC/2 Supply current = (active current) * (PWM duty cycle)
static java.lang.String CMD_CURRENT_I_FILTER
          Get/Set controller current PID gain (Integral)
static java.lang.String CMD_CURRENT_P_FILTER
          Get/Set controller current PID gain (Proportional)
static java.lang.String CMD_DECELERATION
          Get/Set motion deceleration
static java.lang.String CMD_DIGITAL_INPUT_FILTER
          Get/Set Digital input filter
static java.lang.String CMD_DIGITIAL_OUTPUT
          Get/Set digital output state
static java.lang.String CMD_DISARM_HOMING_PROCESS
          Disarm homing process
static java.lang.String CMD_DUMP_CPU
          Set hex mode off
static java.lang.String CMD_ECHO
          Get/Set echo mode
static java.lang.String CMD_ENABLE_AUX_HOME_SEQUENCE_HI
          Configure high speed input as active HI/aux homing trigger
static java.lang.String CMD_ENABLE_AUX_HOME_SEQUENCE_LO
          Configure high speed input as active LO/aux homing trigger
static java.lang.String CMD_ENABLE_MAIN_HOME_SEQUENCE_HI
          Configure high speed input as active HI/main homing trigger
static java.lang.String CMD_ENABLE_MAIN_HOME_SEQUENCE_LO
          Configure high speed input as active LO/main homing trigger
static java.lang.String CMD_GENERAL_PURPOSE_HI
          Configure high speed input as active HI/general purpose
static java.lang.String CMD_GET_AUX_ENC_VELOCITY
          Get velocity aux encoder velocity
static java.lang.String CMD_GET_DESIRED_VELOCITY
          Get commanded velocity
static java.lang.String CMD_GET_DIGITAL_INPUTS
          Set digital input state
static java.lang.String CMD_GET_MAIN_ENC_VELOCITY
          Get velocity main encoder velocity
static java.lang.String CMD_GET_MOTION_STATUS
          Get motion status register
static java.lang.String CMD_GET_MOTOR_FAULT
          Get motor fault register
static java.lang.String CMD_GET_SERIAL_NUMBER
          Get serial numbers SN[1] returns the vendor ID.
static java.lang.String CMD_GET_STATUS_REGISTER
          Get status register
static java.lang.String CMD_GET_VELOCITY_ERROR
          Get velocity error
static java.lang.String CMD_GET_VERSION
          Get software (firmware) version
static java.lang.String CMD_HEXMODE
          Get/Set hex mode
static java.lang.String CMD_HOMING_ABSOLUTE_VALUE
          Get/Set homing absolute value
static java.lang.String CMD_HOMING_ACTIVATION_MODE
          Get/Set homing activation mode
static java.lang.String CMD_HOMING_BEHAVIOR
          Get/Set homing behavior (what to do on homing event trigger)
static java.lang.String CMD_HOMING_EVENT_DEFINITION
          Get/Set homing event
static java.lang.String CMD_HOMING_EVENT_PX
          Get/Set homing event PX register behavior
static java.lang.String CMD_HOMING_OUTPUT_VALUE
          Get/Set homing digital output value
static java.lang.String CMD_INPUT_LOGIC
          Get/Set Input Functions IL[N]
static java.lang.String CMD_JOGGING_VELOCITY
          Get/Set jogging velocity
static java.lang.String CMD_MAX_CURRENT
          Get (read-only) Max active current limit
static java.lang.String CMD_MOTOR_ENABLE
          Motor enable state
static java.lang.String CMD_PEAK_CURRENT_DURATION
          Get/set peak active current duration (sec)
static java.lang.String CMD_PEAK_CURRENT_LIMIT
          Get/set peak active current limit (A) Max value=MC
static java.lang.String CMD_POSITION_COUNTER
          Get/set position counter
static java.lang.String CMD_POSITION_ERROR
          Get position error
static java.lang.String CMD_POSITION_REF_HI
          Get/Set upper reference position
static java.lang.String CMD_POSITION_REF_LO
          Get/Set lower reference position
static java.lang.String CMD_PTP_SPEED
          Get/Set max speed for PTP (point to point) motion Although SP is not used in velocity mode, it must be set so that SP<|VL[2]| and SP<|VH[2]|.
static java.lang.String CMD_RELATIVE_POSITION
          Get/Set relative position
static java.lang.String CMD_SET_DIO5_IGNORE_HI
          Configure high speed input as active HI/ignore
static java.lang.String CMD_SET_DIO5_IGNORE_LO
          Configure high speed input as active LO/ignore
static java.lang.String CMD_SET_XMODULUS_HI
          Get/Set X Modulus
static java.lang.String CMD_SET_XMODULUS_LO
          Get/Set X Modulus
static java.lang.String CMD_SPEED_LIMIT_HI
          Get/Set upper reference speed limit
static java.lang.String CMD_SPEED_LIMIT_LO
          Get/Set lower reference speed limit
static java.lang.String CMD_SPEED_REF_HI
          Get/Set upper reference speed command
static java.lang.String CMD_SPEED_REF_LO
          Get/Set lower reference speed command
static java.lang.String CMD_STOP_DECELERATION
          Get/Set stop deceleration
static java.lang.String CMD_STOP_MOTION
          Stop motor
static java.lang.String CMD_STUCK_SPEED
          Get/set min stuck motor speed (counts/s)
static java.lang.String CMD_TORQUE_LIMIT
          Get/set torque limit (% of continuous current limit) If <2, stuck motor protection is disabled
static java.lang.String CMD_UNIT_MODE
          Set/Get unit motion mode torque:1 velocity:2 position:3-5
static java.lang.String CMD_VELOCITY_I_FILTER
          Get/Set controller velocity PID gain (Integral)
static java.lang.String CMD_VELOCITY_P_FILTER
          Get/Set controller velocity PID gain (Proportional)
static int COUNTS_PER_REVOLUTION
          Motor counts per revolution Note: this depends on the motor commutation and feedback mechanism.
static double DBL_SEC_PER_MIN
          seconds per minute (double)
static int DIGITAL_INPUT_BIT0
           
static int DIGITAL_INPUT_BIT1
           
static int DIGITAL_INPUT_BIT2
           
static int DIGITAL_INPUT_BIT3
           
static int DIGITAL_INPUT_BIT4
           
static int DIGITAL_INPUT_BIT5
           
static int ECHO_DISABLED
          Echo mode enabled
static int ECHO_ENABLED
          Echo mode disabled
static int HEX_MODE_DISABLED
           
static int HEX_MODE_ENABLED
           
static java.lang.String HOMING_BEHAVIOR_NONE
          Homing Behavior: do nothing
static java.lang.String HOMING_BEHAVIOR_SET_OUTPUT
          Homing Behavior: set digital output
static java.lang.String HOMING_BEHAVIOR_STOP
          Homing Behavior: stop motor
static java.lang.String HOMING_EVENT_ABS
          Homing PX register behavior: absolute
static java.lang.String HOMING_EVENT_DIN5
          Homing Event Definition: trigger main switch closure
static java.lang.String HOMING_EVENT_IMMEDIATE
          Homing Event Definition: trigger immediate (manual)
static java.lang.String HOMING_EVENT_MAIN_HOME_SWITCH
          Homing Event Definition: trigger main switch closure
static java.lang.String HOMING_EVENT_NONE
          Homing PX register behavior: no action
static java.lang.String HOMING_EVENT_REL
          Homing PX register behavior: relative
static int IL_MAX_INDEX
           
static int IL_MAX_VALUE
           
static int IL_MIN_INDEX
           
static int IL_MIN_VALUE
           
static int INPUT_LOGIC_ABORT_HI
          Input Logic Mode
static int INPUT_LOGIC_ABORT_LO
          Input Logic Mode
static int INPUT_LOGIC_AUXHOME_HI
          Input Logic Mode
static int INPUT_LOGIC_AUXHOME_LO
          Input Logic Mode
static int INPUT_LOGIC_BG_HI
          Input Logic Mode
static int INPUT_LOGIC_BG_LO
          Input Logic Mode
static int INPUT_LOGIC_BOTHSTOP_HI
          Input Logic Mode
static int INPUT_LOGIC_BOTHSTOP_LO
          Input Logic Mode
static int INPUT_LOGIC_FLS_HI
          Input Logic Mode
static int INPUT_LOGIC_FLS_LO
          Input Logic Mode
static int INPUT_LOGIC_FREEWHEEL_HI
          Input Logic Mode
static int INPUT_LOGIC_FREEWHEEL_LO
          Input Logic Mode
static int INPUT_LOGIC_GP_HI
          Input Logic Mode
static int INPUT_LOGIC_GP_LO
          Input Logic Mode
static int INPUT_LOGIC_HARDSTOP_HI
          Input Logic Mode
static int INPUT_LOGIC_HARDSTOP_LO
          Input Logic Mode
static int INPUT_LOGIC_IGNORE_HI
          Input Logic Mode
static int INPUT_LOGIC_IGNORE_LO
          Input Logic Mode
static int INPUT_LOGIC_MAINHOME_HI
          Input Logic Mode
static int INPUT_LOGIC_MAINHOME_LO
          Input Logic Mode
static int INPUT_LOGIC_RLS_HI
          Input Logic Mode
static int INPUT_LOGIC_RLS_LO
          Input Logic Mode
static int INPUT_LOGIC_SOFTSTOP_HI
          Input Logic Mode
static int INPUT_LOGIC_SOFTSTOP_LO
          Input Logic Mode
static int INT_SEC_PER_MIN
          seconds per minute (int)
static byte[] LINE_END_BYTES
          line end for terminating command
static int MASK_DIGITAL_INPUT_ABORT
           
static int MASK_DIGITAL_INPUT_ACTIVE
           
static int MASK_DIGITAL_INPUT_AUXHOME
           
static int MASK_DIGITAL_INPUT_BG
           
static int MASK_DIGITAL_INPUT_FLS
           
static int MASK_DIGITAL_INPUT_HARDSTOP
           
static int MASK_DIGITAL_INPUT_INH
           
static int MASK_DIGITAL_INPUT_MAINHOME
           
static int MASK_DIGITAL_INPUT_PIN
           
static int MASK_DIGITAL_INPUT_PORT
           
static int MASK_DIGITAL_INPUT_RLS
           
static int MASK_DIGITAL_INPUT_SOFTSTOP
           
static int MAX_ACCELERATION
          Absolute max allowed acceleration (counts per second^2)
static int MAX_DECELERATION
          Absolute max allowed deceleration (counts per second^2)
static int MAX_STOP_DECELERATION
          Absolute max allowed stopping deceleration (counts per second^2)
static int MAX_VELOCITY_COUNTS
          Absolute max allowed commanded speed (counts per second)
static int MAX_VELOCITY_LIMIT
          Absolute max allowed actual speed (counts per second)
static long MAX_XMODULUS
          min x-modulus value
static int MF_ANALOG_FEEBACK
           
static int MF_CPU
           
static int MF_DATABASE
           
static int MF_ECAM
           
static int MF_FEEDBACK_LOSS
           
static int MF_HEARTBEAT
           
static int MF_INHIBIT
           
static int MF_MULT_HALL
           
static int MF_NO_START
           
static int MF_OK
           
static int MF_OVER_VOLTAGE
           
static int MF_PEAK_CURRENT
           
static int MF_POSITION
           
static int MF_POSITION_TRACKING
           
static int MF_SERVO
           
static int MF_SHORT_CIRCUIT
           
static int MF_SPEED
           
static int MF_SPEED_TRACKING
           
static int MF_STACK_OVERFLOW
           
static int MF_STUCK
           
static int MF_TEMPERATURE
           
static int MF_UNDER_VOLTAGE
           
static int MF_ZERO_NOT_FOUND
           
static int MIN_ACCELERATION
          Absolute min allowed acceleration (counts per second^2)
static int MIN_DECELERATION
          Absolute min allowed deceleration (counts per second^2)
static int MIN_STOP_DECELERATION
          Absolute min allowed stopping deceleration (counts per second^2)
static long MIN_XMODULUS
          max x-modulus value
static int MODE_DUAL_FEEDBACK_POSITION
          Unit Mode: Dual Feedback Position
static int MODE_SERIAL_LOCAL
          Driver serial mode - use local serial port If this mode is selected command pacing is not used during cmdWriteRead (not an Elmo mode)
static int MODE_SERIAL_RFC1722
          Driver RFC1722 mode - use ethernet/serial converter e.g.
static int MODE_SINGLE_FEEDBACK_POSITION
          Unit Mode: Single Feedback Position
static int MODE_SPEED
          Unit Mode: Speed
static int MODE_STEPPER
          Unit Mode: Stepper
static int MODE_TORQUE
          Unit Mode: Torque
static int MOTOR_DISABLED
           
static int MOTOR_ENABLED
           
static int MS_POS_STABLIZED
           
static int MS_REF_CONTROLLED
           
static int MS_REF_STATIONARY
           
static int MS_RESERVED
           
static long PX_MAX_VALUE
          max position counter value
static long PX_MIN_VALUE
          min position counter value
static int SR_CPU_STATUS
           
static int SR_CURRENT_LIMIT_ON
           
static int SR_DIGITAL_HALLS
           
static int SR_DRIVE_READ
           
static int SR_GAIN_SCHEDULING_ON
           
static int SR_HOMING_PROCESSING
           
static int SR_LIMIT_STOP
           
static int SR_MOTION_STATUS
           
static int SR_MOTOR_FAILURE_LATCHED
           
static int SR_MOTOR_ON
           
static int SR_OFFSET_CPU_STATUS
           
static int SR_OFFSET_CURRENT_LIMIT_ON
           
static int SR_OFFSET_DIGITAL_HALLS
           
static int SR_OFFSET_DRIVE_READ
           
static int SR_OFFSET_GAIN_SCHEDULING_ON
           
static int SR_OFFSET_HOMING_PROCESSING
           
static int SR_OFFSET_LIMIT_STOP
           
static int SR_OFFSET_MOTION_STATUS
           
static int SR_OFFSET_MOTOR_FAILURE_LATCHED
           
static int SR_OFFSET_MOTOR_ON
           
static int SR_OFFSET_PROGRAM_RUNNING
           
static int SR_OFFSET_RECORDER_STATUS
           
static int SR_OFFSET_REFERENCE_MODE
           
static int SR_OFFSET_STATUS
           
static int SR_OFFSET_UNIT_MODE
           
static int SR_OFFSET_USER_PROGRAM_ERROR
           
static int SR_PROGRAM_RUNNING
           
static int SR_RECORDER_STATUS
           
static int SR_REFERENCE_MODE
           
static int SR_STATUS
           
static int SR_UNIT_MODE
           
static int SR_USER_PROGRAM_ERROR
           
static long TM_CMD_MSEC
          Command timeout (milliseconds)
static long TM_EMPTY_INPUT_MSEC
          default timeout during input stream flush
static long TM_MOTION_WAIT_MSEC
          default motion wait polling interval
static long TM_POLL_DELAY_MSEC
          polling delay during motor start/stop (milliseconds)
static long TM_START_MSEC
          motor startup timeout (milliseconds)
static long TM_STOP_MSEC
          motor stop timeout (milliseconds)
 
Constructor Summary
Elmo(gnu.io.SerialPort port)
          Constructor
 
Method Summary
 void beginMotion()
          Begin motion.
protected  int cmdWriteRead(java.lang.String cmd, byte[] buf, byte[] terminator, long timeoutMsec)
          Perform one I/O transaction, (write then read).
protected  double cmdWriteReadDouble(java.lang.String cmd, int len, long timeoutMsec)
          Write one command and parse the resulting return value as an double.
protected  int cmdWriteReadInt(java.lang.String cmd, int len, long timeoutMsec)
          Write one command and parse the resulting return value as an integer.
protected  long cmdWriteReadLong(java.lang.String cmd, int len, long timeoutMsec)
          Write one command and parse the resulting return value as a long.
protected  java.lang.String cmdWriteReadString(java.lang.String cmd, int len, long timeoutMsec)
          Write one command and parse the resulting return value as a String.
protected  int cmdWriteReadX(java.lang.String cmd)
          write a command and cleanup returned terminator (discards characters read)
static double counts2rpm(int counts, int countsPerRevolution)
          Convert motor speed from counts/second to RPM
protected  void delay(long delayMsec)
          Sleep for specified time
protected  void emptyInput(java.io.InputStream instream, long timeoutMsec)
          Flush the serial input stream.
 void emptyInput(long timeoutMsec)
          Flush the serial input stream.
 int getAcceleration()
          Get speed-up acceleration.
 double getContinuousCurrent()
          Get continous current limit (A)
 int getDeceleration()
          Get slow-down acceleration.
 int getDesiredVelocity()
          Get commanded velocity.
 int getEchoMode()
           
 int getEncoderVelocity()
          Get encoder velocity VX.
 int getHexMode()
           
 int getInputLogic(int inputBit)
          Get Input Logic register.
 int getInputPort()
          read digital input port
 java.io.InputStream getInputStream()
          Return serial port input stream used by this controller.
 int getJoggingVelocity()
          Get jogging velocity.
 double getMaxCurrent()
          Get max current from read-only MC parameter (A)
 int getMotionStatus()
          Get motion status register.
 int getMotorFault()
          Get detailed motor fault codes.
 java.io.OutputStream getOutputStream()
          Return serial port output stream used by this controller.
 double getPeakCurrent()
          Get peak current limit (A)
 int getPeakCurrentDuration()
          Get peak current duration (sec)
protected  long getPositionCounter()
          Get motor position.
protected  long getPositionError()
          Get motor position error.
 int getPTPSpeed()
           
 int getReferenceLimitHi()
          Get high reference speed limit (VH[2]) (counts/sec)
 int getReferenceLimitLo()
          Get low reference speed limit (VL[2]) (counts/sec)
 int getReferenceSpeedHi()
          Get high reference speed limit (VH[2]) (counts/sec)
 int getReferenceSpeedLo()
          Get low reference speed limit (VL[2]) (counts/sec)
 int getSerialMode()
          set serial mode
 gnu.io.SerialPort getSerialPort()
          Return SerialPort used by this controller.
 int getStatusRegister()
          Get status register value.
 int getStopDeceleration()
          Get slow-down stop acceleration.
 int getStuckSpeed()
          Get stuck speed (counts/sec)
 double getTorqueLimit()
          Get torque limit (% continous active current)
 int getUnitMode()
          Get controller operation mode.
 java.lang.String getVersion()
          Return controller version information.
 long getXModulusHi()
           
 long getXModulusLo()
           
abstract  void initializeController(int serialMode, int unitMode)
          Initialize motor controller.
 boolean isEnabled()
          Determine if motor is enabled.
 void jog(int velocity)
          Command new velocity; changes velocity during motion based on current AC, DC and specified JV parameters Sets jogging velocity and initiates new motion.
 void jog(int velocity, int acceleration, int deceleration)
          Command new velocity w/ new acceleration parameters.
static java.lang.String mkCmd(java.lang.String cmd, int value)
           
static java.lang.String mkCmd(java.lang.String cmd, long value)
           
static java.lang.String mkCmd(java.lang.String cmd, java.lang.String value)
           
static java.lang.String mkIndex(java.lang.String cmd, int index)
           
static java.lang.String mkIndexCmd(java.lang.String cmd, int index, int value)
           
static java.lang.String mkIndexCmd(java.lang.String cmd, int index, long value)
           
static java.lang.String mkIndexCmd(java.lang.String cmd, int index, java.lang.String value)
           
 void motionWait(long distance, long pollMsec)
          wait for relative/absolute motion to complete
 void ptpAbsolute(long position, boolean wait)
          Command new absolute position; changes velocity during motion based on current AC, DC and specified JV parameters Enables motor and initiates new motion.
 void ptpAbsolute(long position, int velocity, int acceleration, int deceleration, boolean wait)
          Command new absolute position w/ new acceleration parameters.
 void ptpRelative(long position, boolean wait)
          Command new relative position; changes velocity during motion based on current AC, DC and specified JV parameters Enables motor and initiates new motion.
 void ptpRelative(long position, int velocity, int acceleration, int deceleration, boolean wait)
          Command new relative position w/ new acceleration parameters.
 java.lang.String readRegister(java.lang.String register)
          Return value (String) of Elmo register
static int rpm2counts(double rpm, int countsPerRevolution)
          Convert motor speed from counts/second to RPM
 void setAcceleration(int value)
          Set speed-up acceleration.
 void setContinuousCurrent(double contCurrent)
          Set continuous current (A).
 void setDeceleration(int value)
          Set slow-down acceleration.
 void setEchoMode(int mode)
          Set echo mode
 void setEnable(boolean value, long timeoutMsec)
          Enable or disable the motor fulfills MotorControlIF interface
 void setHexMode(boolean mode)
          Set hex mode.
 void setInputLogic(int inputBit, int value)
          Set Input Logic register.
 void setJoggingVelocity(double velocityRPM, int countsPerRev)
          Set motor velocity.
 void setJoggingVelocity(int velocityCounts)
          Set jogging velocity (counts/second).
 void setPeakCurrent(double peakCurrent)
          Set peak current (A).
 void setPeakCurrentDuration(int peakCurrentDurationSec)
          Set peak current duration (sec).
 void setPositionAbsolute(long value)
          Position Absolute.
 void setPositionCounter(long value)
          Set Position Counter.
 void setPositionRelative(long value)
          Position Relative.
 void setPTPSpeed(int ptpSpeed)
          Set max speed for PTP (point to point) motion.
 void setReferenceLimit(int min, int max)
          Set controller reference speed limits.
 void setReferenceSpeed(int min, int max)
          Set controller reference speed.
 void setSerialMode(int mode)
          set serial mode
 void setSerialPort(gnu.io.SerialPort port)
          Set the SerialPort for this controller to use.
 void setStopDeceleration(int value)
          Set slow-down acceleration, Motor stop deceleration (counts/sec^2) Controls rate at which motor stops when ST command is issued; deceleration during jogging velocity change is handled separately.
 void setStuckSpeed(int stuckSpeed)
          Set stuck speed (counts/sec).
 void setTorqueLimit(double torquePercent)
          Set torque limit (% of continuous current).
 void setUnitMode(int mode)
          Set controller operation mode.
 void setXModulus(long xmLo, long xmHi)
          Set XModulus.
protected  int stopMotor()
          Stop motor.
protected  void writeCommand(java.lang.String cmd)
          Write a command to the serial port.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_log4j

protected static org.apache.log4j.Logger _log4j
Log4j logger


MAX_VELOCITY_COUNTS

public static final int MAX_VELOCITY_COUNTS
Absolute max allowed commanded speed (counts per second)

See Also:
Constant Field Values

MAX_VELOCITY_LIMIT

public static final int MAX_VELOCITY_LIMIT
Absolute max allowed actual speed (counts per second)

See Also:
Constant Field Values

MIN_ACCELERATION

public static final int MIN_ACCELERATION
Absolute min allowed acceleration (counts per second^2)

See Also:
Constant Field Values

MIN_DECELERATION

public static final int MIN_DECELERATION
Absolute min allowed deceleration (counts per second^2)

See Also:
Constant Field Values

MAX_ACCELERATION

public static final int MAX_ACCELERATION
Absolute max allowed acceleration (counts per second^2)

See Also:
Constant Field Values

MAX_DECELERATION

public static final int MAX_DECELERATION
Absolute max allowed deceleration (counts per second^2)

See Also:
Constant Field Values

MIN_STOP_DECELERATION

public static final int MIN_STOP_DECELERATION
Absolute min allowed stopping deceleration (counts per second^2)

See Also:
Constant Field Values

MAX_STOP_DECELERATION

public static final int MAX_STOP_DECELERATION
Absolute max allowed stopping deceleration (counts per second^2)

See Also:
Constant Field Values

PX_MIN_VALUE

public static final long PX_MIN_VALUE
min position counter value

See Also:
Constant Field Values

PX_MAX_VALUE

public static final long PX_MAX_VALUE
max position counter value

See Also:
Constant Field Values

MAX_XMODULUS

public static final long MAX_XMODULUS
min x-modulus value

See Also:
Constant Field Values

MIN_XMODULUS

public static final long MIN_XMODULUS
max x-modulus value

See Also:
Constant Field Values

IL_MIN_INDEX

public static final int IL_MIN_INDEX
See Also:
Constant Field Values

IL_MAX_INDEX

public static final int IL_MAX_INDEX
See Also:
Constant Field Values

IL_MIN_VALUE

public static final int IL_MIN_VALUE
See Also:
Constant Field Values

IL_MAX_VALUE

public static final int IL_MAX_VALUE
See Also:
Constant Field Values

COUNTS_PER_REVOLUTION

public static final int COUNTS_PER_REVOLUTION
Motor counts per revolution Note: this depends on the motor commutation and feedback mechanism. This default value is for a simple DC brushless motor with a single pole pair.

See Also:
Constant Field Values

TM_CMD_MSEC

public static final long TM_CMD_MSEC
Command timeout (milliseconds)

See Also:
Constant Field Values

TM_START_MSEC

public static final long TM_START_MSEC
motor startup timeout (milliseconds)

See Also:
Constant Field Values

TM_STOP_MSEC

public static final long TM_STOP_MSEC
motor stop timeout (milliseconds)

See Also:
Constant Field Values

TM_POLL_DELAY_MSEC

public static final long TM_POLL_DELAY_MSEC
polling delay during motor start/stop (milliseconds)

See Also:
Constant Field Values

TM_EMPTY_INPUT_MSEC

public static final long TM_EMPTY_INPUT_MSEC
default timeout during input stream flush

See Also:
Constant Field Values

TM_MOTION_WAIT_MSEC

public static final long TM_MOTION_WAIT_MSEC
default motion wait polling interval

See Also:
Constant Field Values

INT_SEC_PER_MIN

public static final int INT_SEC_PER_MIN
seconds per minute (int)

See Also:
Constant Field Values

DBL_SEC_PER_MIN

public static final double DBL_SEC_PER_MIN
seconds per minute (double)

See Also:
Constant Field Values

BUF32

public static final int BUF32
Buffer size (32)

See Also:
Constant Field Values

BUF128

public static final int BUF128
Buffer size (128)

See Also:
Constant Field Values

MODE_SPEED

public static final int MODE_SPEED
Unit Mode: Speed

See Also:
Constant Field Values

MODE_STEPPER

public static final int MODE_STEPPER
Unit Mode: Stepper

See Also:
Constant Field Values

MODE_TORQUE

public static final int MODE_TORQUE
Unit Mode: Torque

See Also:
Constant Field Values

MODE_DUAL_FEEDBACK_POSITION

public static final int MODE_DUAL_FEEDBACK_POSITION
Unit Mode: Dual Feedback Position

See Also:
Constant Field Values

MODE_SINGLE_FEEDBACK_POSITION

public static final int MODE_SINGLE_FEEDBACK_POSITION
Unit Mode: Single Feedback Position

See Also:
Constant Field Values

MODE_SERIAL_LOCAL

public static final int MODE_SERIAL_LOCAL
Driver serial mode - use local serial port If this mode is selected command pacing is not used during cmdWriteRead (not an Elmo mode)

See Also:
Constant Field Values

MODE_SERIAL_RFC1722

public static final int MODE_SERIAL_RFC1722
Driver RFC1722 mode - use ethernet/serial converter e.g. Digi. If this mode is selected, command pacing is used during cmdWriteRead (not an Elmo mode)

See Also:
Constant Field Values

MOTOR_ENABLED

public static final int MOTOR_ENABLED
See Also:
Constant Field Values

MOTOR_DISABLED

public static final int MOTOR_DISABLED
See Also:
Constant Field Values

MASK_DIGITAL_INPUT_PORT

public static final int MASK_DIGITAL_INPUT_PORT
See Also:
Constant Field Values

MASK_DIGITAL_INPUT_ACTIVE

public static final int MASK_DIGITAL_INPUT_ACTIVE
See Also:
Constant Field Values

MASK_DIGITAL_INPUT_MAINHOME

public static final int MASK_DIGITAL_INPUT_MAINHOME
See Also:
Constant Field Values

MASK_DIGITAL_INPUT_AUXHOME

public static final int MASK_DIGITAL_INPUT_AUXHOME
See Also:
Constant Field Values

MASK_DIGITAL_INPUT_SOFTSTOP

public static final int MASK_DIGITAL_INPUT_SOFTSTOP
See Also:
Constant Field Values

MASK_DIGITAL_INPUT_HARDSTOP

public static final int MASK_DIGITAL_INPUT_HARDSTOP
See Also:
Constant Field Values

MASK_DIGITAL_INPUT_FLS

public static final int MASK_DIGITAL_INPUT_FLS
See Also:
Constant Field Values

MASK_DIGITAL_INPUT_RLS

public static final int MASK_DIGITAL_INPUT_RLS
See Also:
Constant Field Values

MASK_DIGITAL_INPUT_INH

public static final int MASK_DIGITAL_INPUT_INH
See Also:
Constant Field Values

MASK_DIGITAL_INPUT_BG

public static final int MASK_DIGITAL_INPUT_BG
See Also:
Constant Field Values

MASK_DIGITAL_INPUT_ABORT

public static final int MASK_DIGITAL_INPUT_ABORT
See Also:
Constant Field Values

MASK_DIGITAL_INPUT_PIN

public static final int MASK_DIGITAL_INPUT_PIN
See Also:
Constant Field Values

DIGITAL_INPUT_BIT0

public static final int DIGITAL_INPUT_BIT0
See Also:
Constant Field Values

DIGITAL_INPUT_BIT1

public static final int DIGITAL_INPUT_BIT1
See Also:
Constant Field Values

DIGITAL_INPUT_BIT2

public static final int DIGITAL_INPUT_BIT2
See Also:
Constant Field Values

DIGITAL_INPUT_BIT3

public static final int DIGITAL_INPUT_BIT3
See Also:
Constant Field Values

DIGITAL_INPUT_BIT4

public static final int DIGITAL_INPUT_BIT4
See Also:
Constant Field Values

DIGITAL_INPUT_BIT5

public static final int DIGITAL_INPUT_BIT5
See Also:
Constant Field Values

MS_POS_STABLIZED

public static final int MS_POS_STABLIZED
See Also:
Constant Field Values

MS_REF_STATIONARY

public static final int MS_REF_STATIONARY
See Also:
Constant Field Values

MS_REF_CONTROLLED

public static final int MS_REF_CONTROLLED
See Also:
Constant Field Values

MS_RESERVED

public static final int MS_RESERVED
See Also:
Constant Field Values

HEX_MODE_DISABLED

public static final int HEX_MODE_DISABLED
See Also:
Constant Field Values

HEX_MODE_ENABLED

public static final int HEX_MODE_ENABLED
See Also:
Constant Field Values

INPUT_LOGIC_FREEWHEEL_LO

public static final int INPUT_LOGIC_FREEWHEEL_LO
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_FREEWHEEL_HI

public static final int INPUT_LOGIC_FREEWHEEL_HI
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_HARDSTOP_LO

public static final int INPUT_LOGIC_HARDSTOP_LO
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_HARDSTOP_HI

public static final int INPUT_LOGIC_HARDSTOP_HI
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_IGNORE_LO

public static final int INPUT_LOGIC_IGNORE_LO
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_IGNORE_HI

public static final int INPUT_LOGIC_IGNORE_HI
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_GP_LO

public static final int INPUT_LOGIC_GP_LO
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_GP_HI

public static final int INPUT_LOGIC_GP_HI
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_RLS_LO

public static final int INPUT_LOGIC_RLS_LO
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_RLS_HI

public static final int INPUT_LOGIC_RLS_HI
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_FLS_LO

public static final int INPUT_LOGIC_FLS_LO
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_FLS_HI

public static final int INPUT_LOGIC_FLS_HI
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_BG_LO

public static final int INPUT_LOGIC_BG_LO
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_BG_HI

public static final int INPUT_LOGIC_BG_HI
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_SOFTSTOP_LO

public static final int INPUT_LOGIC_SOFTSTOP_LO
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_SOFTSTOP_HI

public static final int INPUT_LOGIC_SOFTSTOP_HI
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_MAINHOME_LO

public static final int INPUT_LOGIC_MAINHOME_LO
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_MAINHOME_HI

public static final int INPUT_LOGIC_MAINHOME_HI
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_AUXHOME_LO

public static final int INPUT_LOGIC_AUXHOME_LO
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_AUXHOME_HI

public static final int INPUT_LOGIC_AUXHOME_HI
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_BOTHSTOP_LO

public static final int INPUT_LOGIC_BOTHSTOP_LO
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_BOTHSTOP_HI

public static final int INPUT_LOGIC_BOTHSTOP_HI
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_ABORT_LO

public static final int INPUT_LOGIC_ABORT_LO
Input Logic Mode

See Also:
Constant Field Values

INPUT_LOGIC_ABORT_HI

public static final int INPUT_LOGIC_ABORT_HI
Input Logic Mode

See Also:
Constant Field Values

HOMING_BEHAVIOR_STOP

public static final java.lang.String HOMING_BEHAVIOR_STOP
Homing Behavior: stop motor

See Also:
Constant Field Values

HOMING_BEHAVIOR_SET_OUTPUT

public static final java.lang.String HOMING_BEHAVIOR_SET_OUTPUT
Homing Behavior: set digital output

See Also:
Constant Field Values

HOMING_BEHAVIOR_NONE

public static final java.lang.String HOMING_BEHAVIOR_NONE
Homing Behavior: do nothing

See Also:
Constant Field Values

HOMING_EVENT_MAIN_HOME_SWITCH

public static final java.lang.String HOMING_EVENT_MAIN_HOME_SWITCH
Homing Event Definition: trigger main switch closure

See Also:
Constant Field Values

HOMING_EVENT_DIN5

public static final java.lang.String HOMING_EVENT_DIN5
Homing Event Definition: trigger main switch closure

See Also:
Constant Field Values

HOMING_EVENT_IMMEDIATE

public static final java.lang.String HOMING_EVENT_IMMEDIATE
Homing Event Definition: trigger immediate (manual)

See Also:
Constant Field Values

HOMING_EVENT_ABS

public static final java.lang.String HOMING_EVENT_ABS
Homing PX register behavior: absolute

See Also:
Constant Field Values

HOMING_EVENT_REL

public static final java.lang.String HOMING_EVENT_REL
Homing PX register behavior: relative

See Also:
Constant Field Values

HOMING_EVENT_NONE

public static final java.lang.String HOMING_EVENT_NONE
Homing PX register behavior: no action

See Also:
Constant Field Values

ECHO_DISABLED

public static final int ECHO_DISABLED
Echo mode enabled

See Also:
Constant Field Values

ECHO_ENABLED

public static final int ECHO_ENABLED
Echo mode disabled

See Also:
Constant Field Values

CMD_UNIT_MODE

public static final java.lang.String CMD_UNIT_MODE
Set/Get unit motion mode torque:1 velocity:2 position:3-5

See Also:
Constant Field Values

CMD_MOTOR_ENABLE

public static final java.lang.String CMD_MOTOR_ENABLE
Motor enable state

See Also:
Constant Field Values

CMD_BEGIN_MOTION

public static final java.lang.String CMD_BEGIN_MOTION
Begin motion

See Also:
Constant Field Values

CMD_STOP_MOTION

public static final java.lang.String CMD_STOP_MOTION
Stop motor

See Also:
Constant Field Values

CMD_ACCELERATION

public static final java.lang.String CMD_ACCELERATION
Get/Set acceleration

See Also:
Constant Field Values

CMD_DECELERATION

public static final java.lang.String CMD_DECELERATION
Get/Set motion deceleration

See Also:
Constant Field Values

CMD_STOP_DECELERATION

public static final java.lang.String CMD_STOP_DECELERATION
Get/Set stop deceleration

See Also:
Constant Field Values

CMD_SPEED_REF_LO

public static final java.lang.String CMD_SPEED_REF_LO
Get/Set lower reference speed command

See Also:
Constant Field Values

CMD_SPEED_REF_HI

public static final java.lang.String CMD_SPEED_REF_HI
Get/Set upper reference speed command

See Also:
Constant Field Values

CMD_SPEED_LIMIT_LO

public static final java.lang.String CMD_SPEED_LIMIT_LO
Get/Set lower reference speed limit

See Also:
Constant Field Values

CMD_SPEED_LIMIT_HI

public static final java.lang.String CMD_SPEED_LIMIT_HI
Get/Set upper reference speed limit

See Also:
Constant Field Values

CMD_POSITION_REF_LO

public static final java.lang.String CMD_POSITION_REF_LO
Get/Set lower reference position

See Also:
Constant Field Values

CMD_POSITION_REF_HI

public static final java.lang.String CMD_POSITION_REF_HI
Get/Set upper reference position

See Also:
Constant Field Values

CMD_SET_XMODULUS_LO

public static final java.lang.String CMD_SET_XMODULUS_LO
Get/Set X Modulus

See Also:
Constant Field Values

CMD_SET_XMODULUS_HI

public static final java.lang.String CMD_SET_XMODULUS_HI
Get/Set X Modulus

See Also:
Constant Field Values

CMD_JOGGING_VELOCITY

public static final java.lang.String CMD_JOGGING_VELOCITY
Get/Set jogging velocity

See Also:
Constant Field Values

CMD_PTP_SPEED

public static final java.lang.String CMD_PTP_SPEED
Get/Set max speed for PTP (point to point) motion Although SP is not used in velocity mode, it must be set so that SP<|VL[2]| and SP<|VH[2]|. If not, parameters VL,VH,LL,HL may not be correctly written to flash

See Also:
Constant Field Values

CMD_GET_MAIN_ENC_VELOCITY

public static final java.lang.String CMD_GET_MAIN_ENC_VELOCITY
Get velocity main encoder velocity

See Also:
Constant Field Values

CMD_GET_AUX_ENC_VELOCITY

public static final java.lang.String CMD_GET_AUX_ENC_VELOCITY
Get velocity aux encoder velocity

See Also:
Constant Field Values

CMD_GET_VELOCITY_ERROR

public static final java.lang.String CMD_GET_VELOCITY_ERROR
Get velocity error

See Also:
Constant Field Values

CMD_GET_DESIRED_VELOCITY

public static final java.lang.String CMD_GET_DESIRED_VELOCITY
Get commanded velocity

See Also:
Constant Field Values

CMD_RELATIVE_POSITION

public static final java.lang.String CMD_RELATIVE_POSITION
Get/Set relative position

See Also:
Constant Field Values

CMD_ABSOLUTE_POSITION

public static final java.lang.String CMD_ABSOLUTE_POSITION
Get/Set absolute position

See Also:
Constant Field Values

CMD_POSITION_COUNTER

public static final java.lang.String CMD_POSITION_COUNTER
Get/set position counter

See Also:
Constant Field Values

CMD_POSITION_ERROR

public static final java.lang.String CMD_POSITION_ERROR
Get position error

See Also:
Constant Field Values

CMD_INPUT_LOGIC

public static final java.lang.String CMD_INPUT_LOGIC
Get/Set Input Functions IL[N]

See Also:
Constant Field Values

CMD_DIGITAL_INPUT_FILTER

public static final java.lang.String CMD_DIGITAL_INPUT_FILTER
Get/Set Digital input filter

See Also:
Constant Field Values

CMD_CURRENT_I_FILTER

public static final java.lang.String CMD_CURRENT_I_FILTER
Get/Set controller current PID gain (Integral)

See Also:
Constant Field Values

CMD_CURRENT_P_FILTER

public static final java.lang.String CMD_CURRENT_P_FILTER
Get/Set controller current PID gain (Proportional)

See Also:
Constant Field Values

CMD_VELOCITY_I_FILTER

public static final java.lang.String CMD_VELOCITY_I_FILTER
Get/Set controller velocity PID gain (Integral)

See Also:
Constant Field Values

CMD_VELOCITY_P_FILTER

public static final java.lang.String CMD_VELOCITY_P_FILTER
Get/Set controller velocity PID gain (Proportional)

See Also:
Constant Field Values

CMD_COMMUTATION_ARRAY

public static final java.lang.String CMD_COMMUTATION_ARRAY
Get/Set commutation array parameters

See Also:
Constant Field Values

CMD_MAX_CURRENT

public static final java.lang.String CMD_MAX_CURRENT
Get (read-only) Max active current limit

See Also:
Constant Field Values

CMD_PEAK_CURRENT_LIMIT

public static final java.lang.String CMD_PEAK_CURRENT_LIMIT
Get/set peak active current limit (A) Max value=MC

See Also:
Constant Field Values

CMD_PEAK_CURRENT_DURATION

public static final java.lang.String CMD_PEAK_CURRENT_DURATION
Get/set peak active current duration (sec)

See Also:
Constant Field Values

CMD_CONT_CURRENT_LIMIT

public static final java.lang.String CMD_CONT_CURRENT_LIMIT
Get/set continuous active current limit Max value=MC/2 Supply current = (active current) * (PWM duty cycle)

See Also:
Constant Field Values

CMD_TORQUE_LIMIT

public static final java.lang.String CMD_TORQUE_LIMIT
Get/set torque limit (% of continuous current limit) If <2, stuck motor protection is disabled

See Also:
Constant Field Values

CMD_STUCK_SPEED

public static final java.lang.String CMD_STUCK_SPEED
Get/set min stuck motor speed (counts/s)

See Also:
Constant Field Values

CMD_ECHO

public static final java.lang.String CMD_ECHO
Get/Set echo mode

See Also:
Constant Field Values

CMD_HEXMODE

public static final java.lang.String CMD_HEXMODE
Get/Set hex mode

See Also:
Constant Field Values

CMD_DUMP_CPU

public static final java.lang.String CMD_DUMP_CPU
Set hex mode off

See Also:
Constant Field Values

CMD_DIGITIAL_OUTPUT

public static final java.lang.String CMD_DIGITIAL_OUTPUT
Get/Set digital output state

See Also:
Constant Field Values

CMD_GET_DIGITAL_INPUTS

public static final java.lang.String CMD_GET_DIGITAL_INPUTS
Set digital input state

See Also:
Constant Field Values

CMD_GET_STATUS_REGISTER

public static final java.lang.String CMD_GET_STATUS_REGISTER
Get status register

See Also:
Constant Field Values

CMD_GET_MOTION_STATUS

public static final java.lang.String CMD_GET_MOTION_STATUS
Get motion status register

See Also:
Constant Field Values

CMD_GET_MOTOR_FAULT

public static final java.lang.String CMD_GET_MOTOR_FAULT
Get motor fault register

See Also:
Constant Field Values

CMD_GET_SERIAL_NUMBER

public static final java.lang.String CMD_GET_SERIAL_NUMBER
Get serial numbers SN[1] returns the vendor ID. SN[2] returns the product code. SN[3] returns the revision number. SN[4] returns the serial number.

See Also:
Constant Field Values

CMD_GET_VERSION

public static final java.lang.String CMD_GET_VERSION
Get software (firmware) version

See Also:
Constant Field Values

CMD_HOMING_ACTIVATION_MODE

public static final java.lang.String CMD_HOMING_ACTIVATION_MODE
Get/Set homing activation mode

See Also:
Constant Field Values

CMD_ARM_HOMING_PROCESS

public static final java.lang.String CMD_ARM_HOMING_PROCESS
Arm homing process

See Also:
Constant Field Values

CMD_DISARM_HOMING_PROCESS

public static final java.lang.String CMD_DISARM_HOMING_PROCESS
Disarm homing process

See Also:
Constant Field Values

CMD_HOMING_ABSOLUTE_VALUE

public static final java.lang.String CMD_HOMING_ABSOLUTE_VALUE
Get/Set homing absolute value

See Also:
Constant Field Values

CMD_HOMING_EVENT_DEFINITION

public static final java.lang.String CMD_HOMING_EVENT_DEFINITION
Get/Set homing event

See Also:
Constant Field Values

CMD_HOMING_BEHAVIOR

public static final java.lang.String CMD_HOMING_BEHAVIOR
Get/Set homing behavior (what to do on homing event trigger)

See Also:
Constant Field Values

CMD_HOMING_EVENT_PX

public static final java.lang.String CMD_HOMING_EVENT_PX
Get/Set homing event PX register behavior

See Also:
Constant Field Values

CMD_HOMING_OUTPUT_VALUE

public static final java.lang.String CMD_HOMING_OUTPUT_VALUE
Get/Set homing digital output value

See Also:
Constant Field Values

CMD_SET_DIO5_IGNORE_LO

public static final java.lang.String CMD_SET_DIO5_IGNORE_LO
Configure high speed input as active LO/ignore

See Also:
Constant Field Values

CMD_SET_DIO5_IGNORE_HI

public static final java.lang.String CMD_SET_DIO5_IGNORE_HI
Configure high speed input as active HI/ignore

See Also:
Constant Field Values

CMD_GENERAL_PURPOSE_HI

public static final java.lang.String CMD_GENERAL_PURPOSE_HI
Configure high speed input as active HI/general purpose

See Also:
Constant Field Values

CMD_ENABLE_MAIN_HOME_SEQUENCE_LO

public static final java.lang.String CMD_ENABLE_MAIN_HOME_SEQUENCE_LO
Configure high speed input as active LO/main homing trigger

See Also:
Constant Field Values

CMD_ENABLE_MAIN_HOME_SEQUENCE_HI

public static final java.lang.String CMD_ENABLE_MAIN_HOME_SEQUENCE_HI
Configure high speed input as active HI/main homing trigger

See Also:
Constant Field Values

CMD_ENABLE_AUX_HOME_SEQUENCE_LO

public static final java.lang.String CMD_ENABLE_AUX_HOME_SEQUENCE_LO
Configure high speed input as active LO/aux homing trigger

See Also:
Constant Field Values

CMD_ENABLE_AUX_HOME_SEQUENCE_HI

public static final java.lang.String CMD_ENABLE_AUX_HOME_SEQUENCE_HI
Configure high speed input as active HI/aux homing trigger

See Also:
Constant Field Values

MF_OK

public static final int MF_OK
See Also:
Constant Field Values

MF_ANALOG_FEEBACK

public static final int MF_ANALOG_FEEBACK
See Also:
Constant Field Values

MF_FEEDBACK_LOSS

public static final int MF_FEEDBACK_LOSS
See Also:
Constant Field Values

MF_PEAK_CURRENT

public static final int MF_PEAK_CURRENT
See Also:
Constant Field Values

MF_INHIBIT

public static final int MF_INHIBIT
See Also:
Constant Field Values

MF_MULT_HALL

public static final int MF_MULT_HALL
See Also:
Constant Field Values

MF_SPEED_TRACKING

public static final int MF_SPEED_TRACKING
See Also:
Constant Field Values

MF_POSITION_TRACKING

public static final int MF_POSITION_TRACKING
See Also:
Constant Field Values

MF_DATABASE

public static final int MF_DATABASE
See Also:
Constant Field Values

MF_ECAM

public static final int MF_ECAM
See Also:
Constant Field Values

MF_HEARTBEAT

public static final int MF_HEARTBEAT
See Also:
Constant Field Values

MF_SERVO

public static final int MF_SERVO
See Also:
Constant Field Values

MF_UNDER_VOLTAGE

public static final int MF_UNDER_VOLTAGE
See Also:
Constant Field Values

MF_OVER_VOLTAGE

public static final int MF_OVER_VOLTAGE
See Also:
Constant Field Values

MF_SHORT_CIRCUIT

public static final int MF_SHORT_CIRCUIT
See Also:
Constant Field Values

MF_TEMPERATURE

public static final int MF_TEMPERATURE
See Also:
Constant Field Values

MF_ZERO_NOT_FOUND

public static final int MF_ZERO_NOT_FOUND
See Also:
Constant Field Values

MF_SPEED

public static final int MF_SPEED
See Also:
Constant Field Values

MF_STACK_OVERFLOW

public static final int MF_STACK_OVERFLOW
See Also:
Constant Field Values

MF_CPU

public static final int MF_CPU
See Also:
Constant Field Values

MF_STUCK

public static final int MF_STUCK
See Also:
Constant Field Values

MF_POSITION

public static final int MF_POSITION
See Also:
Constant Field Values

MF_NO_START

public static final int MF_NO_START
See Also:
Constant Field Values

SR_DRIVE_READ

public static final int SR_DRIVE_READ
See Also:
Constant Field Values

SR_STATUS

public static final int SR_STATUS
See Also:
Constant Field Values

SR_MOTOR_ON

public static final int SR_MOTOR_ON
See Also:
Constant Field Values

SR_REFERENCE_MODE

public static final int SR_REFERENCE_MODE
See Also:
Constant Field Values

SR_MOTOR_FAILURE_LATCHED

public static final int SR_MOTOR_FAILURE_LATCHED
See Also:
Constant Field Values

SR_UNIT_MODE

public static final int SR_UNIT_MODE
See Also:
Constant Field Values

SR_GAIN_SCHEDULING_ON

public static final int SR_GAIN_SCHEDULING_ON
See Also:
Constant Field Values

SR_HOMING_PROCESSING

public static final int SR_HOMING_PROCESSING
See Also:
Constant Field Values

SR_PROGRAM_RUNNING

public static final int SR_PROGRAM_RUNNING
See Also:
Constant Field Values

SR_CURRENT_LIMIT_ON

public static final int SR_CURRENT_LIMIT_ON
See Also:
Constant Field Values

SR_MOTION_STATUS

public static final int SR_MOTION_STATUS
See Also:
Constant Field Values

SR_RECORDER_STATUS

public static final int SR_RECORDER_STATUS
See Also:
Constant Field Values

SR_DIGITAL_HALLS

public static final int SR_DIGITAL_HALLS
See Also:
Constant Field Values

SR_CPU_STATUS

public static final int SR_CPU_STATUS
See Also:
Constant Field Values

SR_LIMIT_STOP

public static final int SR_LIMIT_STOP
See Also:
Constant Field Values

SR_USER_PROGRAM_ERROR

public static final int SR_USER_PROGRAM_ERROR
See Also:
Constant Field Values

SR_OFFSET_DRIVE_READ

public static final int SR_OFFSET_DRIVE_READ
See Also:
Constant Field Values

SR_OFFSET_STATUS

public static final int SR_OFFSET_STATUS
See Also:
Constant Field Values

SR_OFFSET_MOTOR_ON

public static final int SR_OFFSET_MOTOR_ON
See Also:
Constant Field Values

SR_OFFSET_REFERENCE_MODE

public static final int SR_OFFSET_REFERENCE_MODE
See Also:
Constant Field Values

SR_OFFSET_MOTOR_FAILURE_LATCHED

public static final int SR_OFFSET_MOTOR_FAILURE_LATCHED
See Also:
Constant Field Values

SR_OFFSET_UNIT_MODE

public static final int SR_OFFSET_UNIT_MODE
See Also:
Constant Field Values

SR_OFFSET_GAIN_SCHEDULING_ON

public static final int SR_OFFSET_GAIN_SCHEDULING_ON
See Also:
Constant Field Values

SR_OFFSET_HOMING_PROCESSING

public static final int SR_OFFSET_HOMING_PROCESSING
See Also:
Constant Field Values

SR_OFFSET_PROGRAM_RUNNING

public static final int SR_OFFSET_PROGRAM_RUNNING
See Also:
Constant Field Values

SR_OFFSET_CURRENT_LIMIT_ON

public static final int SR_OFFSET_CURRENT_LIMIT_ON
See Also:
Constant Field Values

SR_OFFSET_MOTION_STATUS

public static final int SR_OFFSET_MOTION_STATUS
See Also:
Constant Field Values

SR_OFFSET_RECORDER_STATUS

public static final int SR_OFFSET_RECORDER_STATUS
See Also:
Constant Field Values

SR_OFFSET_DIGITAL_HALLS

public static final int SR_OFFSET_DIGITAL_HALLS
See Also:
Constant Field Values

SR_OFFSET_CPU_STATUS

public static final int SR_OFFSET_CPU_STATUS
See Also:
Constant Field Values

SR_OFFSET_LIMIT_STOP

public static final int SR_OFFSET_LIMIT_STOP
See Also:
Constant Field Values

SR_OFFSET_USER_PROGRAM_ERROR

public static final int SR_OFFSET_USER_PROGRAM_ERROR
See Also:
Constant Field Values

_serialPort

protected gnu.io.SerialPort _serialPort
Serial port for Elmo control I/O


_serialRx

protected java.io.InputStream _serialRx
Serial port input stream


_serialTx

protected java.io.OutputStream _serialTx
Serial port output stream


_terminatorString

protected java.lang.String _terminatorString
Response terminator (as String)


LINE_END_BYTES

public static final byte[] LINE_END_BYTES
line end for terminating command


_terminator

protected byte[] _terminator
Response terminator (as byte array)


_junk32

protected byte[] _junk32
Buffer for reading disposable input


_longBuf

protected byte[] _longBuf

_intBuf

protected byte[] _intBuf

_doubleBuf

protected byte[] _doubleBuf

_stringBuf

protected byte[] _stringBuf

_serialMode

protected int _serialMode
Serial port mode. Use MODE_SERIAL_LOCAL if using a standard hardware serial port User MODE_SERIAL_RFC_1722 if using a serial/ethernet converter (e.g. Digi)

Constructor Detail

Elmo

public Elmo(gnu.io.SerialPort port)
     throws java.io.IOException
Constructor

Throws:
java.io.IOException
Method Detail

setSerialPort

public void setSerialPort(gnu.io.SerialPort port)
                   throws java.io.IOException
Set the SerialPort for this controller to use.

Parameters:
port - SerialPort to use
Throws:
java.io.IOException

getSerialPort

public gnu.io.SerialPort getSerialPort()
Return SerialPort used by this controller.

Returns:
serial port or null if not set.

getInputStream

public java.io.InputStream getInputStream()
Return serial port input stream used by this controller.

Returns:
input stream or null if not set.

getOutputStream

public java.io.OutputStream getOutputStream()
Return serial port output stream used by this controller.

Returns:
output stream or null if not set.

delay

protected void delay(long delayMsec)
Sleep for specified time

Parameters:
delayMsec - Time to sleep (milliseconds)

rpm2counts

public static int rpm2counts(double rpm,
                             int countsPerRevolution)
Convert motor speed from counts/second to RPM

Parameters:
rpm - motor speed (RPM)
countsPerRevolution - counts per motor revolution
Returns:
motor speed (counts/sec)

counts2rpm

public static double counts2rpm(int counts,
                                int countsPerRevolution)
Convert motor speed from counts/second to RPM

Parameters:
counts - motor speed (counts/second)
countsPerRevolution - counts per motor revolution
Returns:
motor speed (RPM)

mkIndex

public static java.lang.String mkIndex(java.lang.String cmd,
                                       int index)

mkIndexCmd

public static java.lang.String mkIndexCmd(java.lang.String cmd,
                                          int index,
                                          java.lang.String value)

mkIndexCmd

public static java.lang.String mkIndexCmd(java.lang.String cmd,
                                          int index,
                                          int value)

mkIndexCmd

public static java.lang.String mkIndexCmd(java.lang.String cmd,
                                          int index,
                                          long value)

mkCmd

public static java.lang.String mkCmd(java.lang.String cmd,
                                     java.lang.String value)

mkCmd

public static java.lang.String mkCmd(java.lang.String cmd,
                                     int value)

mkCmd

public static java.lang.String mkCmd(java.lang.String cmd,
                                     long value)

emptyInput

public void emptyInput(long timeoutMsec)
                throws java.io.IOException
Flush the serial input stream. (using default (this) input stream)

Parameters:
timeoutMsec - (milliseconds)
Throws:
java.io.IOException

emptyInput

protected void emptyInput(java.io.InputStream instream,
                          long timeoutMsec)
                   throws java.io.IOException
Flush the serial input stream. (using default (this) input stream)

Parameters:
instream - an InputStream to flush
timeoutMsec - (milliseconds)
Throws:
java.io.IOException

writeCommand

protected void writeCommand(java.lang.String cmd)
                     throws java.io.IOException
Write a command to the serial port. terminates the command with a newline and flush the serial port. Only cmdWriteRead should call this directly. Use CmdWriteReadX for write w/ no return value needed.

Parameters:
cmd - command string to write
Throws:
java.io.IOException

cmdWriteRead

protected int cmdWriteRead(java.lang.String cmd,
                           byte[] buf,
                           byte[] terminator,
                           long timeoutMsec)
                    throws TimeoutException,
                           java.io.IOException,
                           java.lang.NullPointerException,
                           java.lang.Exception
Perform one I/O transaction, (write then read).

Parameters:
cmd - Command to send
buf - Destination buffer
terminator - End of response marker
timeoutMsec - Timeout (milliseconds)
Returns:
number of bytes in response.
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

cmdWriteReadX

protected int cmdWriteReadX(java.lang.String cmd)
                     throws java.io.IOException
write a command and cleanup returned terminator (discards characters read)

Throws:
java.io.IOException

cmdWriteReadInt

protected int cmdWriteReadInt(java.lang.String cmd,
                              int len,
                              long timeoutMsec)
                       throws TimeoutException,
                              java.io.IOException,
                              java.lang.NullPointerException,
                              java.lang.Exception
Write one command and parse the resulting return value as an integer.

Parameters:
cmd - command to send
len - maximum expected return length (bytes)
timeoutMsec - timeout for return value (milliseconds)
Returns:
command return value (integer)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

cmdWriteReadLong

protected long cmdWriteReadLong(java.lang.String cmd,
                                int len,
                                long timeoutMsec)
                         throws TimeoutException,
                                java.io.IOException,
                                java.lang.NullPointerException,
                                java.lang.Exception
Write one command and parse the resulting return value as a long.

Parameters:
cmd - command to send
len - maximum expected return length (bytes)
timeoutMsec - timeout for return value (milliseconds)
Returns:
command return value (long)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

cmdWriteReadDouble

protected double cmdWriteReadDouble(java.lang.String cmd,
                                    int len,
                                    long timeoutMsec)
                             throws TimeoutException,
                                    java.io.IOException,
                                    java.lang.NullPointerException,
                                    java.lang.Exception
Write one command and parse the resulting return value as an double.

Parameters:
cmd - command to send
len - maximum expected return length (bytes)
timeoutMsec - timeout for return value (milliseconds)
Returns:
command return value (double)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

cmdWriteReadString

protected java.lang.String cmdWriteReadString(java.lang.String cmd,
                                              int len,
                                              long timeoutMsec)
                                       throws TimeoutException,
                                              java.io.IOException,
                                              java.lang.NullPointerException,
                                              java.lang.Exception
Write one command and parse the resulting return value as a String.

Parameters:
cmd - command to send
len - maximum expected return length (bytes)
timeoutMsec - timeout for return value (milliseconds)
Returns:
command return value (String)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

initializeController

public abstract void initializeController(int serialMode,
                                          int unitMode)
                                   throws TimeoutException,
                                          java.io.IOException,
                                          java.lang.Exception
Initialize motor controller. Abstract method to be implemented by subclasses.

Parameters:
serialMode - serial comms mode (local or RFC1722)
unitMode - elmo unit mode
Throws:
TimeoutException
java.io.IOException
java.lang.Exception

readRegister

public java.lang.String readRegister(java.lang.String register)
                              throws TimeoutException,
                                     java.io.IOException,
                                     java.lang.NullPointerException,
                                     java.lang.Exception
Return value (String) of Elmo register

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

getVersion

public java.lang.String getVersion()
Return controller version information.

Returns:
Controller firmware version or "UNKNOWN" on error.

setSerialMode

public void setSerialMode(int mode)
                   throws java.lang.IllegalArgumentException
set serial mode

Throws:
java.lang.IllegalArgumentException

getSerialMode

public int getSerialMode()
set serial mode


getMaxCurrent

public double getMaxCurrent()
                     throws TimeoutException,
                            java.io.IOException,
                            java.lang.NullPointerException,
                            java.lang.Exception
Get max current from read-only MC parameter (A)

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

setPeakCurrent

public void setPeakCurrent(double peakCurrent)
                    throws TimeoutException,
                           java.io.IOException,
                           java.lang.NullPointerException,
                           java.lang.IllegalArgumentException,
                           java.lang.Exception
Set peak current (A). Max peak current is MC.

Parameters:
peakCurrent - (A)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

getPeakCurrent

public double getPeakCurrent()
                      throws TimeoutException,
                             java.io.IOException,
                             java.lang.NullPointerException,
                             java.lang.Exception
Get peak current limit (A)

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

setPeakCurrentDuration

public void setPeakCurrentDuration(int peakCurrentDurationSec)
                            throws TimeoutException,
                                   java.io.IOException,
                                   java.lang.NullPointerException,
                                   java.lang.IllegalArgumentException,
                                   java.lang.Exception
Set peak current duration (sec).

Parameters:
peakCurrentDurationSec - (sec)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

getPeakCurrentDuration

public int getPeakCurrentDuration()
                           throws TimeoutException,
                                  java.io.IOException,
                                  java.lang.NullPointerException,
                                  java.lang.Exception
Get peak current duration (sec)

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

setContinuousCurrent

public void setContinuousCurrent(double contCurrent)
                          throws TimeoutException,
                                 java.io.IOException,
                                 java.lang.NullPointerException,
                                 java.lang.IllegalArgumentException,
                                 java.lang.Exception
Set continuous current (A). Max continuous current is MC/2.

Parameters:
contCurrent - max continous active current (A)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

getContinuousCurrent

public double getContinuousCurrent()
                            throws TimeoutException,
                                   java.io.IOException,
                                   java.lang.NullPointerException,
                                   java.lang.Exception
Get continous current limit (A)

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

setTorqueLimit

public void setTorqueLimit(double torquePercent)
                    throws TimeoutException,
                           java.io.IOException,
                           java.lang.NullPointerException,
                           java.lang.IllegalArgumentException,
                           java.lang.Exception
Set torque limit (% of continuous current). If the torque limit is exceeded and stuck motor protection is enabled, a motor fault will occur. max value: 100%

Parameters:
torquePercent - max torque, as a percentage of max continous active current (%)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

getTorqueLimit

public double getTorqueLimit()
                      throws TimeoutException,
                             java.io.IOException,
                             java.lang.NullPointerException,
                             java.lang.Exception
Get torque limit (% continous active current)

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

setStuckSpeed

public void setStuckSpeed(int stuckSpeed)
                   throws TimeoutException,
                          java.io.IOException,
                          java.lang.NullPointerException,
                          java.lang.IllegalArgumentException,
                          java.lang.Exception
Set stuck speed (counts/sec). If the motor goes slower than the stuck speed for more than the and peak current duration and the torque exceeds the torque limit and motor protection is enabled (i.e., stuck motor speed > 2), a motor fault will occur. max value: 16000

Parameters:
stuckSpeed - min speed threshold indicating the motor is stuck (counts/sec)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

getStuckSpeed

public int getStuckSpeed()
                  throws TimeoutException,
                         java.io.IOException,
                         java.lang.NullPointerException,
                         java.lang.Exception
Get stuck speed (counts/sec)

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

getStatusRegister

public int getStatusRegister()
                      throws TimeoutException,
                             java.io.IOException,
                             java.lang.NullPointerException,
                             java.lang.Exception
Get status register value. Reported Status Bits 0 : Drive read: 0 0: Conditions OK 1: Problem, as reported by bits 1-3 1-3 : Servo drive status indication details: refer to the following table 4 : Motor on (MO) 4 5 : Reference mode (RM) 5 6 : Motor failure latched (see MF for details) 7-9 : Unit mode (UM) 10 : Gain scheduling on 11 : Either Main or Auxiliary Homing being processed 12 : Program running 13 : Current limit on (LC) 14-15 : Motion status reflection (MS) 16-17 : Recorder status 0: Recorder inactive, no valid recorded data 1: Recorder waiting for a trigger event 2: Recorder finished; valid data ready for use 3: Recording now 18-23 : Not used 24-26 : Digital Hall sensors A, B and C6 27 : CPU status: 0: CPU OK 1: Stack overflow or CPU exception 28 : Stopped by a limit ( RLS, FLS, Stop switch ) or by a VH[3]/VL[3] position command limit 29 : Error in user program 30-31 : Unused 0x8 0x4 0x2 Meaning 0 0 0 OK. 0 0 1 Under voltage: The power supply is shut off or it has too high an impedance. 0 1 0 Over voltage: The power supply voltage is too large, or the servo drive did not succeed in absorbing the kinetic energy while braking a load. A shunt resistor may be needed. 1 0 1 Short circuit: The motor or its wiring may be defective. 1 1 0 Temperature: The drive is overheating.

Returns:
status
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

getMotorFault

public int getMotorFault()
                  throws TimeoutException,
                         java.io.IOException,
                         java.lang.NullPointerException,
                         java.lang.Exception
Get detailed motor fault codes. value/bit 0x0 : The motor is on, or the last motor shutdown was the normal result of a software command. 0x1/0 : 1. Resolver or Analog Halls feedback is not ready - Resolver or Analog Halls angle was not found yet. 2. The amplitude of the analog sensor is lost or too low. 0x1/0 : reserved 0x2/1 : reserved 0x4/2 : Feedback loss: no match between encoder and Hall location. Available in encoder + Hall feedback systems. 0x8/3 : The peak current has been exceeded. Possible reasons are drive malfunction or bad tuning of the current controller. 0x10/4 : inhibit 0x20/5 : reserved 0x40/6 : Two digital Hall sensors were changed at the same time. Error occurs because digital Hall sensors must be changed one at a time. 0x80/7 : Speed tracking error DV[2] - VX (for UM=2 or UM=4, 5) exceeded speed error limit ER[2]. This may occur due to: - Bad tuning of the speed controller - Too tight a speed error tolerance - Inability of motor to accelerate to the required speed due to too low a line voltage or not a powerful enough motor 0x100/8 : Position tracking error DV[3] - PX (UM=5) or DV[3] - PY (UM=4) exceeded position error limit ER[3]. This may occur due to: - Bad tuning of the position or speed controller - Too tight a position error tolerance - Abnormal motor load, or reaching a mechanical limit 0x200/9 : Cannot start because of inconsistent database. The type of database inconsistency is reflected in the status SR report, and in the CD CPU dump report. 0x400/10 : Too large a difference in ECAM table. 0x800/11 : Heartbeat failure. Error occurs only if drive is set to abort under heartbeat failure in a CANopen network (object 0x6007 in CAN object dictionary is set to 2). 0x1000/12 : Servo drive fault. Error described according to the servo drive fault detail bits 13 - 15 in the MF report. Refer to following table. 0x2000/13 : Servo drive fault detail bit 1. Refer to following table. 0x4000/14 : Servo drive fault detail bit 2. Refer to following table. 0x8000/15 : Servo drive fault detail bit 3. Refer to following table. 0x10000/16 : Failed to find the electrical zero of the motor in an attempt to start it with an incremental encoder and no digital Hall sensors. The reason may be that the applied motor current did not suffice for moving the motor from its position. 0x20000/17 : Speed limit exceeded: VXHL[2]. 0x40000/18 : Stack overflow - fatal exception. This may occur if the CPU was subject to a load that it could not handle. Such a situation can arise only due to a software bug in the drive. Use the CD command to get the CPU dump and report to your service center. 0x80000/19 : CPU exception - fatal exception. Something such as an attempt to divide in zero or another fatal firmware error has occurred. Use the CD command to get the CPU dump and report to your service center. 0x100000/20 : reserved 0x200000/21 : Motor stuck - the motor is powered but is not moving according to the definition of CL[2] and CL[3]. 0x400000/22 : Position limit exceeded: PXHL[3] (UM=5), or PYHL[3] (UM=4). 0x10000000/28 : reserved 0x20000000/29 : Cannot start motor 0x80000000/31 : reserved bits 0x8000 0x4000 0x2000 : code 000 : OK 001 : Under voltage. The power supply is shut down or it has too high an output impedance. 010 : Over voltage. The voltage of the power supply is too high, or the servo drive did not succeed in absorbing the kinetic energy while braking a load. A shunt resistor may be required. 011 : reserved 100 : reserved 101 : Short circuit. The motor or its wiring may be defective, or the drive is faulty. 110 : Temperature. Drive overheating. The environment is too hot, or lacks heat removal. There may be a large thermal resistance between the drive and its mounting. 111 : reserved

Returns:
motor fault code
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception
See Also:
Command Reference

getMotionStatus

public int getMotionStatus()
                    throws TimeoutException,
                           java.io.IOException,
                           java.lang.NullPointerException,
                           java.lang.IllegalArgumentException,
                           java.lang.Exception
Get motion status register.

Returns:
MS_REF_CONTROLLED if moving in PTP mode, MS_REF_STATIONARY or MS_POS_STABILIZED if motor stopped.
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

setEchoMode

public void setEchoMode(int mode)
                 throws java.io.IOException,
                        java.lang.IllegalArgumentException
Set echo mode

Parameters:
mode - ECHO_ENABLED or ECHO_DISABLED
Throws:
java.io.IOException
java.lang.IllegalArgumentException

getEchoMode

public int getEchoMode()
                throws TimeoutException,
                       java.io.IOException,
                       java.lang.NullPointerException,
                       java.lang.Exception
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

setHexMode

public void setHexMode(boolean mode)
                throws TimeoutException,
                       java.io.IOException,
                       java.lang.NullPointerException,
                       java.lang.Exception
Set hex mode. Integers returned in hexidecimal format (0xn) if true or as base 10 if false.

Parameters:
mode - enable hex mode if true, disable if false
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

getHexMode

public int getHexMode()
               throws TimeoutException,
                      java.io.IOException,
                      java.lang.NullPointerException,
                      java.lang.Exception
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

getReferenceSpeedLo

public int getReferenceSpeedLo()
                        throws TimeoutException,
                               java.io.IOException,
                               java.lang.NullPointerException,
                               java.lang.Exception
Get low reference speed limit (VL[2]) (counts/sec)

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

getReferenceSpeedHi

public int getReferenceSpeedHi()
                        throws TimeoutException,
                               java.io.IOException,
                               java.lang.NullPointerException,
                               java.lang.Exception
Get high reference speed limit (VH[2]) (counts/sec)

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

setReferenceSpeed

public void setReferenceSpeed(int min,
                              int max)
                       throws java.io.IOException,
                              java.lang.IllegalArgumentException
Set controller reference speed. The motor will ignore commands greater than this limit. The reference speed can only be set when the motor is stopped.

Parameters:
min - minimum reference speed
max - maximum reference speed
Throws:
java.io.IOException
java.lang.IllegalArgumentException

setReferenceLimit

public void setReferenceLimit(int min,
                              int max)
                       throws java.io.IOException,
                              java.lang.IllegalArgumentException
Set controller reference speed limits. The motor will stop if the speed exceeds this limit; min should be
Parameters:
min - minimum motor speed
max - maximum motor speed
Throws:
java.io.IOException
java.lang.IllegalArgumentException

getReferenceLimitLo

public int getReferenceLimitLo()
                        throws TimeoutException,
                               java.io.IOException,
                               java.lang.NullPointerException,
                               java.lang.Exception
Get low reference speed limit (VL[2]) (counts/sec)

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

getReferenceLimitHi

public int getReferenceLimitHi()
                        throws TimeoutException,
                               java.io.IOException,
                               java.lang.NullPointerException,
                               java.lang.Exception
Get high reference speed limit (VH[2]) (counts/sec)

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

setUnitMode

public void setUnitMode(int mode)
                 throws TimeoutException,
                        java.io.IOException,
                        java.lang.NullPointerException,
                        java.lang.IllegalArgumentException,
                        java.lang.Exception
Set controller operation mode. The controller unit mode can only be set when the motor is stopped.

Parameters:
mode - one of: MODE_TORQUE,MODE_SPEED,MODE_SINGLE_FEEDBACK_POSITION,MODE_DUAL_FEEDBACK_POSITION,MODE_STEPPER
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

getUnitMode

public int getUnitMode()
                throws TimeoutException,
                       java.io.IOException,
                       java.lang.NullPointerException,
                       java.lang.IllegalArgumentException,
                       java.lang.Exception
Get controller operation mode.

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

getInputPort

public int getInputPort()
                 throws TimeoutException,
                        java.io.IOException,
                        java.lang.NullPointerException,
                        java.lang.IllegalArgumentException,
                        java.lang.Exception
read digital input port

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

setInputLogic

public void setInputLogic(int inputBit,
                          int value)
                   throws TimeoutException,
                          java.io.IOException,
                          java.lang.NullPointerException,
                          java.lang.IllegalArgumentException
Set Input Logic register.

Parameters:
inputBit - input index (0-indexed; note adjustment for IL IL is 1-indexed)
value - value (bitfield, 0-23d)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException

setXModulus

public void setXModulus(long xmLo,
                        long xmHi)
                 throws TimeoutException,
                        java.io.IOException,
                        java.lang.NullPointerException,
                        java.lang.IllegalArgumentException,
                        java.lang.Exception
Set XModulus. Sets X Modulus for cyclic position counting. Motor must be stopped to set value

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

getXModulusLo

public long getXModulusLo()
                   throws TimeoutException,
                          java.io.IOException,
                          java.lang.NullPointerException,
                          java.lang.Exception
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

getXModulusHi

public long getXModulusHi()
                   throws TimeoutException,
                          java.io.IOException,
                          java.lang.NullPointerException,
                          java.lang.Exception
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

getInputLogic

public int getInputLogic(int inputBit)
                  throws TimeoutException,
                         java.io.IOException,
                         java.lang.NullPointerException,
                         java.lang.IllegalArgumentException,
                         java.lang.Exception
Get Input Logic register.

Parameters:
inputBit - input index (0-indexed; note adjustment for IL IL is 1-indexed)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

setAcceleration

public void setAcceleration(int value)
                     throws TimeoutException,
                            java.io.IOException,
                            java.lang.NullPointerException,
                            java.lang.IllegalArgumentException,
                            java.lang.Exception
Set speed-up acceleration. Takes effect on next beginMotion command.

Parameters:
value - - new value (counts/sec^2)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

getAcceleration

public int getAcceleration()
                    throws TimeoutException,
                           java.io.IOException,
                           java.lang.NullPointerException,
                           java.lang.IllegalArgumentException,
                           java.lang.Exception
Get speed-up acceleration. (counts/sec^2)

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

setDeceleration

public void setDeceleration(int value)
                     throws TimeoutException,
                            java.io.IOException,
                            java.lang.NullPointerException,
                            java.lang.IllegalArgumentException,
                            java.lang.Exception
Set slow-down acceleration. Takes effect on next beginMotion command.

Parameters:
value - - new value (counts/sec^2)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

getDeceleration

public int getDeceleration()
                    throws TimeoutException,
                           java.io.IOException,
                           java.lang.NullPointerException,
                           java.lang.IllegalArgumentException,
                           java.lang.Exception
Get slow-down acceleration. Motor deceleration (counts/sec^2) Used for changing jogging velocity. Deceleration for stopping is controlled separately.

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

setStopDeceleration

public void setStopDeceleration(int value)
                         throws TimeoutException,
                                java.io.IOException,
                                java.lang.NullPointerException,
                                java.lang.IllegalArgumentException,
                                java.lang.Exception
Set slow-down acceleration, Motor stop deceleration (counts/sec^2) Controls rate at which motor stops when ST command is issued; deceleration during jogging velocity change is handled separately. Takes effect on next beginMotion command.

Parameters:
value - - new value (counts/sec^2)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

getStopDeceleration

public int getStopDeceleration()
                        throws TimeoutException,
                               java.io.IOException,
                               java.lang.NullPointerException,
                               java.lang.IllegalArgumentException,
                               java.lang.Exception
Get slow-down stop acceleration.

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

getPositionCounter

protected long getPositionCounter()
                           throws TimeoutException,
                                  java.io.IOException,
                                  java.lang.NullPointerException,
                                  java.lang.Exception
Get motor position.

Returns:
motor position (always 0 for now)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

setPositionCounter

public void setPositionCounter(long value)
                        throws TimeoutException,
                               java.io.IOException,
                               java.lang.NullPointerException,
                               java.lang.IllegalArgumentException
Set Position Counter. Motor must be stopped

Parameters:
value - - position counter value
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException

setPositionRelative

public void setPositionRelative(long value)
                         throws TimeoutException,
                                java.io.IOException,
                                java.lang.NullPointerException,
                                java.lang.IllegalArgumentException,
                                java.lang.Exception
Position Relative. Sets relative position; does not take effect until BG. Motion subject to AC, DC, JV, etc.

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

setPositionAbsolute

public void setPositionAbsolute(long value)
                         throws TimeoutException,
                                java.io.IOException,
                                java.lang.NullPointerException,
                                java.lang.IllegalArgumentException,
                                java.lang.Exception
Position Absolute. Enables motor (required to set PA) Sets absolute position; does not take effect until BG

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

getPositionError

protected long getPositionError()
                         throws TimeoutException,
                                java.io.IOException,
                                java.lang.NullPointerException,
                                java.lang.Exception
Get motor position error.

Returns:
difference between commanded and actual position
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

setPTPSpeed

public void setPTPSpeed(int ptpSpeed)
                 throws java.io.IOException,
                        java.lang.IllegalArgumentException,
                        TimeoutException,
                        java.lang.NullPointerException,
                        java.lang.Exception
Set max speed for PTP (point to point) motion. Although SP is not used in velocity mode, it must be set so that SP<|VL[2]| and SP<|VH[2]|. If not, parameters VL,VH,LL,HL may not be correctly written to flash

Parameters:
ptpSpeed - max PTP speed (counts/sec)
Throws:
java.io.IOException
java.lang.IllegalArgumentException
TimeoutException
java.lang.NullPointerException
java.lang.Exception

getPTPSpeed

public int getPTPSpeed()
                throws java.io.IOException,
                       java.lang.IllegalArgumentException,
                       TimeoutException,
                       java.lang.NullPointerException,
                       java.lang.Exception
Throws:
java.io.IOException
java.lang.IllegalArgumentException
TimeoutException
java.lang.NullPointerException
java.lang.Exception

setJoggingVelocity

public void setJoggingVelocity(double velocityRPM,
                               int countsPerRev)
                        throws TimeoutException,
                               java.io.IOException,
                               java.lang.NullPointerException,
                               java.lang.IllegalArgumentException,
                               java.lang.Exception
Set motor velocity. Does not take effect until next BG command

Parameters:
velocityRPM - - motor speed (RPM)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

setJoggingVelocity

public void setJoggingVelocity(int velocityCounts)
                        throws TimeoutException,
                               java.io.IOException,
                               java.lang.NullPointerException,
                               java.lang.IllegalArgumentException,
                               java.lang.Exception
Set jogging velocity (counts/second). The new velocity does not take effect until the next begin motion command.

Parameters:
velocityCounts - commanded velocity (counts/sec)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

getJoggingVelocity

public int getJoggingVelocity()
                       throws TimeoutException,
                              java.io.IOException,
                              java.lang.NullPointerException,
                              java.lang.Exception
Get jogging velocity. (requested motor velocity; reads value even if motor stopped)

Returns:
velocity
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

getEncoderVelocity

public int getEncoderVelocity()
                       throws TimeoutException,
                              java.io.IOException,
                              java.lang.NullPointerException,
                              java.lang.Exception
Get encoder velocity VX.

Returns:
velocity (instantaneous value, counts/sec)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

getDesiredVelocity

public int getDesiredVelocity()
                       throws TimeoutException,
                              java.io.IOException,
                              java.lang.NullPointerException,
                              java.lang.Exception
Get commanded velocity. ( DV[2]; reads 0 if motor stopped)

Returns:
velocity
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

setEnable

public void setEnable(boolean value,
                      long timeoutMsec)
               throws TimeoutException
Enable or disable the motor fulfills MotorControlIF interface

Throws:
TimeoutException

isEnabled

public boolean isEnabled()
                  throws TimeoutException,
                         java.io.IOException,
                         java.lang.NullPointerException,
                         java.lang.Exception
Determine if motor is enabled.

Returns:
true if enabled, false otherwise.
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

stopMotor

protected int stopMotor()
                 throws TimeoutException,
                        java.io.IOException,
                        java.lang.NullPointerException,
                        java.lang.Exception
Stop motor.

Returns:
0 on success
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

motionWait

public void motionWait(long distance,
                       long pollMsec)
                throws TimeoutException,
                       java.io.IOException,
                       java.lang.NullPointerException,
                       java.lang.IllegalArgumentException,
                       java.lang.Exception
wait for relative/absolute motion to complete

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

beginMotion

public void beginMotion()
                 throws TimeoutException,
                        java.io.IOException,
                        java.lang.NullPointerException,
                        java.lang.IllegalArgumentException,
                        java.lang.Exception
Begin motion. Enables motor and starts new motion (according to jogging velocity and acceleration settings).

Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

ptpAbsolute

public void ptpAbsolute(long position,
                        int velocity,
                        int acceleration,
                        int deceleration,
                        boolean wait)
                 throws TimeoutException,
                        java.io.IOException,
                        java.lang.NullPointerException,
                        java.lang.IllegalArgumentException,
                        java.lang.Exception
Command new absolute position w/ new acceleration parameters. Sets jogging velocity, acceleration and initiates new motion.

Parameters:
position - - counts
velocity - - motor speed (counts/sec)
acceleration - - new accleration value counts/sec^2
deceleration - - new decleration value counts/sec^2
wait - - delay when setting ptp absolute speed
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

ptpAbsolute

public void ptpAbsolute(long position,
                        boolean wait)
                 throws TimeoutException,
                        java.io.IOException,
                        java.lang.NullPointerException,
                        java.lang.IllegalArgumentException,
                        java.lang.Exception
Command new absolute position; changes velocity during motion based on current AC, DC and specified JV parameters Enables motor and initiates new motion.

Parameters:
position - - motor position (counts)
wait - - enable delay when setting ptp absolute speed
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

ptpRelative

public void ptpRelative(long position,
                        int velocity,
                        int acceleration,
                        int deceleration,
                        boolean wait)
                 throws TimeoutException,
                        java.io.IOException,
                        java.lang.NullPointerException,
                        java.lang.IllegalArgumentException,
                        java.lang.Exception
Command new relative position w/ new acceleration parameters. Sets jogging velocity, acceleration and initiates new motion.

Parameters:
position - - counts
velocity - - motor speed (counts/sec)
acceleration - - new accleration value counts/sec^2
deceleration - - new decleration value counts/sec^2
wait - - enable delay when setting ptp absolute speed
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

ptpRelative

public void ptpRelative(long position,
                        boolean wait)
                 throws TimeoutException,
                        java.io.IOException,
                        java.lang.NullPointerException,
                        java.lang.IllegalArgumentException,
                        java.lang.Exception
Command new relative position; changes velocity during motion based on current AC, DC and specified JV parameters Enables motor and initiates new motion.

Parameters:
position - - motor position (relative counts)
wait - - enable delay when setting ptp absolute speed
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

jog

public void jog(int velocity,
                int acceleration,
                int deceleration)
         throws TimeoutException,
                java.io.IOException,
                java.lang.NullPointerException,
                java.lang.IllegalArgumentException,
                java.lang.Exception
Command new velocity w/ new acceleration parameters. Sets jogging velocity, acceleration and initiates new motion. If acceleration or deceleration <=0, they are not set. Equivalent to commandVelocity if acceleration and deceleration both <=0

Parameters:
velocity - - motor speed (counts/sec)
acceleration - - new accleration value counts/sec^2
deceleration - - new decleration value counts/sec^2
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

jog

public void jog(int velocity)
         throws TimeoutException,
                java.io.IOException,
                java.lang.NullPointerException,
                java.lang.IllegalArgumentException,
                java.lang.Exception
Command new velocity; changes velocity during motion based on current AC, DC and specified JV parameters Sets jogging velocity and initiates new motion.

Parameters:
velocity - - motor speed (counts/sec)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.