orthotweezers
Class OrthoTweezersTools

java.lang.Object
  |
  +--orthotweezers.OrthoTweezersTools

public class OrthoTweezersTools
extends java.lang.Object

OrthoTweezersTools is a utility class for doing more sophisticated operations than are provided by the basic OrthoTweezersControl class. Logically, high level manipulation routines don't belong in the basic OrthTweezersControl class which would just clutter it. Note that an OrthoTweezersTools object does not keep any local variables (except for the OrthoTweezersControl object passed to the constructor). It is just a bunch of utility methods. Therefore, any code can create an OrthoTweezersTools object from an OrthoTweezersControl whenever it needs the utility routines.

See Also:
OrthoTweezersControl

Field Summary
static double SWEEP_TO_CONTACT_INCREMENT
           
 
Constructor Summary
OrthoTweezersTools(OrthoTweezersControl control)
          Creates new OrthoTweezersTools which uses the given control object.
 
Method Summary
 OrthoTweezersControl control()
          Returns the OrthoTweezersControl object which was passed to the constructor.
 void getStageXYZ(javax.vecmath.Point3d point)
          Set the point to the coordinates of the stage.
 java.lang.String grasp(double cornerOffset, double gripForce)
          Grasp a rectangular object.
 void heaterOff(int heaterNumber)
          Turn off the heater specified by heaterNumber.
 void heaterOn(int heaterNumber)
          Turn on the heater specified by heaterNumber.
 boolean heaterState(int heaterNumber)
          Return the state of the heater specified by heaterNumber.
 void moveDeltaXY(double deltaX, double deltaY)
          Move the stage in X and Y directions relative to the current position.
 void moveDeltaZ(double deltaZ)
          Move the stage in the Z direction relative to the current position.
 void moveProbeDeltaX(double deltaPosition)
          Move the X probe relative to the current position.
 void moveProbeDeltaY(double deltaPosition)
          Move the Y probe relative to the current position.
 boolean moveProbeXToContact(boolean increasing)
          Move probe X until the tip strain gauge detects a contact force, then back off a little until the force drops near zero.
 boolean moveProbeXToContactBounded(boolean increasing, double minDeflection, double maxDeflection)
          Move probe X, bounded by the given range, until the tip strain gauge detects a contact force, then back off a little until the force drops near zero.
 boolean moveProbeYToContact(boolean increasing)
          Close probe Y until the tip strain gauge detects a contact force, then back off a little until the force drops near zero.
 boolean moveProbeYToContactBounded(boolean increasing, double minDeflection, double maxDeflection)
          Move probe Y, bounded by the given range, until the tip strain gauge detects a contact force, then back off a little until the force drops near zero.
 boolean moveStageXToContact(boolean increasing, double limit)
          Move the stage in the X direction until the probe X tip strain gauge detects a contact force, then back off a little until the force drops near zero.
 boolean moveStageYToContact(boolean increasing, double limit)
          Move the stage in the Y direction until the probe Y tip strain gauge detects a contact force, then back off a little until the force drops near zero.
 void moveToPoint(javax.vecmath.Point3d point)
          This just calls moveToXYZ(x,y,z) with the coordinates of the point.
 void moveToXYZ(double x, double y, double z)
          Move the stage to the XYZ coordinates.
 void resetTipStrains()
          This resets the strain offsets for probe X and probe Y tips so that the strain will now read zero.
 void seekXArmDeflection(double deflection)
          Move probe X until its arm deflection is the given value.
 void seekXArmDeltaDeflection(double deltaDeflection)
          Seek the X probe arm deflection relative to the current deflection.
 boolean seekXTipForce(double force)
          This is a simplified version of seekXTipForceBounded which allows the probe to seek for the entire probe range.
 boolean seekXTipForceBounded(double force, double minDeflection, double maxDeflection)
          Move probe X, bounded to the given range, until its tip force is the given value.
 void seekXYArmDeflection(double xDeflection, double yDeflection)
          This uses seekXArmDeflection and seekYArmDeflection to seek to the given X and Y deflections.
 void seekYArmDeflection(double deflection)
          Move probe Y until its arm deflection is the given value.
 void seekYArmDeltaDeflection(double deltaDeflection)
          Seek the Y probe arm deflection relative to the current deflection.
 boolean seekYTipForce(double force)
          This is a simplified version of seekYTipForceBounded which allows the probe to seek for the entire probe range.
 boolean seekYTipForceBounded(double force, double minDeflection, double maxDeflection)
          Move probe Y, bounded to the given range, until its tip force is the given value.
 void seekZAxisAngle(double angle, double gripForce)
          Try to rotate a block about the Z axis to the given angle.
 boolean seekZSurface(double limit)
          Move the stage in the negative Z direction, making tiny sweeps with probe X, until the probe X tip strain gauge detects a contact force when it is moved, Then increase Z until no force is detected.
 javax.vecmath.Point3d stagePoint()
          Return a new Point3d containing the stage X,Y,Z position in millimeters.
 boolean sweepProbeXToContact(boolean increasing, double maxDeltaY)
          This calls moveProbeXToContact repeatedly, moving SWEEP_TO_CONTACT_INCREMENT millimeters in the Y direction until contact, or until the maxDeltaY has been reached.
 boolean sweepProbeYToContact(boolean increasing, double maxDeltaX)
          This calls moveProbeYToContact repeatedly, moving SWEEP_TO_CONTACT_INCREMENT millimeters in the X direction until contact, or until the maxDeltaX has been reached.
 void ungrasp()
          Ungrasp an object by releasing both probes to zero force, moving down in Z slightly, opening the probes slightly, and restoring the Z position.
 double zAxisAngle()
          Return the angle in radians of the grip axis as it would rotate around the Z axis.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SWEEP_TO_CONTACT_INCREMENT

