man8/PIDmngr_v2

Table of Contents

Name

PIDmngr_v2 - general regulation loop manager version 2

Synopsis

PIDmngr_v2 <argument list>

Description

The program registers with dbman as PIDmngr. This is the same taskname used by PIDmngr(8) . It’s done this way to hopefully keep things simpler.

Arguments

Argument processing is done using Unix long argument syntax.
--mngr <fn>

The pathname to 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 <pn>

The program name to use when processing the CONFLIST file.

If this is not specified it defaults to "PIDmngr_v2".

--show_tbl

Print the contents of the CONFLIST table to stderr after it is loaded.
--diag

If the program is started in this mode stdout and stdin are left open and signals are set so the program may be killed by SIGINT.

This argument is useful when setting up the parameters for the regulation loop(s) because it makes it very easy to kill and restart the program after changing the config file.

--verbose=<n>

Normally the program does it’s work silently. This sets the level of logging information. The numberand restart 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

2 - print signon msg, option settings, loop setup info

--help

Print the help message to stderr and exit.

Parameter scaling information

The regulation loops operate internally on input and output values which have been normalized to between -1.0 and 1.0.

Parameters in the configuration file where this type of scaling is necessary use the Preset field in the configuration file as the full scale value for performing the conversion.

For example, using the type 1 regulation loop to control a bending magnet requires a field strength control (comm1), a field reading from a device such as a hall probe (resp1), and a current control (ctl1).

In our example the hall probe controller has a range of +/- 30KG, and the power supply can provide 60A maximum which is capable of exciting the magnet to approximently 15KG.

The field strength control is a virtual parameter (i.e. not associated with hardware) so PhyMin and PhyMax are set as appropriate, in this case 0 to 15KG.

Our first problem is to set the configuration so that the cmd and feedback elements are scaled in the same way. That is we want to scale both of them so that most of the positive internal parameter range of 0.0 to 1.0 is used.

Since the magnet is only capable of 15KG maximum it seems this is a likely number to use so we set the Preset fields for comm1 and resp1 to 15000.

The output variable is easy, 60 amperes is the power supply maximum and corresponds to 15KG so we set the Preset field for ctl1 to 60.

Configuration name usage

One Group is assigned for each regulation loop to be managed.

Parameters listed as required must be present in the config file for PIDmngr_v2 to operate on the group.

Parameters listed as optional are not required and will be ignored or overridden by defaults as appropriate.

Shared regulation loop Configuration names

file1 0 - required

The type of regulation loop to be used.

The usage of all other parameters is dependent on regulation loop type. See the appropriate filter section below.

Type 1 regulation loop


Type1 has been removed.

Type 2 regulation loop setup configuration name usage

Put "type2" in the file1 Label field to use this loop.

The int0 function group is used for parameters related to the operation of the regulation loop.

The loop parameters all use int1 as the function name.

Index fields within the function are assigned to the filter parameters. Names such as Index0 are used in the manual page for clarity and should be replaced with the integer value in the MNGRconf file, i.e. Index0 is replaced with 0.

All setup parameters may be entered with or without a corresponding database parameter.

If there is no database parameter, i.e. the label and refname fields are set to NULL, the value of the Preset field is used as the value of the parameter.

If there is a database parameter, i.e. the label and refname fields are set to a valid parameter tag name, the value from the AccelNET database is used and the Preset field is ignored.

If a database parameter is used the control key should be set to RSet and the parameter should be owned whatever task PIDmngr_v2 registers as and the permissions should be set for direct update by users and direct update for the owner.

comm1 0 - required


The command variable.

The control key should be set to RSet.

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

See the section "Parameter scaling information" above.

comm2 0 - optional


Loop enable control.

0.0 - off
1.0 - on

The control key should be set to IncN.

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

comm3 0 - optional


Clear loop parameters.

0.0 - nop
1.0 - clear

The control key should be set to Mom.

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

resp1 0 - optional


The feedback loop status.

0.0 - off
1.0 - in limits
2.0 - tune
3.0 - timeout (and still tuning)
4.0 - not used
5.0 - not used
6.0 - not used
7.0 - error

Usually this parameter is named TuneSR in the database.

The control key should be set to RSet.

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

