Piezosystem jena PX 38 SG

Last modified by henrikma@helsinki_fi on 2024/02/07 06:21

The piezo stage connects to a PC via serial port. It has been configured in spec on the Linux machine in the phase-contrast room. The necessary macros (functions) for operating the piezo are found on GitLab: https://version.helsinki.fi/xraylab/imaging/phase-contrast/phase-grating-control. Clone the repository to the Linux PC, for example to:

/home/phasecontrast/phasecontrast_control

The macros for controlling the piezo are located in the piezo.mac file. It can be read into spec with the command:

qdofile("/home/phasecontrast/phasecontrast_control/piezo.mac")

Spec config

To configure the device in spec, first launch spec and type "config". Navigate to the "Interface configuration" tab either by pressing c (multiple times) or shift+I on your keyboard. Add the device under "serial". The device location/name should be something like /dev/ttyS0, and to be sure, you can give it your own name by creating a symbolic link as explained here. The "baud" parameter should be 9600, and the "mode" raw. The spec macros assume that the device has number/ID "1" in the configuration.

Basic usage

  1. Turn on the power supply from the (physical) on/off-switch. The display should light up.
  2. Turn on external control and "closed loop" operation mode by running the command piezoinit in spec.
    The power supply display now shows the piezo position in micrometers.
  3. From spec, the piezo postion can be printed with (don't forget the parenthesis):

    p piezoget()


  4. The piezo can be moved to a desired absolute position x (in micrometers) with:

    piezomv(x)

    This function applies a constant offset to the given value to correct for misspositioning that was noticed with this piezo.

  5. Closed loop operation and external control can be turned off with the piezoexit macro.

    There seems to be a bug, which causes the piezo to move to a wrong position after it has been moved to "0.00" (overload, error 7). In other cases it seems to work fine; it is not suggested to move the piezo to zero.


For best results, the piezo should be allowed to stabilize for ~2 hours after switching on the power supply. The positioning also seems most stable after position ~17 micrometers.

Piezo stepping

Currently, the operation of the Varex 1207 detector is done through the Windows PC in the phase-contrast room. However, the Linux PC can communicate with the Windows PC via the lab network. Movement of the piezo has been implemented in the phase stepping macros in stepping.mac.