Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always getting Nan output readings when using the TCTemp function for thermocouple setup #12

Open
caldecy opened this issue May 8, 2024 · 18 comments
Labels
status: waiting for information More information must be provided before work can proceed type: imperfection Perceived defect in any part of project

Comments

@caldecy
Copy link

caldecy commented May 8, 2024

Hi, I tried compiling the sample code for Thermocouple and upon checking the serial monitor output, it only reads "nan". I've checked that the thermocouple is functional, connected properly to CH0 and supplied with adequate power. I'm using the Portenta AKX00032 device to read the thermocouple values. Any help would be appreciated! Thank you.

@leonardocavagnis
Copy link
Contributor

Hi @caldecy,
Please, could you provide additional details?
For instance, a photo of physical connection, temperature probe model and everything that could be useful to better understand the issue
Thanks

@leonardocavagnis leonardocavagnis added type: imperfection Perceived defect in any part of project status: waiting for information More information must be provided before work can proceed labels May 8, 2024
@caldecy
Copy link
Author

caldecy commented May 10, 2024

Hi @leonardocavagnis,
Apologies for the late reply on the issue.
The photo of my thermocouple connection to the board:
Connection.pdf

Thermocouple model:
Thermocouple Model.pdf

The code that I use is the Temp_probes_Thermocouples.ino

And the result I get is "nan" for all channels' output. A forum on Arduino also has a similar issue.

I reached out to Arduino support team and they have since feedback that they are also aware of this library's issue with K-type Thermocouples but a new version release is not expected soon.

@leonardocavagnis
Copy link
Contributor

Thanks for reply!
What library version are you using?
Please, verify you're using the latest (1.0.1).

@caldecy
Copy link
Author

caldecy commented May 10, 2024 via email

@leonardocavagnis
Copy link
Contributor

Did you also try the old version of Portenta Machine Control library?
(not suggested to use the deprecated one, but just for double checking)

@caldecy
Copy link
Author

caldecy commented May 10, 2024 via email

@leonardocavagnis leonardocavagnis removed the status: waiting for information More information must be provided before work can proceed label May 10, 2024
@leonardocavagnis
Copy link
Contributor

Ok, thanks!
what's the version of the core?
image

@caldecy
Copy link
Author

caldecy commented May 29, 2024

The version is 4.1.3.
image

@leonardocavagnis
Copy link
Contributor

Sorry, we don't support platform.io. If you can retry with the latest Arduino IDE or cli and report if the error still occurs we'll be able to help you.

@leonardocavagnis leonardocavagnis added the status: waiting for information More information must be provided before work can proceed label Jun 3, 2024
@jonas-hagen
Copy link

jonas-hagen commented Sep 9, 2024

I am facing the same issue:

Official Arduino IDE 2.3.2
Arduino Mbed OS Portenta Boards: 4.1.5
Arduinio PortentaMachineControl: 1.0.1

Thermocouples read NaN using the Examples code, RTDs work fine, but are unfortunately not an option for my project.

Old Arduino_MachineControl library works, reads correct TC temperatures.

@leonardocavagnis could you reproduce the problem?

@leonardocavagnis
Copy link
Contributor

I am facing the same issue:

Official Arduino IDE 2.3.2 Arduino Mbed OS Portenta Boards: 4.1.5 Arduinio PortentaMachineControl: 1.0.1

Thermocouples read NaN using the Examples code, RTDs work fine, but are unfortunately not an option for my project.

Old Arduino_MachineControl library works, reads correct TC temperatures.

@leonardocavagnis could you reproduce the problem?

Sorry for the late reply.
Could you please provide more details about the code you're using, your hardware setup, and anything else that could help me better understand the issue?
Thanks!

@jonas-hagen
Copy link

Thanks for the reply!
I am using the bare examples code that ships with the respective versions of the PortentaMachineControl and Arduino_MachineControl and exactly the hardware setup described here: https://docs.arduino.cc/tutorials/portenta-machine-control/rtd-thermocouple-pmc/ there is no custom additions or other peripherals connected.

@SamThomasIaaps
Copy link

Hello,

I am also facing the same issue.

Version 1.2.1 of the library, Arduino IDE 2.3.4, MBED OS Portenta V4.2.1

I have one thermocouple (non-grounded) connected to channel 0 and the base example shows all NaN. I have also repeated this with the same response on two separate boards with the same wiring.

Just uploaded my code using the old library and that is working as usual.

Please let me know if you need anymore info.

Thanks,
Sam

@leonardocavagnis
Copy link
Contributor

Hi @SamThomasIaaps and @jonas-hagen,
Thank you for reporting!

I’m currently unable to replicate the problem on my end, so I would need as many details as possible to assist you better. Could you please provide more information about the thermocouple? What is the model? Is it grounded or ungrounded? Is it Type J or Type K?

Which channel are you using? Is your setup aligned with the connections shown below? If possible, please share a picture of your setup.

Thanks

image

@jonas-hagen
Copy link

Thanks for investigating further.

We used:

  • Type K
  • Channel 0 (and other channels)
  • Non-grounded TC

@leonardocavagnis
Copy link
Contributor

@jonas-hagen thanks!

The PMC you're using has this chip near the TEMP PROBES label. Right?
Image

@jonas-hagen
Copy link

Yes, it has this chip as far as I can remember. Let me check on Monday.

@SamThomasIaaps
Copy link

SamThomasIaaps commented Jan 21, 2025

Hi @leonardocavagnis,

We are using non grounded type K thermocouples connected as in the diagram, here is the part number from RS Components 397-1264. I have tried these in all three channels.

Also our board has the chip next to the temp probes label.

Finally, I have tried a 3-wire PT100 on channel 0 with the same library and that is working as expected.

Thanks,
Sam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for information More information must be provided before work can proceed type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

4 participants