#include "client.h"
Functions | |
int | FWPos (int encpos, int npos, int offset) |
convert the current filter wheel encoder position into beam and load positions. |
Because they have to go somewhere...
|
convert the current filter wheel encoder position into beam and load positions.
Algorithm: Key features are that all rotary-indexed mechanisms we build have fixed positions that are numbered 1-relative (i.e., 1..npos, not 0..npos-1). A negative offset has to be "wrapped" using the number of positions. You'd be very surprised how long it took to get this right. Modular arithmetic in a rotary (cyclic) mechanism makes my head hurt. |