pytunelogix
pytunelogix copied to clipboard
Python PID Tuner with an additional PID Simulator and CSV Logger
pytunelogix
Python PID Tuner for ControlLogix
Windows Exe (no install required) -> https://github.com/Destination2Unknown/pytunelogix/releases
To install use:
pip install pytunelogix
PID tuning in 4 Steps:
A-> Record PRC using Logger
B-> Tune using PID Tuner
C-> Refine tune using PID Simulator
D-> Test tune with FOPDT Simulator for Logix PLC
To use, create a launch file:
examplelaunch.pyw #use pyw for no console
PID Logger

To launch, use:
from pytunelogix.pidlogger import clxlogger
clxlogger.main()
Stage 1 - PID Tuner based on a CSV file of a Process Reaction Curve (PRC)
Notes and Limitations:
Assumes CV and PV data stored at 100ms intervals.
Assumes there is a single step in CV.
Ambient is calculated as an average of the PV prior to the step change.
Doesn't work correctly with a ramp in CV or with multiple CV steps.
N.B.
The PID tuning values are calculated for a PV with a standard range span of 100 in engineering units (e.g. 0-100 deg C or 50-150 deg F).
If the range of the PV has a different span the PID tuning values may need to be rescaled:Example 1: PV range of 200-400 deg C -> PID Gains x2 Example 2: PV range of 75-100 deg C -> PID Gains x0.25
To launch, use:
from pytunelogix.stage1 import csvtuner
csvtuner.main()
Direct Acting:
Reverse Acting:
Stage 2 - Open loop tune
https://user-images.githubusercontent.com/92536730/175918442-017d18a0-0bac-434d-aa44-b8cd3aebe231.mp4
Premium Feature - https://github.com/sponsors/Destination2Unknown
Stage 3 - Closed loop tune
https://user-images.githubusercontent.com/92536730/175920990-3fc2cb66-9d08-4c67-aff7-ff410345f9a5.mp4
Premium Feature - https://github.com/sponsors/Destination2Unknown
Stage 4 - Adaptive tuner
https://user-images.githubusercontent.com/92536730/175921177-86389b8f-2d3c-4dc7-8949-db4cdd782d84.mp4
Premium Feature - https://github.com/sponsors/Destination2Unknown
PID Simulator
Direct Acting:
Reverse Acting:
To launch, use:
from pytunelogix.simulate import simulator
simulator.main()
ControlLogix FOPDT Process Simulator (PID Simulator)
Simulates a Process:

Direct Acting:
Reverse Acting:
To launch, use:
from pytunelogix.clxpidsim import clxsim
clxsim.main()
Windows Standalone Exe: