public final class BladeSetDrvr extends Object implements BladeSet
Definitely NOT thread-safe because any method might manipulate the hardware. Use should be confined to a single thread, or at least one at a time.
| Modifier and Type | Class and Description |
|---|---|
static class |
BladeSetDrvr.Hall
Inner class to hold a set of raw Hall sensor data
|
static class |
BladeSetDrvr.HallItem
Inner class to hold an item of raw Hall sensor data
|
static class |
BladeSetDrvr.SampData
Inner class to hold a set of Sample instances along with some
general info about the move.
|
static class |
BladeSetDrvr.Sample
Inner class to hold an item of sampled data from the motor controller.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
HOM_OPT_NDIRN
Start looking for home by going in the negative direction (decreasing absolute position).
|
static int |
HOM_OPT_PFINAL
Make the final approach to home from the positive side (higher absolute position).
|
static int |
MOV_TYP_SCURVE
Use an S-surve motion profile.
|
static int |
MOV_TYP_TRAP
Use a trapezoidal motion profile.
|
static double |
TORQUE_LIM
The limit on the motor torque expressed as amps supplied by the motor driver.
|
| Constructor and Description |
|---|
BladeSetDrvr(int index)
Finds the default configuration for the blade set and creates the hardware drivers.
|
| Modifier and Type | Method and Description |
|---|---|
BladeSetCalibration |
calibNew(double dist,
double time)
Calibrates the Hall switch positions using continuous slow motion.
|
BladeSetCalibration |
calibrate(double dist,
double step,
double time)
Calibrates the Hall switch positions using a series of small movements.
|
void |
disableDrive()
Turns off the motor drive current if the "drive always on" flag is false.
|
void |
enableDrive()
Turns on the motor drive current if the "drive always on" flag is false.
|
org.lsst.ccs.drivers.iocard.AccesDio |
getAcces()
Gets the AccesDio object being used.
|
double |
getAmbientTemperature()
Gets the ambient temperature around the HCU.
|
BladeSetConfiguration |
getBladeSetConfiguration() |
org.lsst.ccs.drivers.parker.AcrComm |
getComm()
Gets the motor communications object being used.
|
BladeSetConfiguration |
getConfig()
Gets the configuration object being used.
|
double |
getCurrentPosition() |
double |
getDriveTemperature()
Gets the drive temperature.
|
org.lsst.ccs.drivers.iocard.Helios |
getHelios()
Gets the Helios object being used.
|
int |
getIndex() |
double |
getPosition()
Gets the current absolute position in mm.
|
int |
home(int optns,
double vel)
Finds the home position for this blade set.
|
void |
init()
Completes the initialization of the hardware drivers created by the constructor.
|
int |
move(int type,
double dist,
double time,
double mvFract)
Performs a simple move without enabling Hall transition interrupts
or motor controller parameter sampling.
|
BladeSetDrvr.SampData |
moveD(int type,
double dist,
double time,
double mvFract,
int nSamp,
int[] iParms,
int[] fParms)
Performs a move accompanied by parameter sampling in the motor controller.
|
MovementHistory |
moveH(int type,
double dist,
double time,
double mvFract,
int nSamp)
Performs a move using the standard motion program, recording Hall switch transitions and taking
periodic data samples in the motor controller.
|
MovementHistory |
moveP(int type,
double dist,
double time,
double mvFract,
int nSamp)
Works just like moveH() except that no Hall transitions are collected.
|
int |
moveStatus()
Gets the status of the last move from the motor controller: normal
or premature stop reason.
|
MovementHistory |
moveToPosition(double relPosition,
double time)
Moves the blade set to a given relative (i.e.
|
void |
setDriveOff()
Turns the motor drive current off and set the "drive always on" flag false.
|
void |
setDriveOn()
Turns the motor drive current on and set the "drive always on" flag true.
|
public static final int MOV_TYP_SCURVE
public static final int MOV_TYP_TRAP
public static final int HOM_OPT_NDIRN
public static final int HOM_OPT_PFINAL
public static final double TORQUE_LIM
public BladeSetDrvr(int index)
index - the index, 0 or 1, for the blade set.public void init()
public MovementHistory moveToPosition(double relPosition, double time)
moveToPosition in interface BladeSetrelPosition - the target relative positiontime - the duration of the motion in secondspublic double getCurrentPosition()
getCurrentPosition in interface BladeSetpublic BladeSetConfiguration getBladeSetConfiguration()
getBladeSetConfiguration in interface BladeSetpublic double getPosition()
public void setDriveOn()
public void setDriveOff()
public void enableDrive()
public void disableDrive()
public BladeSetCalibration calibrate(double dist, double step, double time)
Does a series of small movement steps for each leg and reads the Hall sensors after each one. This can take a reasonably long time if the step size is small enough to be useful. The blade set is moved away from home for the first leg and toward home for the second, regardless of the signs of dist and step.
dist - the total blade set travel distance for each leg in mm (sign ignored)step - the blade set step in mm (sign ignored)time - the duration of each step in secondspublic BladeSetCalibration calibNew(double dist, double time)
Captures Hall sensor transitions while moving the blade set continuously, thereby mimicking what happens during normal shutter use. Dynamic effects are eliminated by specifying a sufficiently long period for the calibration. The blade set is moved away from home for the first leg and toward home for the second.
dist - the total blade set travel distance in mm (sign ignored)time - the duration of each leg in secondspublic int move(int type,
double dist,
double time,
double mvFract)
type - the move type, MOV_TYP_SCURVE or MOV_TYP_TRAPdist - the signed distance to move (change of absolute position in mm)time - the duration of the move in secondsmvFract - modifies a trapezoidal velocity profile. A value of 0.0
results in a standard profile whereas 1.0 results in a profile
with discontinuous changes between intervals of constant velocity. Put
another way, increasing the value steepens the sides of the
velocity trapezoids and broadens the tops. Limited to [0.0, 0.9].
Always use 0.0 for S-curve profiles.MovementStatus)public BladeSetDrvr.SampData moveD(int type, double dist, double time, double mvFract, int nSamp, int[] iParms, int[] fParms)
type - see move(int, double, double, double)dist - see move(int, double, double, double)time - see move(int, double, double, double)mvFract - see move(int, double, double, double)nSamp - the number of times to perform samplingiParms - the ID numbers of the integer parameters to record at each samplingfParms - the ID numbers of the float parameters to record at each samplingpublic MovementHistory moveH(int type, double dist, double time, double mvFract, int nSamp)
type - see move(int, double, double, double)dist - see move(int, double, double, double)time - see move(int, double, double, double)mvFract - see move(int, double, double, double)nSamp - the number of times to perform samplingpublic MovementHistory moveP(int type, double dist, double time, double mvFract, int nSamp)
moveH(int, double, double, double, int)public int home(int optns,
double vel)
Hitting a motion limit the first time causes motion to reverse. Hitting one a second time stops motion and causes the homing operation to fail.
optns - a bit mask of options. The logical OR of zero or more of:
vel - the velocity at which to begin the home search, mm/secpublic BladeSetConfiguration getConfig()
public org.lsst.ccs.drivers.iocard.AccesDio getAcces()
public org.lsst.ccs.drivers.iocard.Helios getHelios()
public org.lsst.ccs.drivers.parker.AcrComm getComm()
public int moveStatus()
MovementStatuspublic double getDriveTemperature()
public double getAmbientTemperature()
Copyright © 2016 LSST. All rights reserved.