public static final double SWEEP_TO_CONTACT_INCREMENT
Constructor Detail

OrthoTweezersTools

public OrthoTweezersTools(OrthoTweezersControl control)
Creates new OrthoTweezersTools which uses the given control object.
Parameters:
control - The OrthoTweezersControl object which the methods will use.
Method Detail

control

public OrthoTweezersControl control()
Returns the OrthoTweezersControl object which was passed to the constructor.

getStageXYZ

public void getStageXYZ(javax.vecmath.Point3d point)
Set the point to the coordinates of the stage. To return a new Point3d object with the coordinates, use stagePoint().
Parameters:
point - the object which will receive the stage coordiates, in millimeters
See Also:
stagePoint(), OrthoTweezersControl.stageX()

stagePoint

public javax.vecmath.Point3d stagePoint()
Return a new Point3d containing the stage X,Y,Z position in millimeters. To set an existing Point3d object, use getStageXYZ(point).
See Also:
getStageXYZ(javax.vecmath.Point3d)

moveDeltaXY

public void moveDeltaXY(double deltaX,
                        double deltaY)
                 throws CancelException
Move the stage in X and Y directions relative to the current position. This method is identical to control().moveToXY(control().stageX() + deltaX, control().stageY() + deltaY). This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
deltaX - the X distance to move, in millimeters
deltaY - the Y distance to move, in millimeters
Throws:
CancelException - thrown by CancelThread.check()
See Also:
OrthoTweezersControl.moveToXY(double, double), CancelThread

moveDeltaZ

public void moveDeltaZ(double deltaZ)
                throws CancelException
Move the stage in the Z direction relative to the current position. This method is identical to control().moveToZ(control().stageZ() + deltaZ). This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
deltaZ - the Z distance to move, in millimeters
Throws:
CancelException - thrown by CancelThread.check()
See Also:
OrthoTweezersControl.moveToZ(double), CancelThread

moveToXYZ

public void moveToXYZ(double x,
                      double y,
                      double z)
               throws CancelException
Move the stage to the XYZ coordinates. If the Z coordinate to move to is higher than the presens Z value, this moves to the Z coordinate first, otherwise this moves to the XY coordinates first, then to the Z coordinate. This is to make sure the XY motion happens at the highest Z value to avoid crashing into objects on the surface. This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
x - x coordinate to move to, in millimeters
y - y coordinate to move to, in millimeters
z - z coordinate to move to, in millimeters
Throws:
CancelException - thrown by CancelThread.check()
See Also:
OrthoTweezersControl.moveToXY(double, double), OrthoTweezersControl.moveToZ(double), CancelThread

