MATLAB Software for GET/SET Machine Configuration in SPEAR 3

Including CurrReference Values for Feed-Forward Tables

J. Corbett

March 16, 2006

[I. Algorithm]{.underline}

Each time a new configuration is loaded, the setpoints on the SPEAR 3
correctors used in beam line feed-forward tables should be set to:

Configuration Setpoint + delta(CurrReference)

where delta(CurrReference) = CurrReference(now) -- CurrReference(config)

Note that at the time of a configuration change CurrReference(now) does
not get changed, only the corrector setpoint. CurrReference(config) is
stored into the ConfigMonitor structure of the configuration file by
getmachineconfig

[II. New AO Families]{.underline}

For the first implementation of the software we define two new AO
families

HCMCurrReference horizontal correctors used in feed-forward

VCMCurrReference vertical correctors used in feed-forward

The 'Monitor' field for both families will contain the nominal PV's for
[Setpoint]{.underline} of CurrReference for each corrector supply.

The Families HCM/VCMCurrReference are 'MemberOf' 'MachineConfig'. This
will trigger getmachineconfig to save the data in ConfigMonitor but not
trigger setmachineconfig to set the values because there are no Setpoint
or other fields.

[III. Getmachineconfig]{.underline}

When MATLAB acquires data in getmachineconfig it automatically operates
on all AO families that have a Setpoint field or Monitor field and are
MemberOf 'MachineConfig'.

Getmachineconfig will also acquire any family/field combination that is
'MemberOf' 'MachineConfig' and place it in the ConfigSetpoint structure.
For this application we don't want any data in the ConfigSetpoint
structure because setmachineconfig will automatically set the saved
value to the power supplies.

ConfigMonitor.HCMCurrReference.Monitor.Data will contain data acquired
from the Setpoint PV's for CurrReference (same for VCM)

[IV. Setmachineconfig]{.underline}

Setmachineconfig will automatically load all Setpoint values for all
families in the ConfigSetpoint structure retrieved from file. There are
no entries into ConfigSetpoint for the CurrReference families. For our
application, we don't want to change the PV values stored in
CurrReference, only the values of correctors used in the feedforward
tables. The device lists for these correctors are specified in AO
families HCMCurrReference and VCMCurrReference

The algorithm in Setmachineconfig is as follows:

1\. Parse input sequence to form ConfigSetpoint/ConfigMonitor structures
as usual.

2\. Setmachineconfig loads all the HCM Setpoints as usual. All of the
correctors are set to values contained in ConfigSetpoint.HCM.Setpoint
(same for VCM).

3\. New values are loaded into specific HCM supplies according to

Setpoint= getsp('HCM', devlist) + delta(CurrReference)

where delta(CurrReference) is defined above. The devlist for getsp is
taken from the HCMCurrReference AO family. The same applies for VCM.

This calculation will take place at the end of Setmachineconfig in the
file specified by

AD.SetmachineconfigFile='setmachineconfig_finis'.

The file is stored in R:\\Controls\\matlab\\machine\\spear3.

AD field is loaded at the bottom of setoperationalmode.

The algorithm is configuration independent.

[V. ID Trims]{.underline}

Setmachineconfig_finis also loads the CurrReference values for the ID
trims into the CurrSetpt. The ID trim setpoint values are stored in the
family/field 'IDTrim.SetpointName' in order to avoid
getmachineconfig/setmachineconfig from automatically storing and loading
the values contained in family/field 'IDTrim/Setpoint'.

A new AO family 'IDTrim' was created for this purpose.

Skew quad trim for BL5 added July 10, 2006.

[VI. Notes:]{.underline}

1\. to test code use currreftest.m (could be obsolete by now, set a
break in setmachineconfig and execute setmachineconfig_finis from the
K\>\> control line.

2\. Move HCM/VCMCurrReference families from spear3init_ref to spear3init
for operations.

*R:\\Controls\\matlab\\machine\\spear3\\docs\\setconfig_feedforward_code.doc*