User Tools

Site Tools


en-us_commands:pid

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en-us_commands:pid [2026/09/07 21:52] – 만듦 - 바깥 편집 127.0.0.1en-us_commands:pid [2026/09/12 23:27] (current) – 바깥 편집 127.0.0.1
Line 1: Line 1:
-====== PID Control ======+====== PID control ======
  
-^ Command ^ Description ^ +Set PID parameterscalculate output from the measured value and setpoint, and inspect the state.
-| ''IpidSet(idkp, ki, kd, sampleMs, outMin, outMax)'' | Sets coefficients, calculation interval and output range. | +
-| ''IpidRun(id, pv, sv)'' | Calculates output from the current value ''PV'' and setpoint ''SV''. | +
-| ''IpidReset(id)'' | Resets the integral value and internal state. +
-| ''IpidReverse(id, reverse)'' | Selects direct or reverse action. | +
-| ''IpidItermLimit(id, min, max)'' | Limits the integral term range. | +
-| ''IpidOutput(id)'' | Returns the last output value. |+
  
-<code cpp> +  * [[:en-us_commands:reference:ipidset|IpidSet()]] — Sets PID coefficientscalculation interval and output range. 
-void setup() { IpidSet(02.0, 0.5, 0.1, 100, 0, 100); } +  * [[:en-us_commands:reference:ipidrun|IpidRun()]] — Calculates the PID output from the current value and setpoint. 
-void loop() { +  * [[:en-us_commands:reference:ipidreset|IpidReset()]] — Resets the PID integral value and internal state
-  float output = IpidRun(0, ntcReadf(0), 50.0); +  * [[:en-us_commands:reference:ipidreverse|IpidReverse()]] — Selects direct or reverse PID action. 
-  IanalogWritef(0, 0.0, 100.0, output); +  * [[:en-us_commands:reference:ipiditermlimit|IpidItermLimit()]] — Limits the minimum and maximum of the PID integral term
-+  * [[:en-us_commands:reference:ipidoutput|IpidOutput()]] — Returns the last calculated PID output value.
-</code>+
  
-===== Command Prototypes ===== +[[:en-us_commands:builtin|← Built-in function list]]
- +
-^ Return Type ^ Command Prototype ^ +
-| ''bool'' | ''IpidSet(uint8_t id, float kp, float ki, float kd, unsigned long sampleMs, float outMin, float outMax)''+
-| ''float'' | ''IpidRun(uint8_t id, float pv, float sv)''+
-| ''void'' | ''IpidReset(uint8_t id)''+
-| ''void'' | ''IpidReverse(uint8_t id, bool reverse)''+
-| ''void'' | ''IpidItermLimit(uint8_t id, float iMin, float iMax)''+
-| ''float'' | ''IpidOutput(uint8_t id)''+
- +
-PID calculation is not a safety device. Handle sensor open circuits, overtemperature, stuck outputs and emergency stops with separate circuits and logic. +
- +
-[[:en-us_commands:builtin|← Built-in Command List]]+
  
en-us_commands/pid.1788785565.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki