colinl / node-red-contrib-pid

A node-red PID loop controller node intended for the control of real world processes
Apache License 2.0
27 stars 18 forks source link

preserve incoming message #24

Closed avk999 closed 1 year ago

avk999 commented 1 year ago

cleaner PR to preserve incoming message

colinl commented 1 year ago

There were a couple of issues with your commit, it didn't cope with the fact that newMsg may be null at that point in the code, and I had asked that it was not optional. Also the minor point that it is better now to use let rather than var. I have extracted the relevant part of your code and committed it via commit 7dcd2fa and released at 2.0.0.

Do you want to be added as a contributor? If so I need your name.

Many thanks once again for sorting this out.

avk999 commented 1 year ago

Hi Colin, I don't think this contribution is worth mentioning. Thank you for the module itself (works surprisingly good for such a simple PID implementation!) and for accepting this issue.

colinl commented 1 year ago

The algorithm started life written in assembler in an 8 bit micro most of 50 years ago. It had to be simple then as there were only a few k of memory. I have re-written it in several languages since then, but it is still basically the same algorithm.