--
http://nodered.org
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/a03d518d-fa3f-423a-b9d4-ae083eaae3d5%40googlegroups.com.
Without integral it will never converge accurately onto the setpoint. There will always be an error once it has settled out. Without I then when the error is zero (and stable) the the power will be zero.Colin
On 15 November 2016 at 09:12, Steven Daglish <s.c.d...@gmail.com> wrote:
SnapBeen working on creating a PID control system to control my boiler: https://mydiyelectronics.wordpress.com/2016/10/19/room-temperature-control-system-pid-and-pwm/Blog out of date at the moment, but I've now integrated P and D control (not had much need of I at the moment). I also include a PWM system to allow the boiler to switch on / off with a minimum time period of 1 minute.Just looked into the area of creating a node-red node for this as I agree the current ones available are quite limited. Will look into your node soon and can hopefully come back with some useful idea :) (or at least some good thanks ;) )Steven
--
http://nodered.org
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
Hi Colin,While I understand the theory behind what you've wrote, I've yet to find it an issue in my heating system. Although I'm still playing with my heating controller, I've yet to find an off-set problem. Instead, I'm getting a ripple of about +-0.2C.While I could probably reduce the ripple by changing P and D, +- 0.2C is small enough that I'm not that worried about it.Another thing to bear in mind is that when the error is 0, it doesn't necessarily mean that there is zero heat being put into the system (house / room). During the evening while I'm in the house, there will be cookers, people, kettles, electrics, and pets all contributing heat to the system, which could be enough off-set any inaccurate settling point.
One of the bigger problems I'm having in my system is due to the non-simple nature of heating a house: the temperature outside has a large effect on my heating system, meaning when it's warmer outside, I need a smaller P and larger D, otherwise I get a larger-overshoot. However, if I always keep the P low and D high, the system becomes very slow when it is cold outside.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/1dc0c36d-ea4e-410f-80df-64367f25af57%40googlegroups.com.
Hi Colin,
I've had a look into the code and have a few comments / questions.
- I'm currently using the following node.js PID controller https://github.com/wilberforce/pid-controller which seems to be working well so far.
- One of the things I really like about it is the ability to choose a "sample time". Using this, I'm able to call the function multiple times, and only have the PID controller calculate the output at sample time (once a minute for me).
- Is this something that could be included in this node? I'm happy to help writing up the code, but I'm new to npm and github, so not sure the best way I could help (though open to suggestions).
- Would it be possible to add a min / max output value? Since I'm connecting the output of the PID controller to a PWM controller, I only need output values between 0(%) and 100(%). This could be added to another node, but it would be great if it was included.
- I'm also wondering if it's possible to change the way the PID parameters can be changed?
- At the moment, it looks like each parameter can be changed by selecting "setpoint" in "msg.topic", and that you would need multiple calls to change different parameters.
- Would it be possible to use a slightly different system where the parameters each have a different name?
- For example, to change setpoint, you'd change "msg.setpoint", and to change the system input you'd change "msg.input".
- That way you could change multiple parameters in one go, rather than needing multiple calls to the node.
I hope that makes sense and I'm happy to discuss this more. If you'd like, I'm happy to try and figure out how to make these changes locally and then send you any changes I make (sorry, but very good at this whole collaborative code stuff :) )
On 16 November 2016 at 10:25, Steven Daglish <s.c.d...@gmail.com> wrote:Hi Colin,I've had a look into the code and have a few comments / questions.
- I'm currently using the following node.js PID controller https://github.com/wilberforce/pid-controller which seems to be working well so far.
- One of the things I really like about it is the ability to choose a "sample time". Using this, I'm able to call the function multiple times, and only have the PID controller calculate the output at sample time (once a minute for me).
Can you explain why this is desirable? Why would you provide a new process value and not want to recalc the output?
- Is this something that could be included in this node? I'm happy to help writing up the code, but I'm new to npm and github, so not sure the best way I could help (though open to suggestions).
- Would it be possible to add a min / max output value? Since I'm connecting the output of the PID controller to a PWM controller, I only need output values between 0(%) and 100(%). This could be added to another node, but it would be great if it was included.
- I'm also wondering if it's possible to change the way the PID parameters can be changed?
- At the moment, it looks like each parameter can be changed by selecting "setpoint" in "msg.topic", and that you would need multiple calls to change different parameters.
- Would it be possible to use a slightly different system where the parameters each have a different name?
- For example, to change setpoint, you'd change "msg.setpoint", and to change the system input you'd change "msg.input".
- That way you could change multiple parameters in one go, rather than needing multiple calls to the node.
In fact I had it that way originally, but changed it to individual messages, as I found that when I used it I had to put in a node to combine the current values into one message. In my case values are being changed via mqtt, switches, dropdown lists, sliders etc so they all come separately. Can you explain your use case for me?
I hope that makes sense and I'm happy to discuss this more. If you'd like, I'm happy to try and figure out how to make these changes locally and then send you any changes I make (sorry, but very good at this whole collaborative code stuff :) )If you do decide to get involved then the technique to use is to fork from my github repository, make the changes, and then send a Pull Request to me to implement. Best to do as you have first though, to check whether I think the changes are a good idea.CheersColin
On Wednesday, 16 November 2016 12:26:54 UTC, Colin Law wrote:On 16 November 2016 at 10:25, Steven Daglish <s.c.d...@gmail.com> wrote:Hi Colin,I've had a look into the code and have a few comments / questions.
- I'm currently using the following node.js PID controller https://github.com/wilberforce/pid-controller which seems to be working well so far.
- One of the things I really like about it is the ability to choose a "sample time". Using this, I'm able to call the function multiple times, and only have the PID controller calculate the output at sample time (once a minute for me).
Can you explain why this is desirable? Why would you provide a new process value and not want to recalc the output?It's not so much that I want to ignore new values that are coming in, but more that I would like to control when the values are calculated. I have a number of sensor values coming in via MQTT, which aren't synced, so end up coming in at different times (for example more than one temperature sensor in the same room). Rather than recalculate the output when the temperature readings come in, I can have the PID controller only calculate the output say once a minute. It's a small thing and I could easily implement it using another node, so it's no big deal.
On 16 November 2016 at 13:12, Steven Daglish <s.c.d...@gmail.com> wrote:
On Wednesday, 16 November 2016 12:26:54 UTC, Colin Law wrote:On 16 November 2016 at 10:25, Steven Daglish <s.c.d...@gmail.com> wrote:Hi Colin,I've had a look into the code and have a few comments / questions.
- I'm currently using the following node.js PID controller https://github.com/wilberforce/pid-controller which seems to be working well so far.
- One of the things I really like about it is the ability to choose a "sample time". Using this, I'm able to call the function multiple times, and only have the PID controller calculate the output at sample time (once a minute for me).
Can you explain why this is desirable? Why would you provide a new process value and not want to recalc the output?It's not so much that I want to ignore new values that are coming in, but more that I would like to control when the values are calculated. I have a number of sensor values coming in via MQTT, which aren't synced, so end up coming in at different times (for example more than one temperature sensor in the same room). Rather than recalculate the output when the temperature readings come in, I can have the PID controller only calculate the output say once a minute. It's a small thing and I could easily implement it using another node, so it's no big deal.Sorry, still don't get it. The net result is that you are delaying the operation of the loop, which is always a bad thing for loop control. What is advantage of delaying it?
On Wednesday, 16 November 2016 13:55:00 UTC, Colin Law wrote:
> ...
Sorry, still don't get it. The net result is that you are delaying the operation of the loop, which is always a bad thing for loop control. What is advantage of delaying it?
Happy to admit defeat on that one. Not something that fully needs implementing in the code, but more to do with the way my flows work. In case you're interested, I have two temperature senors in a room that send via MQTT. They aren't synced, so send their values at slightly different times. Rather than calculating the new PID value when each arrives, I wait for both to arrive, average them, and them and then do the calculation. In order to be a bit lazy, I simply wait one minute and assume both values have come. I need to improve this anyway, so this will help :)
Pull request made (hopefully...)