Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
m-lundberg committed Dec 11, 2019
1 parent 30dd546 commit 9a22642
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ pid.Ki = 1.0
pid.tunings = (1.0, 0.2, 0.4)
```

To use the PID in [reverse mode](http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-direction/), meaning that an increase in the input leads to a decrease in the output (like when cooling for example), you can set the tuning to negative values:

```python
pid.tunings = (-1.0, -0.1 0)
```

Note that all the tunings should have the same sign.

In order to get output values in a certain range, and also to avoid [integral windup](https://en.wikipedia.org/wiki/Integral_windup) (since the integral term will never be allowed to grow outside of these limits), the output can be limited to a range:
```python
pid.output_limits = (0, 10) # output value will be between 0 and 10
Expand Down

0 comments on commit 9a22642

Please sign in to comment.