Table of Contents

Name

ENERGYmngr - particle energy calculation manager

Synopsis

ENERGYmngr <argument list>

Description

This program calculates various particle energies and contains a spark counter function.

See the ENERGY CALCULATION FORMULAE section of the manual page for more information about the energy calculations.

See the SPARK COUNTER OPERATION section of the manual page for more information about the spark counter function.

See the SPARK INTERLOCK OPERATION section of the manual page for more information about the spark interlock function.

Arguments

Arguments are processed using Unix long argument syntax.
--mngr <fn>

The pathname of the CONFLIST file from which to obtain the configuration information.

If this is not specified it defaults to "MNGRconf" in the current working directory (i.e. the directory where the program was started).

--mngr_pn <fn>

The program name to use when parsing the CONFLIST file.

If this argument is not specified it generally defaults to the program name.

--show_tbl

If this argument is present the contents of the CONFLIST table is printed to stderr
--diag

If this argument is present stdout and stdin are left open and the program may be killed by SIGINT.
--diag_srcE

Print source energy calculation diagnostics to stdout.
This option forces --diag
--diag_totE

Print machine and total energy calculation diagnostics to stdout
This option forces --diag
--verbose=<n>

Normally the program does it’s work silently. This sets the level of logging information. The number is optional but if provided it must include the "=". If no argument is provided the default level is 1.
0 - work silently
1 - print signon msg, option settings

Configuration name usage

The configuration file uses the libmngr(3mngr) facility to connect internal parameters to the AccelNET database. The mappings for this program are given below.

Parameters needed by this program can be combined with parameters belonging to other programs. The "program name" field in the configuration file differentiates the entries.

ENERGYmngr uses "ENERGYmngr" as the program name when searching the file.

Configuration Group 1 name usage

This group is used for the energy calculations.

comm1 0 - optional


SrcSel - which source to use for injection energy. This is an integer value from 0 to 3 where 0 corresponds to S1.

If this parameter is missing the program defaults to 0 (source 1).

The "old way" was for this parameter to be owned by whatever task ENERGYmngr registers as and the permissions should be set for indirect update by users and unconditional for the owner.

Now this parameter may be set the "old way" or the "new way".

The "new way" is for this parameter to be owned by any task and be set for direct update

The program works either way but will print a warning in the log file if the parameter is set the "old way".

comm2 0 - optional


Imass - input mass
If this parameter is missing the program defaults to 1.0.

The parameter should be owned by whatever task ENERGYmngr registers as and the permissions should be set for indirect update by users and unconditional for the owner.

This parameter is used by the calculations in tandem mode. The relationship between this parameter and comm3 is checked in SSAMS mode but it is not used by the calculations.

See the ENERGY CALCULATION FORMULAE section of the manual page for more information.

comm3 0 - optional


Omass - output mass
If this parameter is missing the program defaults to 1.0.

The parameter should be owned by whatever task ENERGYmngr registers as and the permissions should be set for indirect update by users and unconditional for the owner.

This parameter is used by the calculations in tandem mode. The relationship between this parameter and comm2 is checked in SSAMS mode but it is not used by the calculations.

See the ENERGY CALCULATION FORMULAE section of the manual page for more information.

comm4 0 - optional


Ichg - input charge state (usually -1)
If this parameter is missing the program defaults to -1.0.
This is only used in tandem mode.

The parameter should be owned by whatever task ENERGYmngr registers as and the permissions should be set for indirect update by users and unconditional for the owner.

comm5 0 - optional


Ochg - output charge state
If this parameter is missing the program defaults to 1.0.

The parameter should be owned by whatever task ENERGYmngr registers as and the permissions should be set for indirect update by users and unconditional for the owner.

comm6 0 - optional


Elost - energy loss via the stripper
If this parameter is missing the program defaults to 0.0.

This parameter should be positive and scaled in KeV.

The parameter should be owned by whatever task ENERGYmngr registers as and the permissions should be set for indirect update by users and unconditional for the owner.

read1 0 - optional


ion source S1 injection voltage in KV

ENERGYmngr internally scales this parameter to MeV.

read2 0 - optional


ion source S2 injection voltage in KV

ENERGYmngr internally scales this parameter to MeV.

read3 0 - optional


ion source S3 injection voltage in KV

ENERGYmngr internally scales this parameter to MeV.

read4 0 - optional


ion source S4 injection voltage in KV

ENERGYmngr internally scales this parameter to MeV.

read5 0 - required


GVM - terminal voltage in MV

resp1 0 - required


TotInjE - total injected particle energy

If this parameter is missing no calculation will be performed.

resp2 0 - required


TotMachE - total energy added by machine

If this parameter is missing no calculation will be performed.

resp3 0 - required


