Wiki

This version is outdated by a newer approved version.DiffThis version (04 Jan 2021 21:56) was approved by Brandon Bushey.The Previously approved version (03 Jan 2021 21:46) is available.Diff

This is an old revision of the document!


Multichannel Thermocouple - Digital Outputs - Demo

The ADuCM360_demo_cn0391 is a temperature measurement demo project which uses the thermocouple principle of measurement with the EVAL-ADICUP360 base board and an additional EVAL-CN0391-ARDZ shield. The project is created using the GNU ARM Eclipse Plug-ins in Eclipse environment.

General description

The ADuCM360_demo_cn0391 project uses the EVAL-CN0391-ARDZ shield which is a multichannel thermocouple temperature measurement system with cold junction compensation.

The EVAL-CN0391-ARDZ shield uses the AD7124-8 part which is a 8-Channel Low Noise, Low Power, 24-Bit, Sigma-Delta ADC with PGA and Reference. All signal conditioning and excitation is performed by the AD7124-8, no additional components are needed.

The EVAL-CN0391-ARDZ board has 4 thermocouple ports: P1~P4. The board has 4 Pt1000 RTDs: R1~R4 close to each thermocouple socket for cold junction compensation. It supports all 8 types of thermocouple: T, J, K, E, S, R, N, B with full range temperature measurement. The RTD operates in the 2-wire mode and the excitation current is generated by the AD7124-8.

The ADuCM360_demo_cn0391 application reads the 4 RTD channels and the 4 thermocouple channels, processes them, makes all necessary calculations in order to output a linearized temperature for each available port. The UART interface (19200 baud rate, 1 start bit, 8-bits data length, no parity bits and 2 stop bits) is used to send data to a terminal window. The user has the possibility to enable/disable calibration on each channel separately. In the terminal window after initialization will appear information messages regarding this: if calibration is enable then the user will be informed when the calibration is completed, otherwise the user will be informed that the calibration is disabled (see USE_RTD_CALIBRATION and USE_TH_CALIBRATION parameters).

Before starting the measurement it is required to setup the thermocouple types for each port (check P1_TYPE - P4_TYPE). Based on those settings the output data will be calculated and displayed in the terminal window continuously considering a data refresh parameter (see DISPLAY_REFRESH). Also the warning messages will be displayed if the final linearized temperature for the selected thermocouple is out of the boundaries:

Temperature Measurement and Linearization Algorithm

This project uses voltage to temperature solution, based on the cold junction temperature compensation and thermocouple measurements in order to provide a final linearized temperature. The linearization is dictated by thermocouple type and it uses standard formulas generated by the National Institute of Standards and Technology (NIST).

When implementing thermocouple measurements, the thermocouple measures the temperature at the thermocouple relative to the cold junction. The cold junction temperature must be added to give the overall temperature. Converting the thermocouple measured voltage to a temperature requires the data measured to be linearized. Linearization is carried out by using the cold junction temperature together with the voltage generated by the thermocouple.

Cold Junction Measurement

For the cold junction temperature measurement is used PT1000 RTD method. Cold junction reading from each RTD channel is used to calculate RTD resistance:

The PT1000 RTD is ideally 1000Ω at 0°C. There are two separate equations that are used for linearization and depending on the calculated resistance it is use one or the other:

1. RTD resistance > 1000Ω


2. RTD resistance ≤ 1000Ω


Thermocouple Measurement

For thermocouple temperature linearization are used standard NIST equations. The thermocouple type used dictates the formulas needed for the linearization. First the cold junction temperature needs to be converted to a cold junction voltage. This conversion is implemented using a standard formula. The formula is the same for all thermocouple types. However, the coefficient values used in the formula are dependent on the thermocouple type.

The final thermocouple voltage is calculated using thermocouple voltage read on the thermocouple channel and adding to this value the converted cold junction voltage:

                                                 Vtc - final voltage value for themocouple channel
    Vtc = Vtc_read + Vcj                         Vtc_read - voltage value measured on thermocouple channel
                                                 Vcj - cold junction voltage calculated using first NIST formula

For the final linearized temperature value is used the second polynomial formula provided by NIST standard:

Demo Requirements

