- Added a boa recount mode in hmcontrol. Soemtimes the CCD overruns
- Added a staticoffset to motorsec.c in order to allow the use of softzero for physics purposes. - When a triple axis motor fails to start, the whole shit needs to be stopped. This has now been implemented into tasdrive.c - There were crashes in adding NB reflections to a reflection list. This has been fixed.
This commit is contained in:
17
motorsec.c
17
motorsec.c
@@ -123,7 +123,7 @@ static long SecMotorRun(void *sulf, SConnection * pCon, float fNew)
|
||||
static int SecMotorCheckBoundary(pMotor self, float fVal, float *fTarget,
|
||||
char *pError, int iErrLen)
|
||||
{
|
||||
double fZero, fixed, lowerlim, upperlim, sign;
|
||||
double fZero, fixed, lowerlim, upperlim, sign, offset;
|
||||
float fHard, hupper, hlower;
|
||||
char pBueffel[512];
|
||||
hdbValue v;
|
||||
@@ -134,6 +134,8 @@ static int SecMotorCheckBoundary(pMotor self, float fVal, float *fTarget,
|
||||
fixed = v.v.doubleValue;
|
||||
assert(SICSHdbGetPar(self, NULL, "softzero", &v) == 1);
|
||||
fZero = v.v.doubleValue;
|
||||
assert(SICSHdbGetPar(self, NULL, "staticoffset", &v) == 1);
|
||||
offset = v.v.doubleValue;
|
||||
assert(SICSHdbGetPar(self, NULL, "softlowerlim", &v) == 1);
|
||||
lowerlim = v.v.doubleValue;
|
||||
assert(SICSHdbGetPar(self, NULL, "softupperlim", &v) == 1);
|
||||
@@ -165,6 +167,7 @@ static int SecMotorCheckBoundary(pMotor self, float fVal, float *fTarget,
|
||||
}
|
||||
|
||||
/* correct for zero point */
|
||||
fZero += offset;
|
||||
fZero = -fZero;
|
||||
fHard = fVal - fZero;
|
||||
|
||||
@@ -392,15 +395,16 @@ static void AddMotorPar(pHdb node, int priv, char *name)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static float hardToSoftPosition(pMotor self, float hard)
|
||||
{
|
||||
float sign, zero, fVal;
|
||||
float sign, zero, fVal, offset;
|
||||
|
||||
SecMotorGetPar(self, "sign", &sign);
|
||||
SecMotorGetPar(self, "softzero", &zero);
|
||||
SecMotorGetPar(self, "staticoffset", &offset);
|
||||
fVal = hard;
|
||||
if (sign < 0) {
|
||||
fVal += zero;
|
||||
fVal += zero + offset;
|
||||
} else {
|
||||
fVal -= zero;
|
||||
fVal -= zero + offset;
|
||||
}
|
||||
fVal *= sign;
|
||||
return fVal;
|
||||
@@ -728,6 +732,11 @@ pMotor SecMotorInit(char *name)
|
||||
SetHdbProperty(child, "__save", "true");
|
||||
AddHipadabaChild(node, child, NULL);
|
||||
|
||||
child = MakeSICSHdbPar("staticoffset", usMugger,
|
||||
MakeHdbFloat((double) 0.0));
|
||||
SetHdbProperty(child, "__save", "true");
|
||||
AddHipadabaChild(node, child, NULL);
|
||||
|
||||
child = MakeHipadabaNode("status", HIPTEXT, 1);
|
||||
SetHdbProperty(child, "motname", name);
|
||||
AddHipadabaChild(node, child, NULL);
|
||||
|
||||
Reference in New Issue
Block a user