User Tools

Site Tools


en-us_commands:reference:ipidrun

Differences

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

Link to this comparison view

Next revision
Previous revision
en-us_commands:reference:ipidrun [2026/09/07 21:52] – 만듦 - 바깥 편집 127.0.0.1en-us_commands:reference:ipidrun [2026/09/08 00:53] (current) – 바깥 편집 127.0.0.1
Line 17: Line 17:
 <code cpp> <code cpp>
 void setup() { void setup() {
-  IpidSet(15.0, 0.51.0, 100, 0, 65535);+  IpidSet(24.0, 0.20.0, 100, 0, 255);  // Set PID coefficients, calculation interval and output range. 
 +  IpidReverse(2, true);  // Select direct or reverse PID action.
 } }
  
 void loop() { void loop() {
-  float pv = ntcRead(4) / 10.0; +  float pv = ntcRead(4) / 10.0;  // Return the NTC 3950 10kΩ sensor temperature as an integer in 0.1°C units. 
-  float sv = 50.0; +  float sv = 25.0; 
-  uint16_t output = (uint16_t)IpidRun(1, pv, sv);+  int output = (int)IpidRun(2, pv, sv);  // Calculate the PID output from the current value and setpoint.
  
-  PWM(12, output, true);+  analogWrite(11, output);
 } }
 </code> </code>
Line 37: Line 38:
   * ''IpidReset()'' resets the integral term, previous PV and previous output value.   * ''IpidReset()'' resets the integral term, previous PV and previous output value.
   * Use the same ''id'' for only one control loop.   * Use the same ''id'' for only one control loop.
 +
 +===== Built-in Commands in the Same Category =====
 +
 +  * [[:en-us_commands:reference:ipidset|IpidSet() View detailed description]]
 +  * [[:en-us_commands:reference:ipidreset|IpidReset() View detailed description]]
 +  * [[:en-us_commands:reference:ipidreverse|IpidReverse() View detailed description]]
 +  * [[:en-us_commands:reference:ipiditermlimit|IpidItermLimit() View detailed description]]
 +  * [[:en-us_commands:reference:ipidoutput|IpidOutput() View detailed description]]
  
 [[:en-us_commands:builtin|← Built-in Command List]] [[:en-us_commands:builtin|← Built-in Command List]]
  
en-us_commands/reference/ipidrun.1788785567.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki