Auto Alignment Script

This page explains the automatic alignment script. It resides in /cvs/cds/kami/scripts/AutoAlignment/

Working Principle

The dither alignment technique uses a sinusoidal signal to move a mirror in pitch or yaw. By demodulating the transmitted power signal at the same frequency as the excitation signal, we can obtain an error signal of misalignment.


There are three parties involved in the dither alignment. The first one is the realtime code, which does the excitation and demodulation. Then the demodulated signal is read by a python script called This script feedback the error signal to corresponding Picomotors by writing appropriate values to EPICS PVs which are monitored by The daemon script is responsible to drive Picomotors according to the values of the EPICS PVs reserved for Picomotors.

AIS realtime code

AIS is an acronym for Alignment Initialization System.
The current AIS is in a very primitive state, but does a job well.

There is a sin-cos signal generator at the top left. This signal goes out from the DAC to be injected to a pitch or yaw actuator of an optics. The signal is also used as a LO for demodulators. Signals from a QPD are filtered for line removal and AC coupling. The demodulated signal is filtered by a LPF and a comb filter of 10Hz harmonics.

The alignment script ( obtains the error signal by reading an EPICS channel, such as K1:CTR-AIS_TRX_DEMOD_OUT.

Usage of the alignment script

First, you have to make sure that the EPICS-PicoMotor system is properly running. See CLIO/Technicals/PMEPICS for details. Then invoke with an appropriate options. Run it with option -h to see available options.

Example: --freq 5 --excGain 10.0 -fbGain -0.01 --readBackChan "K1:CTR-AIS_TRX_DEMOD_OUTPUT" --feedBackChan "K1:PICO-MC_END_PIT"

This will read K1:CTR-AIS_TRX_DEMOD_OUTPUT as the error signal and feed it back to K1:PICO-MC_END_PIT

Operation details of

This script does discrete proportional feedback control. First it reads a value from the readback channel. Then multiplies it with the feedback gain. This number (rounded) is set as the speed of the Picomotor. Then the Picomotor is moved for 0.5 sec or a duration specified by --fbDuration option. The script pauses for 2 second to wait for the mirror to settle. This duration can be over-ridden by option --fbWait. After the pause, the error signal is read again and the next feedback iteration starts.

The pause duration is doubled when the error signal gets smaller than 20 or the value specified by --slowDownLevel. The feedback finishes when the error signal gets smaller than the value specified by --successCond (defaults to 2.0) or time out happens. --timeout controls the time out length.

Current Status

Be sure to update this section when you change the setting.

Currently, one 8752 Picomotor controller is connected to the CLIO CDS network. It is given a hostname pico. There are nine 8753 drivers connected to this 8752. The optics controlled by the controller are MC_END, MC_IN, MC_OUT, MMT1, MMT2, SM1. There is link to the PicoMotor overview screen in the menu.adl of medm/k1/ctr/. You can control those mirrors from the MEDM screens.

PicoMotor_MEDM.png PICO_ETMX_PIT.png

The AIS realtime code currently has two ADC inputs for ETMX and ETMY. Although the name implies ETMs, now ETMX is used for MC_END. The AIS has only one excitation output at this moment. This output is directly connected to the Pitch input of the MC_END coil driver. In order to align other optics, you have to change the cabling. This is annoying. Once we get more DAC channels, we should dedicate two DAC channels (pitch and yaw) for each mirror, so that we can align all optics without changing cables.

The excitation output is the output 3 of the first DAC on kami1. The ETMX_IN is connected to the 25th input of the ADC. The sum signal of the MC_END QPD is connected to this channel. Note that we put an ND filter in front of the QPD to avoid saturating the QPD (Apr 15 2010, Aso, Miyakawa).

CLIO/AutoAlignmentScripts (last edited 2010-04-16 15:06:39 by YoichiAso)