Large dynamic range small-angle diffractometer D22

Small-angle scattering is a technique that measures the deviation to small angles (much less than one degree to several degrees) of an X-ray or neutron beam due to structures of small size in the sample. “Small” means dimensions of a few tenths to about 100 nanometres, such as clusters in alloys, polymers, or biological macromolecules.

Back to ILL Homepage
www > Instruments & Support > Instruments & groups > D22 > documentation

D22RobotArm

Instructions for the use of D22's robot

This document describes how to set up the robot arm, determine the sample positions, and set up the commands for the use of the robot. Please, refer to the D22 Manual and the D22 documentation for other topics. Technical details on the programs can be found in the "Rapport de Stage" by Yaël André (August 1999), available at D22 and in the ILL library.

The "isel C-Series Wiring and Setup Manual" can be found here as a pdf file.

Contents

1. Introduction

D22's ISEL robot uses a command interface provided by the manufacturer. A summer student of the ILL, Yaël André, has written several procedures to facilitate its use. The first procedure, running on the instrument control PC, sets up the co-ordinates of the sample rack and in-beam positions with respect to the origin of the robot arm. The second procedure uses this coordinate information to create command files that select a sample in the sample rack and move it to the in-beam position, and others that return it to the rack.

To top

2. Mounting the robot

Text yet to be written

2. Determining the sample rack and in-beam positions

2.1. Connections

  • Connect the the three black round connectors of the arm axes to the plugs "Achse 1" to "Achse 3" on the back side of the ISEL unit "Schrittmotor-Controller C142-4".
  • Connect the grey connector of the PC/AT cable to RS 232 C plug on the front face of the ISEL unit "Schrittmotor-Controller C142-4"
  • Connect the red connector of the PC/AT cable either to the communication plug of the PC used for test purposes or via a RS232 adapter to the cable from the interface plug defined here for use with the instrument supervision PC.
  • Connect the ISEL unit "Schrittmotor-Controller C142-4" to the mains
  • Switch on ("1", bottom right on front face)
  • Push "POWER" button on front face, right side
  • Push "reset micro-P" button (5th module from the left on front face)
  • Push "start" button on front face

To top

2.2. Manual control of the arm

The robot arm can be manually controlled using the BASIC program keymove1.bas, a slightly modified version of Yaël André's keymove.bas. This program is found in the subdirectory c:\Winnt40\I5\RobotT on the instrument supervision PC. Move down (cd) to this subdirectory. Then

  • Open a DOS window: Icon "Demarrage" -> Programmes -> Invite de programmes
  • The command "qbasic keymove1.bas" in the DOs window starts the program keymove1.bas.

The program keymove1.bas starts by setting the robot to its internal origin (0,0,0), i.e. sample holder close to the detector tube, on the right, and up.

The program allows one to move the robot arm in all directions using the French keyboard keys A and W for the +/- "X" movement (along the neutron direction), Z and X for the "Y" movement across the beam, and E and C for the "Z" down/up movement. (A, Z and E are the first three characters in the top line, and W, X and C the first characters in the bottom line on a French keyboard.)

Three step sizes are available. The program starts with "low", corresponding to 0.1 mm. Pressing the space bar once toggles to "medium" (1 mm), then to "high" (10 mm), and back to "low".

Pushing the ENTER or RETURN keys prints a 19-digit hexadecimal arm co-ordinate. The meaning of this is
0 XXXXXX YYYYYY ZZZZZZ,
where the first 0 stands for a correct instruction, followed by 6-digit co-ordinates for the X, Y and Z steps.

These hexadecimal values are translated by the qbasic program into decimal values and positions in mm with respect to the robot reference co-ordinates.

Typing Q (and then any key) quits the program.

Move the robot arm to the first sample rack position and to the position of the sample in the beam and note the two corresponding hexadecimal values.

It is suggested that you leave the robot in a position slightly off the reference co-ordinates. (This is performed automatically by the MAD command file "isel_reference.cmd".)

To top

3. Preparing the command files

Yaël André also wrote a Tk/Tcl procedure ("robot_files") that prepares a set of command files necessary for picking up a sample in the rack, moving it in the beam, and returning it from there to the initial rack position.