TotPartE - total of injected and machine energy

If this parameter is missing no calculation will be performed.

const1 0


This parameter determines the style of energy calculations performed by ENERGYmngr.

If it is missing the program defaults to tandem calculations.

0 = tandem calculations
1 = single ended calculations
2 = SSAMS calculations

See the ENERGY CALCULATION FORMULAE section of the manual page for more information.

const2 0


If missing or if present and value is 0 then energy calculations are in MeV.

If present and value is 1 then energy calculations are in KeV.

Configuration Group 2 name usage

This group is used for the spark counter function.

comm1 0 - required


The lower limit for the terminal voltage.

This parameter should have the same range and scaling as the GVM parameter (CFG1 read5).

The parameter should be owned by whatever task ENERGYmngr registers as and the permissions should be set for indirect update by users and unconditional for the owner.

comm2 0 - required


The maximum spark limit.

The parameter should be owned by whatever task ENERGYmngr registers as and the permissions should be set for indirect update by users and unconditional for the owner.

comm3 0 - required


Spark counter enable.

0.0 = disable spark counting
1.0 = enable spark counting

The parameter should be owned by whatever task ENERGYmngr registers as and the permissions should be set for indirect update by users and unconditional for the owner.

comm4 0 - required


Spark counter reset.

0.0 = nop
1.0 = reset the spark counter system

The parameter should be owned by whatever task ENERGYmngr registers as and the permissions should be set for indirect update by users and unconditional for the owner.

resp1 0 - required


The spark count.

resp2 0 - required


Spark counter limit status.

1.0 = ok (below limit)
0.0 = over spark limit

The parameter should be owned by whatever task ENERGYmngr registers as and the permissions should be set for direct update for the owner.

Note that "traditional" behavior of this parameter may be changed by using the const1 0 parameter listed below.

resp3 0 - optional


Spark in progress interlock.

0.0 = spark in progress
1.0 = ok

The parameter should be owned by whatever task ENERGYmngr registers as and the permissions should be set for direct update for the owner.

int0 0 - optional


The spark counter window.

If the Label and RefName fields are NULL the value is taken from the Preset field. If the Label and RefName fields are non NULL and the name of a valid database parameter the value is taken from the db.

If the entry is missing from the config file it defaults to 0.1.

const1 0


This parameter determines the polarity of the spark counter limit status parameter (g2,resp2,0).

If it is missing the program defaults to the behavior described above.

When the parameter is present and the Preset field is set to 1.0 the spark counter limit status output is reversed to produce "traditional" behavior.

0 = behave normally (new behavior)
0.0 = exceeded spark count limit

1.0 = ok

1 = reverse polarity (traditional behavior)
1.0 = exceeded spark count limit

0.0 = ok

Configuration Group 3 name usage

This group is used for the spark interlock function.

comm1 0 - required


The desired terminal voltage.

Many times this is the TRV control for the TPS (or equivalent).

resp1 0 - required


Spark in progress interlock.

0.0 = spark in progress
1.0 = ok

The parameter should be owned by whatever task ENERGYmngr registers as and the permissions should be set for direct update for the owner.

int0 0 - optional


The spark interlock lower limit percentage.

If the Label and RefName fields are NULL the value is taken from the Preset field. If the Label and RefName fields are non NULL and the name of a valid database parameter the value is taken from the db. If the entry is missing the value defaults to 50%.

The parameter should be owned by whatever task ENERGYmngr registers as and the permissions should be set for indirect update for the users and unconditional update for the owner.

int1 0 - optional


The spark interlock upper limit percentage.

If the Label and RefName fields are NULL the value is taken from the Preset field. If the Label and RefName fields are non NULL and the name of a valid database parameter the value is taken from the db. If the entry is missing the value defaults to 80%.

The parameter should be owned by whatever task ENERGYmngr registers as and the permissions should be set for indirect update for the users and unconditional update for the owner.

Energy Calculation Formulae

The energy calculations may be performed in three possible ways: tandem, single, or ssams. The const1 configuration parameter is used to decide which mode to use when performing calculations. The calculation mode is printed to stderr when ENERGYmngr is started.

variable names


SrcV = total injection voltage
Gvm = accelerator terminal voltage
InjE = total injection energy
TotalE = total particle energy
Elost = particle energy lost by stripper
Icharge = input charge state
Ocharge = output charge state
Imass = input mass
Omass = output mass
MVconv = 1e-3 (convert to MV from KV)

Tandem mode


InjE = (SrcV * MVconv) * fabs(Icharge)
MachE = (Gvm * fabs(Icharge) * (Omass/Imass)) + (Gvm * Ocharge) - Elost
TotalE = (InjE * (Omass/Imass)) + MachE