moveToPoint

public void moveToPoint(javax.vecmath.Point3d point)
                 throws CancelException
This just calls moveToXYZ(x,y,z) with the coordinates of the point. This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
point - the point containing the coordinates to move to, in millimeters
Throws:
CancelException - thrown by CancelThread.check()
See Also:
moveToXYZ(double, double, double), CancelThread

moveProbeDeltaX

public void moveProbeDeltaX(double deltaPosition)
                     throws CancelException
Move the X probe relative to the current position. This method is identical to control().moveProbeX(control().probeXPosition() + deltaPosition). This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
deltaPosition - the distance to move the probe X position, in the same normalized units from -1 to 1 that moveProbeX uses
Throws:
CancelException - thrown by CancelThread.check()
See Also:
OrthoTweezersControl.moveProbeX(double), CancelThread

moveProbeDeltaY

public void moveProbeDeltaY(double deltaPosition)
                     throws CancelException
Move the Y probe relative to the current position. This method is identical to control().moveProbeY(control().probeYPosition() + deltaPosition). This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
deltaPosition - the distance to move the probe Y position, in the same normalized units from -1 to 1 that moveProbeY uses
Throws:
CancelException - thrown by CancelThread.check()
See Also:
OrthoTweezersControl.moveProbeY(double), CancelThread

seekXArmDeflection

public void seekXArmDeflection(double deflection)
                        throws CancelException
Move probe X until its arm deflection is the given value. This uses feedback from the arm (but not tip) strain gauge. To move the probe directly without any feedback, use moveProbeX. This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
deflection - the deflection to seek to in millimeters
Throws:
CancelException - thrown by CancelThread.check() or if got an InterruptedException.
See Also:
CancelThread, OrthoTweezersControl.moveProbeX(double)

seekYArmDeflection

public void seekYArmDeflection(double deflection)
                        throws CancelException
Move probe Y until its arm deflection is the given value. This uses feedback from the arm (but not tip) strain gauge. To move the probe directly without any feedback, use moveProbeY. This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
deflection - the deflection to seek to in millimeters
Throws:
CancelException - thrown by CancelThread.check() or if got an InterruptedException.
See Also:
CancelThread, OrthoTweezersControl.moveProbeY(double)

seekXYArmDeflection

public void seekXYArmDeflection(double xDeflection,
                                double yDeflection)
                         throws CancelException
This uses seekXArmDeflection and seekYArmDeflection to seek to the given X and Y deflections. If the Y arm deflection is increasing, this moves the Y arm to its deflection first, otherwise, this moves the X arm first. This is to prevent the case where probe X is decreasing while probe Y is increasing, but probe X is moved first and could crash into probe Y. This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
xDeflection - the deflection to seek for the X arm in millimeters
yDeflection - the deflection to seek for the Y arm in millimeters
Throws:
CancelException - thrown by CancelThread.check()
See Also:
CancelThread, seekXArmDeflection(double), seekYArmDeflection(double)

resetTipStrains

public void resetTipStrains()
This resets the strain offsets for probe X and probe Y tips so that the strain will now read zero. This just calls control().resetXTipStrain() and control().resetYTipStrain(). Because the strain gauge readings drift over time, you should call this whenever you are sure that the tips are not touching anything.

seekXArmDeltaDeflection

public void seekXArmDeltaDeflection(double deltaDeflection)
                             throws CancelException
Seek the X probe arm deflection relative to the current deflection. This method is identical to seekXArmDeflection(control().xArmDeflection() + deltaDeflection). This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
deltaDeflection - the distance to deflect the probe X arm in millimeters relative to the current deflection.
Throws:
CancelException - thrown by CancelThread.check()
See Also:
seekXArmDeflection(double), CancelThread

seekYArmDeltaDeflection

public void seekYArmDeltaDeflection(double deltaDeflection)
                             throws CancelException
