Easy PID Controller

Easy PID Controller Node for Node-RED

The easy-pid-controller is a simple-to-use Node-RED node that provides Proportional-Integral-Derivative (PID) control functionalities. This node is designed to integrate easily with various control systems and offers configuration options for 0-10V and 4-20mA control signals.

Features

  • Easy to configure PID parameters: Kp, Ki, Kd.
  • Setpoint (SV) input for desired control level.
  • Process Variable (PV) input to feedback the current state.
  • Output values for PID components (P, I, D), final output signal, and mapped value signal.
  • Choice of control signal types: 0-10V or 4-20mA.
[{"id":"8bcc78a80d0753f6","type":"tab","label":"easy pid","disabled":false,"info":"","env":[]},{"id":"824f517bb54ec8fb","type":"easy-pid-controller","z":"8bcc78a80d0753f6","name":"","k_p":"1.2","k_i":"1","k_d":"0.01","sensor_type":"4-20mA","dt":"1","range_min":"0","range_max":"100","x":530,"y":200,"wires":[["4cbd4fd8445b5301","fed8ec916835b82a","829fe279c5d63469"]]},{"id":"8e0b66211ec865fe","type":"mqtt in","z":"8bcc78a80d0753f6","name":"","topic":"SV","qos":"2","datatype":"auto-detect","broker":"8101d945.ea6768","nl":false,"rap":true,"rh":0,"inputs":0,"x":310,"y":200,"wires":[["824f517bb54ec8fb"]]},{"id":"8b1ccfc0975d47f7","type":"mqtt in","z":"8bcc78a80d0753f6","name":"","topic":"PV","qos":"2","datatype":"auto-detect","broker":"8101d945.ea6768","nl":false,"rap":true,"rh":0,"inputs":0,"x":310,"y":280,"wires":[["824f517bb54ec8fb"]]},{"id":"4cbd4fd8445b5301","type":"debug","z":"8bcc78a80d0753f6","name":"debug 244","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":790,"y":200,"wires":[]},{"id":"0586b87e4165a3e9","type":"inject","z":"8bcc78a80d0753f6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":130,"y":140,"wires":[["747852e2c9cd5dfb"]]},{"id":"747852e2c9cd5dfb","type":"change","z":"8bcc78a80d0753f6","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"auto","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":140,"wires":[["824f517bb54ec8fb"]]},{"id":"fed8ec916835b82a","type":"influxdb out","z":"8bcc78a80d0753f6","influxdb":"073bf1f18e97e7fb","name":"","measurement":"valve","precision":"","retentionPolicy":"","database":"database","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":730,"y":120,"wires":[]},{"id":"fe7800415ab3fdf9","type":"comment","z":"8bcc78a80d0753f6","name":"Sends and receives data from send-to-easy-pid-node-red,js","info":"Now set SV using mag.payload instead of node.config","x":250,"y":60,"wires":[]},{"id":"d969396a8897043e","type":"range","z":"8bcc78a80d0753f6","minin":"4","maxin":"20","minout":"0","maxout":"100","action":"scale","round":false,"property":"payload","name":"","x":840,"y":300,"wires":[["5a1730e1cc5e429b"]]},{"id":"829fe279c5d63469","type":"function","z":"8bcc78a80d0753f6","name":"Value","func":"var op = msg.payload.Value;\n\nmsg.payload = op;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":300,"wires":[["d969396a8897043e"]]},{"id":"5a1730e1cc5e429b","type":"debug","z":"8bcc78a80d0753f6","name":"debug 246","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1010,"y":300,"wires":[]},{"id":"8101d945.ea6768","type":"mqtt-broker","name":"Local MQTT","broker":"mqtt://localhost","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""},{"id":"073bf1f18e97e7fb","type":"influxdb","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"easypid","name":"easypid","usetls":false,"tls":"dffcbfae.6e9d","influxdbVersion":"1.x","url":"http://localhost:8086","rejectUnauthorized":true},{"id":"dffcbfae.6e9d","type":"tls-config","name":"","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"","servername":"","verifyservercert":false}]

Flow Info

Created 2 years ago
Rating: 5 1

Owner

Actions

Rate:

Node Types

Core
  • change (x1)
  • comment (x1)
  • debug (x2)
  • function (x1)
  • inject (x1)
  • mqtt in (x2)
  • mqtt-broker (x1)
  • range (x1)
  • tls-config (x1)
Other

Tags

  • PID
  • Autotuning
  • ProcessControl
  • PIDTuning
  • PIDController
  • BufferstackIO
  • Pune
  • India
  • Automation
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option