- Added separate drivable motors for four circle H, K, L
- Added a listen mode to commandlog in order to support the batchEditor - Some small fixes to exe* for BatchEditor
This commit is contained in:
88
hkl.tex
88
hkl.tex
@ -8,6 +8,9 @@ provided by Jean Allibon, ILL with the MAD four circle diffractometer
|
||||
control program in ANSI-C. For theory, see the contribution by
|
||||
W.C. Hamilton in the International Tables for Crystallography, 1974 edition.
|
||||
|
||||
There is a sister object to HKL which uses HKL to implement virtual motors for
|
||||
H, K, and L. See below for the description
|
||||
|
||||
The object uses the following object data structure:
|
||||
\begin{flushleft} \small
|
||||
\begin{minipage}{\linewidth} \label{scrap1}
|
||||
@ -33,6 +36,8 @@ $\langle$hkldat {\footnotesize ?}$\rangle\equiv$
|
||||
\mbox{}\verb@ pSelVar pMono;@\\
|
||||
\mbox{}\verb@ long lID;@\\
|
||||
\mbox{}\verb@ float scanTolerance;@\\
|
||||
\mbox{}\verb@ float targetHKL[3];@\\
|
||||
\mbox{}\verb@ int targetDirty;@\\
|
||||
\mbox{}\verb@ } HKL;@\\
|
||||
\mbox{}\verb@@$\diamond$
|
||||
\end{list}
|
||||
@ -64,7 +69,10 @@ checking.
|
||||
This is detector tilt.
|
||||
\item[pMono] The selector variable doing the wavelength.
|
||||
\item[scanTolerance] The hkl module refuses to position a reflection if it is
|
||||
to close to omega limits for scanning. This is the tolerance to use.
|
||||
to close to omega limits for scanning. This is the tolerance to use.
|
||||
\item[targetHKL] The target HKL values to support the H, K, L virtual motors
|
||||
\item[targetDirty] A flag which is set when the virtual motors have to recalculate the
|
||||
settings and to drive.
|
||||
\end{description}
|
||||
|
||||
The wavelength is a bit tricky. As it would be to time consuming to read two
|
||||
@ -102,6 +110,7 @@ $\langle$hklint {\footnotesize ?}$\rangle\equiv$
|
||||
\mbox{}\verb@ int GetLambda(pHKL self, float *fVal);@\\
|
||||
\mbox{}\verb@ int GetCurrentHKL(pHKL self, float fVal[3]);@\\
|
||||
\mbox{}\verb@ int GetCurrentPosition(pHKL self, SConnection *pCon, float fPosition[4]);@\\
|
||||
\mbox{}\verb@ int GetHKLFromAngles(pHKL self, SConnection *pCon, float fVal[3]); @\\
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@ int CalculateSettings(pHKL self, float fHKL[3], float fPsi, int iHamil,@\\
|
||||
\mbox{}\verb@ float fSet[4],SConnection *pCon);@\\
|
||||
@ -166,6 +175,7 @@ pointer to the connection object doing the command for error messages and
|
||||
everything. The error returns are the same as with CalculateSettings
|
||||
well. With the addition of HKJMOTFAIL, which means that a motor failed to
|
||||
drive properly.
|
||||
\item[GetHKLFromAngles] calculates the current HKL from Angles.
|
||||
\item[DriveSettings] drives to the the settings given in fSet.
|
||||
\item[HKLAction] is the interpreter wrapper function for the HKL object.
|
||||
\end{description}
|
||||
@ -220,3 +230,79 @@ drive properly.
|
||||
\vspace{-2ex}
|
||||
\end{minipage}\\[4ex]
|
||||
\end{flushleft}
|
||||
\subsubsection{The Crystallographic Virtual Motor Object}
|
||||
This module implements virtual motors H, K and L on top of the HKL object. It was choosen to implement this
|
||||
in a separate module because the hkl module is already big and complex enough. The problem is how to
|
||||
keep track of the necessary settings for HKL because the motors are interrelated. This is solved in the
|
||||
following scheme:
|
||||
\begin{itemize}
|
||||
\item Starting any of the motors H, K or L results in new values to be set in the HKL internal data
|
||||
structure and a dirty flag to be set.
|
||||
\item On a call to the drivable interfaces status function the dirty flag is checked and, if
|
||||
appropriate, the motor positions are recalculated and the motors started.
|
||||
\item H, K and L values are recalculated from motors on each read.
|
||||
\end{itemize}
|
||||
For each virtual motor an internal data structure is required:
|
||||
\begin{flushleft} \small
|
||||
\begin{minipage}{\linewidth} \label{scrap5}
|
||||
$\langle$hklmotdat {\footnotesize ?}$\rangle\equiv$
|
||||
\vspace{-1ex}
|
||||
\begin{list}{}{} \item
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@typedef struct __HKLMOT {@\\
|
||||
\mbox{}\verb@ pObjectDescriptor pDes;@\\
|
||||
\mbox{}\verb@ pHKL pHkl;@\\
|
||||
\mbox{}\verb@ pIDrivable pDriv;@\\
|
||||
\mbox{}\verb@ int index;@\\
|
||||
\mbox{}\verb@ }HKLMot, *pHKLMot;@\\
|
||||
\mbox{}\verb@@$\diamond$
|
||||
\end{list}
|
||||
\vspace{-1ex}
|
||||
\footnotesize\addtolength{\baselineskip}{-1ex}
|
||||
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
|
||||
\item Macro referenced in scrap ?.
|
||||
\end{list}
|
||||
\end{minipage}\\[4ex]
|
||||
\end{flushleft}
|
||||
The fields are:\begin{description}
|
||||
\item[pDes] The required object descriptor.
|
||||
\item[pHkl] The HKL object to use for calculations.
|
||||
\item[pDriv] The drivable interface.
|
||||
\item[index] The index of the motors target in the targetHKL array in the HKL structure.
|
||||
\end{description}
|
||||
The target HKL and the dirty flag is in the main HKL data structure.
|
||||
|
||||
There is no external interface to this, all the functionality is hidden in the drivable interface
|
||||
functions. The interpreter interface is minimal: only a value request is supported. There is
|
||||
however a factory function in order to install the HKL motors into the interpreter.
|
||||
|
||||
\begin{flushleft} \small
|
||||
\begin{minipage}{\linewidth} \label{scrap6}
|
||||
\verb@"hklmot.h"@ {\footnotesize ? }$\equiv$
|
||||
\vspace{-1ex}
|
||||
\begin{list}{}{} \item
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@/*------------------------------------------------------------------------------------------------------@\\
|
||||
\mbox{}\verb@ Virtual motor interface to reciprocal space coordinates H, K and L for a four circle diffractometer.@\\
|
||||
\mbox{}\verb@ Requires a HKL object for calculations.@\\
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@ copyright: see file COPYRIGHT@\\
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@ Mark Koennecke, February 2005@\\
|
||||
\mbox{}\verb@--------------------------------------------------------------------------------------------------------*/@\\
|
||||
\mbox{}\verb@#ifndef SICSHKLMOT@\\
|
||||
\mbox{}\verb@#define SICSHKLMOT@\\
|
||||
\mbox{}\verb@/*====================== data structure ==============================================================*/@\\
|
||||
\mbox{}\verb@@$\langle$hklmotdat {\footnotesize ?}$\rangle$\verb@@\\
|
||||
\mbox{}\verb@/*======================= interpreter interface ======================================================*/@\\
|
||||
\mbox{}\verb@int HKLMotAction(SConnection *pCon, SicsInterp *pSics, void *pData, int argc, char *argv[]);@\\
|
||||
\mbox{}\verb@int HKLMotInstall(SConnection *pCon, SicsInterp *pSics, void *pData, int argc, char *argv[]);@\\
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@#endif@\\
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@ @\\
|
||||
\mbox{}\verb@@$\diamond$
|
||||
\end{list}
|
||||
\vspace{-2ex}
|
||||
\end{minipage}\\[4ex]
|
||||
\end{flushleft}
|
||||
|
Reference in New Issue
Block a user