Seek the Y probe arm deflection relative to the current deflection. This method is identical to seekYArmDeflection(control().yArmDeflection() + deltaDeflection). This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
deltaDeflection - the distance to deflect the probe Y arm in millimeters relative to the current deflection.
Throws:
CancelException - thrown by CancelThread.check()
See Also:
seekYArmDeflection(double), CancelThread

moveProbeXToContact

public boolean moveProbeXToContact(boolean increasing)
                            throws CancelException
Move probe X until the tip strain gauge detects a contact force, then back off a little until the force drops near zero. If increasing is true then the probe position increases, otherwise decreases. To do a similar operation by moving the stage instead of the probe, use moveStageXToContact. This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
increasing - true to increase the probe position to contact, false to decrease
Returns:
true for success, false if couldn't find contact. Note that this may return false if the probe is already contacting something, but in the opposite direction as indicated by increasing.
Throws:
CancelException - thrown by CancelThread.check()
See Also:
CancelThread, moveStageXToContact(boolean, double), moveProbeXToContactBounded(boolean, double, double)

moveProbeXToContactBounded

public boolean moveProbeXToContactBounded(boolean increasing,
                                          double minDeflection,
                                          double maxDeflection)
                                   throws CancelException
Move probe X, bounded by the given range, until the tip strain gauge detects a contact force, then back off a little until the force drops near zero. If increasing is true then the probe position increases, otherwise decreases. To do a similar operation by moving the stage instead of the probe, use moveStageXToContact. This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
increasing - true to increase the probe position to contact, false to decrease
minDeflection - minimum probe X deflection (in millimeters) allowed when seeking the contact. This also stops if control.probeXPosition() reaches the absolute limit of -1. If minDeflection >= maxDeflection, this simply returns false.
maxDeflection - maximum probe X deflection (in millimeters) allowed when seeking the contact. This also stops if control.probeXPosition() reaches the absolute limit of +1. If maxDeflection <= minDeflection, this simply returns false.
Returns:
true for success, false if couldn't find contact. Note that this may return false if the probe is already contacting something, but in the opposite direction as indicated by increasing.
Throws:
CancelException - thrown by CancelThread.check()
See Also:
CancelThread, moveStageXToContact(boolean, double), moveProbeXToContact(boolean)

moveProbeYToContact

public boolean moveProbeYToContact(boolean increasing)
                            throws CancelException
Close probe Y until the tip strain gauge detects a contact force, then back off a little until the force drops near zero. If increasing is true then the probe position increases, otherwise decreases. To do a similar operation by moving the stage instead of the probe, use moveStageYToContact. This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
increasing - true to increase the probe position to contact, false to decrease
Returns:
true for success, false if couldn't find contact. Note that this may return false if the probe is already contacting something, but in the opposite direction as indicated by increasing.
Throws:
CancelException - thrown by CancelThread.check()
See Also:
CancelThread, moveStageYToContact(boolean, double), moveProbeYToContactBounded(boolean, double, double)

moveProbeYToContactBounded

public boolean moveProbeYToContactBounded(boolean increasing,
                                          double minDeflection,
                                          double maxDeflection)
                                   throws CancelException
Move probe Y, bounded by the given range, until the tip strain gauge detects a contact force, then back off a little until the force drops near zero. If increasing is true then the probe position increases, otherwise decreases. To do a similar operation by moving the stage instead of the probe, use moveStageXToContact. This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
increasing - true to increase the probe position to contact, false to decrease
minDeflection - minimum probe Y deflection (in millimeters) allowed when seeking the contact. This also stops if control.probeYPosition() reaches the absolute limit of -1. If minDeflection >= maxDeflection, this simply returns false.
maxDeflection - maximum probe Y deflection (in millimeters) allowed when seeking the contact. This also stops if control.probeYPosition() reaches the absolute limit of +1. If maxDeflection <= minDeflection, this simply returns false.
Returns:
true for success, false if couldn't find contact. Note that this may return false if the probe is already contacting something, but in the opposite direction as indicated by increasing.
Throws:
CancelException - thrown by CancelThread.check()
See Also:
CancelThread, moveStageXToContact(boolean, double), moveProbeXToContact(boolean)

