# liquid-pid

> PID Controller in NodeJS for liquids (water, beer, etc.)

Latest version **1.0.0** (published 2014-12-22) · 0 weekly downloads

## Install

```sh
npm install liquid-pid
pnpm add liquid-pid
yarn add liquid-pid
bun add liquid-pid
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2014-12-22 |
| First published | 2013-11-14 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Péter Márton |
| Maintainers | hekike |

## Links

- npm: https://www.npmjs.com/package/liquid-pid
- Repository: https://github.com/hekike/liquid-pid
- Issues: https://github.com/hekike/liquid-pid/issues
- npm.io page: https://npm.io/package/liquid-pid

## Recent versions

- 1.0.0 (latest) — 2014-12-22
- 0.0.3 — 2014-01-21
- 0.0.2 — 2013-11-24
- 0.0.1 — 2013-11-14

## README

liquid-pid
==========

[![Build Status](https://travis-ci.org/hekike/liquid-pid.png?branch=master)](https://travis-ci.org/hekike/liquid-pid)

PID Controller in NodeJS for liquids (water, beer, etc.).
Simulator, Plots and Tests are included. 

Let's go and brew something!

https://npmjs.org/package/liquid-pid

## Installation

    $ npm install liquid-pid

## Example

    var
      liquidPID = require('liquid-pid'),
      actualP = 0,
      pidController;
    
    pidController = new liquidPID({
      temp: {
        ref: 67         // Point temperature                                       
      },
      Pmax: 1000,       // Max power (output),
      
      // Tune the PID Controller
      Kp: 25,           // PID: Kp
      Ki: 1000,         // PID: Ki
      Kd: 9             // PID: Kd
    });
    
    actualP = pidController.calculate(66.7);	// call with the actual temp
    console.log(actualP);
    
    actualP = pidController.calculate(67.0);    // call with the actual temp
    console.log(actualP);
    
    actualP = pidController.calculate(69.0);    // call with the actual temp
    console.log(actualP);
    
For more complex example please check the simulation/ dir.


## Methods

### .tune(Kp, Ki, Kd)
Configure the PID controller
For the details please check http://en.wikipedia.org/wiki/PID_controller
### .getRefTemperature()
return Number, with the actual ref temperature (what we want to reach/hold)
### .setPoint(temp)
Set new point temperature.
### .calculate(actualTemperature)
Call it continuesly to calculate the required power/output for your heater during the time.
## Simulation

### Sample 1
Reach and hold 40 °C
![alt tag](https://raw.github.com/hekike/liquid-pid/master/docs/img/simulation1.png)

### Browser simulation
http://hekike.github.io/liquid-pid/plot/app/

## Test
Tests are included.

## Other
The "liquid-pid" is used in our BIAB homebrew installation.

For more info: @slashdotpeter

------

---
_Source: https://npm.io/package/liquid-pid · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
