SICS-720 Add autofocussing on Taipan using the following energy relations,

Avfocus = 115 + 2.13 * Ef
Mvfocus = 102.2 + 1.78 * Ei

Ahfocus = 45.68 - (-105.7) * (0.945) ^ Ef
Mhfocus = 184.42 - (60.1) * (0.951) ^ Ei

NOTE: Parameters are set via tasub mono/ana  VB1/VB2/HB1/HB2/HB3
This commit is contained in:
Ferdi Franceschini
2014-03-10 14:05:46 +11:00
parent 879a573e05
commit 9b19ddf4e6
5 changed files with 96 additions and 32 deletions

View File

@@ -39,9 +39,9 @@
static long TASSetValue(void *pData, SConnection * pCon, float value)
{
ptasMot self = (ptasMot) pData;
assert(self);
int qcodes[] = {3,4,5,8}; /* qh,qk,ql, en */
int i;
assert(self);
if (self->code > 5 && self->math->tasMode == ELASTIC) {
SCWrite(pCon, "ERROR: cannot drive this motor in elastic mode",
@@ -328,9 +328,9 @@ static int startMotors(ptasMot self, tasAngles angles,
self->math->busy[A2] = 1;
}
if (self->math->motors[MCV] != NULL) {
if (self->math->motors[MCV] != NULL && self->math->autofocus) {
curve = maCalcVerticalCurvature(self->math->machine.monochromator,
angles.monochromator_two_theta);
angles.monochromator_two_theta, getTasPar(self->math->target, EI), self->math->focusfn);
status = startTASMotor(self->math->motors[MCV], pCon, self->math->motname[MCV],
curve, silent,stopFixed);
if (status != OKOK) {
@@ -341,9 +341,9 @@ static int startMotors(ptasMot self, tasAngles angles,
}
}
if (self->math->motors[MCH] != NULL) {
if (self->math->motors[MCH] != NULL && self->math->autofocus) {
curve = maCalcHorizontalCurvature(self->math->machine.monochromator,
angles.monochromator_two_theta);
angles.monochromator_two_theta, getTasPar(self->math->target, EI), self->math->focusfn);
status = startTASMotor(self->math->motors[MCH], pCon, self->math->motname[MCH],
curve, silent,stopFixed);
if (status != OKOK) {
@@ -374,9 +374,9 @@ static int startMotors(ptasMot self, tasAngles angles,
self->math->busy[A6] = 1;
}
if (self->math->motors[ACV] != NULL) {
if (self->math->motors[ACV] != NULL && self->math->autofocus) {
curve = maCalcVerticalCurvature(self->math->machine.analyzer,
angles.analyzer_two_theta);
angles.analyzer_two_theta, getTasPar(self->math->target, EF), self->math->focusfn);
status = startTASMotor(self->math->motors[ACV], pCon, self->math->motname[ACV],
curve, silent,stopFixed);
if (status != OKOK) {
@@ -386,9 +386,9 @@ static int startMotors(ptasMot self, tasAngles angles,
self->math->busy[ACV] = 1;
}
}
if (self->math->motors[ACH] != NULL) {
if (self->math->motors[ACH] != NULL && self->math->autofocus) {
curve = maCalcHorizontalCurvature(self->math->machine.analyzer,
angles.analyzer_two_theta);
angles.analyzer_two_theta, getTasPar(self->math->target, EF), self->math->focusfn);
status = startTASMotor(self->math->motors[ACH], pCon, self->math->motname[ACH],
curve, silent,stopFixed);
if (status != OKOK) {
@@ -666,9 +666,9 @@ static int startQMMotors(ptasMot self, tasAngles angles,
self->math->busy[A2] = 1;
}
if (self->math->motors[MCV] != NULL) {
if (self->math->motors[MCV] != NULL && self->math->autofocus) {
curve = maCalcVerticalCurvature(self->math->machine.monochromator,
angles.monochromator_two_theta);
angles.monochromator_two_theta, getTasPar(self->math->target, EI), self->math->focusfn);
status = startTASMotor(self->math->motors[MCV], pCon, self->math->motname[MCV],
curve, silent,stopFixed);
if (status != OKOK) {
@@ -678,9 +678,9 @@ static int startQMMotors(ptasMot self, tasAngles angles,
}
}
if (self->math->motors[MCH] != NULL) {
if (self->math->motors[MCH] != NULL && self->math->autofocus) {
curve = maCalcHorizontalCurvature(self->math->machine.monochromator,
angles.monochromator_two_theta);
angles.monochromator_two_theta, getTasPar(self->math->target, EI), self->math->focusfn);
status = startTASMotor(self->math->motors[MCH], pCon, self->math->motname[MCH],
curve, silent,stopFixed);
if (status != OKOK) {
@@ -709,9 +709,9 @@ static int startQMMotors(ptasMot self, tasAngles angles,
self->math->busy[A6] = 1;
}
if (self->math->motors[ACV] != NULL) {
if (self->math->motors[ACV] != NULL && self->math->autofocus) {
curve = maCalcVerticalCurvature(self->math->machine.analyzer,
angles.analyzer_two_theta);
angles.analyzer_two_theta, getTasPar(self->math->target, EF), self->math->focusfn);
status = startTASMotor(self->math->motors[ACV], pCon, self->math->motname[ACV],
curve, silent,stopFixed);
if (status != OKOK) {
@@ -720,9 +720,9 @@ static int startQMMotors(ptasMot self, tasAngles angles,
self->math->busy[ACV] = 1;
}
}
if (self->math->motors[ACH] != NULL) {
if (self->math->motors[ACH] != NULL && self->math->autofocus) {
curve = maCalcHorizontalCurvature(self->math->machine.analyzer,
angles.analyzer_two_theta);
angles.analyzer_two_theta, getTasPar(self->math->target, EF), self->math->focusfn);
status = startTASMotor(self->math->motors[ACH], pCon, self->math->motname[ACH],
curve, silent,stopFixed);
if (status != OKOK) {