Re #7: Added spin calibration algorithm to determine needle orientation.