Skip to content

ingeniadevteam/ebrain-iot-pids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PID

https://www.npmjs.com/package/awesome-pid

Config

config/pid.json

[
  {
    "name": "PID1", // PID name
    "k_p": 0.5,     // Proportional gain
    "k_i": 0.05,    // Integral gain
    "k_d": 0.1,     // Derivative gain
    "dt": 1000,     // Time interval in milliseconds
  }
]

Example

app.pids.PID1.setTarget(32); // 32ºC
let goalReached = false
while (!goalReached) {
  let output = measureFromSomeSensor();
  let input  = ctr.update(output);
  applyInputToActuator(input);
  goalReached = (input === 0) ? true : false; // in the case of continuous control, you let this variable 'false'
}

Releases

No releases published

Packages

No packages published