org.mbari.siam.foce.devices.controlLoop
Class PH_Responder

java.lang.Object
  extended by org.mbari.siam.foce.devices.controlLoop.BaseResponder
      extended by org.mbari.siam.foce.devices.controlLoop.PH_Responder
All Implemented Interfaces:
ControlResponseIF, ProcessParameterIF
Direct Known Subclasses:
PH_LIN_Responder, PH_PID_Responder

public abstract class PH_Responder
extends BaseResponder
implements ProcessParameterIF


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.mbari.siam.distributed.devices.ProcessParameterIF
ProcessParameterIF.DummyConstValues, ProcessParameterIF.DummyFIDMap, ProcessParameterIF.DummyIDMap, ProcessParameterIF.DummyIIDMap, ProcessParameterIF.DummyModeNames, ProcessParameterIF.DummyOIDMap, ProcessParameterIF.DummyParamNames, ProcessParameterIF.DummyRIDMap, ProcessParameterIF.DummySIDMap
 
Field Summary
protected static org.apache.log4j.Logger _log4j
          Log4j logger
protected static int AFT_VALVE_INDEX
           
protected static int FWD_VALVE_INDEX
           
protected static int NUMBER_OF_VALVES
           
static java.lang.String RECORD_HEADER
           
 
Fields inherited from class org.mbari.siam.foce.devices.controlLoop.BaseResponder
_attributes, _cfgPacketBuffer, _controlProcess, _correction, _dataPacket, _dataTurbineHost, _doTurbinate, _error, _esw_pump_amode, _esw_valve_amode, _lastDataPacket, _maxDataBytes, _offset, _packetBuffer, _packetParser, _ph_cmode, _ph_rmode, _previousError, _previousProcessValue, _processValue, _rawCorrection, _recordDelimiter, _recordType, _setPoint, _thruster_amode, _turbinator, _velocity_cmode, DELIMITERS
 
