org.lsst.ccs.subsystems.fcs.drivers
Class CanOpenClampActuatorModule

java.lang.Object
  extended by java.util.Observable
      extended by org.lsst.ccs.framework.Module
          extended by org.lsst.ccs.subsystems.fcs.ClampActuatorModule
              extended by org.lsst.ccs.subsystems.fcs.drivers.CanOpenClampActuatorModule
All Implemented Interfaces:
Serializable, Observer, Actuator, PieceOfHardware

public class CanOpenClampActuatorModule
extends ClampActuatorModule
implements PieceOfHardware

This deviceErrorFile a model for the clamp actuator in the Single Filter Test. The actuator deviceErrorFile used to unlock or release a clamp. To unlock a clamp, the actuator must be ON and to release the clamp it has to be OFF. There deviceErrorFile 2 clamps actuators on the carousel : one for side X-, one for side X+ For the Single Filter Test the actuator will be Maxon Motor EPOS2 24/5. (cf EPOS2_Firmware_Specification_En.pdf) There deviceErrorFile many operation modes for this actuators. For the Single Filter Test, we will use VELOCITY mode or CURRENT mode.

Author:
virieux
See Also:
Serialized Form

Nested Class Summary
static class CanOpenClampActuatorModule.ActuatorMode
           
 
Nested classes/interfaces inherited from class org.lsst.ccs.framework.Module
org.lsst.ccs.framework.Module.ValueUpdate
 
Field Summary
protected  boolean enabling
           
 
Fields inherited from class org.lsst.ccs.subsystems.fcs.ClampActuatorModule
on, readValue, sentCurrentMaxValue, sentCurrentMinValue, sentValue
 
Fields inherited from class org.lsst.ccs.framework.Module
configMethods, log, name, nObserverThreads, registry, tickMillis
 
Constructor Summary
CanOpenClampActuatorModule()
           
CanOpenClampActuatorModule(String nodeID, int inputID, String serial, Motor motor)
           
 
Method Summary
 boolean checkMotorParameters()
          This methods read the parameters of the motor stored in the actuator (hardware configuration)and compare with the configuration stored in the Configuration Data Base (software configuration).
 String disable()
           
 String displayErrorHistory()
           
 String displayErrorRegister()
           
 String displayMotorParameters()
           
 String enable()
          This methods enable the actuator : i.e.
 String getMode()
           
 int getMotor_continuousCurrentLimit()
           
 int getMotor_maxSpeedInCurrentMode()
           
 String getMotor_mode()
           
 int getMotor_outputCurrentLimit()
           
 int getMotor_polePairNumber()
           
 int getMotor_thermalTimeConstantWinding()
           
 int getMotor_type()
           
 Motor getMotor()
           
 String getNodeID()
           
 int getPositionSensorType()
           
 String getSerialNB()
           
 void initialize()
           
 void initModule()
           
 boolean isConfigOK()
           
 boolean isEnable()
           
 String maintainCurrent()
           
 String off()
          This method set to zero the current value and stops the motor motion.
 String on()
          This methods enables the actuator and puts the motor on in sending the appropriate current value to the actuator.
 void quickStop()
           
 String readControlWord()
          Read the control world (index=6040, subindex=0,size=2)
 int readCurrent()
          In Current Mode this methods returns the current actualy received by the motor.
 String[] readErrorHistory()
          The error history holds errors that have occurred on the device and have been signalled via the emergency object.
 String readErrorRegister()
          At index 1001 there deviceErrorFile an error register for the device.
 int readMotorData(String subindex)
          This methods reads the parameters of the motor stored in the actuator.
 int readMotorType()
          This command read the motor type on the actuator.
 int readNumberOfErrors()
          Extract from the Maxon Motor firmware specification : Contains the number of actual errors that are recorded in the array starting at subindex 1.
 int readPositionSensorType()
          This command read the position sensor type on the actuator.
 String readSDO(String index, String subindex)
           
 String readStatusword()
          Read the status world (index=6041, subindex=0,size=2)
 int readVelocity()
           
 void resetFault()
           
 Object restoreParameters()
           
 Object saveParameters()
          This method save the parameters in the actuator memory.
 void setMaxiAcceleration(int acceleration)
           
 void setMaxiVelocity(int velocity)
           
 void setMode(String modeInString)
           
 void setMotor(Motor motor)
           
 void setNodeID(String nodeID)
           
 void setSerialNB(String serialNB)
           
 void setVelocity()
           
 void stopCurrent()
          In current mode this methods set to zero the value of the current sent to the motor.
 void stopVelocity()
           
 void switchOn()
           
 String toString()
           
 void updateReadValue()
           
 void writeControlWord(String value)
          Write a value in hexa in the control world (index=6040, subindex=0,size=2)
 void writeCurrent(int aValue)
          In current mode this methods send a current to the motor.
 void writeMaxSpeed(int value)
           