resp2 0 - optional


The difference between the feedback and the command variable.

Many times this control is named Delta?? in the database. For example, DeltaG might be used in the case of a regulation loop for a bending magnet.

The control key should be set to RSet.

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

PhyMin, PhyMax, SpanMin, and SpanMax should be set to a value large enough to handle the maximum difference between the cmd input (comm1) and the feadback input (read1).

read1 0 - required


The feedback variable.

Ownership and permissions for the parameter do not matter and should be set as appropriate for the I/O manager obtaining the information from the hardware.

See the section "Parameter scaling information" above.

read2 - optional


Interlock inputs.

Two interlock inputs are provided. Index0 is input 1 and Index1 is input 2.

If either of these parameters are present then the current value is tested against the preset field and if they don’t match the tuning loop is inhibited.

Ownership and permissions for the parameter do not matter and should be set as appropriate for the I/O manager obtaining the information from the hardware.

ctl1 0 - required


The command output.

The parameter should be writable by whatever task PIDmngr_v2 registers as.

See the section "Parameter scaling information" above.

int0 - optional

This group of parameters is global to the loop.

Index0 - deadband

Each time the regulation loop is processed the difference between cmd and feedback is calculated (resp2). If the absolute value of the difference is less than the value of deadband the tune status(resp1) is set to "nop" and nothing else is done.

If the difference is greater than deadband then tune status is set to "tune" and a correction is calculated.

This parameter is a positive quantity scaled in database units.

The parameter range is 0.0 to 10000.0.

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

Index1 - tune timeout time

The amount of time the loop will attempt to tune before setting the TuneSR (resp1) to timeout.

If the timeout value is exceeded the loop will continue to tune but the TuneSR value will indicate a timeout.

Index2 - sampling rate

The amount of time between passes of the regulation loop. The value is in seconds.

The parameter range is 1.0 to 60.0.

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

int1 - optional

This group of parameters applies to the filters used by the loop.

Index0 - frequency

This parameter is scaled in millihertz.

It specifies the crossover frequency between the integrator and the differentiator.

The range is 0.0 to 1000.0.

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

Index1 - integral gain

The parameter range is 0.0 to 1000.0.

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

Index2 - derivative gain

The parameter range is 0.0 to 1000.0.

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

Type BM regulation loop setup configuration name usage

This regulation loop is tailered to the needs of a bending magnet power supply and hall probe system.

Put "type_bm" in the file1 Label field to use this loop.

The int0 function group is used for parameters related to the operation of the regulation loop.

The parameters for the filters used by the loop all use int1 as the function name.

Index fields within the function are assigned to the filter parameters. Names such as Index0 are used in the manual page for clarity and should be replaced with the integer value in the MNGRconf file, i.e. Index0 is replaced with 0.

All setup parameters may be entered with or without a corresponding database parameter.

If there is no database parameter, i.e. the label and refname fields are set to NULL, the value of the Preset field is used as the value of the parameter.

If there is a database parameter, i.e. the label and refname fields are set to a valid parameter tag name, the value from the AccelNET database is used and the Preset field is ignored.

If a database parameter is used the control key should be set to RSet and the parameter should be owned whatever task PIDmngr_v2 registers as and the permissions should be set for direct update by users and direct update for the owner.

comm1 - required


The command variable.

The control key should be set to RSet.

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

See the section "Parameter scaling information" above.

comm2 0 - optional


Loop enable control.

0.0 - off
1.0 - on

The control key should be set to IncN.

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

comm3 0 - optional


Clear loop parameters.

0.0 - nop
1.0 - clear

The control key should be set to Mom.

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

resp1 0 - optional


The feedback loop status.

0.0 - off
1.0 - in limits
2.0 - tune
3.0 - timeout (and still tuning)
4.0 - in limits and sleeping
5.0 - out of limits and sleeping
6.0 - not used
7.0 - error

Usually this parameter is named TuneSR in the database.

The control key should be set to RSet.

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

resp2 0 - optional


The difference between the feedback and the command variable.

Many times this control is named Delta?? in the database. For example, DeltaG might be used in the case of a regulation loop for a bending magnet.

The control key should be set to RSet.

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

