HomingKBP06.py

HomingKBP06.py supports the homing of the KB mirror axes at P06.

Warning: This script is intended to be used by experts only because movements of the KB axes may lead to collisions.

The motor assignment:

p06/motor/mi.75 X
p06/motor/mi.76 Y
p06/motor/mi.79 Z
p06/motor/mi.83 Vertically focussing mirror, theta 
p06/motor/mi.84 Horizontally focussing mirror, theta

HomingKBP06.py --all gives an overview:

$ ./HomingKBP06.py --all
p06/motor/mi.75 at 0.000    HomeBits 0x4c0000 Flag True
p06/motor/mi.76 at 0.000    HomeBits 0x4c0000 Flag True
p06/motor/mi.79 at -0.001   HomeBits 0x4c0000 Flag True
p06/motor/mi.83 at -0.050   HomeBits 0xc0000 Flag True
p06/motor/mi.84 at -0.000   HomeBits 0xc0000 Flag True

To inspect the status of a single axis:

$ ./HomingKBP06.py --motor 75 
p06/motor/mi.75 at 0.000    Steps 0 HomeBits 0x4c0000 Flag True

The commands display the motor positions, the status of the home bits and a flag that indicates whether the home bit of a particular axis is set. However, the home position is not defined by the status of this flag. Instead it is defined to be the point where this flag becomes True, if the axis is moved from below.

Before the homing procedure is started, it is necessary to locate the home position roughly. In this example, the axis 75 is moved to -0.1.

$ ./HomingKBP06.py --motor 75 -0.1
p06/motor/mi.75 at -0.001   Steps -1 HomeBits 0x4c0000 Flag True
p06/motor/mi.75 at -0.003   Steps -3 HomeBits 0x4c0000 Flag True
p06/motor/mi.75 at -0.005   Steps -5 HomeBits 0x4c0000 Flag True
p06/motor/mi.75 at -0.008   Steps -9 HomeBits 0x4c0000 Flag True
p06/motor/mi.75 at -0.012   Steps -13 HomeBits 0x4c0000 Flag True
p06/motor/mi.75 at -0.017   Steps -17 HomeBits 0x4c0000 Flag True
p06/motor/mi.75 at -0.022   Steps -23 HomeBits 0x480000 Flag False
p06/motor/mi.75 at -0.028   Steps -29 HomeBits 0x480000 Flag False
...
p06/motor/mi.75 at -0.101   Steps -101 HomeBits 0x480000 Flag False
p06/motor/mi.75 at -0.100   Steps -100 HomeBits 0x480000 Flag False

We see that the home flag becomes True close to 0, the expected home position. All is well.

The point where the home flag changes it's value should be close to 0, plusMinus 0.1. If this is not the case, the search area has to enlarged and, let's assume we found the home position at 3, move the axis to 3 and calibrate it to 0. This is just a rough calibration but it allows us to start the home sequence.

Currently it is assumed that all home positions are at 0. If this is not the case, the script has to be changed accordingly.

It is important that we start the homing procedure from a point below the home position.

$ ./HomingKBP06.py --motor 75 --home
24 Jan 2017 11:49:13: --- homing of p06/motor/mi.75, starts at -0.1
24 Jan 2017 11:49:13: p06/motor/mi.75, original slew rate 500
24 Jan 2017 11:49:13: p06/motor/mi.75, coarse move to 0.1
p06/motor/mi.75 at -0.098   Steps -98 HomeBits 0x480000 Flag False
p06/motor/mi.75 at -0.093   Steps -93 HomeBits 0x480000 Flag False
...
p06/motor/mi.75 at -0.002   Steps -2 HomeBits 0x480000 Flag False
24 Jan 2017 11:49:13: p06/motor/mi.75, home detected at 0, stopping move
24 Jan 2017 11:49:14: p06/motor/mi.75, back to -0.15
p06/motor/mi.75 at 0.063    Steps 63 HomeBits 0x4c0000 Flag True
p06/motor/mi.75 at 0.061    Steps 61 HomeBits 0x4c0000 Flag True
...
p06/motor/mi.75 at -0.150   Steps -150 HomeBits 0x480000 Flag False
24 Jan 2017 11:49:15: p06/motor/mi.75, fine move to 0.1 using fineSlew 50
p06/motor/mi.75 at -0.148   Steps -148 HomeBits 0x480000 Flag False
p06/motor/mi.75 at -0.145   Steps -145 HomeBits 0x480000 Flag False
...
p06/motor/mi.75 at -0.002   Steps -2 HomeBits 0x480000 Flag False
24 Jan 2017 11:49:18: p06/motor/mi.75, home detected at 0, stopping move
24 Jan 2017 11:49:18: p06/motor/mi.75, restore old slew rate 500 
24 Jan 2017 11:49:18: p06/motor/mi.75, move to home 0 
p06/motor/mi.75 at 0.000    Steps 0 HomeBits 0x4c0000 Flag True
p06/motor/mi.75 at -0.002   Steps -2 HomeBits 0x4c0000 Flag True
...
p06/motor/mi.75 at 0.000    Steps 0 HomeBits 0x4c0000 Flag True
24 Jan 2017 11:49:19: p06/motor/mi.75, comparing current position with HomePosition (TS attribute) 0 
24 Jan 2017 11:49:19: p06/motor/mi.75, position (0) == homePosition, no calibration necessary
24 Jan 2017 11:49:19: --- p06/motor/mi.75: homing successfully DONE

The procedure starts with a home-search at full speed. The motion is stopped when the home flag is detected. Next, the axis is moved to a point 0.15 units below home. The slew rate is decreased to 50 and the home search is repeated at slow speed. After home is detected the motion is stopped, the original slew rate is restored and the axis is moved to home. Then the current position is compared with the HomePosition Tango server attribute. If there is a difference, the script prompts the user for confirmation to calibrate the axis. If a calibation is done, the step registers are cleared.

Logging information can be found in /online_dir/HomingKBP06.log.

The save procedure to home all KB mirror axes is:

2019-11-13