esrf

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

MSTATE.MAC
See other macros in category: Positioning
Description:
    Reads motor parameters (MAXE and SPEC) and checks vpap CY550 chip parameters.
Documentation:
    DESCRIPTION
    These macros read the actual parameters of motors configured in SPEC, or installed on a MAXE device. They eventually check whether these parameters fit the CY550 vpap board chip stepping algorithm.
    You can choose what to read, compute and list out of SPEC, MAXE and CY550 parameters.
    Parameters read and listed from SPEC for a given motor are :
    	motor	as motor mnemonic in SPEC
    	ctrllr  as motor controller name
    	fstepr  as first step rate  
    	velo    as velocity
    	acc ms  as acceleration time in ms
    	accel   as acceleration value eventually sent to MAXE server
    	backl   as backlash
    	hslewr  as home slew rate
    	step    as stepping mode (Full or Half step)
    
    Parameters read and listed from MAXE for a given device and axis number or 
    for  a given SPEC motor are:
    	devices names list 
    	axis	as axis number
    	units	as current unit 
    	mstate	as motor state
    	mpos	as motor position
    	estate  as encoder state
    	epos	as encoder position
    	backl   as backlash
    	hslewr  as home slew rate
    	stepr   as first step rate
    	velo  	as velocity
    	accel   as acceleration value
    	limits  as limits switches
    
    CY550 parameters are the following, computed from MAXE parameters for a given 
    device and axis number or for a given SPEC motor, or from given SPEC motors 
    parameters, or from the base rate, velocity and acceleration parameters input
    by the user:
    	Fstepr  as first rate parameter
       	  min      
       	  max      
    	slewR   as slew rate parameter
    	  min      
     	  max     
    	accel   as acceleration value 
     	  min  
     	  max  
    	Slop    as slope parameter 
    	Rdyn    as step rate dynamic
     	  min   
     	  max   
    	acctms  as corresponding SPEC acceleration time in ms
     	  min   
     	  max   
    The values out of range in CY550 part are highlighted.
    
      vpaptst os9 program connection:
    • Slop is the value to be given to command S
    • Fstepr is the value to scan through the CY550 step rate table to find out the index to give to the command F
    • slewR is the value to scan through the CY550 step rate table to find out the index to give to the command R


    ATTENTION
    The CY550 calculations stand as a general guide for the choice of the stepping parameters for Vpap boards equipped with the CY550 chip at 12 MHz clock frequency. Be aware that due to the complex nature of the CY550 stepping algorithm, it is difficult to provide an exact formula concerning its acceleration behaviour. The formula used in these macros is an aproximate formula. This should be used as a general guide only, with actual timing and acceleration values best determined experimentally.

Macros:
    mstate
    Usage: mstate [<+|->MAXE] [<+|->CY] [<+|->SPEC] [maxe_device|motor_mne_list] [axis_number] [axis_number] ...
      USAGE:
    • options: By default, only the MAXE parameters are listed, unless the input does not make any sense for the MAXE (stepping parameters, or not MAXE motor). You have to play with the +CY +SPEC +MAXE -CY -SPEC -MAXE options to change the listing. The latest options set is memorized untill next change. You can change one or several options at a time. The macro adapts options also itself if it happens that your input does not make any sense to the current options set.
    • arguments
      • none: macro asks for a MAXE device name or motor mnemonics. If you want to test cy550 chip paramters, answer "0", then it asks for base-rate, velocity (steps/sec), and acceleration time (ms). If you are not happy with the acceleration time, give it "0", then it asks for the acceleration (steps/sec/sec).
      • maxe device: all the axes installed on that device, or the ones specified on command line are listed.
      • list of motor mnemonics: mnemonics are separated by spaces, or "-". "-" indicates the group of motors configured between both specified ones.


Internal Macros:
    ms_parse
    Usage: ms_parse <mstate_input_argument_line>
    Parses the mstate input arguments to figure out if they are SPEC motor mnemonics or MAXE device names.

    ms_pr_endmsg
    Usage: ms_pr_endmsg


    ms_spec
    Usage: ms_spec <motor_mnemonic_list>
    For each motor of the list, extracts parameters from SPEC; if a motor is controlled by MAXE, parameters are read from MAXE server as well and cy550 stepping parameters computed;
    Lists parameters out according to the options set.

    ms_maxe
    Usage: ms_maxe <device_name [axis] ...>
    Reads parameters from MAXE server and computes the cy550 stepping parameters.

    ms_assign_M
    Usage: ms_assign_M
    Prepares MAXE parameters display output.

    ms_pr_maxe
    Usage: ms_pr_maxe
    Prints out MAXE parameters if MAXE option is set.

    ms_cy550
    Usage: ms_cy550 <base_rate> <velocity> <0|acceleration> <acceleration_time|0>
    Calculates the CY550 parameters and their limits out of the input arguments arguments, and prepares the display output.

    ms_pr_cy550
    Usage: ms_pr_cy550
    Prints out the CY550 parameters if the CY option is set.

    utilsetup
    Usage: utilsetup
    Sets some characters processing up. (Bold,Underlined,...)

Filename: mstate.mac
Author: Elke RAABE 01/95, Marie-Claire LAGIER 1994
Last mod.: 12/08/2008 16:12 by rey