PhyMin, PhyMax, SpanMin, and SpanMax should be set to a value large enough to handle the maximum difference between the cmd input (comm1) and the feadback input (read1).

resp3 0 - optional


The countdown timer variable.

Many times this control is named CntDown in the database.

The control key should be set to RSet.

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

PhyMin, PhyMax, SpanMin, and SpanMax should be set to a value large enough to handle the maximum timer value entered into the int0 index3 parameter.

read1 0 - required


The feedback variable.

Ownership and permissions for the parameter do not matter and should be set as appropriate for the I/O manager obtaining the information from the hardware.

See the section "Parameter scaling information" above.

read2 0 - optional


Interlock inputs.

Two interlock inputs are provided. Index0 is input 1 and Index1 is input 2.

If this parameter is present then the current value is tested against the preset field and if they don’t match the tuning loop is inhibited.

Ownership and permissions for the parameter do not matter and should be set as appropriate for the I/O manager obtaining the information from the hardware.

ctl1 0 - required


The command output.

The parameter should be writable by whatever task PIDmngr_v2 registers as.

See the section "Parameter scaling information" above.

int0 - optional

This group of parameters is global to the loop.

Index0 - deadband

Each time the regulation loop is processed the difference between cmd and feedback is calculated (resp2). If the absolute value of the difference is less than the value of deadband the tune status(resp1) is set to "nop" and nothing else is done.

If the difference is greater than deadband then tune status is set to "tune" and a correction is calculated.

This parameter is a positive quantity scaled in database units.

The parameter range is 0.0 to 10000.0.

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

Index1 - sleep deadband

The deadband value to use when the loop is sleeping.

This takes care of situations where the BM needs to be tuned as precisely as possible but after the loop goes to sleep the BM may be allowed to be inside of a larger deadband without the tune status read, i.e. resp1 indicating "out of limits and sleeping".

If this parameter is not present the deadband_sleep value is set to the same value as the tuning deadband.

Index2 - tune timeout time

The amount of time the loop will attempt to tune before setting the TuneSR (resp1) to timeout.

If the timeout value is exceeded the loop will continue to tune but the TuneSR value will indicate a timeout.

Index3 - sleep countdown time

The amount of time to wait before the loop goes to sleep after going in limit.

Index4 - sampling rate

The amount of time between passes of the regulation loop. The value is in seconds.

The parameter range is 1.0 to 60.0.

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

Index5 - feedback mode

If this parameter is present and the value is 1 then the absolute value of the feedback input is used.

This is meant to be used with switching magnets where the power supply has a polarity switch and the current control is always positive.

Index6 - wakeup countdown time

The amount of time to wait before waking up the loop if it drifts out of limit while sleeping.

int1 - optional

This group of parameters applies to the filters used by the loop.

Index0 - frequency

This parameter is scaled in millihertz.

It specifies the crossover frequency between the integrator and the differentiator.

The range is 0.0 to 1000.0.

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

Index1 - integral gain

The parameter range is 0.0 to 1000.0.

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

Index2 - derivative gain

The parameter range is 0.0 to 1000.0.

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

Type BB regulation loop setup configuration name usage

This regulation loop is for use with "bang-bang" type devices.

This means devices where there isn’t any kind of linear device to control such as a power supply. Instead, the devices meant to be controlled by this loop use some sort of increment/decrement control.

An example might be a vacuum chamber where it is desired to regulate the pressure in the chamber.

In this case the feedback input would be a vacuum read such as a manometer or thermocouple guage and the control would be a 3 way valve where one port of the valve is connected to a vacuum pump, and the second port is connected to a source of gas to fill the chamber.

The valve should be capable of three states: "closed", "empty", or "fill".

Put "type_bb" in the file1 Label field to use this loop.

The int0 function group is used for parameters related to the operation of the regulation loop.

There aren’t any filter parameters at this time however int1 is reserved in case we want to add something later.

int2 is used to provide the appropriate values for the closed, empty, and fill states of the control.

Index fields within the function are assigned to the regulation loop parameters. Names such as Index0 are used in the manual page for clarity and should be replaced with the integer value in the MNGRconf file, i.e. Index0 is replaced with 0.

All setup parameters may be entered with or without a corresponding database parameter.

