Lemonergy · Studio block
Continuous weighted PID
Combines continuous proportional, integral and filtered derivative control with weights and limits.
- Implementation ID
native-pid- Reviewed
- 2026-10-27
Behavior
dx_integral/dt = Ki (reference − measurement), subject to conditional integration. τ dx_filter/dt = c reference − measurement − x_filter. u = clamp(Kp (b reference − measurement) + x_integral + Kd dx_filter/dt, lower, upper). The worked example connects this operation to signals in Lemonergy Studio.
Interface
| Name | Direction | Unit | Meaning |
|---|---|---|---|
in0 | input | 1 | Setpoint; real scalar. |
in1 | input | 1 | Measurement; real scalar. |
out0 | output | 1 | Control; real scalar. |
Parameters
Defaults are initial model values. Select values for your own model and operating conditions.
| Parameter | Unit | Default | Meaning and limits |
|---|---|---|---|
Proportional gainparams[0] | 1 | 1 | Configured finite numerical parameter. |
Integral gainparams[1] | 1 | 0.5 | Configured finite numerical parameter. |
Derivative gainparams[2] | 1 | 0 | Configured finite numerical parameter. |
Derivative filter timeparams[3] | s | 0.1 | Configured finite numerical parameter. |
Lower output limitparams[4] | 1 | -10 | Configured finite numerical parameter. |
Upper output limitparams[5] | 1 | 10 | Configured finite numerical parameter. |
Proportional setpoint weightparams[6] | 1 | 1 | Configured finite numerical parameter. |
Derivative setpoint weightparams[7] | 1 | 0 | Configured finite numerical parameter. |
Initial statestables[0] | 1 | [0, 0] | Integral output, derivative filter state. |
Equations and rules
dx_integral/dt = Ki (reference − measurement), subject to conditional integrationτ dx_filter/dt = c reference − measurement − x_filteru = clamp(Kp (b reference − measurement) + x_integral + Kd dx_filter/dt, lower, upper)
Worked example
Continuous weighted PID — worked example
Setpoint = 1; Measurement = 0. Control at 1 s = 1.5.
Open Studio example after release →| Output | Time (s) | Expected value | Unit | Absolute tolerance |
|---|---|---|---|---|
Controlout0 | 1 | 1.5 | 1 | 2e-06 |
Explore the recorded outputs
Continuous weighted PID recorded example
Continuous weighted PID13 actual recorded samples. Lines are visual guides between samples. Synthetic example, not measured cell data.
Read the selected signal as a table
| Time (s) | Value |
|---|
Download the recorded samples (JSON) · Open this Studio example after release
Use in a workflow
Continuous weighted PID — worked example
Combines continuous proportional, integral and filtered derivative control with weights and limits.
- Continuous weighted PID: dx_integral/dt = Ki (reference − measurement), subject to conditional integration. τ dx_filter/dt = c reference − measurement − x_filter. u = clamp(Kp (b reference − measurement) + x_integral + Kd dx_filter/dt, lower, upper). The worked example connects this operation to signals in Lemonergy Studio.
- Use the block reference for settings and connections.
- Implementation tested locally; public release pending.
Connected concepts
Limits and interpretation
- Shapes and element types are explicit. Values must be finite; automatic reshaping and unit conversion are not performed.
Scientific and mathematical references
These sources explain the scientific and mathematical background. The behavior, interface and limits above define the Lemonergy implementation; a citation does not imply every model option in the source is implemented.
- Feedback Systems: An Introduction for Scientists and Engineers, second edition
Karl J. Åström, Richard M. Murray · Princeton University Press; author-maintained FBSwiki · 2021
Technical reference · State-space modeling, feedback and PID control. These mathematical foundations do not establish a particular software implementation.
Implementation sources
This reference follows the public interface and locally verified numerical checks for an upcoming release.
Contract: Lemonergy Studio public contract · Verification record: verification-2026-10-27
docs/glossary/native-block-verification.json
This implementation and its workflow uses (JSON) · Knowledge graph (JSON-LD)