sweepProbeXToContact

public boolean sweepProbeXToContact(boolean increasing,
                                    double maxDeltaY)
                             throws CancelException
This calls moveProbeXToContact repeatedly, moving SWEEP_TO_CONTACT_INCREMENT millimeters in the Y direction until contact, or until the maxDeltaY has been reached. In this way, it will sweep the X probe until it contacts an object, in which case this returns true. NOTE: This assumes that the probe Y position is greater than zero such that the moving of probe X will not contact it. Upon success, you can determine the position of the contacted object as stageX() + xArmDeflection(). This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
increasing - true to increase the probe position to contact, false to decrease. If increasing is true, this initially moves probe X position to -1, otherwise it initially moves probe X position to +1. This assumes the path is clear to move the probe to the initial position. Also, once the probe is move to the initial position, this calls control().resetXTipStrain() to recalibrate the zero offset of the probe so that it is sensitive.
maxDeltaY - the maximun distance to travel in increments of SWEEP_TO_CONTACT_INCREMENT while trying to get moveProbeXToContact to return true. The maxDeltaY is positive since we only sweep while moving in the positive Y direction.
Returns:
true for success, false if couldn't find contact.
Throws:
CancelException - thrown by CancelThread.check()
See Also:
CancelThread, moveProbeXToContact(boolean)

sweepProbeYToContact

public boolean sweepProbeYToContact(boolean increasing,
                                    double maxDeltaX)
                             throws CancelException
This calls moveProbeYToContact repeatedly, moving SWEEP_TO_CONTACT_INCREMENT millimeters in the X direction until contact, or until the maxDeltaX has been reached. In this way, it will sweep the Y probe until it contacts an object, in which case this returns true. NOTE: This assumes that the probe X position is greater than zero such that the moving of probe Y will not contact it. Upon success, you can determine the position of the contacted object as stageY() + yArmDeflection(). This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
increasing - true to increase the probe position to contact, false to decrease. If increasing is true, this initially moves probe Y position to -1, otherwise it initially moves probe Y position to +1. This assumes the path is clear to move the probe to the initial position. Also, once the probe is move to the initial position, this calls control().resetYTipStrain() to recalibrate the zero offset of the probe so that it is sensitive.
maxDeltaY - the maximun distance to travel in increments of SWEEP_TO_CONTACT_INCREMENT while trying to get moveProbeYToContact to return true. The maxDeltaX is positive since we only sweep while moving in the positive X direction.
Returns:
true for success, false if couldn't find contact.
Throws:
CancelException - thrown by CancelThread.check()
See Also:
CancelThread, moveProbeYToContact(boolean)

moveStageXToContact

public boolean moveStageXToContact(boolean increasing,
                                   double limit)
                            throws CancelException
Move the stage in the X direction until the probe X tip strain gauge detects a contact force, then back off a little until the force drops near zero. If increasing is true then the position increases (as defined by moveToXY), otherwise decreases. If the stage moves the limit distance without contact, then return false. To do a similar operation by moving the probe instead of the stage, use moveProbeXToContact. This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
increasing - true to increase the X position until contact, false to decrease
limit - the maximum distance in millimeters to move while checking for contact. This should be a positive number (even if the stage will move in the negative direction). If it is a negative number, this takes its absolute value.
Returns:
true for success, false if couldn't find contact before the limit distance was reached
Throws:
CancelException - thrown by CancelThread.check()
See Also:
CancelThread, moveProbeXToContact(boolean)

moveStageYToContact

public boolean moveStageYToContact(boolean increasing,
                                   double limit)
                            throws CancelException
Move the stage in the Y direction until the probe Y tip strain gauge detects a contact force, then back off a little until the force drops near zero. If increasing is true then the position increases (as defined by moveToXY), otherwise decreases. If the stage moves the limit distance without contact, then return false. To do a similar operation by moving the probe instead of the stage, use moveProbeYToContact. This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
increasing - true to increase the X position until contact, false to decrease
limit - the maximum distance in millimeters to move while checking for contact. This should be a positive number (even if the stage will move in the negative direction). If it is a negative number, this takes its absolute value.
Returns:
true for success, false if couldn't find contact before the limit distance was reached
Throws:
CancelException - thrown by CancelThread.check()
See Also:
CancelThread, moveProbeYToContact(boolean)