If there is no database parameter, i.e. the label and refname fields are set to NULL, the value of the Preset field is used as the value of the parameter.

If there is a database parameter, i.e. the label and refname fields are set to a valid parameter tag name, the value from the AccelNET database is used and the Preset field is ignored.

If a database parameter is used the control key should be set to RSet and the parameter should be owned whatever task PIDmngr_v2 registers as and the permissions should be set for direct update by users and direct update for the owner.

comm1 - required


The command variable.

The control key should be set to RSet.

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

The note in the "Parameter scaling information" section above pertaining to the use of the Preset field does not apply here.

comm2 0 - optional


Loop enable control.

0.0 - off
1.0 - on

The control key should be set to IncN.

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

comm3 0 - optional


Clear loop parameters.

0.0 - nop
1.0 - clear

The control key should be set to Mom.

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

resp1 0 - optional


The feedback loop status.

0.0 - off
1.0 - in limits
2.0 - tune
3.0 - timeout (and still tuning)
4.0 - not used
5.0 - not used
6.0 - not used
7.0 - error

Usually this parameter is named TuneSR in the database.

The control key should be set to RSet.

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

resp2 0 - optional


The difference between the feedback and the command variable.

Many times this control is named Delta?? in the database. For example, DeltaP might be used in the case of a pressure regulation loop.

The control key should be set to RSet.

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

PhyMin, PhyMax, SpanMin, and SpanMax should be set to a value large enough to handle the maximum difference between the cmd input (comm1) and the feadback input (read1).

resp3 0 - optional


The countdown timer variable.

Many times this control is named CntDown in the database.

The control key should be set to RSet.

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

PhyMin, PhyMax, SpanMin, and SpanMax should be set to a value large enough to handle the maximum timer value entered into the int0 index3 parameter.

read1 0 - required


The feedback variable.

Ownership and permissions for the parameter do not matter and should be set as appropriate for the I/O manager obtaining the information from the hardware.

The note in the "Parameter scaling information" section above pertaining to the use of the Preset field does not apply here.

read2 0 - optional


Interlock inputs.

Two interlock inputs are provided. Index0 is input 1 and Index1 is input 2.

If this parameter is present then the current value is tested against the preset field and if they don’t match the tuning loop is inhibited.

Ownership and permissions for the parameter do not matter and should be set as appropriate for the I/O manager obtaining the information from the hardware.

ctl1 0 - required


The command output.

The parameter should be writable by whatever task PIDmngr_v2 registers as.

The control should be of a type which expects three possible values:

rest - do nothing
increase - increase the value of whatever is being regulated.
decrease - decrease the value of whatever is being regulated.

See the int2 parameter section below for more information.

int0 - optional

This group of parameters is global to the regulation loop.

Index0 - deadband

Each time the regulation loop is processed the difference between cmd and feedback is calculated (resp2). If the absolute value of the difference is less than the value of deadband the tune status(resp1) is set to "nop" and nothing else is done.

If the difference is greater than deadband then tune status is set to "tune" and a correction is calculated.

This parameter is a positive quantity scaled in database units.

The parameter range is 0.0 to 10000.0.

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

Index1 - tune timeout time

The amount of time the loop will attempt to tune before setting the TuneSR (resp1) to timeout.

If the timeout value is exceeded the loop will continue to tune but the TuneSR value will indicate a timeout.

Index2 - sampling rate

The amount of time between passes of the regulation loop. The value is in seconds.

The parameter range is 0.1 to 60.0.

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

int1 - optional

This group of parameters is not presently in use but is reserved in case we want to add a smoothing filter or something else in the future.

int2 - optional

This group of parameters is used to specify what values to write to the control parameter to perform regulation.

In all cases the value is placed in the Preset field. The Label/RefName can’t be used to associate these parameters with the database.

Index0 - rest value

The default is 0.0
Index1 - decrease value

The default is 1.0
Index2 - increase value

The default is 2.0

Examples

Notes

If a kill -1 is sent to the process, PIDmngr_v2 will dump it’s internal state information to stderr. This was added to help diagnose problems with the pid loop.

See Also

Manual page revision

$Id: PIDmngr_v2.8,v 2.1 2008/07/18 16:04:59 kitchen Exp $


Table of Contents