2.0.2 • Published 3 months ago

@clysema/ebrain-iot-pids v2.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 months ago

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'
}
2.0.2

3 months ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.0

2 years ago