# PID Control with Limit // PV

**URL:** <https://discourse.nodered.org/t/pid-control-with-limit-pv/75733>\
**Category:** General\
**Tags:** function-node\
**Created:** [25 February 2023 17:07 UTC](https://discourse.nodered.org/t/pid-control-with-limit-pv/75733 "2023-02-25T17:07:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick94](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nick94/32/63996_2.png) [@Nick94](https://discourse.nodered.org/u/Nick94)\
**Post date:** [25 February 2023 17:07 UTC](https://discourse.nodered.org/t/pid-control-with-limit-pv/75733/1 "2023-02-25T17:07:05Z")

</div>

Hi Guys,  
i want to do a Controller to heat my water with PV Energy when there is an "overflow". I grab the Data from my main meter and convert it to these numbers shown in the pictures.  
My Problem is, that i got low numbers in the night (under 50) because the PV doesnt produce any Power. So my PID Controller is running away with very high numbers (200,300...) (Right now i only simulate it and use the values: P=1, I=0.5 D=0). Is there maybe any solution to code a PID Controller in javascript and do something like a limit to the top and bottom? (sorry i dont have any coding experience)  
A workaround for me would be a periodical reset but thats not the nicest Solution....  
Do you have any tipps? Thanks

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/5/a54c480eaf5612ceb1e35c87cd3de0a9c0c8fb00.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [25 February 2023 21:12 UTC](https://discourse.nodered.org/t/pid-control-with-limit-pv/75733/2 "2023-02-25T21:12:40Z")

</div>

Use a PID node that has integral lock to prevent the runaway from happening. node-red-contrib-pid for example.

---

<div class="post-metadata">

**Author:** ![Nick94](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nick94/32/63996_2.png) [@Nick94](https://discourse.nodered.org/u/Nick94)\
**Post date:** [4 April 2023 13:37 UTC](https://discourse.nodered.org/t/pid-control-with-limit-pv/75733/3 "2023-04-04T13:37:59Z")

</div>

sorry for the late response, i had some personal problems.  
Yeah i already found this PID Control but i don't know how to use it properly...  
Thats my Problem.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [3 June 2023 13:38 UTC](https://discourse.nodered.org/t/pid-control-with-limit-pv/75733/4 "2023-06-03T13:38:31Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