Fields inherited from interface org.mbari.siam.distributed.devices.ProcessParameterIF
AC_PH_INT_AFT, ACTUATION_DISABLED, ACTUATION_ENABLED, ACTUATION_MAX, ACTUATION_MIN, BX_PH_ESW, BX_PH_EXT_MID_L, BX_PH_EXT_MID_R, BX_PH_INT_AFT_L, BX_PH_INT_AFT_R, BX_PH_INT_FWD_L, BX_PH_INT_FWD_R, BX_VESWP, BX_VH2O_EXT_X, BX_VH2O_EXT_Y, BX_VH2O_INT_X, BX_VH2O_INT_Y, BX_VTHR_AFT, BX_VTHR_FWD, CONNECTOR_TYPE_EXT_OSDT, CONNECTOR_TYPE_RAW, CONNECTOR_TYPE_SIAM_OSDT, CONNECTOR_TYPE_SIAM_REG, const_mnem2value, CONTROL_MODE_CONSTANT, CONTROL_MODE_DEADBAND, CONTROL_MODE_MANUAL, CONTROL_MODE_MAX, CONTROL_MODE_MIN, CONTROL_MODE_OFFSET, CONTROL_MODE_PANIC, DIR_X, DIR_Y, DIR_Z, EC_PH_EXT, FC_PH_INT_FWD, filter_id2fname, HD_HDG_EXT, HD_HDG_INT, IAC_PH_INT_AFT_L, IAC_PH_INT_AFT_R, IBX_PH_ESW, IBX_PH_EXT_MID_L, IBX_PH_EXT_MID_R, IBX_PH_INT_AFT_L, IBX_PH_INT_AFT_R, IBX_PH_INT_FWD_L, IBX_PH_INT_FWD_R, IBX_VESWP, IBX_VH2O_EXT_X, IBX_VH2O_EXT_Y, IBX_VH2O_INT_X, IBX_VH2O_INT_Y, IBX_VTHR_AFT, IBX_VTHR_FWD, IC_PH_INT, IEC_PH_EXT_MID_L, IEC_PH_EXT_MID_R, IFC_PH_INT_FWD_L, IFC_PH_INT_FWD_R, IHD_HDG_EXT_X, IHD_HDG_EXT_Y, IHD_HDG_INT_X, IHD_HDG_INT_Y, IIC_PH_INT_AFT, IIC_PH_INT_FWD, IMA_MAG_EXT_X, IMA_MAG_EXT_Y, IMA_MAG_INT_X, IMA_MAG_INT_Y, input_id2iname, IVC_VH2O_EXT_X, IVC_VH2O_EXT_Y, IVC_VH2O_INT_X, IVC_VH2O_INT_Y, IVS_ESWV_AFT, IVS_ESWV_FWD, LOC_ESW, LOC_EXT, LOC_INT, MA_MAG_EXT, MA_MAG_INT, mode_id2pname, OUTPUT_AFT_ESW_VALVE, OUTPUT_AFT_THRUSTER_VELOCITY, OUTPUT_ESW_PUMP_VELOCITY, OUTPUT_FWD_ESW_VALVE, OUTPUT_FWD_THRUSTER_VELOCITY, output_id2name, OUTPUT_TYPE_EXT, OUTPUT_TYPE_SIAM, PARAM_CO2_CONCENTRATION, PARAM_DENSITY_SW, PARAM_ESW_PUMP_AMODE, PARAM_ESW_VALVE_AMODE, PARAM_EXP_A, PARAM_EXP_B, PARAM_EXP_H, PARAM_EXP_K, PARAM_FLUME_AREA, param_id2pname, PARAM_MAX_FLOW_CHANGE_PERCENT, PARAM_PH_ABS_MAX, PARAM_PH_ABS_MIN, PARAM_PH_CMODE, PARAM_PH_DEADBAND_HI, PARAM_PH_DEADBAND_LO, PARAM_PH_LIN_FILTER_DEPTH, PARAM_PH_LIN_OFFSET, PARAM_PH_LIN_SLOPE, PARAM_PH_MAX_CORRECTION, PARAM_PH_OFFSET, PARAM_PH_PID_KD, PARAM_PH_PID_KI, PARAM_PH_PID_KP, PARAM_PH_PID_MAX_KI, PARAM_PH_PID_SCALE_FACTOR, PARAM_PH_RMODE, PARAM_PH_SETPOINT, param_pname2aname, PARAM_THRUSTER_AMODE, PARAM_VELOCITY_CAL_A, PARAM_VELOCITY_CAL_B, PARAM_VELOCITY_CAL_C, PARAM_VELOCITY_CMODE, PARAM_VELOCITY_DEADBAND_HI, PARAM_VELOCITY_DEADBAND_LO, PARAM_VELOCITY_MAX_CORRECTION, PARAM_VELOCITY_MAX_RPM, PARAM_VELOCITY_MIN_RPM, PARAM_VELOCITY_OFFSET, PARAM_VELOCITY_PID_KD, PARAM_VELOCITY_PID_KI, PARAM_VELOCITY_PID_KP, PARAM_VELOCITY_PID_MAX_KI, PARAM_VELOCITY_PID_SCALE_FACTOR, PARAM_VELOCITY_RMODE, PARAM_VELOCITY_SETPOINT, POS_AFT, POS_FWD, POS_L, POS_MID, POS_R, PROC_EXCL, PROC_INCL, RESPONSE_MODE_EXP, RESPONSE_MODE_LIN, RESPONSE_MODE_MAX, RESPONSE_MODE_MIN, RESPONSE_MODE_PID, ROLE_AFT_ESW_VALVE, ROLE_AFT_THRUSTER, ROLE_ESW_PH, ROLE_ESW_PUMP, ROLE_EXT_MID_L_PH, ROLE_EXT_MID_R_PH, ROLE_EXT_X_VELOCITY, ROLE_EXT_Y_VELOCITY, ROLE_FWD_ESW_VALVE, ROLE_FWD_THRUSTER, role_id2name, ROLE_INT_AFT_L_PH, ROLE_INT_AFT_R_PH, ROLE_INT_FWD_L_PH, ROLE_INT_FWD_R_PH, ROLE_INT_X_VELOCITY, ROLE_INT_Y_VELOCITY, ROLE_MASK, SIG_AFT_THRUSTER_VEL, SIG_AFT_THRUSTER_VEL_CMD_CHK, SIG_AFT_THRUSTER_VEL_CMD_RAW, SIG_ESW_AFT_VALVE_CMD, SIG_ESW_AFT_VALVE_STATE, SIG_ESW_FWD_VALVE_CMD, SIG_ESW_FWD_VALVE_STATE, SIG_ESW_INJ_VOL, SIG_ESW_PUMP_CMD_CHK, SIG_ESW_PUMP_CMD_RAW, SIG_ESW_PUMP_VEL, SIG_FWD_THRUSTER_VEL, SIG_FWD_THRUSTER_VEL_CMD_CHK, SIG_FWD_THRUSTER_VEL_CMD_RAW, SIG_PH_ERR, SIG_PH_ESW, SIG_PH_ESW_FILT, SIG_PH_EXT_FILT, SIG_PH_EXT_MID_L, SIG_PH_EXT_MID_R, SIG_PH_GRAD, SIG_PH_INT_AFT_FILT, SIG_PH_INT_AFT_L, SIG_PH_INT_AFT_R, SIG_PH_INT_FILT, SIG_PH_INT_FWD_FILT, SIG_PH_INT_FWD_L, SIG_PH_INT_FWD_R, SIG_VH2O_EXT_DIR_FILT, SIG_VH2O_EXT_MAG_FILT, SIG_VH2O_EXT_X_FILT, SIG_VH2O_EXT_X_RAW, SIG_VH2O_EXT_Y_FILT, SIG_VH2O_EXT_Y_RAW, SIG_VH2O_INT_DIR_FILT, SIG_VH2O_INT_ERR, SIG_VH2O_INT_MAG_FILT, SIG_VH2O_INT_X_FILT, SIG_VH2O_INT_X_RAW, SIG_VH2O_INT_Y_FILT, SIG_VH2O_INT_Y_RAW, signal_id2sname, TYPE_ALL, TYPE_ESW, TYPE_MASK, TYPE_MOTOR, TYPE_PH, TYPE_VALVE, TYPE_VELOCITY, VC_VH2O_EXT_X, VC_VH2O_EXT_Y, VC_VH2O_INT_X, VC_VH2O_INT_Y, VS_ESWV_AFT, VS_ESWV_FWD
 
