-
Notifications
You must be signed in to change notification settings - Fork 2
MERLIN, LET and WISH Oscillating radial collimators
Wiki > The Backend System > Specific Device IOC > Miscellaneous motion control > MERLIN, LET and WISH Oscillating Radial Collimators
The oscillating radial collimator on MERLIN is similar but not quite the same as the one on LET.
Occasionally the oscillating collimator stops oscillating, you can tell because the current angle
on the OPI will not be changing.
To restart this is sometimes tricky try the following:
- On the OPI
- Click Stop
- Alter the
swept angle
andoperating frequency
to a valid and different values so it will resend the setting- The valid values for the swept angle as currently 0-2 (you can see by right click on the input text box and
Show pv info
) - The valid values of operating frequency are 0-0.5
- The valid values for the swept angle as currently 0-2 (you can see by right click on the input text box and
- Set the swept angle and operating frequency back to the required settings
- Click start
- The
Mode
should now readHoming
thenOscillating
and the current angle should start changing.- this was fairly quick (less than 1 minute)
- The thread will die if zero is sent for distance and velocity. The driver must ensure that distance and velocity are not sent at IOC start.
- The oscillation will stop if the galil is power cycled. To restart the oscillation, the galil driver will need to be restarted to re-upload the oscillation code, and then the collimator restarted as usual via it's OPI. Once the collimator is started via to OPI it will home and then switch to oscillating.
The oscillations are managed by the galil code different on LET and MERLIN. This section is an rough explanation of the code.
'************MERLIN Collimator*********
'***********************************
'DETERMINE INITIAL POSITION
'***********************************
Comments
#HOMER
'*******STEP 1 - Retract Motor******
mode=0
count=0
MT~a=2
DC~a=1024;AC~a=1024;SH~a
For homing set up some variables:
- mode (what galil is doing)
- count (how many oscillations it has performed)
Then set the acceleration and deceleration and switch motor on.
JP #HOME, @IN[6]=1
SP~a=250;PR~a=2600
mode=1
BG~a
#INI
JP #INI, @IN[6]<>1
WT 100
ST~a
AM~a
If at home switch then move off it otherwise go directly to HOME
step.
#HOME
'*******STEP 2 - Find Gigital Home*******
mode=1
AC~a=67107840;DC~a=1024;SP~a=250;PR~a=-2600
SH~a;BG~a
#HEO
JP #HEO, @IN[6]=1
ST~a
AM~a
WT100
Move in negative direction and stop as soon as we hit the home switch.
AC~a=1024;DC~a= 67107840;SP~a= 20;PR~a=2600
SH~a;BG~a
#HR
JP #HR, @IN[6]<>1
ST~a
AM~a
WT1000
Move off the home switch and stop as soon as it disengages.
DP~a=-200
PA~a=0
SH~a
SP~a=1024
BG~a
AM~a
WT1000
Set the position of the home switch as -200 and move to 1024.
#OSCILSU
'****Step 3 - Oscillation Setup*******
mode=2
count=0
AC~a=accel;DC~a=accel;SP~a=vel
SH~a
PA~a=-dist/2
MC~a
Move to half the oscillation distance in the negative direction. See below for how distance is calculated.
#OSCIL
'****Step 4 - Oscillations************
time1=TIME
SP~a=vel
SH~a;PA~a=dist/2;BG~a;
#CHECK1
JP #CHECK1, @IN[6]=0
check=_RP~a
AM~a
SH~a;PA~a=-dist/2;BG~a;AM~a
count=count+1
time=TIME-time1
'JP #HOMER, check>125
JP#OSCIL
EN
Move to positive and then negative positions of oscillation, recording time for total movement. There is a disabled check that we clear the limit switch. Repeat this motion forever. See below for how distance is calculated.
The code on LET is the same except that:
- It uses a different input for the home switch,
- It performs jogs instead of limited moves
- The home switch is defined to be at 0 (not -200)
- It does not switch on the motor before each move
- After the home and before the setup oscillation it does not move the motor away from the home switch position
The distance and velocity the ORC is asked to move is calculated based on the provided swept angle and frequency. This calculation is done in the db inside motorExtensions
. The purpose of these calculations is to ensure that twice the swept angle is travelled with a constant velocity. First the time taken for half a cycle, T, is calculated:
T = 1/(2*freq)
Then swept distance in steps, D, is calculated:
D = 2*Radius*(Steps/mm)*tan(swept_angle)
The required velocity, V, is then calculated based on the equation:
(2/A)*(V^2) - V*T + D = 0
The solution to which is calculated as:
V = A * (T - sqrt(T^2 - 8*(D/A))) / 4
which is sent to the controller as vel
. From this velocity the distance required to get to this velocity is calculated:
D_v = V^2 / (2*A)
And so the total dist
sent to the control is:
dist = 2*D_v + D
The explanation for these equations can be seen in the following diagram (courtesy of Ben Withers)
The WISH collimator is slightly unusual in the way that it:
- Does not have timing information in the Galil code, so frequency can not be easily read back. To get around this in the Db it is aliased to the setpoint.
- Every x amount of oscillations it rotates 360 degrees - this is referred to as a "maintenance rotation". This is not required on LET/MERLIN as they use different bearing types
- It calculates the required swept angle using the gearbox ratio etc. rather than the tan of the angle as defined above. The velocity calculations are done in the same way.
There is some logic in the OPI that will show the fields for the maintenance rotation such as how long until the next one and what the set value is before rotating. This is enabled on load of the wish Db file.