Dynamic Instrument Controller Setup
Use this skill when an agent must add instruments and controllers to a NeqSim dynamic process model. It documents transmitter selection, controller configuration, valve or equipment manipulation, direct/reverse action checks, and transient validation.
When to Use
- When a dynamic NeqSim model needs level, pressure, temperature, or flow measurement devices.
- When a process valve or unit should be manipulated by a controller during
runTransient().
- When an agent needs to create public controller setup guidance with setpoints, min/max transmitter ranges, and PID parameters.
- When controller event logs and
autoTuneFromEventLog(False) should be used for tuning studies.
Inputs
loop_name: public loop identifier such as LC-001 or PC-001.
controlled_variable: measured variable such as level, pressure, temperature, or flow.
transmitter_target: NeqSim unit or stream that the transmitter measures.
manipulated_equipment: valve or equipment receiving the controller.
setpoint: controller setpoint in the same basis as the transmitter.
minimum_value and maximum_value: transmitter validation range.
reverse_acting: whether controller output decreases when measured value increases.
kp, ti, td: PID parameters for ControllerDeviceBaseClass#setControllerParameters(...).
Outputs
loop_ready: boolean indicator for whether the supplied loop metadata is complete and internally consistent.
transmitter_class: recommended NeqSim transmitter class.
controller_steps: NeqSim API sequence for creating and attaching the control loop.
validation_warnings: missing range, action, setpoint, or tuning issues.
autotune_steps: optional event-log and setpoint-step workflow.
Engineering Method
The Python class DynamicInstrumentControllerModel is a public control-loop setup checker. It does not tune or run NeqSim. It maps a controlled variable to a known NeqSim measurement-device class and validates that the controller metadata is sufficient for a dynamic simulation workflow.
The controller guidance uses NeqSim's dynamic control pattern:
- Create a measurement device for the measured unit or stream.
- Set transmitter minimum and maximum values.
- Create
ControllerDeviceBaseClass.
- Attach the transmitter.
- Set direct or reverse action.
- Set controller setpoint and PID parameters.
- Attach the controller to the manipulated valve or equipment.
- Run transient simulation and inspect response, saturation, and stability.
Python Usage Pattern
from dynamic_instrument_controller_setup import DynamicInstrumentControllerModel
model = DynamicInstrumentControllerModel()
loop = model.evaluate(
loop_name="LC-001",
controlled_variable="level",
transmitter_target="V-001",
manipulated_equipment="LCV-001",
setpoint=0.3,
minimum_value=0.01,
maximum_value=0.99,
reverse_acting=True,
kp=25.8,
ti=400.1,
td=0.0,
)
print(loop.loop_ready)
print(loop.transmitter_class)
print(loop.controller_steps)
NeqSim implementation pattern:
lt01 = ns.process.measurementdevice.LevelTransmitter(v001)
lt01.setMaximumValue(0.99)
lt01.setMinimumValue(0.01)
lc01 = ns.process.controllerdevice.ControllerDeviceBaseClass()
lc01.setTransmitter(lt01)
lc01.setReverseActing(True)
lc01.setControllerSetPoint(0.3)
lc01.setControllerParameters(25.8, 400.1, 0.0)
lcv001.setCalculateSteadyState(False)
lcv001.setController(lc01)
process.add(lt01)
process.run()
process.storeInitialState()
process.runTransient()
Pressure control example:
pt01 = ns.process.measurementdevice.PressureTransmitter(v001.getGasOutStream())
pc01 = ns.process.controllerdevice.ControllerDeviceBaseClass()
pc01.setTransmitter(pt01)
pc01.setReverseActing(False)
pc01.setControllerSetPoint(5.0)
pc01.setControllerParameters(1.0, 2000.0, 0.0)
pcv001.setController(pc01)
Autotuning workflow:
lc01.resetEventLog()
lc01.setControllerSetPoint(0.33)
# run transient steps and collect response
lc01.setControllerSetPoint(0.27)
# run transient steps and collect response
tuned = lc01.autoTuneFromEventLog(False)
print(lc01.getKp(), lc01.getTi(), lc01.getTd())
Validation Checklist
Common Mistakes
| Symptom |
Cause |
Fix |
| Controller drives the valve in the wrong direction |
Reverse/direct action is wrong |
Check process cause and effect, then set setReverseActing(True/False) correctly |
| Pressure rises or falls away from setpoint |
Outlet-valve PI error has the wrong sign |
When increasing controller output opens the gas outlet, use measured pressure minus setpoint so high pressure increases outflow |
| Controller never responds |
Transmitter or controller was not added or attached |
Add the measurement device to the process and attach the controller to manipulated equipment |
| Output saturates at valve limit |
Transmitter range, setpoint, or PID gain is unrealistic |
Check min/max range, setpoint basis, valve opening limits, and PID parameters |
| Autotune gives poor parameters |
Event log does not contain a clear response |
Reset event log, apply deliberate setpoint steps, and run enough transient time |
Limitations
- The Python helper does not run NeqSim and does not replace controller tuning.
- No proprietary control narratives, operating procedures, or safety instrumented functions are included.
- PID parameters are setup metadata, not a guarantee of stable operation.
- Human review is required before engineering or operational decisions.
Related NeqSim Functionality
neqsim.process.measurementdevice.LevelTransmitter — separator/vessel level measurement.
neqsim.process.measurementdevice.PressureTransmitter — pressure measurement on streams or equipment outlets.
neqsim.process.measurementdevice.TemperatureTransmitter and VolumeFlowTransmitter — stream temperature and volume-flow measurements.
neqsim.process.controllerdevice.ControllerDeviceBaseClass — transmitter-based dynamic controller with setpoint, action, PID parameters, response, event log, and autotuning support.
neqsim.process.equipment.valve.ThrottlingValve#setController(...) — attach a controller to a manipulated valve.
neqsim.process.processmodel.ProcessSystem#runTransient() — execute the controlled dynamic process.
In Python these classes are reachable through the neqsim package, for example from neqsim import jneqsim.
References
1---2name: neqsim-dynamic-instrument-controller-setup3description: Set up measurement devices and PID-style controllers for NeqSim dynamic process simulations. USE WHEN: a task needs to add transmitters, controller devices, valve manipulation, setpoints, controller action, and autotuning workflow guidance before runTransient calculations.4---56# Dynamic Instrument Controller Setup78Use this skill when an agent must add instruments and controllers to a NeqSim dynamic process model. It documents transmitter selection, controller configuration, valve or equipment manipulation, direct/reverse action checks, and transient validation.910## When to Use1112- When a dynamic NeqSim model needs level, pressure, temperature, or flow measurement devices.13- When a process valve or unit should be manipulated by a controller during `runTransient()`.14- When an agent needs to create public controller setup guidance with setpoints, min/max transmitter ranges, and PID parameters.15- When controller event logs and `autoTuneFromEventLog(False)` should be used for tuning studies.1617## Inputs1819- `loop_name`: public loop identifier such as `LC-001` or `PC-001`.20- `controlled_variable`: measured variable such as `level`, `pressure`, `temperature`, or `flow`.21- `transmitter_target`: NeqSim unit or stream that the transmitter measures.22- `manipulated_equipment`: valve or equipment receiving the controller.23- `setpoint`: controller setpoint in the same basis as the transmitter.24- `minimum_value` and `maximum_value`: transmitter validation range.25- `reverse_acting`: whether controller output decreases when measured value increases.26- `kp`, `ti`, `td`: PID parameters for `ControllerDeviceBaseClass#setControllerParameters(...)`.2728## Outputs2930- `loop_ready`: boolean indicator for whether the supplied loop metadata is complete and internally consistent.31- `transmitter_class`: recommended NeqSim transmitter class.32- `controller_steps`: NeqSim API sequence for creating and attaching the control loop.33- `validation_warnings`: missing range, action, setpoint, or tuning issues.34- `autotune_steps`: optional event-log and setpoint-step workflow.3536## Engineering Method3738The Python class `DynamicInstrumentControllerModel` is a public control-loop setup checker. It does not tune or run NeqSim. It maps a controlled variable to a known NeqSim measurement-device class and validates that the controller metadata is sufficient for a dynamic simulation workflow.3940The controller guidance uses NeqSim's dynamic control pattern:41421. Create a measurement device for the measured unit or stream.432. Set transmitter minimum and maximum values.443. Create `ControllerDeviceBaseClass`.454. Attach the transmitter.465. Set direct or reverse action.476. Set controller setpoint and PID parameters.487. Attach the controller to the manipulated valve or equipment.498. Run transient simulation and inspect response, saturation, and stability.5051## Python Usage Pattern5253```python54from dynamic_instrument_controller_setup import DynamicInstrumentControllerModel5556model = DynamicInstrumentControllerModel()57loop = model.evaluate(58 loop_name="LC-001",59 controlled_variable="level",60 transmitter_target="V-001",61 manipulated_equipment="LCV-001",62 setpoint=0.3,63 minimum_value=0.01,64 maximum_value=0.99,65 reverse_acting=True,66 kp=25.8,67 ti=400.1,68 td=0.0,69)7071print(loop.loop_ready)72print(loop.transmitter_class)73print(loop.controller_steps)74```7576NeqSim implementation pattern:7778```python79lt01 = ns.process.measurementdevice.LevelTransmitter(v001)80lt01.setMaximumValue(0.99)81lt01.setMinimumValue(0.01)8283lc01 = ns.process.controllerdevice.ControllerDeviceBaseClass()84lc01.setTransmitter(lt01)85lc01.setReverseActing(True)86lc01.setControllerSetPoint(0.3)87lc01.setControllerParameters(25.8, 400.1, 0.0)8889lcv001.setCalculateSteadyState(False)90lcv001.setController(lc01)91process.add(lt01)92process.run()93process.storeInitialState()94process.runTransient()95```9697Pressure control example:9899```python100pt01 = ns.process.measurementdevice.PressureTransmitter(v001.getGasOutStream())101pc01 = ns.process.controllerdevice.ControllerDeviceBaseClass()102pc01.setTransmitter(pt01)103pc01.setReverseActing(False)104pc01.setControllerSetPoint(5.0)105pc01.setControllerParameters(1.0, 2000.0, 0.0)106pcv001.setController(pc01)107```108109Autotuning workflow:110111```python112lc01.resetEventLog()113lc01.setControllerSetPoint(0.33)114# run transient steps and collect response115lc01.setControllerSetPoint(0.27)116# run transient steps and collect response117tuned = lc01.autoTuneFromEventLog(False)118print(lc01.getKp(), lc01.getTi(), lc01.getTd())119```120121## Validation Checklist122123- [ ] Controlled variable is mapped to the correct NeqSim transmitter class.124- [ ] Transmitter minimum and maximum values bracket the setpoint and expected operating range.125- [ ] Controller action is documented as reverse or direct acting.126- [ ] Manipulated equipment supports controller attachment and dynamic mode.127- [ ] PID parameters are finite and appropriate for a first transient trial.128- [ ] Transient response is checked for saturation, instability, and nonphysical states.129- [ ] Autotuning is only applied after a deliberate event-log excitation sequence.130131## Common Mistakes132133| Symptom | Cause | Fix |134| --- | --- | --- |135| Controller drives the valve in the wrong direction | Reverse/direct action is wrong | Check process cause and effect, then set `setReverseActing(True/False)` correctly |136| Pressure rises or falls away from setpoint | Outlet-valve PI error has the wrong sign | When increasing controller output opens the gas outlet, use measured pressure minus setpoint so high pressure increases outflow |137| Controller never responds | Transmitter or controller was not added or attached | Add the measurement device to the process and attach the controller to manipulated equipment |138| Output saturates at valve limit | Transmitter range, setpoint, or PID gain is unrealistic | Check min/max range, setpoint basis, valve opening limits, and PID parameters |139| Autotune gives poor parameters | Event log does not contain a clear response | Reset event log, apply deliberate setpoint steps, and run enough transient time |140141## Limitations142143- The Python helper does not run NeqSim and does not replace controller tuning.144- No proprietary control narratives, operating procedures, or safety instrumented functions are included.145- PID parameters are setup metadata, not a guarantee of stable operation.146- Human review is required before engineering or operational decisions.147148## Related NeqSim Functionality149150- `neqsim.process.measurementdevice.LevelTransmitter` — separator/vessel level measurement.151- `neqsim.process.measurementdevice.PressureTransmitter` — pressure measurement on streams or equipment outlets.152- `neqsim.process.measurementdevice.TemperatureTransmitter` and `VolumeFlowTransmitter` — stream temperature and volume-flow measurements.153- `neqsim.process.controllerdevice.ControllerDeviceBaseClass` — transmitter-based dynamic controller with setpoint, action, PID parameters, response, event log, and autotuning support.154- `neqsim.process.equipment.valve.ThrottlingValve#setController(...)` — attach a controller to a manipulated valve.155- `neqsim.process.processmodel.ProcessSystem#runTransient()` — execute the controlled dynamic process.156157In Python these classes are reachable through the `neqsim` package, for example `from neqsim import jneqsim`.158159## References160161- NeqSim repository: https://github.com/equinor/neqsim162- NeqSim Skills Guide: https://github.com/equinor/neqsim/blob/master/docs/integration/skills_guide.md163- Public NeqSim dynamic separator and process-control examples.