source: MML/trunk/machine/SOLEIL/StorageRing/insertions/idSetOrbitBump.m @ 17

Last change on this file since 17 was 17, checked in by zhangj, 10 years ago

To have a stable version on the server.

  • Property svn:executable set to *
File size: 932 bytes
Line 
1function ErrorFlag = idSetOrbitBump(BPM_Family, BPM_DeviceList, GoalOrbit, CM_Family, CM_IncrementList)
2%Makes an accurate incremental bump, by walking around the problem of eventual
3%saturation of BPMs
4
5BPM_LinearLimitPos = 1; %[mm] max. abs. value of position after which the BMPs start to saturate
6
7numPos = length(GoalOrbit);
8maxAbsPos = 0;
9for i = 1:numPos
10    curAbsPos = abs(GoalOrbit(i));
11    if(maxAbsPos < curAbsPos)
12        maxAbsPos = curAbsPos;
13    end
14end
15
16if(maxAbsPos <= BPM_LinearLimitPos)
17    setorbitbump(BPM_Family, BPM_DeviceList, GoalOrbit, CM_Family, CM_IncrementList);
18        return;
19end
20
21[OCS, OCS0, V, S, ErrorFlag] = setorbitbump(BPM_Family, BPM_DeviceList, GoalOrbit*(BPM_LinearLimitPos/maxAbsPos), CM_Family, CM_IncrementList, 'NoSetSP');
22if(ErrorFlag)
23    return;
24end
25CM_DeviceList = OCS.CM.DeviceList;
26CM_DeltaSP = OCS.CM.Delta;
27
28stepsp(CM_Family, CM_DeltaSP*(maxAbsPos/BPM_LinearLimitPos), CM_DeviceList);
Note: See TracBrowser for help on using the repository browser.