protected  void writeMotorData(String subindex, String sizeInHexa, int value)
          This method writes the parameters for the motor on the actuator.
 void writeMotorParameters()
          Write the values of the motor fields in the actuator memory.
 void writeMotorType(int value)
          This command set the motor type on the actuator.
 void writePositionSensorType(int value)
           
 String writeSDO(String index, String subindex, String length, String newValue)
           
 
Methods inherited from class org.lsst.ccs.subsystems.fcs.ClampActuatorModule
getReadValue, getSentCurrentMaxValue, getSentCurrentMinValue, getSentValue, getStatusData, isOff, isOn, setSentCurrentMaxValue, setSentCurrentMinValue
 
Methods inherited from class org.lsst.ccs.framework.Module
change, checkHardware, dropConfigurationContext, getCheckedValueFromConfiguration, getContext, getModule, getName, getNObserverThreads, getObservables, getSubsystem, getTickMillis, init, listens, newConfigurationContext, notifyChange, notifyChangeWithoutPreliminaryChecks, processUpdate, publishData, publishData, publishData, publishData, register, register, sendToReply, sendToStatus, setBeanName, setContext, setName, setNObserverThreads, setObservables, setStateModularSubsystem, setStateModularSubsystem, setTickMillis, shutdownCommand, shutdownNow, start, startTicking, tick, update
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.lsst.ccs.subsystems.fcs.common.PieceOfHardware
getName
 

Field Detail

enabling

protected volatile boolean enabling
Constructor Detail

CanOpenClampActuatorModule

public CanOpenClampActuatorModule()

CanOpenClampActuatorModule

public CanOpenClampActuatorModule(String nodeID,
                                  int inputID,
                                  String serial,
                                  Motor motor)
Method Detail

getNodeID

public String getNodeID()
Specified by:
getNodeID in interface PieceOfHardware
Specified by:
getNodeID in class ClampActuatorModule
Returns:
the receivedNodeID

setNodeID

public void setNodeID(String nodeID)
Parameters:
receivedNodeID - the receivedNodeID to set

getSerialNB

public String getSerialNB()
Specified by:
getSerialNB in interface PieceOfHardware
Specified by:
getSerialNB in class ClampActuatorModule
Returns:
the serialNB

setSerialNB

public void setSerialNB(String serialNB)
Parameters:
serialNB - the serialNB to set

isConfigOK

public boolean isConfigOK()
Specified by:
isConfigOK in interface PieceOfHardware
Returns:
true If this piece of hardware is booted and its configuration on the hardware is the same than the one in the Configuration DB.

getMotor

public Motor getMotor()
Returns:
the motor

setMotor

public void setMotor(Motor motor)
Parameters:
motor - the motor to set

getMode

public String getMode()
Returns:
the mode as a String

setMode

public void setMode(String modeInString)
Parameters:
mode - the mode to set

updateReadValue

public void updateReadValue()
                     throws org.lsst.ccs.bus.BadCommandException,
                            SDORequestError
Throws:
org.lsst.ccs.bus.BadCommandException
SDORequestError

initialize

public void initialize()
Specified by:
initialize in interface PieceOfHardware

getMotor_continuousCurrentLimit

public int getMotor_continuousCurrentLimit()
Specified by:
getMotor_continuousCurrentLimit in class ClampActuatorModule

getMotor_maxSpeedInCurrentMode

public int getMotor_maxSpeedInCurrentMode()
Specified by:
getMotor_maxSpeedInCurrentMode in class ClampActuatorModule

getMotor_mode

