Refresh and auto update of values

Hi there,

Using Node-red v.2.0.6.

Having some questions.

  1. So I'm having some difficulties understanding what is wrong with my code. I have an input voltage from an generator that I would like to regulate to 230V setpoint, using an valve that controls steam air flow.
    I can't seem to regulate it good enough.
    The input to the PID from the generator varies (as it should), and in the beginning of the flow it reads the value correctly. But then it feels like the it doesn't update the value anymore, although I know it changes.
    Is there a way to force Node-red to read automatically read the input like every 0.1 sec (even if no changes of the value occured)?
  1. I'm using Automation HAT. Could that be a problem regarding the value not changing?

  2. The same problem occurs in the Node-red UI as well, that value (generator V input to Node-red) don't continue to refresh/update.

  3. The PID I'm using right now is "node-red-contrib-pid". Then I scale up the output from the PID, from 0-1 to 0-10. Because my valve requires 0-10V input voltage.
    Is there a PID with an output like 0-10 or 0-100?
    Or maybe they way I do it is the way and the first questions here above solves the problem of to fast reaction of the PID.

Attached my code.

Thanks in advance!
flows (4).json (56.3 KB)

Hi again,

Would be great if some kind soul could help me out! :slight_smile:

Hi again,

Bumping to get some nice people to help out!

I'm still a newb myself,
but ill pipe in here and attempt to either help or confuse you.
controlling a valve is what your trying to do. that I can help with.
Whatl i am not understanding is how does a valve that holds back or realeases steam help control your voltage?
what hardware are you using right now to sense your voltage?
and what type of valve is it a solenoid valve, an electric ball or butterfly valve?

so its a little hard because the language in flows in not one i know. however.
in the first flow tab where you are getting the data from the hat and then splitting the 3 analog signals. 1 you do not need 3 split nodes , rather just one. here is how i changed that little bit.
updatedsplitnode.json (5.5 KB)
hopefully it makes a little sense.
now i do not use an automated hat for my controls .
I use an esp8266, I have Tasmota flashed to it, makes things easier then having to code arduino.I have a coil relay connected to it, a DS18b20 1 wire temp sensor, and a pressure transducer. the pressure transducer is actually connected to an ADS1115 which is actually connected to my esp8266.
then i use Mqtt messaging from it to the mosquito server installed on my pi that i have node red on.

so our systems are different but have same outcome and bassically same input.
on the flow i shared with you where i changed the switch node.
place a debug node on each out. copy the debug information and share with me so i can see the initial messages coming out of your in. also what device is the analog device that you are using.

Here is my flow where i control a solenoid valve , keep in mind its either off or on not an inbetween.
fermenter.json (54.0 KB)

Fist it is easier if we have the complete json object that kicks the control off.


As with this we can simulate the flow. We also need to know the object in the json you are using for the control.


[{"id":"c6659f37.54b0f","type":"switch","z":"d34f2b9c.b8cc68","name":"Pass ADC3","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"automationhat/analog.3","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":590,"y":240,"wires":[["e302a3ea.5a404"]]},{"id":"52a09120.1c02c","type":"switch","z":"d34f2b9c.b8cc68","name":"Pass ADC2","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"automationhat/analog.2","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":590,"y":180,"wires":[["a6c67e7.6351a8"]]},{"id":"664895a7.90a4ac","type":"switch","z":"d34f2b9c.b8cc68","name":"Pass ADC1","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"automationhat/analog.1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":590,"y":120,"wires":[["6d665e54.02875"]]},{"id":"6d665e54.02875","type":"link out","z":"d34f2b9c.b8cc68","name":"Tryck/Nivågivare","links":["3b0e5dbd.3083a2"],"x":715,"y":120,"wires":[]},{"id":"a6c67e7.6351a8","type":"link out","z":"d34f2b9c.b8cc68","name":"","links":["6c038886.3ce188","f03f0300.ea4e5","43c08f15.49cb"],"x":715,"y":180,"wires":[]},{"id":"e302a3ea.5a404","type":"link out","z":"d34f2b9c.b8cc68","name":"Reserv","links":[],"x":715,"y":240,"wires":[]},{"id":"eff06e87.5182e","type":"rpi-automation-hat in","z":"d34f2b9c.b8cc68","name":"Analog Automation HAT Inputs","input":false,"analog":true,"x":180,"y":120,"wires":[["c6659f37.54b0f","664895a7.90a4ac","52a09120.1c02c","d632224b1aa31528","a0d8164e914f775c"]]},{"id":"d632224b1aa31528","type":"change","z":"d34f2b9c.b8cc68","name":"","rules":[{"t":"set","p":"payload","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":180,"y":180,"wires":[[]]},{"id":"f2a44d0f8a58e0ea","type":"inject","z":"d34f2b9c.b8cc68","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"payload","payloadType":"flow","x":170,"y":240,"wires":[["664895a7.90a4ac","52a09120.1c02c","c6659f37.54b0f"]]},{"id":"a0d8164e914f775c","type":"debug","z":"d34f2b9c.b8cc68","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":410,"y":100,"wires":[]}]

It is also wise if you want a english speaking community to look at your flow, to have the flow in english.

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