IU Predict for Motors - vibration
IU Predict for Motors - vibration
This flow extract data from the IFM vibration sensor (vvb001) for IU Predict for motors:
- Monitoring:
- Extract regularly (every few seconds or minutes) monitoring data using the node
get data
from @inuse/node-red-contrib-ifm-vvb001
- Extract regularly (every few seconds or minutes) monitoring data using the node
- Advanced diagnostic:
- Extract regularly (every few minutes or hours) high frequency acceleration record using the node
blob stream
from @inuse/node-red-contrib-ifm-vvb001 - If the motor is idle, we do not proceed to the recording of the acceleration.
- Extract regularly (every few minutes or hours) high frequency acceleration record using the node
Data is then send to InUse MQTT Broker.
How to use it?
First you need to set up the global variables under the node Set globals
:
- The
iolink-master-ip
should be the IP address of the IO link master - The
topic_prefix
is used as the MQTT topic prefix to send the monitoringdata
or theacceleration
The default intervals to send the data are:
- 30 seconds for the monitoring (v-rms, a-rms, crest, etc.)
- 4 hours for the
acceleration
(advanced diagnosis)
These values can be tuned, especially during the setup of a new motor (ex: reduce the interval for the acceleration
to 30 minutes in order to generate the maximum number of recordings that should be labeled in InUse platform in order to train the advanced diagnosis algorithm).
[{"id":"77ebe1cfaa9dfc95","type":"tab","label":"iupm_vibration","disabled":false,"info":"# IU Predict for Motors - vibration\n\nThis flow extract data from the IFM vibration sensor (vvb001) for [IU Predict for motors](https://inuse.eu/iu-predict-predictive-maintenance/):\n- Monitoring:\n - Extract regularly (every few seconds or minutes) monitoring data using the node `get data` from [@inuse/node-red-contrib-ifm-vvb001](https://flows.nodered.org/node/@inuse/node-red-contrib-ifm-vvb001) \n- Advanced diagnostic:\n - Extract regularly (every few minutes or hours) high frequency acceleration record using the node `blob stream` from [@inuse/node-red-contrib-ifm-vvb001](https://flows.nodered.org/node/@inuse/node-red-contrib-ifm-vvb001)\n - If the motor is idle, we do not proceed to the recording of the acceleration.\n \nData is then send to InUse MQTT Broker.\n\n# How to use it?\nFirst you need to set up the global variables under the node `Set globals`:\n- The `iolink-master-ip` should be the IP address of the IO link master\n- The `topic_prefix` is used as the MQTT topic prefix to send the monitoring `data` or the `acceleration`\n\n\nThe default intervals to send the data are:\n - 30 seconds for the monitoring (v-rms, a-rms, crest, etc.)\n - 4 hours for the `acceleration` (advanced diagnosis)\n \nThese values can be tuned, especially during the setup of a new motor (ex: reduce the interval for the `acceleration` to 30 minutes in order to generate the maximum number of recordings that should be labeled in InUse platform in order to _train_ the advanced diagnosis algorithm).\n\n","env":[]},{"id":"5ecb3e3532bc3883","type":"debug","z":"77ebe1cfaa9dfc95","name":"msg","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":770,"y":220,"wires":[]},{"id":"611e97610230437c","type":"mqtt out","z":"77ebe1cfaa9dfc95","name":"","topic":"","qos":"0","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"2708e9b5c016f96f","x":950,"y":380,"wires":[]},{"id":"497953df87e9d3de","type":"function","z":"77ebe1cfaa9dfc95","name":"Format","func":"msg.payload = {\n data : {\n v_Rms : msg.payload.v_Rms,\n a_Peak : msg.payload.a_Peak,\n a_Rms : msg.payload.a_Rms,\n Temperature : msg.payload.Temperature,\n Crest : msg.payload.Crest,\n status : msg.payload.status\n },\n ts : msg.payload.ts\n};\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":460,"y":420,"wires":[["e69af8e92b1e53dd"]]},{"id":"d8e24df776172919","type":"function","z":"77ebe1cfaa9dfc95","name":"Set globals","func":"","outputs":1,"noerr":0,"initialize":"flow.set(\"iolink-master-ip\",\"192.168.0.1\")\nflow.set(\"topic_prefix\",\"my_producer_code/my_site_code/my_machine_code/vvb001/X01/\")\nflow.set(\"topic_acceleration\", flow.get(\"topic_prefix\")+\"acceleration\")\nflow.set(\"topic_data\", flow.get(\"topic_prefix\")+\"data\")\n","finalize":"","libs":[],"x":130,"y":40,"wires":[[]]},{"id":"e69af8e92b1e53dd","type":"queue","z":"77ebe1cfaa9dfc95","name":"queue","connected":"^connected","connectedType":"re","disconnected":"","disconnectedType":"re","sqlite":"db_iupm_vibration.sqlite","x":770,"y":380,"wires":[["611e97610230437c"]]},{"id":"6d8440b8370c3681","type":"status","z":"77ebe1cfaa9dfc95","name":"","scope":["611e97610230437c"],"x":460,"y":480,"wires":[["e69af8e92b1e53dd","431586140eb64e2a"]]},{"id":"431586140eb64e2a","type":"switch","z":"77ebe1cfaa9dfc95","name":"","property":"status.fill","propertyType":"msg","rules":[{"t":"eq","v":"green","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":610,"y":540,"wires":[["0bf6cc6f2cd1e6e4"],["6c15c8ed03646875"]]},{"id":"0bf6cc6f2cd1e6e4","type":"exec","z":"77ebe1cfaa9dfc95","command":"sudo /sbin/mx-led-ctl -p 1 -i 2 off","addpay":"","append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":860,"y":500,"wires":[[],[],[]]},{"id":"6c15c8ed03646875","type":"exec","z":"77ebe1cfaa9dfc95","command":"sudo /sbin/mx-led-ctl -p 1 -i 2 on","addpay":"","append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":860,"y":600,"wires":[[],[],[]]},{"id":"e82fc2ada2302c5b","type":"inject","z":"77ebe1cfaa9dfc95","name":"Solid at startup","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"1","topic":"","payloadType":"date","x":500,"y":600,"wires":[["6c15c8ed03646875"]]},{"id":"a0b438e9296427d2","type":"inject","z":"77ebe1cfaa9dfc95","name":"10 seconds","props":[{"p":"topic","v":"topic_data","vt":"global"}],"repeat":"10","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":110,"y":420,"wires":[["98523b128274b976"]]},{"id":"3aab8feb913cfe79","type":"inject","z":"77ebe1cfaa9dfc95","name":"30 seconds","props":[{"p":"payload.ts","v":"","vt":"date"}],"repeat":"30","crontab":"","once":true,"onceDelay":0.1,"topic":"","payloadType":"str","x":110,"y":160,"wires":[["5e0e75248599ecc6"]]},{"id":"0904b7ae0386330d","type":"inject","z":"77ebe1cfaa9dfc95","name":"4 hours","props":[{"p":"payload.ts","v":"","vt":"date"},{"p":"topic","v":"topic_acceleration","vt":"global"}],"repeat":"14400","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":100,"y":220,"wires":[["fe141e7fea77201f"]]},{"id":"d082c0b3ea80f22b","type":"inject","z":"77ebe1cfaa9dfc95","name":"clear","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"0.3","topic":"","payload":"","payloadType":"date","x":90,"y":100,"wires":[["fefc55e113b41ff4"]]},{"id":"351911136464d8ff","type":"function","z":"77ebe1cfaa9dfc95","name":"Format","func":"msg.payload = {\n data : {\n length : msg.payload.length,\n acceleration : msg.payload.acceleration,\n crc : msg.payload.crc,\n v_Rms : msg.payload.v_Rms,\n a_Peak : msg.payload.a_Peak,\n a_Rms : msg.payload.a_Rms,\n Temperature : msg.payload.Temperature,\n Crest : msg.payload.Crest,\n status : msg.payload.status\n },\n ts : msg.payload.ts\n};\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":580,"y":340,"wires":[["5ecb3e3532bc3883","e69af8e92b1e53dd"]]},{"id":"98523b128274b976","type":"iolink-VVB001-get-data","z":"77ebe1cfaa9dfc95","name":"get data","ip":"iolink-master-ip","ipType":"global","port":1,"topic":"","x":300,"y":420,"wires":[["497953df87e9d3de"]]},{"id":"eea0899a9f0edaad","type":"iolink-VVB001-stream-blob","z":"77ebe1cfaa9dfc95","name":"blob stream","ip":"iolink-master-ip","ipType":"global","port":1,"topic":"","x":390,"y":340,"wires":[["351911136464d8ff"]]},{"id":"5e0e75248599ecc6","type":"iolink-VVB001-status-blob","z":"77ebe1cfaa9dfc95","name":"blob status","ip":"iolink-master-ip","ipType":"global","port":1,"x":270,"y":160,"wires":[[]]},{"id":"fefc55e113b41ff4","type":"iolink-VVB001-abort-blob","z":"77ebe1cfaa9dfc95","name":"abort blob","ip":"iolink-master-ip","ipType":"global","port":1,"x":290,"y":100,"wires":[]},{"id":"8c788045fcd88d76","type":"switch","z":"77ebe1cfaa9dfc95","name":"is running?","property":"payload.v_Rms","propertyType":"msg","rules":[{"t":"gt","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":280,"wires":[["eea0899a9f0edaad"]]},{"id":"fe141e7fea77201f","type":"iolink-VVB001-get-data","z":"77ebe1cfaa9dfc95","name":"get data","ip":"iolink-master-ip","ipType":"global","port":1,"topic":"","x":160,"y":280,"wires":[["8c788045fcd88d76"]]},{"id":"2708e9b5c016f96f","type":"mqtt-broker","name":"InUse MQTT Broker","broker":"mqtts://mycompany.mqtt.productinuse.com","port":"1883","tls":"273daffe.81304","clientid":"my_company_node_red_1","autoConnect":true,"usetls":true,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"273daffe.81304","type":"tls-config","name":"","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"inuse.cer","servername":"","verifyservercert":false,"alpnprotocol":""}]