public String getMotor_mode()
Specified by:
getMotor_mode in class ClampActuatorModule

getMotor_outputCurrentLimit

public int getMotor_outputCurrentLimit()
Specified by:
getMotor_outputCurrentLimit in class ClampActuatorModule

getMotor_polePairNumber

public int getMotor_polePairNumber()
Specified by:
getMotor_polePairNumber in class ClampActuatorModule

getMotor_thermalTimeConstantWinding

public int getMotor_thermalTimeConstantWinding()
Specified by:
getMotor_thermalTimeConstantWinding in class ClampActuatorModule

getMotor_type

public int getMotor_type()
Specified by:
getMotor_type in class ClampActuatorModule

getPositionSensorType

public int getPositionSensorType()
Specified by:
getPositionSensorType in class ClampActuatorModule

initModule

public void initModule()
Overrides:
initModule in class org.lsst.ccs.framework.Module

isEnable

public boolean isEnable()
                 throws SDORequestError
Throws:
SDORequestError

resetFault

public void resetFault()
                throws SDORequestError
Throws:
SDORequestError

enable

public String enable()
              throws SDORequestError
This methods enable the actuator : i.e. this makes the actuator able to receive commands.

Returns:
Throws:
SDORequestError

disable

public String disable()
               throws SDORequestError
Throws:
SDORequestError

switchOn

public void switchOn()
              throws SDORequestError
Throws:
SDORequestError

saveParameters

public Object saveParameters()
                      throws SDORequestError
This method save the parameters in the actuator memory.

Returns:
Throws:
SDORequestError

restoreParameters

public Object restoreParameters()
                         throws SDORequestError
Throws:
SDORequestError

writeControlWord

public void writeControlWord(String value)
                      throws SDORequestError
Write a value in hexa in the control world (index=6040, subindex=0,size=2)

Parameters:
value - in hexa
Throws:
SDORequestError

readControlWord

public String readControlWord()
                       throws SDORequestError
Read the control world (index=6040, subindex=0,size=2)

Returns:
value in hexa
Throws:
SDORequestError

readStatusword

public String readStatusword()
                      throws SDORequestError
Read the status world (index=6041, subindex=0,size=2)

Returns:
value in hexa
Throws:
SDORequestError

quickStop

public void quickStop()
               throws SDORequestError
Throws:
SDORequestError

on

public String on()
          throws org.lsst.ccs.bus.BadCommandException,
                 org.lsst.ccs.bus.ErrorInCommandExecutionException
This methods enables the actuator and puts the motor on in sending the appropriate current value to the actuator.

Specified by:
on in interface Actuator
Specified by:
on in class ClampActuatorModule
Returns:
a message
Throws:
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException

maintainCurrent

public String maintainCurrent()
                       throws org.lsst.ccs.bus.BadCommandException,
                              org.lsst.ccs.bus.ErrorInCommandExecutionException
Specified by:
maintainCurrent in class ClampActuatorModule
Throws:
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException

off

public String off()
           throws org.lsst.ccs.bus.BadCommandException,
                  org.lsst.ccs.bus.ErrorInCommandExecutionException
This method set to zero the current value and stops the motor motion. Then it disables the actuator.

Specified by:
off in interface Actuator
Specified by:
off in class ClampActuatorModule
Returns:
Throws:
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException

readErrorRegister

public String readErrorRegister()
                         throws SDORequestError
At index 1001 there deviceErrorFile an error register for the device. The device maps internal errors in this byte.

Returns:
error code in Hexa
Throws:
SDORequestError

displayErrorRegister

public String displayErrorRegister()
                            throws SDORequestError
Throws:
SDORequestError

readErrorHistory

public String[] readErrorHistory()
                          throws SDORequestError
The error history holds errors that have occurred on the device and have been signalled via the emergency object. This methods reads the Maxon Motor Error History and returns an array of error code.

Returns:
errors : a list of device error code
Throws:
SDORequestError

displayErrorHistory

public String displayErrorHistory()
                           throws SDORequestError
Throws:
SDORequestError

readNumberOfErrors

public int readNumberOfErrors()
                       throws SDORequestError
Extract from the Maxon Motor firmware specification : Contains the number of actual errors that are recorded in the array starting at subindex 1. Writing a “0” deletes the error history (empties the array). Values higher then “0” (zero) are not allowed to write." Read and returns the number of errors registred in the Error History

Throws:
SDORequestError

writeMotorParameters

public void writeMotorParameters()
                          throws SDORequestError
Write the values of the motor fields in the actuator memory.

Throws:
SDORequestError

writeMotorType

public void writeMotorType(int value)
                    throws SDORequestError
This command set the motor type on the actuator.

Throws:
SDORequestError

readMotorType

public int readMotorType()
                  throws SDORequestError
This command read the motor type on the actuator.

Returns:
the motor type in decimal
Throws:
SDORequestError

readPositionSensorType

public int readPositionSensorType()
                           throws SDORequestError
This command read the position sensor type on the actuator.

Returns:
the position sensor type in decimal
Throws:
SDORequestError

writePositionSensorType

public void writePositionSensorType(int value)
                             throws SDORequestError
Throws:
SDORequestError

writeMaxSpeed

public void writeMaxSpeed(int value)
                   throws SDORequestError
Throws:
SDORequestError

writeMotorData

protected void writeMotorData(String subindex,
                              String sizeInHexa,
                              int value)
                       throws SDORequestError
This method writes the parameters for the motor on the actuator. The parameters for the motor data are stored in the index 6410.

Parameters:
subindex -
sizeInHexa - size of the parameter in Can Open
value - FORMAT=int the value of the parameter in decimal format
Throws:
SDORequestError

readMotorData

public int readMotorData(String subindex)
                  throws SDORequestError
This methods reads the parameters of the motor stored in the actuator. (index 6410)

Parameters:
subindex -
Returns:
value FORMAT=int the value of the parameter in decimal format
Throws:
SDORequestError

checkMotorParameters

public boolean checkMotorParameters()
                             throws MismatchMotorConfigurationException,
                                    SDORequestError
This methods read the parameters of the motor stored in the actuator (hardware configuration)and compare with the configuration stored in the Configuration Data Base (software configuration).

Returns:
true if the hardware and software configuration are the same, false otherwise.
Throws:
MismatchMotorConfigurationError
MismatchMotorConfigurationException
SDORequestError

displayMotorParameters

public String displayMotorParameters()
                              throws SDORequestError
Throws:
SDORequestError

writeCurrent

public void writeCurrent(int aValue)
                  throws org.lsst.ccs.bus.BadCommandException,
                         SDORequestError
In current mode this methods send a current to the motor. This make run the motor.

Parameters:
aValue - UNIT=mA / FORMAT=decimal the value of the current to be sent.
Throws:
org.lsst.ccs.bus.BadCommandException
SDORequestError

readCurrent

public int readCurrent()
                throws org.lsst.ccs.bus.BadCommandException,
                       SDORequestError
In Current Mode this methods returns the current actualy received by the motor.

Returns:
the current UNIT=mA / FORMAT=decimal
Throws:
org.lsst.ccs.bus.BadCommandException
SDORequestError

stopCurrent

public void stopCurrent()
                 throws org.lsst.ccs.bus.BadCommandException,
                        SDORequestError
In current mode this methods set to zero the value of the current sent to the motor. This stops the motor.

Throws:
org.lsst.ccs.bus.BadCommandException
SDORequestError

setMaxiVelocity

public void setMaxiVelocity(int velocity)

setMaxiAcceleration

public void setMaxiAcceleration(int acceleration)

setVelocity

public void setVelocity()
                 throws org.lsst.ccs.bus.BadCommandException
Throws:
org.lsst.ccs.bus.BadCommandException

readVelocity

public int readVelocity()
                 throws org.lsst.ccs.bus.BadCommandException
Throws:
org.lsst.ccs.bus.BadCommandException

stopVelocity

public void stopVelocity()
                  throws org.lsst.ccs.bus.BadCommandException
Throws:
org.lsst.ccs.bus.BadCommandException

writeSDO

public String writeSDO(String index,
                       String subindex,
                       String length,
                       String newValue)
                throws SDORequestError
Throws:
SDORequestError

readSDO

public String readSDO(String index,
                      String subindex)
               throws SDORequestError
Throws:
SDORequestError

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012 LSST. All Rights Reserved.