cn0391 problem

Hi guys/ girls,

i am currentlyrunning the program CN0391 and I am getting some errors. I hooked up a Omega CL3512A to imitate the Thermocouple voltage.

however I am not getting the right values on Channel P1. 67°C should be in the Seebeck value for a Thermocouple T 2.864mV, and -10° should be -0.383mV

however these readout values also account for the other 4 Thermocouple inputs.

 

P1channel (Type 84)

	_ADC CJ code = 16517640

	R_rtd = 1550.49 ohmi

	cj_Temp = 143.91

	cj_Voltage = 6.40 mV

	_ADC TC code = 16777215

	th_Voltage_read = 156.25 mV

	th_Voltage = 162.65 mV



	WARNING: Linearized temperature value is not available -> exceeds upper limit!!!

		 Supported temperature range for thermocouple Type 84is [-200400

  1. and I tried to look up what a TC84 Thermocouple is what is that?
  2. is the linearisation limited? should I enlarge the Progmem with a full Thermocouple Array? and a RTD Array? the Teensy3.6 has a bit more space then the Arduino Program-mem

if I omit the DISPLAY_REFRESH delay with: a millis(); i get also 6 Time outs.

  1. where do I have to place the Display_refresh (delay) as well?

      unsigned long currentMillis=millis();
      if(currentMillis-previousMillis>=DISPLAY_REFRESH1)
      {
        CN0391_set_data();
        Serial.println("test");
        CN0391_display_data();
        previousMillis=currentMillis;
      }

I would like to use this program in another program.

  1. The teensy collects data from the Internal ADC and AD7124 sends it to the display and shows the values on screen.
  2. some help will be greatly appreciated, because I dont know how to tinker with the void CN0391_Get_Data(void); and get Data out of it.
  3. I just need data from the RTD and CN0391 in Temperature how do I get those values?

best regards

Bastiaan Pierik



grammar correction and sentences for readibility.
[edited by: BP2015-MDC at 12:17 PM (GMT 0) on 17 Aug 2020]
  • 0
    •  Analog Employees 
    on Aug 24, 2020 2:56 PM 3 months ago

    Hello,

    It would seem like the calculations are wrong because something went wrong in getting the thermocouple type. Have you changed anything in the sources? You would have to set the desired thermocouple type in this source.

    You can find some useful information for the program on the wiki. The program should give a warning if the measured temperature for a specific thermocouple is out of bounds.

    DYSPLAY_REFERESH is found here if that is the question. The code you showed should work provided you initialize previousMillis to 0.

    To get data from the device try to follow the steps in the CN0391_set_data function substituting the output parameters with the ones of your choice.

    Regards,
    Andrei.

  • Hello Andrei,

    many thanks for taking your time, and writing me. I copy pasted your code, after that I tried various methods to get acces to certain values, however I resetted them to the old factory settings. before uploading the code I made sure all the files that are needed to run the CN0391.h are included. these are communication, AD7124, RTD, Thermocouple, and all other Cpp files.

    Total Code:

    DOCX

    Page 7 = Void Setup

    Page 10 = Void Loop

    Page 10 = Menu1Check

    Page 15 = Menu1Countdown

    Page  19= TFT_HX8357

    I currently am Running this Setup with a CL3512A from Omega. I hooked up a Thermocouple T connector to the first Thermocouple input from the CN0391 Evaluation kit.I have cut out for convienience the Serial Monitor Code.

    Procedure: as given by the link:

    https://wiki.analog.com/resources/eval/user-guides/arduino-uno/reference_designs/demo_cn0391

    #define USE_RTD_CALIBRATION  YES  // Set YES to enable calibration on RTD channel, otherwise set to NO
    #define USE_TH_CALIBRATION   YES   // Set YES to enable calibration on TC channel, otherwise set to NO
    #define DISPLAY_REFRESH (10) //ms

    I set the Thermocouple.h file for all of the P1_TYPE to TYPE_T the CL3512A. the value on the screen of the CL3512A is fluctuating a bit because of the Currents that are flowing through the pins from the AD7124. the range is 32°C and fluctuates from 31.8 till 33.2C°. I guess this is normal behavior, sending currents and after on measuring them with the AD7124.

    here is the Serialmonitor output.

    I got 6 or 7x TIMEOUT and then he starts to read the values from the Thermocouples.

    Serial Monitor with Thermocouple T for all 4 thermocouple inputs.

    Serialmonitor_TC_T_25_08_2020.rtf

    by attaching the Thermocouple K cable with Thermocouple K, without the Calibrator:(just a Thermocouple K Wire with a K connector).

    Serialmonitor_TC_K_25_08_2020.rtf

    both show the Error out of bounds.

    for a K thermocouple =TC1,2,3,4 -2001372 exceeds lower Limit for all four.

    for a T thermocouple=TC1,2,3,4 -200400 exceeds upper limit for all four.

    -----------------------

    here is another Test for the AD7124. Full Test INO.

    from:https://github.com/epsilonrt/ad7124/blob/master/examples/ad7124-full-test/ad7124-full-test.ino

    DOCX

    I hope I can help I dont want to resort to a less complete solution such as a MAX31885. Everything is allready written and there. many thanks for looking into this.

    I am sorry I have to bother you guys with trivial questions like this.

    best regards

    Bastiaan

  • I guess the problem isn’t that easy to solve and you have tons of work todo.

    ill be on holidays for a week:) keep it updated would be most kind.

    best regards 

    Bastiaan

  • 0
    •  Analog Employees 
    on Aug 28, 2020 2:01 PM 3 months ago in reply to BP2015-MDC

    Hello Bastiaan,

    In debugging this, I think we should at first confirm that we are getting the correct voltage level. To calculate it try this formula after calling the `_ADCValue1[i] = CN0391_read_channel((i + 4));` routine.

    It seems that voltage readings are negative so try checking if the calibrator is connected backwards. Also try using a voltmeter to verify calibrator output.

    Let me know how it goes.

    Regards,
    Andrei.

  • I checked the Calibrator CL3512A with an Keithley 2700 and it has a small error margin. Room temperature is 25.1C° and has been calibrated accordingly. the measured voltage for a thermocouple T at 25C° =1mV.

    At 62.5C° this should be 2.519mV

    but the Keithley gives me a 1.519mV for 62.5C°

    i guess this is added in the Keithley 2700 itself because of the cold junction.

    the Thermocouple.h is set on Thermocouple T for all the thermcouple Inputs.

    Serial monitor gives me: could it be that the value should be divided by 100?

    P1channel (Type 84)

        _ADC CJ code = 16777215

        R_rtd = 1600.00 ohmi

        cj_Temp = 157.17

        cj_Voltage = 7.07 mV

        _ADC TC code = 16777215

        th_Voltage_read = 156.25 mV

        th_Voltage = 163.32 mV



        WARNING: Linearized temperature value is not available -> exceeds upper limit!!!

             Supported temperature range for thermocouple Type 84is [-200400

    ].

    so I tried to place the code exactly behind you told me and the beginning values from the Serialmonitor the first batch of values 1,2,3,4 are the same if the values are to high.

    second batch are:

    0

    0.00

    8355840

    0

    -6.25

    8355840

    0

    798.44

    8355840

    0

    798.44

    test

    P1channel (Type 84)

        _ADC CJ code = 8388608

        R_rtd = 0.00 ohmi

        cj_Temp = -242.02

        cj_Voltage = -6.13 mV

        _ADC TC code = 0

        th_Voltage_read = -156.25 mV

        th_Voltage = -162.38 mV



        WARNING: Linearized temperature value is not available -> exceeds lower limit!!!

             Supported temperature range for thermocouple Type 84 [-200400

    ].

    P2channel (Type 84)

        _ADC CJ code = 8355840

        R_rtd = -6.25 ohmi

        cj_Temp = -243.41

        cj_Voltage = -6.14 mV

        _ADC TC code = 0

        th_Voltage_read = -156.25 mV

        th_Voltage = -162.39 mV



        WARNING: Linearized temperature value is not available -> exceeds lower limit!!!

             Supported temperature range for thermocouple Type 84 [-200400

    ].

    P3channel (Type 84)

        _ADC CJ code = 12574720

        R_rtd = 798.44 ohmi

        cj_Temp = -51.14

        cj_Voltage = -1.86 mV

        _ADC TC code = 0

        th_Voltage_read = -156.25 mV

        th_Voltage = -158.11 mV



        WARNING: Linearized temperature value is not available -> exceeds lower limit!!!

             Supported temperature range for thermocouple Type 84 [-200400

    ].

    P4channel (Type 84)

        _ADC CJ code = 12574720

        R_rtd = 798.44 ohmi

        cj_Temp = -51.14

        cj_Voltage = -1.86 mV

        _ADC TC code = 0

        th_Voltage_read = -156.25 mV

        th_Voltage = -158.11 mV



        WARNING: Linearized temperature value is not available -> exceeds lower limit!!!

             Supported temperature range for thermocouple Type 84 [-200400


    many thanks.

    Bastiaan