Digital temperature sensor chip control method based on FPGA
Through the connection of the FPGA controller with the digital temperature sensor chip and the over-temperature warning prediction algorithm, the problem of insufficient reaction time in the digital temperature sensor chip control is solved, and faster alarm response and better safety are achieved.
Patent Information
- Application Number
- CN202311826438.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2025-07-22
AI Technical Summary
During the control process of existing digital temperature sensor chips, when the temperature changes rapidly, the reaction time is insufficient, and it is difficult to issue alarms in time, resulting in safety hazards.
The FPGA controller is used to connect it to the digital temperature sensor chip, set the temperature alarm interval threshold and the temperature change threshold within time, and use the over-temperature early warning prediction algorithm to conduct predictive monitoring based on the neural network, and directly issue an alarm.
Faster alarm response is achieved, more processing time is provided, and safety is improved, especially when temperature changes rapidly and alarms are issued.
Smart Images

Figure CN120352046A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital temperature sensor chip control, and particularly to a method for controlling a digital temperature sensor chip based on FPGA. Background Art
[0002] A digital temperature sensor is a sensor that can convert the physical quantity of temperature into a digital quantity that can be directly read by data acquisition devices such as computers, PLCs, and intelligent meters through a temperature-sensitive element and a corresponding circuit. Its chip is the main component of the digital temperature sensor, and the chip affects the accuracy, sensitivity, etc. of the digital temperature sensor.
[0003] The temperature control system plays a very important role in both industrial production processes and daily life. An excessively low or high temperature environment is not only a waste of resources, but also has a serious impact on the lifespan of machines and workers, and is very likely to cause serious economic property losses. In life, the temperature is also crucial for people's life and production. Therefore, whether in industrial production or life, the measurement and control of temperature are very important.
[0004] Currently, in the process of controlling a digital temperature sensor chip, since the main relevant parameter is the temperature value, in the prior art, during the control process of the digital temperature sensor chip, when the temperature reaches a certain warning value, corresponding reminders and alarms are issued. However, during use, since the temperature is constantly changing, and then reaches the warning value during the changing process, but then the temperature will still change. The reaction time left for personnel during this process is still insufficient, especially in the state of rapid temperature change. If the warning value is lowered, it is easy to have problems in defining this value. Therefore, the present invention proposes a method for controlling a digital temperature sensor chip based on FPGA to solve the problems existing in the prior art. Summary of the Invention
[0005] In view of the above problems, the object of the present invention is to propose a method for controlling a digital temperature sensor chip based on FPGA, which has the advantage of predictive control and solves the problems existing in the prior art.
[0006] To achieve the object of the present invention, the present invention is realized through the following technical solutions: A method for controlling a digital temperature sensor chip based on FPGA includes the following steps:
[0007] Step 1: Connect the FPGA controller and the digital temperature sensor chip physically. The specific connection method is to connect the output end of the digital temperature sensor chip to the input end of the FPGA controller through the I / O port and the bus protocol.
[0008] Step 2: Set the working parameters of the digital temperature sensor chip in the FPGA controller and store them for direct calling when setting the FPGA controller later. The working parameters include communication parameters and measurement range;
[0009] Step 3: Preset the temperature alarm interval thresholds in the FPGA controller, which are the highest alarm temperature threshold A and the lowest alarm temperature threshold B respectively. It also includes the temperature increase threshold C within a specified time and the temperature decrease threshold D within a specified time;
[0010] Step 4: After setting in the FPGA controller, the FPGA controller reads the digital temperature value of the digital temperature sensor chip, calculates it, and performs corresponding operations according to the calculation results;
[0011] Step 5: Transmit the read digital temperature to the corresponding temperature display through the FPGA controller for display.
[0012] Further improvement lies in: In the above Step 2, the communication parameters include communication protocol, data format, and communication rate, and the measurement range is the measurement range of the digital temperature sensor chip.
[0013] Further improvement lies in: There are several groups of the working parameters, and these several groups of working parameters are independent of each other.
[0014] Further improvement lies in: In the above Step 3, the time units of the temperature increase threshold C within a specified time and the temperature decrease threshold D within a specified time are both seconds.
[0015] Further improvement lies in: In the above Step 4, when the comparison result reaches the preset temperature alarm interval threshold, the FPGA controller issues a corresponding control signal. When the comparison result is lower than the preset temperature alarm interval threshold, go to Step 5.
[0016] Further improvement lies in: In the above Step 4, the calculation results include the current temperature value and the temperature change value per second.
[0017] Further improvement lies in: In the above Step 4, the calculation method of the temperature change value per second is: subtract the temperature value at the earliest time from the temperature value at the last time in the specified time interval, and then divide by the specified time interval.
[0018] Further improvement lies in: In the above Step 5, the calculation results are also displayed on the temperature display.
[0019] Further improvement lies in: In the above Step 4, an over-temperature warning prediction algorithm is set in the FPGA controller, and the read digital temperature value is calculated using the over-temperature warning prediction algorithm.
[0020] Further improvement lies in: The over-temperature warning prediction algorithm is built based on a neural network.
[0021] The beneficial effects of the present invention are as follows: By introducing two values, namely the temperature increase threshold within a specified time and the temperature decrease threshold within a specified time, and calculating these two values based on the FPGA controller, during the control process of the digital temperature sensor chip, the calculation result is used to determine whether the current temperature exceeds the preset threshold. When it exceeds, a corresponding alarm is directly issued without waiting for the temperature to reach other thresholds. Therefore, the present invention adopts a predictive monitoring method to play a role in predicting alarms. Compared with the alarm state of conventional thresholds, the present invention has a faster effect and relatively more time is left for personnel to handle, thus having better safety. Brief Description of the Drawings
[0022] Figure 1 It is a schematic diagram of the control process of the digital temperature sensor chip of the present invention. Detailed Embodiments
[0023] To deepen the understanding of the present invention, the following will further elaborate on the present invention in combination with embodiments. These embodiments are only used to explain the present invention and do not constitute a limitation on the protection scope of the present invention.
[0024] Embodiment 1
[0025] According to Figure 1 As shown, this embodiment proposes a method for controlling a digital temperature sensor chip based on FPGA, including the following steps:
[0026] Step 1: Connect the FPGA controller and the digital temperature sensor chip physically. The specific connection method is to connect the output end of the digital temperature sensor chip to the input end of the FPGA controller through the I / O port and the bus protocol;
[0027] Step 2: Set the working parameters of the digital temperature sensor chip in the FPGA controller and store them for subsequent direct invocation when setting the FPGA controller. Its working parameters include communication parameters and measurement range. Among them, the communication parameters include communication protocol, data format, and communication rate, and the measurement range is the measurement range of the digital temperature sensor chip. And several groups of the working parameters are provided. In this embodiment, five groups of preset working parameters are set, and several groups of the working parameters are independent of each other, that is, corresponding working parameters are set for different working states. Therefore, after initialization, they can be directly invoked, and further, they can also be reset;
[0028] Step 3: Preset temperature alarm range thresholds in the FPGA controller, which are the highest alarm temperature threshold A and the lowest alarm temperature threshold B respectively. It also includes the temperature increase threshold C within a specified time and the temperature decrease threshold D within a specified time. The time units of the temperature increase threshold C within a specified time and the temperature decrease threshold D within a specified time are both seconds;
[0029] Step 4: After setting in the FPGA controller, the FPGA controller reads the digital temperature value of the digital temperature sensor chip and calculates it. Corresponding operations are performed according to the calculation results. Specifically, an over-temperature warning prediction algorithm is set in the FPGA controller. The read digital temperature value is calculated using the over-temperature warning prediction algorithm, and the over-temperature warning prediction algorithm is built based on a neural network. Thus, according to the calculation results, the FPGA controller issues corresponding control signals. When the result is lower than the preset temperature alarm range threshold, go to Step 5. The results include the current temperature value and the temperature change value per second. The calculation method of the temperature change value per second is: subtract the temperature value at the earliest time from the temperature value at the last time within the specified time interval, and then divide by the specified time interval;
[0030] Step 6: Transmit the read digital temperature to the corresponding temperature display through the FPGA controller for display, and at the same time display the calculation results in the temperature display.
[0031] Embodiment 2
[0032] According to Figure 1 , including the following steps:
[0033] Step 1: To optimize the convenience of connecting the digital temperature sensor chip to the FPGA controller, the digital temperature sensor chip usually adopts a single-wire protocol. Its interface with the FPGA controller only needs to occupy one I / O port and does not require any external components. It directly converts the ambient temperature into a digital signal and serially outputs it in digital code format. Therefore, the FPGA controller can directly receive the digital signal for subsequent control processing;
[0034] Step 2: After the FPGA controller is connected to the digital temperature sensor chip, it does not start working yet. The FPGA controller needs to be initialized first, and then the working parameters of the digital temperature sensor chip are set to make the digital temperature sensor chip meet the requirements of subsequent work. The specific working parameters include communication parameters and measurement range. Each digital temperature sensor chip has its own communication protocol, such as baud rate, data format, etc. Therefore, through the initialization process, these communication parameters can be set so that the digital temperature sensor chip can correctly receive and send data. Specifically, in the embodiment, the communication parameters include communication protocol, data format, and communication rate. The initialization of the communication protocol is to ensure that the digital temperature sensor chip can correctly connect to the FPGA controller and send and receive data. The data format is for the FPGA controller to read conveniently, and the communication rate determines the communication efficiency. The corresponding measurement range is to ensure that the digital temperature sensor chip can measure temperature within the correct range, avoiding overload or underload of the digital temperature sensor chip and ensuring the measurement accuracy of the digital temperature sensor chip;
[0035] Step 3: In this embodiment, since the present invention mainly relates to the control of digital temperature sensor chips, and temperature measurement and control are very important in industrial production and life, the digital temperature sensor chip is used to measure and control temperature. Then, during the process of temperature measurement and control, the temperature often reaches a certain warning value, so the need for reminder and alarm is increased. Traditionally, only a maximum alarm temperature threshold A and a minimum alarm temperature threshold B are set. After reaching the corresponding thresholds, control signals for reminder and alarm are sent. However, in this embodiment, a temperature increase threshold C within a specified time and a temperature decrease threshold D within a specified time are also added. The time units of the temperature increase threshold C within a specified time and the temperature decrease threshold D within a specified time are both seconds, that is, simplified to how many degrees the temperature rises per second and how many degrees the temperature drops per second. When encountering a sudden temperature situation, when it reaches the maximum alarm temperature threshold A or the minimum alarm temperature threshold B, the temperature has already changed unusually at this time. Then, after the alarm is issued, the temperature will still change. Therefore, the reminder at this time will be relatively slow. Therefore, the present invention collects temperature changes through the FPGA controller, calculates them, and converts them into the temperature change per second. Thus, the present invention adopts a predictive monitoring method to play a role in predictive alarm. Therefore, when it is applied to equipment, it can assist in predicting possible faults of the equipment, perform safety maintenance in advance, and reduce the risks that may occur to the equipment in the future. When it is applied to life, when the temperature changes rapidly, it can remind users in advance. Then, users can take measures such as opening windows in advance or running out in advance. Therefore, the present invention has a good predictive judgment effect;
[0036] Step 4: In this embodiment, after programming and setting in the FPGA controller, during the operation of the digital temperature sensor, corresponding control of the digital temperature sensor chip is performed. The FPGA controller reads the digital temperature value of the digital temperature sensor chip, calculates it, and performs corresponding operations according to the calculation results. Specifically, an over-temperature warning prediction algorithm is provided in the FPGA controller. The over-temperature warning prediction algorithm is used to calculate the read digital temperature value, and the over-temperature warning prediction algorithm is built based on a neural network. Thus, according to the calculation results, the FPGA controller issues corresponding control signals, and the control signals are sent to an external alarm. That is, when the present invention starts to work, the FPGA controller is electrically connected to the external alarm. The FPGA controller issues corresponding control signals according to the comparison results. After receiving the control signals, the external alarm emits an alarm sound to play a warning effect. When the result is lower than the threshold of the preset temperature alarm range, go to Step 5, where the result includes the current temperature value and the temperature change value per second. The calculation method of the temperature change value per second is: subtract the temperature value at the earliest time from the temperature value at the last time in the specified time interval, and then divide by the specified time interval. The calculation result includes the current temperature value and the temperature change value per second.
[0037] The corresponding calculation method of the temperature change value per second is: subtract the temperature value at the earliest time from the temperature value at the last time in the specified time interval, and then divide by the specified time interval. For example, if the specified time interval is 10s, that is, subtract the temperature value at the first second from the temperature value at the last second, and then divide by 10s. The result obtained is the temperature change value per second.
[0038] Step 5: Thus, under normal circumstances, the digital temperature read by the FPGA controller is transmitted to the corresponding temperature display for display, and the calculation result, that is, the temperature change value per second, is also displayed.
[0039] An over-temperature warning prediction algorithm is provided inside the FPGA controller. Thus, the read digital temperature value is calculated using the over-temperature warning prediction algorithm, and the obtained result is used for subsequent comparison. Specifically, in the over-temperature warning prediction algorithm, a large amount of historical temperature data is first collected. These data will serve as the input of the neural network for training and testing the model. The subsequent temperature change is predicted based on the change of the historical temperature data. Then, the collected data is preprocessed, which includes removing noise and standardization. Then the data is divided into a training set and a testing set. The training set is used to train the neural network, and the testing set is used to evaluate the performance of the neural network. Then a neural network model is constructed. The neural network model has a single hidden layer structure, which includes a set of input layers, a set of hidden layers, and a set of output layers. Then the training set is used to train the neural network model. During the training process, the neural network will continuously adjust its weights and biases through the backpropagation algorithm to minimize the prediction error. Then the testing set is used to test the trained neural network model. After ensuring that its performance meets the requirements, it is applied to the FPGA controller, that is, the over-temperature warning prediction algorithm is obtained. Thus, after the read digital temperature value enters, the corresponding prediction result is obtained. Since a corresponding processing result will be generated after each prediction result, this processing result is the actual processing result. Thus, based on the neural network-based over-temperature warning prediction algorithm, training is carried out according to each prediction result and processing result, so as to have the effect of self-learning and improve the accuracy of prediction.
[0040] The above shows and describes the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. What is described in the above embodiments and the specification only illustrates the principles of the present invention. Without departing from the framework and scope of application of the present invention, the present invention will have various changes and improvements, and these changes and improvements all fall within the scope of the present invention claimed. The scope of protection claimed by the present invention is defined by the appended claims and their equivalents.
Claims
1. A control method for a digital temperature sensor chip based on FPGA, characterized in that: It includes the following steps: Step 1: Connect the FPGA controller and the digital temperature sensor chip physically. The specific connection method is to connect the output end of the digital temperature sensor chip to the input end of the FPGA controller through the I / O port and the bus protocol; Step 2: Set the working parameters of the digital temperature sensor chip in the FPGA controller and store them for direct calling when setting the FPGA controller later. Its working parameters include communication parameters and measurement range; Step 3: Preset the temperature alarm interval thresholds in the FPGA controller, which are the highest alarm temperature threshold A and the lowest alarm temperature threshold B respectively. It also includes the temperature increase threshold C within a specified time and the temperature decrease threshold D within a specified time; Step 4: After setting in the FPGA controller, the FPGA controller reads the digital temperature value of the digital temperature sensor chip, calculates it, and performs corresponding operations according to the calculation results; Step 5: Transmit the read digital temperature to the corresponding temperature display through the FPGA controller for display.
2. The control method of a digital temperature sensor chip based on FPGA according to claim 1, wherein: In Step 2, the communication parameters include communication protocol, data format, and communication rate, and the measurement range is the measurement range of the digital temperature sensor chip.
3. A control method for a digital temperature sensor chip based on FPGA according to claim 1, characterized in that: There are several groups of the working parameters, and these several groups of working parameters are not related to each other.
4. A control method for a digital temperature sensor chip based on FPGA according to claim 1, characterized in that: In Step 3, the time units of the temperature increase threshold C within a specified time and the temperature decrease threshold D within a specified time are both seconds.
5. A control method for a digital temperature sensor chip based on FPGA according to claim 1, characterized in that: In Step 4, when the comparison result reaches the preset temperature alarm interval threshold, the FPGA controller issues a corresponding control signal. When the comparison result is lower than the preset temperature alarm interval threshold, it enters Step 5.
6. A control method for a digital temperature sensor chip based on FPGA according to claim 1, characterized in that: In Step 4, the calculation results include the current temperature value and the temperature change value per second.
7. A control method for a digital temperature sensor chip based on FPGA according to claim 1, characterized in that: In Step 4, the calculation method of the temperature change value per second is: subtract the temperature value at the earliest time from the temperature value at the last time in the specified time interval, and then divide by the specified time interval.
8. A control method for a digital temperature sensor chip based on FPGA according to claim 1, characterized in that: In Step 5, display the calculation results in the temperature display.
9. A control method for a digital temperature sensor chip based on FPGA according to claim 1, characterized in that: In Step 4, an over-temperature warning prediction algorithm is set in the FPGA controller, and the read digital temperature value is calculated using the over-temperature warning prediction algorithm.
10. A control method for a digital temperature sensor chip based on FPGA according to claim 9, characterized in that: The over-temperature warning prediction algorithm is built based on a neural network.