Position Proportional (POSP)
This information applies to the
CompactLogix
5370, ControlLogix
5570, Compact GuardLogix
5370, GuardLogix
5570, Compact GuardLogix
5380, CompactLogix
5380, CompactLogix
5480, ControlLogix
5580, and GuardLogix
5580 controllers.The Position Proportional (POSP) instruction opens or closes a device by pulsing open or close contacts at a user defined cycle time with a pulse width proportional to the difference between the desired and actual positions.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
POSP(POSP_tag)
Operands
Function Block
Operand | Type | Format | Description |
POSP tag | POSITION_PROP | Structure | POSP structure |
Structured Text
Operand | Type | Format | Description |
block tag | POSITION_PROP | Structure | POSP structure |
See
Structured Text Syntax
for more information on the syntax of expressions within structured text.POSITION_PROP Structure
Input Parameter | Data Type | Description |
---|---|---|
EnableIn | BOOL | Enable input. If false, the instruction does not execute and outputs are not updated.
Default is true. |
SP | REAL | Setpoint. This is the desired value for the position. This value must use the same engineering units as Position.
Valid = any float
Default = 0.0 |
Position | REAL | Position feedback. This analog input comes from the position feedback from the device.
Valid = any float
Default = 0.0 |
OpenedFB | BOOL | Opened feedback. This input signals when the device is fully opened. When true, the open output is not allowed to turn on.
Default is false. |
ClosedFB | BOOL | Closed feedback. This input signals when the device is fully closed. When true, the close output is not allowed to turn on.
Default is false. |
PositionEUMax | REAL | Maximum scaled value of Position and SP.
Valid = any float
Default = 100.0 |
PositionEUMin | REAL | Minimum scaled value of Position and SP.
Valid = any float
Default = 0.0 |
CycleTime | REAL | Period of the output pulse in seconds. A value of zero clears both OpenOut and CloseOut. If this value is invalid, the instruction assumes a value of zero and sets the appropriate bit in Status.
Valid = any positive float
Default = 0.0 |
OpenRate | REAL | Open rate of the device in %/second. A value of zero clears OpenOut. If this value is invalid, the instruction assumes a value of zero and sets the appropriate bit in Status.
Valid = any positive float
Default = 0.0 |
CloseRate | REAL | Close rate of the device in %/second. A value of zero clears CloseOut. If this value is invalid, the instruction assumes a value of zero and sets the appropriate bit in Status.
Valid = any positive float
Default = 0.0 |
MaxOnTime | REAL | Maximum time in seconds that an open or close pulse can be on. If OpenTime or CloseTime is calculated to be larger than this value, they are limited to this value. If this value is invalid, the instruction assumes a value of CycleTime and sets the appropriate bit in Status.
Valid = 0.0 to CycleTime
Default = CycleTime |
MinOnTime | REAL | Minimum time in seconds that an open or close pulse can be on. If OpenTime or CloseTime is calculated to be less than this value, they are set to zero. If this value is invalid, the instruction assumes a value of zero and sets the appropriate bit in Status.
Valid = 0.0 to MaxOnTime
Default = 0.0 |
Deadtime | REAL | Additional pulse time in seconds to overcome friction in the device. Deadtime is added to the OpenTime or CloseTime when the device changes direction or is stopped. If this value is invalid, the instruction sets the appropriate bit in Status and uses a value of Deadtime = 0.0.
Valid = 0.0 to MaxOnTime
Default = 0.0 |
Output Parameter | Data Type | Description |
---|---|---|
EnableOut | BOOL | Indicates if instruction is enabled. Cleared to false if PositionPercent overflows. |
OpenOut | BOOL | This output is pulsed to open the device. |
CloseOut | BOOL | This output is pulsed to close the device. |
PositionPercent | REAL | Position feedback is expressed as percent of the Position span. |
SPPercent | REAL | Setpoint is expressed as percent of the Position span. |
OpenTime | REAL | Pulse time in seconds of OpenOutput for the current cycle. |
CloseTime | REAL | Pulse time in seconds of CloseOutput for the current cycle. |
Status | DINT | Status of the function block. |
InstructFault (Status.0) | BOOL | The instruction detected one of the following execution errors. This is not a minor or major controller error. Check the remaining status bits to determine what occurred. |
CycleTimeInv (Status.1) | BOOL | Invalid CycleTime value. The instruction uses zero. |
OpenRateInv (Status.2) | BOOL | Invalid OpenRate value. The instruction uses zero. |
CloseRateInv (Status.3) | BOOL | Invalid CloseRate value. The instruction uses zero. |
MaxOnTimeInv (Status.4) | BOOL | Invalid MaxOnTime value. The instruction uses the CycleTime value. |
MinOnTimeInv (Status.5) | BOOL | Invalid MinOnTime value. The instruction uses zero. |
DeadtimeInv (Status.6) | BOOL | Invalid Deadtime value. The instruction uses zero. |
PositionPctInv (Status.7) | BOOL | The calculated PositionPercent value is out of range. |
SPPercentInv (Status.8) | BOOL | The calculated SPPercent value is out of range. |
PositionSpanInv (Status.9) | BOOL | PositionEUMax = PositionEUMin. |
Description
The POSP instruction usually receives the desired position setpoint from a PID instruction output.
Scaling the Position and Setpoint Values
The PositionPercent and SPPercent outputs are updated each time the instruction is executed. If either of these values is out of range (less than 0% or greater than 100%), the appropriate bit in Status is set, but the values are not limited. The instruction uses these formulas to calculate whether the values are in range:
How the POSP Instruction Uses the Internal Cycle Timer
The instruction uses CycleTime to determine how often to recalculate the duration of Open and Close output pulses. An internal timer is maintained and updated by DeltaT. DeltaT is the elapsed time since the instruction last executed. Whenever the internal timer equals or exceeds the programmed CycleTime (cycle time expires) the Open and Close outputs are recalculated.
You can change the CycleTime at any time.
If CycleTime = 0, the internal timer is cleared to 0, OpenOut is cleared to false and CloseOut is cleared to false.
Producing Output Pulses
The following diagram shows the three primary states of the POSP instruction.
Calculating Open and Close Pulse Times
OpenOut is pulsed whenever SP > Position feedback. When this occurs, the instruction sets CloseTime = 0 and the duration for which OpenOut is to be turned on is calculated as:
If OpenTimen-1 < CycleTime, then add Deadtime to OpenTime.
If OpenTime > MaxOnTime, then limit to MaxOnTime.
If OpenTime < MinOnTime, then set OpenTime = 0.
If any of the following conditions exist, OpenOut is not pulsed and OpenTime = 0.
OpenFB is true or PositionPercent 100
CycleTime = 0
OpenRate = 0
SPPercent is invalid
The CloseOut is pulsed whenever SP < Position feedback. When this occurs, the instruction sets OpenTime = 0 and the duration for which CloseOut is to be turned on is calculated as:
If CloseTimen-1 < CycleTime, then add Deadtime to CloseTime.
If CloseTime > MaxOnTime, then limit to MaxOnTime.
If CloseTime < MinOnTime, then set CloseTime to 0.
If any of the following conditions exist, CloseOut will not be pulsed and CloseTime will be cleared to 0.0.
ClosedFB is true or PositionPercent 0
CycleTime = 0
CloseRate = 0
SPPercent is invalid
OpenOut and CloseOut will not be pulsed if SPPercent equals PositionPercent. Both OpenTime and CloseTime will be cleared to false.
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. See
Common Attributes
for operand-related faults.Execution
Function Block
Condition/State | Action Taken |
---|---|
Prescan | EnableIn and EnableOut bits are cleared to false. |
Tag.EnableIn is false | EnableIn and EnableOut bits are cleared to false. |
Tag.EnableIn is true | EnableIn and EnableOut bits are set to true.
The instruction executes. |
Instruction first run | N/A |
Instruction first scan | OpenTime and CloseTime are cleared to 0.0. |
Postscan | EnableIn and EnableOut bits are cleared to false. |
Structured Text
Condition/State | Action Taken |
---|---|
Prescan | See Prescan in the Function Block table. |
Normal Execution | See Tag.EnableIn is true in the Function Block table. |
Postscan | See Postscan in the Function Block table. |
Examples
Example 1
In this example, the POSP instruction opens or closes a motor-operated valve based on the CVEU output of the PIDE instruction. The actual valve position is wired into the Position input and optional limit switches, which show if the valve is fully opened or closed, are wired into the OpenedFB and ClosedFB inputs. The OpenOut and CloseOut outputs are wired to the open and close contacts on the motor-operated valve.
Function Block
Structured Text
FlowController.PV := WaterFlowRate;
PIDE(FlowController);
FlowValve.SP := FlowController.CVEU;
FlowValve.Position := FlowValvePosition;
FlowValve.OpenedFB := FlowValveOpened;
FlowValve.ClosedFB := FlowValveClosed;
POSP(FlowValve);
OpenFlowValveContact := FlowValve.OpenOut;
CloseFlowValveContact := FlowValve.CloseOut;
Provide Feedback