{
  "node": {
    "id": "block:native-pid",
    "type": "Block",
    "label": "Continuous weighted PID",
    "properties": {
      "id": "native-pid",
      "name": "Continuous weighted PID",
      "kind": "studio",
      "summary": "Combines continuous proportional, integral and filtered derivative control with weights and limits.",
      "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.",
      "ports": [
        {
          "name": "in0",
          "direction": "input",
          "unit": "1",
          "description": "Setpoint; real scalar.",
          "shape": [],
          "elementType": "real"
        },
        {
          "name": "in1",
          "direction": "input",
          "unit": "1",
          "description": "Measurement; real scalar.",
          "shape": [],
          "elementType": "real"
        },
        {
          "name": "out0",
          "direction": "output",
          "unit": "1",
          "description": "Control; real scalar.",
          "shape": [],
          "elementType": "real"
        }
      ],
      "parameters": [
        {
          "key": "params[0]",
          "label": "Proportional gain",
          "unit": "1",
          "default": 1,
          "description": "Configured finite numerical parameter."
        },
        {
          "key": "params[1]",
          "label": "Integral gain",
          "unit": "1",
          "default": 0.5,
          "description": "Configured finite numerical parameter."
        },
        {
          "key": "params[2]",
          "label": "Derivative gain",
          "unit": "1",
          "default": 0,
          "description": "Configured finite numerical parameter."
        },
        {
          "key": "params[3]",
          "label": "Derivative filter time",
          "unit": "s",
          "default": 0.1,
          "description": "Configured finite numerical parameter."
        },
        {
          "key": "params[4]",
          "label": "Lower output limit",
          "unit": "1",
          "default": -10,
          "description": "Configured finite numerical parameter."
        },
        {
          "key": "params[5]",
          "label": "Upper output limit",
          "unit": "1",
          "default": 10,
          "description": "Configured finite numerical parameter."
        },
        {
          "key": "params[6]",
          "label": "Proportional setpoint weight",
          "unit": "1",
          "default": 1,
          "description": "Configured finite numerical parameter."
        },
        {
          "key": "params[7]",
          "label": "Derivative setpoint weight",
          "unit": "1",
          "default": 0,
          "description": "Configured finite numerical parameter."
        },
        {
          "key": "tables[0]",
          "label": "Initial states",
          "unit": "1",
          "default": [
            0,
            0
          ],
          "description": "Integral output, derivative filter state."
        }
      ],
      "equations": [
        "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)"
      ],
      "example": {
        "title": "Continuous weighted PID — worked example",
        "text": "Setpoint = 1; Measurement = 0. Control at 1 s = 1.5.",
        "url": "https://design.lemonergy.com/cosim.html?example=block-native-pid",
        "label": "Open Studio example",
        "inputs": [
          {
            "port": "in0",
            "label": "Setpoint",
            "value": 1,
            "unit": "1"
          },
          {
            "port": "in1",
            "label": "Measurement",
            "value": 0,
            "unit": "1"
          }
        ],
        "checks": [
          {
            "port": "out0",
            "label": "Control",
            "atS": 1,
            "value": 1.5,
            "unit": "1",
            "tolerance": 2e-06
          }
        ]
      },
      "limits": [
        "Shapes and element types are explicit. Values must be finite; automatic reshaping and unit conversion are not performed."
      ],
      "references": [
        "astrom-murray-feedback"
      ],
      "caseIds": [
        "native-native-pid"
      ],
      "availability": {
        "status": "released",
        "label": "Available in Lemonergy Studio",
        "detail": "The bundled example is available in the production release verified on 28 October 2026. The parameters and examples here are synthetic teaching fixtures, not a characterized cell or a validated operating limit."
      },
      "evidence": [
        "docs/glossary/native-block-verification.json"
      ],
      "sourceRepository": "Lemonergy Studio public contract",
      "sourceRevision": "verification-2026-10-27",
      "exampleTraces": [
        {
          "id": "native-pid",
          "url": "https://lemonergy.com/learn/glossary/api/traces/native-pid.json?v=cd80f576b793",
          "title": "Continuous weighted PID recorded example",
          "exampleId": "block-native-pid",
          "source": "Executed synthetic Lemonergy Studio example",
          "recordedOn": "2026-10-28",
          "points": 13,
          "channels": 1,
          "omittedChannels": 0,
          "interpolation": "linear",
          "solver": {
            "method": "dormand-prince-45",
            "reason": "non-stiff-time-scales"
          }
        }
      ],
      "type": "native-pid",
      "implementationId": "native-pid",
      "url": "https://lemonergy.com/learn/glossary/blocks/native-pid/",
      "documentationUrl": "https://lemonergy.com/learn/glossary/blocks/native-pid/",
      "sourceFile": "block-library.json",
      "reviewed": "2026-10-27",
      "releaseEvidence": {
        "environment": "production",
        "status": "verified",
        "revision": "e76cadfc203e15eb41f3478d8b1044a5b851953d",
        "verifiedOn": "2026-10-28",
        "exampleUrls": [
          "https://design.lemonergy.com/cosim.html?example=block-native-pid"
        ]
      }
    }
  },
  "incoming": [
    {
      "id": "edge:usesBlock/native-native-pid/0",
      "type": "usesBlock",
      "source": "workflow:native-native-pid",
      "target": "block:native-pid",
      "properties": {
        "sourceFile": "wiki-blocks.json",
        "position": 0,
        "name": "Continuous weighted PID",
        "type": "native-pid",
        "role": "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.",
        "settings": [
          "Use the block reference for settings and connections.",
          "Bundled example verified on the production release of 28 October 2026."
        ]
      }
    }
  ],
  "outgoing": [
    {
      "id": "edge:cites/block:native-pid/reference:astrom-murray-feedback",
      "type": "cites",
      "source": "block:native-pid",
      "target": "reference:astrom-murray-feedback",
      "properties": {
        "sourceFile": "block-library.json",
        "scope": "Scientific or mathematical background; implementation scope is stated by the block contract"
      }
    }
  ],
  "neighbors": [
    {
      "id": "workflow:native-native-pid",
      "type": "Workflow",
      "label": "Continuous weighted PID — worked example",
      "properties": {
        "id": "native-native-pid",
        "title": "Continuous weighted PID — worked example",
        "kind": "studio",
        "summary": "Combines continuous proportional, integral and filtered derivative control with weights and limits.",
        "steps": [
          "Review the interface, units and model limits.",
          "Open the Studio example and run its bundled model.",
          "Compare outputs with the numerical checks; change one input and run again."
        ],
        "example": "Setpoint = 1; Measurement = 0. Control at 1 s = 1.5.",
        "observe": "Inspect the output channels and checks on the block reference page.",
        "limits": "Shapes and element types are explicit. Values must be finite; automatic reshaping and unit conversion are not performed.",
        "url": "https://design.lemonergy.com/cosim.html?example=block-native-pid",
        "label": "Open Studio example",
        "evidence": [
          "docs/glossary/native-block-verification.json"
        ]
      }
    },
    {
      "id": "reference:astrom-murray-feedback",
      "type": "Reference",
      "label": "Feedback Systems: An Introduction for Scientists and Engineers, second edition",
      "properties": {
        "title": "Feedback Systems: An Introduction for Scientists and Engineers, second edition",
        "publisher": "Princeton University Press; author-maintained FBSwiki",
        "url": "https://fbswiki.org/wiki/index.php/Feedback_Systems%3A_An_Introduction_for_Scientists_and_Engineers",
        "type": "Textbook",
        "scope": "State-space modeling, feedback and PID control. These mathematical foundations do not establish a particular software implementation.",
        "year": 2021,
        "authors": [
          "Karl J. Åström",
          "Richard M. Murray"
        ],
        "accessed": "2026-10-27"
      }
    }
  ]
}