Constructor Summary
PH_Responder(FOCEProcess controlProcess, ControlLoopAttributes attributes)
           
 
Method Summary
protected  float applyConstraints(double correction)
          Apply physical/operational constraints to the raw pH signal correction from the PID loop.
 java.lang.StringBuffer getSampleBuffer()
          Return a sample buffer with current process data.
 SensorDataPacket getSamplePacket()
          return a sensor data packet sub-classes should override
 void initialize()
          initialize control loop
protected  void initTurbinator()
           
protected  double pumpCommand(double phCorrection)
          convert the pH signal correction to pump motor input phTarget is either an offset or setpoint, depending on the value of mode (CONTROL_MODE_CONSTANT, CONTROL_MODE_OFFSET).
 float update()
          update output: where the rubber is told to meet the road (update control loop)
protected  void updateInputs()
          get any signals needed
protected  void updatePumpOutputs(double pumpCommand)
          Send command updates to inputs (CO2 delivery pump)
protected  void updateValveOutputs(int[] valveCommands)
          Send command updates to inputs (CO2 delivery pump)
protected  int[] valveCommands()
          Get command updates to CO2 delivery valves
 
Methods inherited from class org.mbari.siam.foce.devices.controlLoop.BaseResponder
getConfigBuffer, getCorrection, getLastSample, reset, showParsedData
 
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


RECORD_HEADER

public static final java.lang.String RECORD_HEADER
See Also:
Constant Field Values

FWD_VALVE_INDEX

protected static final int FWD_VALVE_INDEX
See Also:
Constant Field Values

AFT_VALVE_INDEX

protected static final int AFT_VALVE_INDEX
See Also:
Constant Field Values

NUMBER_OF_VALVES

protected static final int NUMBER_OF_VALVES
See Also:
Constant Field Values
Constructor Detail

PH_Responder

public PH_Responder(FOCEProcess controlProcess,
                    ControlLoopAttributes attributes)
             throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

initialize

public void initialize()
initialize control loop

Specified by:
initialize in interface ControlResponseIF
Overrides:
initialize in class BaseResponder

initTurbinator

protected void initTurbinator()

applyConstraints

protected float applyConstraints(double correction)
                          throws java.lang.Exception
Apply physical/operational constraints to the raw pH signal correction from the PID loop. (The actuation method(s) may also apply additional contraints)

Throws:
java.lang.Exception

updateInputs

protected void updateInputs()
                     throws java.lang.Exception
get any signals needed

Specified by:
updateInputs in class BaseResponder
Throws:
java.lang.Exception

pumpCommand

protected double pumpCommand(double phCorrection)
convert the pH signal correction to pump motor input phTarget is either an offset or setpoint, depending on the value of mode (CONTROL_MODE_CONSTANT, CONTROL_MODE_OFFSET).


valveCommands

protected int[] valveCommands()
                       throws java.lang.Exception
Get command updates to CO2 delivery valves

Throws:
java.lang.Exception

updateValveOutputs

protected void updateValveOutputs(int[] valveCommands)
                           throws java.lang.Exception
Send command updates to inputs (CO2 delivery pump)

Throws:
java.lang.Exception

updatePumpOutputs

protected void updatePumpOutputs(double pumpCommand)
                          throws java.lang.Exception
Send command updates to inputs (CO2 delivery pump)

Throws:
java.lang.Exception

update

public float update()
             throws java.lang.Exception
update output: where the rubber is told to meet the road (update control loop)

Specified by:
update in interface ControlResponseIF
Specified by:
update in class BaseResponder
Throws:
java.lang.Exception

getSamplePacket

public SensorDataPacket getSamplePacket()
return a sensor data packet sub-classes should override

Specified by:
getSamplePacket in interface ControlResponseIF
Specified by:
getSamplePacket in class BaseResponder

getSampleBuffer

public java.lang.StringBuffer getSampleBuffer()
                                       throws java.lang.Exception
Return a sample buffer with current process data. sub-classes should call the base class to get the common data items.

Specified by:
getSampleBuffer in interface ControlResponseIF
Overrides:
getSampleBuffer in class BaseResponder
Throws:
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.