When new values for Omass or Imass are entered the new value is tested to make sure the relationship Omass <= Imass is maintained.

Single ended mode


InjE = SrcV * MVconv * Ocharge
MachE = Gvm * Ocharge
TotalE = InjE + MachE

No relationship testing of Omass or Imass is performed since these values are not used by the calculations.

SSAMS mode


InjE = SrcV * MVconv * Ocharge
MachE = Gvm * Ocharge
TotalE = InjE + MachE

When new values for Omass or Imass are entered the new value is tested to make sure the relationship Omass <= Imass is maintained.

Omass or Imass are not used by the energy calculations. However, these parameters may be used in other places within AccelNET such as the bending magnet calculations. ENERGYmngr checks the relationship as a convenience to make sure other parts of the system behave sensibly.

Spark Counter Operation

The spark counter function provides a way to keep track of the number of accelerator sparks. It does this by comparing the GVM to a threshold value.

When the GVM (CFG1 read5) rises above the threshold value (comm1) the counter is armed.

If the GVM falls below the threshold minus a window value (int0) the spark counter is incremented and the counter is disarmed until the GVM again rises above the threshold value.

For example:

Starting values are: GVM = 1.9 MV, threshold = 2.0 MV, window = 0.5 MV

The GVM rises to 2.1 MV, the counter is "armed".

The accelerator sparks and the GVM falls to 1.4 MV, the counter is "disarmed" and count is incremented.

The cycle begins again when the GVM rises above 2.0 MV.

Spark counting is enabled by the setting of the enable parameter (comm3). The counter may be reset by the reset parameter (comm4).

The number of sparks in kept in a counter (resp1). If the number of sparks exceeds the spark limit (comm2), the spark limit parameter (resp2) is set.

Spark Interlock Operation

The spark interlock function provides an output which is always active, i.e. it is not affected by enabling or disabling it like the spark counter.

The motivation for inventing this is DMANserv_v2(8) . We need to have a spark-in-progress signal which always active because it can be disabled from within the DMAN system.

The group1 read5 parameter (GVM) is used for the terminal voltage.

The behavior of the resp1 parameter is very similiar to the spark counter’s resp3 parameter.

The difference is that spark counter uses a threshold control (g2 comm1) and a window for it’s operation while the spark interlock uses the TRV and calculates it’s spark interlock threshold and rearming threshold as a percentage of the current TRV setting.

The spark threshold and the rearming threshold percentages may be changed using the int0 and int1 parameters.

Note that the program enforces limits which prevent the thresholds from being less than 5 percent of each other.

Configuration Example

This example shows the configuration for an accelerator with two ion sources and the spark counter function.

#
#    Energy Manager
#
# group 1
#
ENERGYmngr|g1|comm1 |0|SETUP |SrcSel |
ENERGYmngr|g1|comm2 |0|SETUP |Ispecies|
ENERGYmngr|g1|comm3 |0|SETUP |Ospecies|
ENERGYmngr|g1|comm5 |0|SETUP |ChgState|
ENERGYmngr|g1|comm6 |0|SETUP |Elost |
#
ENERGYmngr|g1|read1 |0|INJ S1-1|TotInjV |
ENERGYmngr|g1|read2 |0|INJ S2-1|TotInjV |
ENERGYmngr|g1|read5 |0|TPS TK-1|GvmVR |
#
ENERGYmngr|g1|resp1 |0|SETUP |TotInjE |
ENERGYmngr|g1|resp2 |0|SETUP |TotMachE|
ENERGYmngr|g1|resp3 |0|SETUP |TotPartE|
#
# group 2
#
ENERGYmngr|g2|comm1 |0|SETUP |SparkThr|
ENERGYmngr|g2|comm2 |0|SETUP |SparkLim|
ENERGYmngr|g2|comm3 |0|SETUP |EnableSC|
ENERGYmngr|g2|comm4 |0|SETUP |ResetSC |
#
ENERGYmngr|g2|resp1 |0|SETUP |SparkCnt|
ENERGYmngr|g2|resp2 |0|SETUP |LimitSR |
#
ENERGYmngr|g2|int0 |0|NULL |NULL |0.5

Notes

ENERGYmngr writes complaints in the log file about missing parameters. If the calculations don’t seem to work check the config file as well as checking dbman’s log file (in case write permissions are wrong or the limits are too low).

Some of the parameters in group2 and group3 are listed as required. However, they are only "required" if you want to use the spark counter and spark interlock functions. At this time messages are printed in the log file if they are missing. If you aren’t using the spark counter etc. then ignore the messages.

See Also

libmngr(3mngr)

Manual page revision

$Id: ENERGYmngr.8,v 1.24 2008/10/23 14:50:56 kitchen Exp $


Table of Contents