Reading a thermocouple ?

More
11 Jun 2019 21:46 #136663 by tommylight
Replied by tommylight on topic Reading a thermocouple ?
That is a 100k thermocouple, so it's resistance is 100Kohm or 100000 Ohm, so the input of the mesa board will drop down the voltage as it also needs a bit for it to function, and the input resistance/impedance is never infinite.
That can easily be addressed with a potentiometer instead of the resistor, so you can adjust it's value to get 6V at the input.
Do you plan on reading negative temperatures with it?
If not, better leave it as is as you will have more headroom for positive values.

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

More
11 Jun 2019 21:51 #136667 by PCW
Replied by PCW on topic Reading a thermocouple ?
The 7I76 input impedance is 20K ohm. This is why you see the large voltage
drop.
The following user(s) said Thank You: tommylight

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

More
11 Jun 2019 23:50 #136677 by superman
Replied by superman on topic Reading a thermocouple ?
Thank you @tommylight and @PCW

Meanwhile i have recognized that the input impedance is 20k --> www.mesanet.com/pdf/parallel/7i76man.pdf --> Page 14.
Sorry for that, i should have read it more carefully.

Now, i have wired as following:
+12V --- 100k NTC@25deg --- (20k) MESA-Analog0

Knowing that, i have developed my own formula to calculate Temperature from Input-Voltage, based on Measuring the Temperature with NTCs
The question is: Where can i implement my calculation?
My aim is to measure the temperature of the extruder of my 3d-printer (max 220deg) and to display the temperature via PyVCP.
I am using this thermistor.

I have read that there exists a Py-Interface to LCNC. Maybe it is possible to do this kind of calculations with it. However, there is no easy-to-understand tutorial on how to realize this kind of stuff. Is it possible to post a short example/howTo or maybe show me some links, where i can find more informations about that.
So the aim is to read in the analog input with "ain" in python, do the calculations in python and finally return the result to PyVCP.

Thank you very much in advance.

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

More
12 Jun 2019 00:00 #136678 by andypugh
Replied by andypugh on topic Reading a thermocouple ?
I would always prefer a thermocouple to a thermistor for that sort of job.

But the answer to converting ADC counts to Degrees is likely to be the "lincurve" HAL component.
That can approximate any function between known limits.

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

More
12 Jun 2019 08:10 #136701 by superman
Replied by superman on topic Reading a thermocouple ?
@andypugh

Thank you very much, with lincurve i was able to solve the problem.

If someone is interested, following the interesting HAL-lines:
loadrt lincurve count=2 personality=2,2

addf lincurve.0 servo-thread

setp lincurve.0.x-val-00 2.24
setp lincurve.0.y-val-00 24.8
setp lincurve.0.x-val-01 11.8
setp lincurve.0.y-val-01 220

net extruder-sensor-raw lincurve.0.in <= hm2_5i25.0.7i76.0.0.analogin0
net extruder-sensor-interp lincurve.0.out =>    pyvcp.extruder-sensor

Nevertheless, does someone know how to solve it using a py-script? Or is the Py-Interface not intended to do this kind of calculations?

Thanks in advance!

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

More
12 Jun 2019 08:42 #136704 by andypugh
Replied by andypugh on topic Reading a thermocouple ?

Nevertheless, does someone know how to solve it using a py-script? Or is the Py-Interface not intended to do this kind of calculations?


You could certainly write a Python userspace component to compute the temperature and make it available on a HAL pin.
linuxcnc.org/docs/2.7/html/hal/halmodule.html
But such a component does not run on a fixed realtime schedule. This means that the OS could crash and the temperature would stop updating the temperature. And this could be very bad when the temperature is that of an extruder. (one possible outcome is a house fire)
Much better to keep everything in the more dependable realtime layer.
You could do it in a C realtime component:
linuxcnc.org/docs/2.7/html/hal/comp.html
But Lincurve already exists and was designed for this sort of thing.

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

More
17 Feb 2020 10:27 - 17 Feb 2020 11:19 #157576 by Hortensie
Replied by Hortensie on topic Reading a thermocouple ?
Hi, I tried to use max31855 component and defined following items in the hal
loadrt max31855 personality=1
addf max31855.0.bitbang-spi servo-thread

setp hm2_5i25.0.7i76.0.0.output-06 true
setp hm2_5i25.0.7i76.0.0.output-07 true

net spi.clk.in hm2_5i25.0.7i76.0.0.output-06 max31855.0.clk.out
net spi.cs.in hm2_5i25.0.7i76.0.0.output-07 max31855.0.cs.out

net spi.data0.in hm2_5i25.0.7i76.0.0.input-01-not max31855.0.data.0.in
net temp_celcius max31855.0.temp-celsius.0

Before max31855 / sensor connection I got following warning (seems ok?)


File Attachment:



However when I connect my hw/sensor to those pins I got overrun current warning at linux cnc


File Attachment:



spi.clk.in & spi.cs.in signal are changing continuously values from 0 to 1


File Attachment:



Any idea about root cause?
I got this Hardware piece - max31855

Connection as below, Mesa Field input is 12V

File Attachment:

Last edit: 17 Feb 2020 11:19 by Hortensie.

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

More
17 Feb 2020 15:00 #157620 by PCW
Replied by PCW on topic Reading a thermocouple ?
You are driving a 3.3V part with 12V signals. You have likely damaged your MAX31855.

If you want to interface to a 3.3V chip, I would suggest using the (unused)?) second I/O
port on the 5I25 (P2)

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

More
17 Feb 2020 19:06 #157652 by Hortensie
Replied by Hortensie on topic Reading a thermocouple ?
Oh well... Currently P2 is unused however I have 7i74 for long term projects to get more I/O or connet some Rs422 devices. Temporary i could use it . If i got IT right i need to set W3 up to disable 5v tolerance Mode on 5i25?? Anyway any other options like 3.3v to 12v Opto coupler or other mesa cards?

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

More
27 Feb 2020 13:41 #158636 by andypugh
Replied by andypugh on topic Reading a thermocouple ?

Oh well... Currently P2 is unused


Do you have a parallel port? There is no reason you can't use that alongside a Mesa card for some extra 5V IO.

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

Moderators: cmorley
Time to create page: 0.094 seconds
Powered by Kunena Forum