Although the names of these files can be chosen, it is advised to keep the original ones: putsample01.cmd to putsamplenn.cmd and getsample01.cmd to getsamplen.cmd.

At present Tk/Tcl is not yet installed on the instrument control computer. Therefore, it is necessary to run the procedure robot_files on a UNIX workstation (d22lnx, lsslnx1, d22sgi...). We advise you to create a subdirectory, e.g. "Robot", in your user zone, moving to it (cd Robot), and to copy a few items to it from the directory /home/ce/sans/Linux/Robot. The files needed are

  • robot_files
  • getsample
  • putsample
  • holdsample
  • get_from_hold

The latter four files are default files that contain symbolic positions and speeds for the partial positioning movements and are used for creating the files corresponding to individual sample movements.

putsample serves to create files that pick up a sample, leave it in a recipient in the measuring position and return the robot arm to its parking position. The files created with the help of getsample return the sample to the rack.

holdsample serves to create files that pick up a sample and hold it in the measuring position. get_from_hold files return the sample into the rack and return the robot arm to its parking position.

Run

(/usr/public/bin/)expectk robot_files

to create command files to be used with MAD.

The file isel_init contains the last-used start values for robot_files. The file isel_reference.cmd, when executed by MAD, moves the robot to its origin.

The file names need to be entered, one by one, in the field "Files to load" of robot_files. They also contain a description of the meaning of every line. A few other necessary files will be created by starting the procedure robot_files:

robot_files needs the co-ordinates of the first sample, the increment to reach the following sample, and the co-ordinates of the in-beam position of the sample, either in coder steps as indicated by the value determined above, but in decimal, or in mm.

Once the command files exist on the data treatment UNIX workstation, they need to be copied to the acquisition workstation (d22), by using ftp or xftp.

ftp to d22 as user d22, password d22d22, and copy files with extension cmd.

The command files contain strings that are sent to the motor control unit as normal MAD commands. Example:

rs232 @07
rs232 @0d1000,1000,1000
rs232 @0i
rs232 m0,30,8120,5000,0,30,0,30
rs232 m9600,5000,8120,30,0,30,0,30
rs232 m9600,30,8120,30,22400,3000,0,30
rs232 p65529,0,1
rs232 510
rs232 m9600,30,8120,30,0,5000,0,30
rs232 m9600,30,17320,5000,0,30,0,30
rs232 m2800,5000,17320,30,0,30,0,30
rs232 m2800,30,17320,30,10000,5000,0,30
rs232 p65529,0,0
rs232 510
rs232 m2800,30,17320,30,0,5000,0,30
rs232 m2800,30,0,5000,0,30,0,30
rs232 m0,5000,0,30,0,30,0,30
rs232 9
rs232 @0S

The rs232 command sends a character string to an RS232 communication line (COMM2) that is connected to the ISEL unit "Schrittmotor-Controller C142-4".

For use with John Allibon's program robot, see below, "rs232" needs to be replaced by "unix robot". The newest version of robot_files does this automatically.

The order of events in this example is the following: The robot arm starts from some position to move above the sample in-beam position, moves down to the sample, closes a contact e.g. to use a Venturi valve to soak up the sample, transports the sample to its original rack position, opens the contact again to liberate the sample, and moves back to the robot origin.

To top

4. Controlling the robot with MAD

John Allibon has written an application "robot" that allows one to send command strings to the robot, have them executed and get a return string.

robot uses unit $robot_term_line, e.g. /dev/ttya02s.

robot works on the system level and can be called from within MAD via

MAD> unix robot _string_

The command files can be used in MAD command lines or within MAD command files like other commands. Here is an example:

MAD> start putsample07
MAD> wait 30
MAD> par subtitle sample 7
MAD> run 1000 t s 1
MAD> start getsample07
MAD> wait 40
MAD> start putsample05
MAD> wait 30
MAD> par subtitle sample 5
MAD> run 2000 t s 1
MAD> start getsample05

The wait commands are necessary since responses from the robot cannot be treated as yet.

To top

5. Appendix

5.1. Steps per mm

X direction: 40 steps/mm
Y direction: 40 steps/mm
Z direction: 80 steps/mm

2.2. Maximal movements

X direction: 17000 steps/ 425 mm
Y direction: 42500 steps/ 1060 mm
Z direction: 22500 steps/ 280 mm

To top

5.3. Robot command summary

Immediate mode

Absolute motion                          @(GN)M(GX),(SX),(GY),(SY),(GZ),(SZ),(GZ1),(SZ1)
[Cirular interpolation @(GN)Y(B),(V),(E),(X),(Y),(RX),(RY)]
Clear battery-backed memory @(GN)k
Enter program mode @(GN)i
Home motors (return to mechanical zero) @(GN)R(Axes)
Identify current postion of axes @(GN)P
Incremmental motion @(GN)A(GX),(SX),(GY),(SY),(GZ),(SZ),(GZ1),(SZ1)
[Select interpolation axes @(GN)e(S)]
[Select circle Direction @(GN)f(D)]
Set homing speeds @(GN)d(SX),(SY),(SZ)
Specify axes @(GN)(Axes)
Start program execution @(GN)s
Stop program execution @(GN)(ascii 255)
3D interpolation On/Off @(GN)z(I)
Zero absolute (current position -> 0) @(GN)n(Axes)

(GN): device number, in general 0
M capital: acknowledge at the end, m small: at beginning of the motion
(GX) X axis steps, (GY) Y axis steps, (GZ) Z axis steps, (GZ1) dummy steps
(SX) X axis speed, (SY) Y axis speed, (SZ) Z axis speed, (SZ1) dummy speed
(B) length of arc in steps, (V) speed of motion, (E) error factor
(X),(Y) X and Y axes relative to centre of arc
(RX),(RY) indicate quadrant containing starting point
(Axes): 0 for X, 2 for Y, 4 for Z or sums thereof
(S) Code for the axes to be interpolated, 0: X-Y, 1: X-Z, 2: Y-Z
(D) value for direction of rotation, 0 for clockwise, -1 for counter-clockwise
(I) 0 for 3D interpolation OFF, 1 for ON

Program mode

Absolute motion                          m(GX),(SX),(GY),(SY),(GZ),(SZ),(GZ1),(SZ1)
[Cirular interpolation Y(B),(V),(E),(X),(Y),(RX),(RY)]
End program mode 9
Home motors (return to mechanical zero) 7(Axes)
Impulse operation 4(Code) Codes: 1 - set output ON
2 - set output OFF
3 - impulse for 0.5 sec
4 - wait for input
5 - send impules and wait
for acknowledgment
6 - wait for impulse and
acknowledge
Incremmental motion 0(GX),(SX),(GY),(SY),(GZ),(SZ),(GZ1),(SZ1)
Loop/Branch 3(N)(S)
Move until impulse 6(GX),(SX),(GY),(SY),(GZ),(SZ),(GZ1),(SZ1)
Read input port o65531,(N),(V),(F)
[Select interpolation axes e(S)]
Send sychronisation character 1(SC)
[Set circle Direction f(D)]
Set output p(address),(N),(V)
Set homing speeds @(GN)d(SX),(SY),(SZ)
3D interpolation On/Off z(I)
Time delay 5(Time in 1/10 sec)
Wait for sychronisation character 2(SC)(Off)
Zero absolute (current position -> 0) n(Axes)

values like above and
(SC) Synchronisation character, ascii 33-125, except 64
(N) any of the bit address numbers 1 to 8 or 0 for multiple
(V) value 0 or 1 for bit 0r between 0 and 255 for entire address
(F) offset (line number) for branching to line (F)
(address) 65529 for output group 1, 65530 for output group 2

To top

5.4. Robot error messages

0     no error
2 emergency stop or limit switch encountered
3 illegal number of axes
4 axis not defined
5 syntax error
6 out of memory
7 illegal parameters
8 illegal branch
c loop error
D illegal speed specified
G no data for execution in memory
z internal "SW" error
(CR) unexpected end of command

To top

5.5. Meaning of parameters in put/getsample files

%1 abscissa of the first sample
%2 ordinate of the first sample
%3 height value of the first sample
%4 abscissa of measurement position
%5 ordinate of measurement position
%6 height value of measurement position

%7 abscissa (or ordinate) increment for sample position (0 for sample 1)

All values in the files putsample and getsample are in steps.

To top


Web document produced by Roland May, ILL Grenoble (last update: 24-Aug-2007)