esrf

Beamline Instrument Software Support
SPEC Macro documentation: [ Macro Index | BCU Home ]

piezo_gcs.mac $Revision: 1.2 $
See other macros in category: All
Description:
    Macros to control a piezo PI controller connected via GPIB line. ONLY GCS (General Command Set) compatible PI controller can be driven by this macro set.
Documentation:
    DESCRIPTION
    This macro file allows to connect a piezo to a macro motor in SPEC.
    Controllers currently supported are:
    PI E-516 (GPIB)
    For debug purpose mainly, it's also possible to configure a macro counter that will read the position of a piezo axis. But to avoid duplicating parameters, the counter has no parameter and takes them from its corresponding macro motor. In order to guess the motor to use, the name of the counter must be the same as the motor with \"_c\" added at the end. For instance: \"nnn_x_c\" for \"nnn_x\"

    SETUP
    In order to configure a macro motor:
    1) You must have a "MOTORS" defined with:
    DEVICE set to "piezogcs"
    TYPE set to "Macro Motor"
    ADDR set to the GPIB_Address of the controller
    NUM must be set also
    2) Per piezo axis you must define a motor with:
    Controller set to "MAC_MOT"
    Unit field must be set to the "MOTOR" entry.
    Chan field must be set to the piezo axis of the controller (for instance "0" stands for axis "A", "1" for "B" etc)
    3) In the config file add for each motor (WARNING: these parameters are critical and can damage your hardware if wrong. They are specific to each axis and not to the controller. Therefore check with Electronics Group the value and DO NOT copy/paste these values)
    MOTPAR:a7 = mu/V resolution in micron per volt (ex: 35)
    MOTPAR:a9 = Vout/Vcmd ratio out volt / command volt (ex: 10)
    MOTPAR:deadtime = seconds sleep time after a motion (ex: 0.1)
    In order to configure a macro counter:
    1) You must have a "SCALERS" defined with:
    DEVICE set to "piezogcs_c"
    TYPE set to "Macro Counter"
    NUM must be set also
    2) Per piezo axis you must define a counter with:
    Device set to "MAC_CNT"
    Mnemonic must the motor mne plus "_c"
    Unit do not mind
    Chan do not mind


Macros:
    piezogcsdebug
    Usage: piezogcsdebug [personal msg]
    Switch on or off the print of debug messages

Internal Macros:
    piezogcs_checkctl
    Usage: piezogcs_checkctl()
    Check if controller was well configured

    piezogcs_getch
    Usage: piezogcs_getch(ch)
    Convert channel from digit to single ASCII char

    piezogcs_config
    Usage: piezogcs_config(num,type,p1,p2,p3)
    MACRO MOTOR: Called by spec after reading the config file

    piezogcs_getpos
    Usage: piezogcs_getpos (motor_num)
    MACRO MOTOR: return the position read from the controller

    piezogcs_cmd
    Usage: piezogcs_cmd(num,key,p1,p2)
    MACRO MOTOR: Called by spec on motor operation.

    piezogcs_c_config
    Usage: piezogcs_c_config(num,type,p1,p2,p3)
    MACRO MOTOR: Called by spec after reading the config file

    piezogcs_c_cmd
    Usage: piezogcs_c_cmd(num,key,p1,p2)
    MACRO MOTOR: Called by spec on counter operation.

Filename: pi_e516.mac
Author: BLISS 2006
Last mod.: 22/05/2012 10:14 by perez