seekZSurface

public boolean seekZSurface(double limit)
                     throws CancelException
Move the stage in the negative Z direction, making tiny sweeps with probe X, until the probe X tip strain gauge detects a contact force when it is moved, Then increase Z until no force is detected. This can be used to find the Z coordinate of the surface. This assumes that initially probeX is not in contact with anything, especially probe Y. If the stage moves the limit distance without contact, then return false. This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
limit - the maximum distance in millimeters to move while checking for contact. This should be a positive number (even if the stage moves in the negative Z direction). If it is a negative number, this takes its absolute value.
Returns:
true for found the surface, false if couldn't find contact before the limit distance was reached, or if couldn't release the contact force after it was encountered.
Throws:
CancelException - thrown by CancelThread.check()
See Also:
CancelThread, moveProbeXToContact(boolean)

seekXTipForce

public boolean seekXTipForce(double force)
                      throws CancelException
This is a simplified version of seekXTipForceBounded which allows the probe to seek for the entire probe range.
See Also:
seekXTipForceBounded(double, double, double)

seekXTipForceBounded

public boolean seekXTipForceBounded(double force,
                                    double minDeflection,
                                    double maxDeflection)
                             throws CancelException
Move probe X, bounded to the given range, until its tip force is the given value. This seeks until the desired force, or until the probe deflection reaches minDeflection or maxDeflection, or until the probe position reaches the absolute limits of position -1 or 1. This uses feedback from the tip (but not arm) strain gauge. The direction in which the probe will move is derived from comparing the present force on the tip with the desired force. This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
force - the force to seek to in milli Newtons
minDeflection - minimum probe X deflection (in millimeters) allowed when seeking the desired force. This also stops if control.probeXPosition() reaches the absolute limit of -1. If minDeflection >= maxDeflection, this simply returns false.
maxDeflection - maximum probe X deflection (in millimeters) allowed when seeking the desired force. This also stops if control.probeXPosition() reaches the absolute limit of +1. If maxDeflection <= minDeflection, this simply returns false.
Returns:
true if achieved the requested force, false if not in which case the probe has either reached minDeflection or maxDeflection, or the absolute position limits of -1 or 1.
Throws:
CancelException - thrown by CancelThread.check() or if got an InterruptedException.
See Also:
OrthoTweezersControl.probeXPosition(), CancelThread

seekYTipForce

public boolean seekYTipForce(double force)
                      throws CancelException
This is a simplified version of seekYTipForceBounded which allows the probe to seek for the entire probe range.
See Also:
seekYTipForceBounded(double, double, double)

seekYTipForceBounded

public boolean seekYTipForceBounded(double force,
                                    double minDeflection,
                                    double maxDeflection)
                             throws CancelException
Move probe Y, bounded to the given range, until its tip force is the given value. This seeks until the desired force, or until the probe deflection reaches minDeflection or maxDeflection, or until the probe position reaches the absolute limits of position -1 or 1. This uses feedback from the tip (but not arm) strain gauge. The direction in which the probe will move is derived from comparing the present force on the tip with the desired force. This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
force - the force to seek to in milli Newtons
minDeflection - minimum probe Y deflection (in millimeters) allowed when seeking the desired force. This also stops if control.probeYPosition() reaches the absolute limit of -1. If minDeflection >= maxDeflection, this simply returns false.
maxDeflection - maximum probe Y deflection (in millimeters) allowed when seeking the desired force. This also stops if control.probeYPosition() reaches the absolute limit of +1. If maxDeflection <= minDeflection, this simply returns false.
Returns:
true if achieved the requested force, false if not in which case the probe has either reached minDeflection or maxDeflection, or the absolute position limits of -1 or 1.
Throws:
CancelException - thrown by CancelThread.check() or if got an InterruptedException.
See Also:
OrthoTweezersControl.probeYPosition(), CancelThread

