- description: sddscontrollaw performs simple feedback on process variables. The input file defines a gain
matrix in a simple control law equation. The set of process variables for measurement are given by the names
of the numerical data columns, and the set of process variables for control are given by a string column. By
default, the feedback tries to regulate the values of the measurement to zero. The output file is a log of all
process variables during the feedback. For robustness, a file of tests for a set of process variables may be
defined so that the feedback may be suspended when any tests fail.
- examples: The trajectory of the LTP beamline and the energy of the linac upstream of the LTP beamline is
controlled with this command:
sddscontrollaw LTP.InvR12 LTPfeedback.out -interval=5 -steps=3600
-gain=0.75 -warning
where the contents of the file LTP.InvR12 are
SDDS1
&column
name = "CorrectorNames", type = "string", &end
! LTP:PH* are readbacks of beam position monitors
&column
name = "LTP:PH1", type = "double", &end
&column
name = "LTP:PH2", type = "double", &end
&column
name = "LTP:PH3", type = "double", &end
&column
name = "LTP:PH4", type = "double", &end
&data
mode = ascii, &end
! LTP:H[124] are dipole steering magnets.
LTP:H1 1.45e-01 7.95e-02 1.84e-01 -3.70e-02
LTP:H2 0.00e-00 2.12e-01 3.34e-01 8.39e-02
! Sled timing controls the linac energy.
L5:SledTiming 0.00e-00 0.00e-00 8.25e-03 9.45e-03
LTP:H4 0.00e-00 0.00e-00 -9.81e-03 1.44e-01
- synopsis:
usage: sddscontrollaw <inputfile> [-searchPath=<dir-path>] [-actuatorColumn=<string>]
[<outputfile>] [-infiniteLoop] [-pendIOTime] [-filterFile=<file>]
[-generations[=digits=<integer>][,delimiter=<string>][,rowlimit=<number>]
[,timelimit=<secs>] | -dailyFiles]
[-controlQuantityDefinition=<file>]
[-gain={<real-value>|PVname=<name>}]
{[-interval={<real-value>|PVname=<name>}] | -triggerPV=<PVname>[,modulus=<integer>]}
[-steps=<integer=value>]
[-updateInterval=<integer=value>]
[{-integration | -proportional}]
[-holdPresentValues] [-offsets=<offsetFile>]
[-PVOffsets=<filename>] [-endOfLoopPV=<pvName>]
[-average={<number>|PVname=<name>}[,interval=<seconds>]]
[-despike[=neighbors=<integer>][,passes=<integer>][,averageOf=<integer>][,threshold=<value>]
[,pvthreshold=<pvname][,file=<filename>][,countLimit=<integer>]
[,startThreshold=<value>,endThreshold=<value>,stepsThreshold=<integer>]
[,rampThresholdPV=<string>]]
[-deltaLimit={value=<value>|file=<filename>}]
[-readbackLimit={value=<value>|minValue=<value>,maxValue=<value>|file=<filename>}]
[-actionLimit={value=<value>|file=<filename>}]
[-testValues=<SDDSfile>] [-statistics=<filename>[,mode=<full|brief>]]
[-auxiliaryOutput=matrixFile=<file>,controlQuantityDefinition=<file>,
filterFile=<file>],controlLogFile=<file>[,mode=<integral|proportional>]
[-runControlPV={string=<string>|parameter=<string>},pingTimeout=<value>
[-runControlDescription={string=<string>|parameter=<string>}]
[-launcherPV=<pvname>]
[-verbose] [-dryRun] [-warning]
[-servermode=pid=<file>,command=<file>]
[-controlLogFile=<file>]
[-glitchLogFile=file=<string>,[readbackRmsThreshold=<value>][,controlRmsThreshold=<value>]
[,rows=<integer]]
[-CASecurityTest] [-waveforms=<filename>,<type>] [-postChangeExecution=<string>]
Perform simple feedback on APS control system process variables using ca calls.
- files:
- input file:
The input file is an SDDS file with a string column and at least one numerical column. The first
string column encountered gives the list of control process variables, the other string columns
being ignored. The names of the numerical columns are the measurement process variables. The
numerical data columns form a matrix which will be used in a simple control-law equation such
as
 | (1) |
or
 | (2) |
The quantity xn is the vector of measurement process variable values at step n, K is the matrix, un is the
vector of control process variables calculated to reduce the values of the measurement process variables
on the next iteration. The first equation refers to proportional control, while the second one
refers to integral control. For trajectory or orbit correction in accelerators, where xn are beam
position monitor readbacks, and un are steering magnet setpoints, one chooses the integral control
equation.
- control quantity definition file:
An optional control quantity definition file may be specified. This file allows one to use names in the matrix
input file that are not really process variables, but more simplified and descriptive names. This situation can
occur if the matrix file is obtained from postprocessing of sddsexperiment output data, a common way to
generate the correction matrix empirically. The control quantity definition file is a cross-reference file
which sddscontrollaw uses to match the input file names to real PV names. Two columns are
required:
- SymbolicName — String. Data must match all column names in the input file, and string column
data in the input file.
- ControlName — String. Corresponding PV names.
- test values file:
To make sddscontrollaw more robust, one can implement tests on any process variable, not necessarily those
involved in the feedback itself. If any of the tests fail, then the feedback is suspended until the test succeeds.
The test consist of checking whether a process variable is within a specified range or not. The testValues file
has three required columns and one optional one:
- ControlName — Required string column. PV names to test.
- MinimumValue, MaximumValue — Required double columns. Defines a valid range for corresponding
PVs. An error is generated when MinimumValue > MaximumValue.
- SleepTime — Optional double. Specifies sleep (or pause) time before attempting another test.
- output log file:
The output file contains one data column for each process variables defined in the input file. By default, the
data type is float (single precision). One row is written at every time step.
Two time columns and a step column are defined:
- Time — Double. Elapsed time of readback since the start of epoch.
- ElapsedTime — Double. Elapsed time of readback since the start of execution.
- TimeOfDay — Double. System time in units of hours. The time does not wrap around at 24 hours.
- Step — Long. Step number.
There are two parameters defined:
- TimeStamp — String. Time stamp for file.
- Gain — Double. Gain factor specified on the commandline.
- switches:
- examples:
sddscontrollaw sddscontrollaw.inv2 -searchPath=/home/oxygen/OAG/sddsEpicsTests -interval=1
-steps=10 -gain=.75
-controlQuantityDefinition=sddscontrollaw.cqdf -testValues=sddscontrollaw.test -despike
-average=3,interval=.1 -verbose
sddscontrollaw sddscontrollaw.inv -searchPath=/home/oxygen/OAG/sddsEpicsTests -interval=1
-steps=15 -gain=1.2 -holdPresentValues -verbose
sddscontrollaw sddscontrollaw.inv -searchPath=/home/oxygen/OAG/sddsEpicsTests -interval=1
-steps=15 -gain=1.1 -offsets=sddscontrollaw.offsets -verbose
- see also:
- author: Louis Emery, Hairong Shang, Robert Soliday, ANL/APS.