NSLS-II-AMX / profile_collection

IPython profile configuration - Collection
BSD 3-Clause "New" or "Revised" License
0 stars 3 forks source link

Make rotation axis alignment plan more robust under varied lighting #13

Open dalekreitler-bnl opened 1 year ago

dalekreitler-bnl commented 1 year ago

Rotation axis alignment plan occasionally fails to determine the true rotation axis and requires 2-3 attempts to bring the cross hairs into +/- 2 um of true rotation axis. This failure may be due to new lighting conditions around the sample position following installation of front light, holey mirror realignment, microscope focus, or some combination of these factors.

A more robust algorithm is required, things to try:

dalekreitler-bnl commented 1 year ago

This commit adds a custom function to ADCompVision for determining camera coordinates of an alignment pin tip. Input parameters are varied under hutch lighting conditions to minimize the variance in the y pixel signal, the pertinent output for rotation axis measurement.

Screenshot from 2023-02-26 15-07-53

Screenshot from 2023-02-26 14-54-58

dalekreitler-bnl commented 1 year ago

Towards increasing the number of measurements. When acquiring multiple images occasionally an incoming acquire signal is missed by the camera resulting in a repeated read:

{'value': 260.0, 'timestamp': 1677435457.8841} {'value': 256.0, 'timestamp': 1677435458.336215} {'value': 256.0, 'timestamp': 1677435458.885434} {'value': 260.0, 'timestamp': 1677435459.133155} {'value': 256.0, 'timestamp': 1677435459.551832} {'value': 259.0, 'timestamp': 1677435460.102981} {'value': 260.0, 'timestamp': 1677435460.504927} {'value': 260.0, 'timestamp': 1677435460.504927} {'value': 260.0, 'timestamp': 1677435461.305329}

This effect seems worse in "Free Run" trigger mode and is somewhat mitigated by using "Fixed Rate" and increasing NumImages from 1->2. General strategy to minimize constantly rotating omega is to use the per_step argument for a scan and increase the number of measurements with the repeat plan_stub, except here we also will read the rotation motor position for linear regression.