Air pressure pyVCP gauge real values

More
03 Dec 2021 08:28 - 03 Dec 2021 08:29 #228265 by Leintz2
hi !
My pressure sensor is connected to mesa 7i76e analog "0" input....I can read it it and so on...but of course it show me wrong numbers...how to correct all values in properly scaled format

my postgui file contains:
#air pressure
setp hm2_7i76e.0.7i76.0.0.analogin0-scalemax 75 (this scalemax 75 gives allmost correct value with 6 bar air pressure)
net pressurein <= hm2_7i76e.0.7i76.0.0analogin0
net pressurein => pvcp.pressure

pressure sensor parameters are attached
Attachments:
Last edit: 03 Dec 2021 08:29 by Leintz2.

Please Log in or Create an account to join the conversation.

More
03 Dec 2021 09:18 #228267 by roland

Please Log in or Create an account to join the conversation.

More
03 Dec 2021 09:43 #228270 by rodw
Have a look at the lincurve component. That will let you map your output to theĀ  non linear data in your tableĀ 

Please Log in or Create an account to join the conversation.

More
06 Dec 2021 08:25 #228423 by Leintz2
hi !
problem solved...

net pressurein scale.1.in <= hm2_7i76e.0.7i76.0.0.analogin0
setp scale.1.gain 2.52
setp scale.1.offset -0.7947

custom postgui.hal
net pressurein2 scale.1.out => pyvcp.pressure

OK....HOW IS IT POSSIBLE TO DISPLAY MESSAGE (ALERT) WINDOW IF THE AIR PRESSURE VALUE DROPS BELOW A LIMIT VALUE? ANY IDEAS?

Please Log in or Create an account to join the conversation.

More
06 Dec 2021 09:08 #228427 by roland
you can use the near component to get the threshold value
linuxcnc.org/docs/2.8/html/man/man9/near.9.html
The following user(s) said Thank You: rodw

Please Log in or Create an account to join the conversation.

More
07 Dec 2021 06:23 #228507 by Leintz2
so.I added some lines..
#airpressure message
loadrt message names=msgairpressure messages="AIR PRESSURE IS TOO LOW/HIGH!"
loadrt near count=1
addf msgairpressure servo-thread
addf near.0 servo-thread

net pressurein2 => near.0.in2
setp near.0.in1 6.75
setp near.0.difference 1.25
net msgpressure <= near.0.out
net msgpressure => msgairpressure.trigger

Yes...it work if the pressure drops below the limit 5.5 bar (and AXIS will generate in the corner 11 message in same time)...One is enough....how to avoid 10 extra messages?

If I start the AXIS and the air pressure is already below 5.5 bar...I have now warning messages.
How to get one warning message if te pressure is <5.5bar ?

Please Log in or Create an account to join the conversation.

More
08 Dec 2021 06:37 #228605 by Leintz2
solution:
#airpressure message
loadrt message names=msgairpressure,msglowpressure messages="AIR PRESSURE IS TOO LOW, NO AIR PRESSURE"
loadrt near count=2
loadrt threads name2=1sek period2=1000000000

addf msgairpressure servo-thread
addf msglowpressure servo-thread
addf near.0 1sek
addf near.1 1sek

net pressurein2 => near.0.in2
setp near.0.in1 6.75
setp near.0.difference 1.25
net msgpressure <= near.0.out
net msgpressure => msgairpressure.trigger

net pressurein2 => near.1.in2
setp near.1.in1 1
setp near.1.difference 0.2
net msglowpressure2 <= near.1.out
net msglowpressure2 => msglowpressure.trigger

Please Log in or Create an account to join the conversation.

Time to create page: 0.069 seconds
Powered by Kunena Forum