grasp

public java.lang.String grasp(double cornerOffset,
                              double gripForce)
                       throws CancelException
Grasp a rectangular object. The object to grasp must be in the path of both probe X and probe Y as they would close inward. To achieve this, you may want to use sweepProbeXToContact and sweepProbeYToContact. This assumes that the path is free for both probe arms to defelect fully outward. After deflecting both arms fully outward, this calls control().resetXTipStrain() and control().resetYTipStrain() to recalibrate the zero offset of the probes so that they are sensitive. This sweeps at the present Z height in the decreasing X and Y directions along the edges of the rectangular object until finding the lower and left corners of the object, which is assumed to be at angle (rather than aligned to the X-Y axes). Once the corners are found, this computes the grip points which are a distance of cornerOffset along the edges from the corner. Then this grips with the given gripForce. This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
cornerOffset - the distance along the edge from the corners to graps, in millimeters. If this is less than 0.01, this sets it to 0.01.
gripForce - the force with which to grip, in milli Newtons
Returns:
null for success, otherwise an error String describing the problem.
Throws:
CancelException - thrown by CancelThread.check() or if got an InterruptedException.
See Also:
CancelThread, sweepProbeXToContact(boolean, double), sweepProbeYToContact(boolean, double)

zAxisAngle

public double zAxisAngle()
Return the angle in radians of the grip axis as it would rotate around the Z axis. The grip axis is a line between the tips of the two probes, where the position of the tip is found by adding the probe arm and tip deflections. An angle of zero is when probe X is at zero deflection and probe Y is at some positive deflection. An angle of PI/2 is when probe X is at some positive deflection and probe Y is at zero deflection. In this way, a movement from angle zero to angle PI/2 corresponds to a part rotating in the positive direction around the Z axis.

seekZAxisAngle

public void seekZAxisAngle(double angle,
                           double gripForce)
                    throws CancelException
Try to rotate a block about the Z axis to the given angle. This assumes that both probes are in contact with a block which can be rotated freely. This calls CancelThread.check() to maybe throw a CancelException.
Parameters:
angle - the angle to rotate to in radians. This is measured by the relative positions of the probe tips. When probe X is at deflection zero and probe Y has a positive deflection, this angle is zero. The angle increases to PI/2 where probe Y has zero deflection and probe X has a positive deflection. If angle is less than zero or greater than PI/2, it is clipped to this range.
gripForce - the gripping force in milliNewtons to maintain while rotating
Throws:
CancelException - thrown by CancelThread.check()
See Also:
CancelThread

ungrasp

public void ungrasp()
             throws CancelException
Ungrasp an object by releasing both probes to zero force, moving down in Z slightly, opening the probes slightly, and restoring the Z position. If the zAxisAngle() of the part is near zero or PI/2, then on of the probes must be released by moving the stage (and the object with it) away from the probe. This calls CancelThread.check() to maybe throw a CancelException.
Throws:
CancelException - thrown by CancelThread.check()
See Also:
CancelThread, zAxisAngle()

heaterOn

public void heaterOn(int heaterNumber)
Turn on the heater specified by heaterNumber.
Parameters:
heaterNumber - - the number of the heater to turn on. At present there is only one heater on the system so this number must be 1. In the future there may be heater number 2, 3, etc. If heaterNumber is not 1, this does nothing.

heaterOff

public void heaterOff(int heaterNumber)
Turn off the heater specified by heaterNumber.
Parameters:
heaterNumber - - the number of the heater to turn off. At present there is only one heater on the system so this number must be 1. In the future there may be heater number 2, 3, etc. If heaterNumber is not 1, this does nothing.

heaterState

public boolean heaterState(int heaterNumber)
Return the state of the heater specified by heaterNumber.
Parameters:
heaterNumber - - the number of the heater to turn off. At present there is only one heater on the system so this number must be 1. In the future there may be heater number 2, 3, etc. If heaterNumber is not 1, this does nothing and returns false.
Returns:
true if the heater is on, otherwise false.