Libraries - ControlLib


ControlLib contains various automatic control related procedures.

PID

The PID procedure is a PID implementation on velocity form with support for tracking, feedforward, auto/manual mode, setpoint weighting, maximum derivative gain, dynamic execution time, and bumpless parameter and mode changes.

Datatype Direction Default Description
Signals
PV Real in 0 Process Value, the measurement value for the process.
SP Real in 0 SetPoint, the reference value.
TR Real in 0 TRacking signal, the actually actuated control signal in the previous scan cycle.
MV Real out - Manipulated Variable, the control signal.
FF Real in 0 FeedForward, an external signal added to the control signal.
Man Real in 0 Manual, the control signal when in manual mode.
Controller Parameters
K Real in 1 Controller gain.
Ti Real in 20 Controller integral time.
Td Real in 0 Controller derivative time.
Nd Real in 8 Maximum derivative gain. Usually called N but that is a reserved word in JGrafchart.
b Real in 1 Setpoint weight for the P-part.
execFreq Int in 1 Execution Frequency, the PID controller sample time is execFreq times the calling Grafchart application's scan cycle time.
Interaction
useFF Bool in 0 Signal to turn feedforward on/off.
manualMode Bool in 0 Signal to turn manual mode on/off.
stop Bool in 0 Signal to terminate the procedure call and thus stop executing the PID controller.

PID_Pos

The PID_Pos procedure is a PID implementation on positional form with support for tracking, setpoint weighting, maximum derivative gain, and dynamic execution time. The parameters are the same as for the PID procedure except that those related to feedforward and auto/manual mode are missing.