The following is a list of items needed in order to replicate this demo.

  • Hardware
    • EVAL-ADICUP360
    • EVAL-CN0391-ARDZ
    • Up to 4 Thermocouple Sensors (Type T, J, K, E, S, R, N, B)
    • Mirco USB to USB cable
    • PC or Laptop with a USB port
  • Software
    • ADuCM360_demo_cn0391 software
    • CrossCore Embedded Studio (2.7.0 or higher)
    • ADuCM36x DFP (1.0.2 or higher)
    • CMSIS ARM Pack (4.3.0 or higher)
    • Serial Terminal Program
      • Such as Putty or Tera Term

Setting up the hardware

  1. To program the base board, set the jumpers/switches as shown in the next figure. The important jumpers/switches are highlighted in red.
  2. Connect the EVAL-CN0391-ARDZ to the Arduino connectors P2, P5, P6, P7, P8 of the EVAL-ADICUP360 board.
  3. Connect your thermocouples to the EVAL-CN0391-ARDZ via (P1-P4).
  4. Set the jumper JP1 of EVAL-CN0391-ARDZ board as shown in the picture
  5. Plug in the USB cable from the PC to the EVAL-ADICUP360 base board via the Debug USB.(P14)

Obtaining the source code

We recommend not opening the project directly, but rather import it into CCES and make a local copy in your workspace.

The source code and include files of the ADuCM360_demo_cn0391 can be found on Github:


CrossCore Embedded Studio Application Source Code:

ADuCM360_demo_cn0391

For more information on importing, debugging, or other tools related questions, please see the tools user guide.

Configuring the Software Parameters

  • RTD channel calibration - USE_RTD_CALIBRATION parameter - enable/disable calibration on RTD channel - YES → enable calibration; NO → disable calibration(CN0391.h).
  • Thermocouple channel calibration - USE_TH_CALIBRATION parameter - enable/disable calibration on thermocouple channel - YES → enable calibration; NO → disable calibration(CN0391.h).
  • Terminal refresh - DISPLAY_REFRESH parameter - how often to refresh the output data - input time value in [msec] (CN0391.h).
  • Thermocouple types - P1_TYPE - P4_TYPE parameters - selects on of available thermocouple types for each port - TYPE_T - TYPE_B → thermocouple types(Thermocouple.h).

Outputting Data

Serial Terminal Output

  1. In order to view the data, you must flash the program to the EVAL-ADICUP360.
  2. Once complete you will need to switch the USB cable from the DEBUG USB (P14) to the USER USB (P13).
  3. Then follow the UART settings below with the serial terminal program.


Following is the UART configuration.

  Select COM Port
  Baud rate: 19200
  Data: 8 bit
  Parity: none
  Start: 1 bit
  Stop: 2 bit
  Flow Control: none


How to use the Tools

The official tool we promote for use with the EVAL-ADICUP360 is CrossCore Embedded Studio. For more information on downloading the tools and a quick start guide on how to use the tool basics, please check out the Tools Overview page.

Importing

For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our How to import existing projects into your workspace section.

Debugging

For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our How to configure the debug session section.

Project structure

The ADuCM360_demo_cn0391 is a C++ project that uses ADuCM36x C/C++ Project structure.

This project contains: system initialization part - disabling watchdog, setting system clock, enabling clock for peripherals; SPI read/write; for configuring and reading from AD7124; UART read/write functions; calculation algorithm for cold junction and linearized thermocouple temperature.

In the src and include folders you will find the source and header files related to CN0391 software application. The Communication.cpp/h files contain SPI and UART specific data, meanwhile the CN0391.cpp/h files contain the calculation part, the AD7124.cpp/h files contain ADC channels handling. The RTD.h and Thermocouple.h headers contains specific data for RTD channel and Thermocouple channel used in the temperature calculation algorithm.


The RTE folder contains device and system related files:

  • Device Folder – contains low levels drivers for ADuCM360 microcontroller.(try not to edit these files)
  • system.rteconfig - Allows the user to select the peripherial components they need, along with the startup and ARM cmsis files needed for the project.



End of Document

resources/eval/user-guides/eval-adicup360/reference_designs/demo_cn0391.1609793815.txt.gz · Last modified: 04 Jan 2021 21:56 by Brandon Bushey