Delta Tau GEO BRICK LV User Manual

Page of 440
Turbo PMAC User Manual 
Writing and Executing Motion Programs
 
323
 
Second Rotation Example 
To rotate the coordinate system 15 degrees in the XY plane, as in the first rotation example, but about an 
arbitrary point (P1, P2) instead of the origin.  In this case the rotation matrix is the same as for a rotation 
about the origin, but a displacement vector is also required.  In general, for a rotation of angle 
θ about a 
point (x
0
, y
0
), the displacement vector required is: 
[x
0
(1-cosθ) - y
0
 sinθ
[x
0
 sinθ + y
0
(1-cosθ)] 
       ] 
To implement this in Turbo PMAC code, assuming that Q40 through Q48 are as in the above rotation 
example, add: 
Q50=P1*(1-COS(15))-P2*SIN(15) 
Q51=P1*SIN(15)+P2*(1-COS(15)) 
Q52=0 
AROT40 
 
 
 
; Create 15 degree rotation 
ADIS50 
 
 
 
; Create proper displacement 
Current Position Transformation 
When a coordinate system is transformed, it is important to realize that the starting positions for the 
upcoming move are transformed, and this has an effect on an axis not explicitly commanded in this 
upcoming move.  In absolute mode, any axis not explicitly commanded implicitly receives a command to 
its existing position, in this case, the transformed position.  For example, if the absolute move X1Y0 is 
followed by a 45o rotation, this position is transformed to X0.707Y0.707.  If this is followed by an 
absolute X2 move command, this is equivalent to an X2Y0.707 command, not to an X2Y0 command. 
Entering a Motion Program 
The motion program statements are entered one program buffer at a time into PMAC.  For each program 
buffer, the first step is to open the buffer for entry with the OPEN PROG n command (where n is the 
buffer number – with a range of 1 to 32,767).  Next, if there is anything currently in the buffer that should 
not be kept, it should be emptied with the CLEAR command.  Existing lines cannot be edited or new lines 
inserted between existing lines; only new lines can be appended to the end (with, of course, the option of 
clearing the whole buffer first). 
Typically in program development, the editing will be done in a host-based text editor such as the PMAC 
Executive Program editor, and the old version of the PMAC program buffer is cleared every time the new 
version is downloaded to the card.  After the last of the program statements is downloaded, a CLOSE 
command should be sent to the card to close the program buffer. 
It is a good idea to issue a few commands before the OPEN PROG n command to make sure the buffer 
space is ready for the program statements.  First, make sure that no motion programs are currently 
executing (except for rotary programs). The A (for the addressed coordinate system) or <CTRL-A (for all 
coordinate systems) abort command can be used to make sure execution has stopped.  In addition,  make 
sure that no other buffer is open; use the CLOSE command for this.  Next, make sure that all the open 
buffer space has not been taken up with a data gathering buffer; use the DELETE GATHER command for 
this. 
All of these (on-line) commands can be included in the editor file with the actual motion program 
statements, even though they are not part of the actual program.  They would not be reported as part of the 
program if PMAC were asked to LIST PROG n.  (The PMAC Executive program editor, as part of its 
Upload function, appends these commands to the returned program.) 
The advisable format to use when working in a text editor is: