Temperature control method and system for detection of exhaled gas alcohol content detector
The temperature control of the alcohol content detector of the exhaled gas through the fuzzy PID algorithm solves the problems of inaccurate temperature control and poor environmental adaptability in the prior art, and achieves rapid and accurate temperature adjustment, which improves the reliability of the verification results.
Patent Information
- Application Number
- CN202511045273.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2025-08-26
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The temperature control method of the exhaled gas alcohol content detector in the prior art has the problems of long preheating time, inaccurate temperature control and poor adaptability to environmental changes, which affects the accuracy of the calibration results.
The fuzzy PID algorithm is used to dynamically adjust the proportion, integral and differential parameters. Through the fuzzy processing of temperature difference and temperature difference change rate, combined with the triangular membership function and preset fuzzy rule table, the precise temperature control of the alcohol content detector of the exhaled gas is achieved.
It improves the accuracy and stability of temperature control, reduces the computational complexity, ensures that the temperature quickly and accurately approaches the target value, and improves the reliability of the verification results.
Smart Images

Figure CN120540446A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of metrological verification of exhaled gas alcohol content detectors, and in particular relates to a temperature control method and system for verification of exhaled gas alcohol content detectors. Background Art
[0002] The exhaled alcohol detector is a measuring instrument used by traffic law enforcement departments to detect the alcohol content in exhaled breath. It is a national mandatory metrological verification instrument. Its accuracy is a people's livelihood measuring instrument that ensures traffic safety and the rights and interests of people's lives and property. At the same time, in some enterprises that prohibit working after drinking, the alcohol content in employees' exhaled breath is tested to ensure the safety of the company's personnel and property.
[0003] The current metrological calibration basis for exhaled breath alcohol content detectors is the national calibration procedure JJG657-2019 "Exhaled Breath Alcohol Content Detector", which conducts periodic mandatory calibration to ensure that its measurement value is accurate and reliable. The metrological calibration personnel conduct calibration in accordance with the calibration procedure. The procedure has clear requirements for the temperature of the device, which directly affects the accuracy of the calibration value. The currently used metrological calibration device has a long preheating time, and sufficient preheating time is required to ensure that the outlet temperature of the calibration meets the calibration requirements. The temperature needs to be effectively controlled during the calibration process.
[0004] The outlet temperature of the breath alcohol detector calibration device is controlled using a fuzzy PID algorithm. Traditional fuzzy PID algorithms require a rigorous mathematical model to calculate the optimal temperature control output. When performing temperature control in a breath alcohol detector calibration device, the temperature sensor within the device is affected by the calibration environment and installation method. This uncertainty increases with environmental influences and the nonlinearity of the sensor's heat transfer characteristics.
[0005] Prior art Chinese patent application CN202210420035.5 discloses a flow and temperature control method for the calibration of an exhaled gas alcohol content detector, in which both the primary heating control system and the secondary heating control system adopt a variable domain fuzzy PI control algorithm; the variable domain fuzzy PI control algorithm is divided into three parts: fuzzification, fuzzy reasoning and defuzzification, wherein the input of fuzzy reasoning is the deviation e and the deviation change rate ec, and reasoning is performed through fuzzy rules, and then the proportional and integral parameters of the PI controller are defuzzified, and the result is output to the PI controller, thereby controlling the heating temperature in real time.
[0006] This existing technology uses a variable universe fuzzy PI algorithm, adjusting only two PI parameters. This results in weak fine-tuning capabilities when approaching the target temperature. Furthermore, this existing technology introduces a scaling factor to dynamically adjust the universe, requiring real-time calculation of the universe scaling factor. This increases the complexity of exponential operations and parameter tuning, resulting in increased computational time and impacting real-time control. Summary of the Invention
[0007] The purpose of the present invention is to provide a temperature control method and system for the calibration of an exhaled breath alcohol content detector, which partially solves or alleviates the above-mentioned deficiencies in the prior art, can achieve high-precision real-time control of temperature, and at the same time has good adaptability to changes in the calibration environment, solves the uncertainty and nonlinearity of temperature changes, and achieves real-time control of heating or cooling, so that the outlet gas temperature of the calibration generator can be controlled at any time, so that its temperature is as close as possible to the simulated human body exhaust temperature, thereby improving the accuracy of the calibration results.
[0008] In order to solve the above-mentioned technical problems, the present invention specifically adopts the following technical solutions: a temperature control method for calibrating an exhaled breath alcohol content detector, comprising: Get the current temperature and calculate the temperature difference and temperature difference change rate between the current temperature and the target temperature; Performing fuzzy processing on the temperature difference and the temperature difference change rate to obtain the membership degree corresponding to the temperature difference and the temperature difference change rate; According to the membership of the temperature difference and the temperature difference change rate, the fuzzy membership of the control parameter is queried from a preset fuzzy rule table; the control parameter is used to perform PID temperature control on the exhaled gas alcohol content detector, including a proportional coefficient, an integral coefficient, and a differential coefficient; The fuzzy membership of the control coefficient is clarified to obtain the value of the control coefficient; Substitute the value of the control coefficient into the PID control formula to output the control quantity to control the temperature of the exhaled breath alcohol content detector.
[0009] As an improvement, the method for fuzzy processing the temperature difference and the temperature difference change rate includes: Divide the temperature difference range into n continuous intervals, thereby obtaining n-1 temperature difference points, where the temperature difference points are the dividing points between the intervals, and each temperature difference point corresponds to a membership degree; Divide the temperature difference change rate range into n continuous intervals, thereby obtaining n-1 temperature difference change rate points, where the temperature difference change rate points are dividing points between intervals, and each temperature difference change rate point corresponds to a membership degree; Assign the temperature difference and the temperature difference change rate to the corresponding degree of membership.
[0010] As an improvement, the target temperature is 34°C, the temperature difference range is [-0.5°C, 0.5°C], and the temperature difference change rate range is [-0.05°C, 0.05°C]; The temperature difference range is divided into 10 continuous intervals, including [-0.5℃~-0.4℃], (-0.4℃~-0.3℃], (-0.3℃~-0.2℃], (-0.2℃~-0.1℃], (-0.1℃~0.0℃], (0.0℃~0.1℃], (0.1℃~0.2℃], (0.2℃~0.3℃], (0.3℃~0.4℃], (0.4℃~0.5℃]; the temperature difference points include -0.4℃, -0.3℃, -0.2℃, -0.1℃, 0.0℃, 0.1℃, 0.2℃, 0.3℃, and 0.4℃; The temperature difference change rate range is divided into 10 continuous intervals, including [-0.05℃ / s~-0.04℃ / s], (-0.04℃ / s~-0.03℃ / s], (-0.03℃ / s~-0.02℃ / s], (-0.02℃ / s~-0.01℃ / s], (-0.01℃ / s~0℃ / s], (0℃ / s~0.01℃ / s], (0.01℃ / s~0.0 2℃ / s], (0.02℃ / s~0.03℃ / s], (0.03℃ / s~0.04℃ / s], (0.04℃ / s~0.05℃ / s]; the temperature difference change rate points include -0.04℃ / s, -0.03℃ / s, -0.02℃ / s, -0.01℃ / s, 0.00℃ / s, 0.01℃ / s, 0.02℃ / s, 0.03℃ / s, 0.04℃ / s; The membership degrees include NA, NB, NM, NS, ZO, PS, PM, PB, and PA.
[0011] As an improvement, the fuzzy rule table is: .
[0012] As an improvement, the method of clarifying the fuzzy membership of the control coefficient includes using the formula:
[0013] Calculate the value of the control parameter; where K is the value of the control parameter, z i is the temperature difference point or temperature difference change rate point of the i-th membership degree, is the value of the i-th membership, i is the serial number of the membership, and n is the number of memberships.
[0014] As an improvement, use triangular membership functions:
[0015] Calculate the value of the membership; wherein c is the membership vertex, a is the membership left endpoint, b is the membership right endpoint, and x is the temperature difference or the temperature difference change rate.
[0016] As an improvement, the PID control formula is: ; in, u k is the fuzzy PID temperature control output, K p is the proportionality coefficient, K i is the differential coefficient, K d is the differential coefficient, e k is the discrete deviation of temperature at the current moment, e k-1 is the temperature discrete deviation at the previous moment, e j is the jth discrete temperature deviation, j is the serial number of the discrete temperature deviation, and k is the number of discrete temperature deviation numbers.
[0017] As an improvement, a temperature sensor is provided on the gas flow path of the exhaled gas alcohol content detector for collecting the current temperature, and a control module is provided to control the temperature sensor.
[0018] As an improvement, the control method of the temperature sensor includes: S101 initialization; S102 waits for receiving a message; After receiving the message, S103 determines whether the message verification is successful; if successful, execute step S104; otherwise, discard the message and execute step S102; S104 parses the message and starts saving the new temperature value; determines whether the command field in the message is "end measurement", if so, turns off the timer; if not, executes step S105; S105 determines whether the command field in the message is "start measurement". If so, start the timer to collect data and return a success code; otherwise, execute step S106; S106 determines whether the counter value of the data circular queue is greater than a quantity threshold. If so, data of the quantity threshold is taken from the data circular queue; otherwise, all data in the data circular queue is taken out.
[0019] The present invention also provides a temperature control system for calibrating an exhaled gas alcohol content detector, comprising: The temperature acquisition module is used to obtain the current temperature and calculate the temperature difference and temperature difference change rate between the current temperature and the target temperature; A membership degree acquisition module is used to perform fuzzy processing on the temperature difference and the temperature difference change rate to obtain the membership degree corresponding to the temperature difference and the temperature difference change rate; A control parameter membership acquisition module is used to query the membership of the control parameters from a preset fuzzy rule table based on the membership of the temperature difference and the temperature difference change rate; the control parameters are used to perform PID temperature control on the exhaled gas alcohol content detector, including proportional coefficients, integral coefficients, and differential coefficients; The control parameter clarification module is used to clarify the fuzzy membership of the control coefficient and obtain the value of the control coefficient; The control quantity output module is used to substitute the value of the control coefficient into the PID control formula to output the control quantity to control the temperature of the exhaled gas alcohol content detector.
[0020] Beneficial effects: This invention utilizes a fuzzy PID algorithm, dynamically adjusting the proportional, integral, and differential parameters simultaneously. As the target temperature approaches, the differential component rapidly adjusts the control variable based on the rate of change of the temperature difference, effectively suppressing temperature overshoot. When the temperature approaches 34°C and the heating rate is rapid, the differential coefficient Kd increases, initiating a preemptive reverse control action to steadily approach the target temperature. This prevents significant temperature fluctuations near the target value and significantly improves the accuracy and stability of temperature control.
[0021] This invention employs a more detailed fuzzy delineation of temperature differences and their rates of change, enabling a more precise description of system states through the use of multiple continuous intervals and triangular membership functions. Furthermore, a pre-defined fuzzy rule table fully accounts for various possible operating conditions, providing clear adjustment strategies for each parameter based on different temperature differences and rates of change. This meticulous rule design enables the system to make more accurate control decisions under various operating conditions, particularly enabling more precise fine-tuning when approaching the target temperature.
[0022] This solution eliminates the need for complex exponential calculations. Instead, the blurring and sharpening process relies primarily on simple linear operations and membership function calculations, resulting in a relatively small computational footprint. The triangular membership function used in calculating membership is a simple linear function that is easy to implement and calculate. This simple calculation method reduces processor performance requirements, shortens computation time, and improves the system's real-time performance.
[0023] This invention utilizes a 20ms timer interrupt and 25-point temperature acquisition method to quickly capture temperature changes. Furthermore, a data loop queue management mechanism ensures efficient and orderly data processing, avoiding data backlogs and delays. During each timer interrupt, the system promptly processes newly acquired temperature data and rapidly adjusts PID parameters based on fuzzy rules to achieve real-time temperature control. This efficient real-time response capability enables the system to rapidly adjust to temperature changes, ensuring that the temperature remains stable near the target value. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for the embodiments or the description of the prior art. In all drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the various elements or parts are not necessarily drawn according to the actual scale. Obviously, the drawings described below are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without inventive work.
[0025] Figure 1 This is a flow chart of embodiment 1 of the present invention.
[0026] Figure 2 This is a structural diagram of embodiment 2 of the present invention. DETAILED DESCRIPTION
[0027] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0028] Herein, suffixes such as "module," "component," or "unit" used to represent elements are only used to facilitate description of the present invention and have no specific meaning. Therefore, "module," "component," or "unit" may be used interchangeably.
[0029] As used herein, terms such as "upper," "lower," "inner," "outer," "front," "back," "one end," and "the other end" indicate positions or locations based on those shown in the accompanying drawings. These terms are intended solely to facilitate and simplify the description of the present invention and are not intended to indicate or imply that the devices or components referred to must have, be constructed, or operate in a specific orientation. Therefore, they should not be construed as limitations on the present invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0030] As used herein, unless otherwise expressly specified or limited, the terms "installed," "provided with," and "connected" should be understood broadly. For example, "connected" may refer to a fixed connection, a detachable connection, or an integral connection; it may refer to a mechanical connection, a direct connection, an indirect connection via an intermediate medium, or internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention on a case-by-case basis.
[0031] As used herein, "and / or" includes any and all combinations of one or more of the associated listed items.
[0032] Herein, "plurality" means two or more than two, ie, it includes two, three, four, five, etc.
[0033] Example 1: like Figure 1 As shown, this embodiment provides a temperature control method for calibrating an exhaled breath alcohol content detector, comprising: S1 obtains the current temperature and calculates the temperature difference and the temperature difference change rate between the current temperature and the target temperature.
[0034] According to the requirements of the calibration procedure, the outlet temperature of the exhaled gas alcohol content detector is (34±0.5)℃, so the target temperature value is 34℃. The difference between the temperature measurement value and the target temperature value is the error e, and the temperature difference change rate is ec. The two are used as the input of the controller.
[0035] For example, if the current measured outlet temperature is 33.6°C, the error e = 33.6 - 34 = -0.4°C, indicating that the actual temperature is lower than the target. By analyzing the error e, the controller can determine the degree of deviation between the current temperature and the target temperature and determine the appropriate control measures to adjust the temperature.
[0036] The temperature difference rate of change (ec) measures the rate of temperature change over time. It's the ratio of the change in temperature error (e) over a specific time interval to the time interval. For example, at time t1, the error (e1) is -0.3°C. After a period (Δt), at time t2, the error (e2) is -0.2°C. Then, the temperature difference rate of change (ec) = (e2 - e1) / Δt = (-0.2 - (-0.3)) / Δt = 0.1 / Δt. The temperature difference rate of change (ec) helps the controller understand the trend of temperature changes and determine whether the temperature is rapidly approaching the target value, moving away from it, or remaining stable. A positive and large value for ec indicates that the temperature is rapidly rising toward the target. A negative and large absolute value for ec indicates that the temperature is rapidly falling away from the target.
[0037] The error e and the temperature differential rate of change ec serve as inputs to the controller, providing real-time temperature status information. Based on these two inputs, the controller uses a fuzzy PID control algorithm to calculate and output corresponding control signals to adjust the power of the heating or cooling device, thereby achieving precise control of the breath alcohol content detector's outlet temperature.
[0038] In this embodiment, a temperature sensor is provided on the gas flow path of the exhaled breath alcohol content detector to collect the current temperature, and a control module is provided to control the temperature sensor. Specifically, based on the configurable conditions of the alcohol content detector calibration device, a platinum thermistor is selected as the temperature sensor and fixed at the center of the gas flow path. The platinum resistor has high precision and good stability. The temperature sensor is connected to the temperature display instrument using a four-wire connection method. The temperature instrument can be corrected. The temperature display instrument data is connected to the lower computer software control module and connected to the alcohol detector calibration system. By selecting the DAC chip, the SPI control timing, ADC peripherals, clock frequency is set to 8.1k, and the CAN bus is initialized. When the peripheral machine is configured, it starts to read the temperature, and at the same time, the converted data is directly stored in the memory of the ADC through the DAC. Since the temperature needs to be continuously collected, the mode needs to be continuously converted. A timer is set in the temperature control unit, and the time interrupt interval (20ms) is set. The temperature command is set, 25 temperature points are taken in the temperature, and it is determined whether the temperature is in the fuzzy range. Continuous measurements are made to obtain the temperature of the wine detector, and then the data is transmitted back to the temperature control system of the wine detector to achieve control of the air outlet temperature of the wine detector.
[0039] More specifically, the control method of the temperature sensor includes: S101 initialization.
[0040] Complete the initial hardware and software configuration to prepare for subsequent data acquisition and communication. This includes initializing sensor drivers, such as the four-wire interface configuration for a platinum RTD, initializing communication interfaces including the SPI / CAN bus, ADC / DAC peripherals, initializing timers (setting a 20ms interrupt interval), and initializing the data loop queue for storing temperature data.
[0041] S102 waits for receiving a message.
[0042] Monitors control commands sent by external systems in real time. Messages contain key commands such as "Start Measurement" and "End Measurement." These are the only inputs that trigger the sensor to execute corresponding actions, ensuring that the sensor operates only when receiving valid commands, preventing misoperation.
[0043] After receiving the message, S103 determines whether the message verification is successful; if successful, execute step S104; otherwise, discard the message and execute step S102.
[0044] Verify message integrity through CRC check and parity check to prevent malfunctions caused by data transmission errors.
[0045] S104 parses the message and starts saving the new temperature value; determines whether the command field in the message is "end measurement", if so, turns off the timer; if not, executes step S105.
[0046] If the command is "end measurement", the timer is immediately turned off to stop periodic temperature collection to avoid invalid data generation.
[0047] S105 determines whether the command field in the message is "start measurement". If so, start the timer to collect data and return a success code; otherwise, execute step S106.
[0048] If the command is "Start Measurement", the timer is turned on, periodic temperature collection is started, and the external system is informed that the command has been executed through the "Return Success Code".
[0049] S106 determines whether the counter value of the data circular queue is greater than a quantity threshold. If so, data of the quantity threshold is taken from the data circular queue; otherwise, all data in the data circular queue is taken out.
[0050] When the counter is greater than a threshold value, such as 25, the latest 25 sets of data are taken from the circular queue. The threshold is usually set according to the control algorithm requirements to prevent queue data backlog and ensure real-time processing.
[0051] When the counter is less than or equal to the threshold value of 25, all data in the queue is taken out to avoid data omission and ensure that each processing is based on all current valid data.
[0052] S2 performs fuzzy processing on the temperature difference and the temperature difference change rate to obtain the membership degree corresponding to the temperature difference and the temperature difference change rate.
[0053] In fuzzy control, fuzzification is the process of converting precise input data (such as temperature difference and temperature difference rate of change) into fuzzy sets, enabling the controller to make decisions based on human language and experience. By mapping temperature difference and temperature difference rate of change to different membership degrees, uncertainty and nonlinearity in temperature control can be handled more flexibly.
[0054] Specifically, the method for fuzzy processing the temperature difference and the temperature difference change rate in this embodiment includes: S21 divides the temperature difference range into n continuous intervals on average, thereby obtaining n-1 temperature difference points, where the temperature difference points are dividing points between intervals, and each temperature difference point corresponds to a membership degree.
[0055] In this embodiment, the temperature difference range is divided into 10 continuous intervals, including [-0.5°C to -0.4°C], (-0.4°C to -0.3°C], (-0.3°C to -0.2°C], (-0.2°C to -0.1°C], (-0.1°C to 0.0°C], (0.0°C to 0.1°C], (0.1°C to 0.2°C], (0.2°C to 0.3°C], (0.3°C to 0.4°C], (0.4°C to 0.5°C]; the temperature difference points include -0.4°C, -0.3°C, -0.2°C, -0.1°C, 0.0°C, 0.1°C, 0.2°C, 0.3°C, and 0.4°C.
[0056] S22 divides the temperature difference change rate range into n continuous intervals, thereby obtaining n-1 temperature difference change rate points, where the temperature difference change rate points are dividing points between the intervals, and each temperature difference change rate point corresponds to a membership degree; In this embodiment, the temperature difference change rate range is divided into 10 continuous intervals, including [-0.05℃ / s~-0.04℃ / s], (-0.04℃ / s~-0.03℃ / s], (-0.03℃ / s~-0.02℃ / s], (-0.02℃ / s~-0.01℃ / s], (-0.01℃ / s~0℃ / s], (0℃ / s~0.01℃ / s], (0.01℃ / s~ 0.02℃ / s], (0.02℃ / s~0.03℃ / s], (0.03℃ / s~0.04℃ / s], (0.04℃ / s~0.05℃ / s]; the temperature difference change rate points include -0.04℃ / s, -0.03℃ / s, -0.02℃ / s, -0.01℃ / s, 0.00℃ / s, 0.01℃ / s, 0.02℃ / s, 0.03℃ / s, and 0.04℃ / s.
[0057] S23 assigns the temperature difference and the temperature difference change rate to the corresponding membership degree.
[0058] The membership degrees include NA (negative large), NB (negative medium), NM (negative small), NS (negative slight), ZO (zero), PS (positive slight), PM (positive small), PB (positive medium), and PA (positive large), that is, the temperature difference points of -0.4℃, -0.3℃, -0.2℃, -0.1℃, 0.0℃, 0.1℃, 0.2℃, 0.3℃, and 0.4℃ and the temperature difference change rate points of -0.04℃, -0.03℃, -0.02℃, -0.01℃, 0.00℃, 0.01℃, 0.02℃, 0.03℃, and 0.04℃ correspond to the above membership degrees respectively.
[0059] S3 queries the fuzzy membership of the control parameters from the preset fuzzy rule table based on the membership of the temperature difference and the temperature difference change rate; the control parameters are used to perform PID temperature control on the exhaled gas alcohol content detector, including proportional coefficient, integral coefficient and differential coefficient.
[0060] Specifically, the fuzzy rule table in this embodiment is: Table 1 Fuzzy rule table .
[0061] The fuzzy rule table is a PID control parameter, namely the proportional coefficient K, which is determined based on the temperature difference (e membership) and the temperature difference change rate (ec membership). p , integral coefficient K i and the differential coefficient K d The rows of the table correspond to the membership of the temperature difference e, the columns correspond to the membership of the temperature difference change rate ec, and the content of each cell in the table represents the fuzzy membership of the corresponding set of PID control parameters.
[0062] Among them, the fuzzy membership is expressed in a form similar to "PA / NA / NM", corresponding to the proportional coefficient K p , integral coefficient K i and the differential coefficient K d For example, “PA” indicates a large absolute value in the positive direction, “NA” indicates a large absolute value in the negative direction, and “NM” indicates a moderately negative absolute value. These fuzzy set memberships are used to describe the adjustment direction and degree of the control parameters.
[0063] Assume that when the membership of the temperature difference e is "NS" (negative small) and the membership of the temperature difference change rate ec is "PS" (positive small), the cross cell content is "NS / NA / NS", which means as follows: Proportional coefficient K pThe fuzzy membership of is "NS" (small negative), which means that the proportional coefficient needs to be adjusted negatively and slightly. For example, if the current temperature is slightly lower than the target temperature and is rising, the proportional control effect can be appropriately reduced to avoid temperature overshoot.
[0064] Integration coefficient K i The fuzzy membership is "NA" (large negative absolute value), indicating that the integral coefficient should be significantly reduced. This is because the integral effect accumulates error. In this case, the temperature deviation is small and improving, so the integral accumulation effect needs to be weakened to prevent over-adjustment of the control variable.
[0065] Differential coefficient K d The fuzzy membership is "NS" (small negative), which means that the differential coefficient needs to be adjusted negatively and slightly. The differential action is adjusted based on the error change rate. The current temperature change rate is small positive, so appropriately reducing the differential action will make the system response smoother.
[0066] In this way, based on the fuzzy membership of the temperature difference and its rate of change obtained from actual measurements, the fuzzy membership of the PID control parameters is obtained from the fuzzy rule table, providing a basis for subsequently clarifying the fuzzy control parameters and applying them to the PID temperature control of the exhaled breath alcohol content detector.
[0067] S4 clarifies the degree of membership of the control coefficient and obtains the value of the control coefficient.
[0068] Specifically, the centroid method formula is used in this embodiment:
[0069] Calculate the value of the control parameter; where K is the value of the control parameter, z i is the temperature difference point or temperature difference change rate point of the i-th membership degree, is the value of the i-th membership, i is the serial number of the membership, and n is the number of memberships.
[0070] Using triangular membership functions:
[0071] Calculate the value of the membership; wherein c is the membership vertex, a is the membership left endpoint, b is the membership right endpoint, and x is the temperature difference or the temperature difference change rate.
[0072] The use of the centroid method and triangular membership functions is fundamental to fuzzy control theory. In the prior art, more than 90% of fuzzy PID controllers employ similar methods, and the detailed calculation process will not be detailed in this disclosure.
[0073] S5 substitutes the value of the control coefficient into the PID control formula to output the control quantity to control the temperature of the exhaled gas alcohol content detector.
[0074] Specifically, the PID control formula is: ; in, u k is the fuzzy PID temperature control output, K p is the proportionality coefficient, K i is the differential coefficient, K d is the differential coefficient, e k is the discrete deviation of temperature at the current moment, e k-1 is the temperature discrete deviation at the previous moment, e j is the jth discrete temperature deviation, j is the serial number of the discrete temperature deviation, and k is the number of discrete temperature deviation numbers.
[0075] For example, if e k = 0.5, e k-1 = 0.3, K p = 0.2, K i = 0.1, K d = 0.05, and the cumulative error If it is 2, the proportional term is 0.1, the integral term is 0.2, and the differential term is 0.01.
[0076] final, u k =0.1+0.2+0.01=0.31. This control quantity is used to adjust the temperature of the detector so that it approaches the target temperature, ensuring that the output temperature is stable within the specified range and achieving precise temperature control.
[0077] The temperature of the outlet gas during calibration is controlled in real time to ensure that the accuracy of the calibration is minimally affected by temperature and to improve the reliability of the calibration instrument.
[0078] Table 2 Comparison of the temperature displayed by the calibration device and the temperature controlled by PID
[0079] As shown in Table 2, based on the experimental data, the outlet temperature measured by the fuzzy PID temperature control system is closer to 34°C. According to the calibration requirements of the alcohol content detector, this temperature is the most ideal calibration state.
[0080] Table 3 Measured values of outlet gas content (standard value 0.1 mg / L)
[0081] Table 4 Measured values of outlet gas content (standard value 0.4 mg / L)
[0082] Table 5 Measured values of outlet gas content (standard value 0.6 mg / L)
[0083] According to the experimental data in Table 3-5, the calibration data of the alcohol content detector are in line with the error value range required by the regulations within the temperature range of (34±0.5)℃, but the closer to 34℃, the higher the data stability and accuracy.
[0084] Example 2: like Figure 2 As shown, this embodiment provides a temperature control system for calibrating an exhaled breath alcohol content detector, comprising: The temperature acquisition module is used to obtain the current temperature and calculate the temperature difference and temperature difference change rate between the current temperature and the target temperature; A membership degree acquisition module is used to perform fuzzy processing on the temperature difference and the temperature difference change rate to obtain the membership degree corresponding to the temperature difference and the temperature difference change rate; A control parameter membership acquisition module is used to query the membership of the control parameters from a preset fuzzy rule table based on the membership of the temperature difference and the temperature difference change rate; the control parameters are used to perform PID temperature control on the exhaled gas alcohol content detector, including proportional coefficients, integral coefficients, and differential coefficients; The control parameter clarification module is used to clarify the fuzzy membership of the control coefficient and obtain the value of the control coefficient; The control quantity output module is used to substitute the value of the control coefficient into the PID control formula to output the control quantity to control the temperature of the exhaled gas alcohol content detector.
[0085] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0086] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a computer terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0087] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are protected by the present invention.
Claims
1. A temperature control method for calibrating an exhaled breath alcohol content detector, characterized in that include: Get the current temperature and calculate the temperature difference and temperature difference change rate between the current temperature and the target temperature; Performing fuzzy processing on the temperature difference and the temperature difference change rate to obtain the membership degree corresponding to the temperature difference and the temperature difference change rate; According to the membership of the temperature difference and the temperature difference change rate, the fuzzy membership of the control parameter is queried from a preset fuzzy rule table; the control parameter is used to perform PID temperature control on the exhaled gas alcohol content detector, including a proportional coefficient, an integral coefficient, and a differential coefficient; The fuzzy membership of the control coefficient is clarified to obtain the value of the control coefficient; Substitute the value of the control coefficient into the PID control formula to output the control quantity to control the temperature of the exhaled breath alcohol content detector.
2. A temperature control method for calibrating an exhaled breath alcohol content detector according to claim 1, characterized in that The method for fuzzy processing the temperature difference and the temperature difference change rate includes: Divide the temperature difference range into n continuous intervals, thereby obtaining n-1 temperature difference points, where the temperature difference points are the dividing points between the intervals, and each temperature difference point corresponds to a membership degree; Divide the temperature difference change rate range into n continuous intervals, thereby obtaining n-1 temperature difference change rate points, where the temperature difference change rate points are dividing points between intervals, and each temperature difference change rate point corresponds to a membership degree; Assign the temperature difference and the temperature difference change rate to the corresponding degree of membership.
3. The temperature control method for calibrating an exhaled breath alcohol content detector according to claim 2, characterized in that: The target temperature is 34°C, the temperature difference range is [-0.5°C, 0.5°C], and the temperature difference change rate range is [-0.05°C, 0.05°C]; The temperature difference range is divided into 10 continuous intervals, including [-0.5℃~-0.4℃], (-0.4℃~-0.3℃], (-0.3℃~-0.2℃], (-0.2℃~-0.1℃], (-0.1℃~0.0℃], (0.0℃~0.1℃], (0.1℃~0.2℃], (0.2℃~0.3℃], (0.3℃~0.4℃], (0.4℃~0.5℃]; the temperature difference points include -0.4℃, -0.3℃, -0.2℃, -0.1℃, 0.0℃, 0.1℃, 0.2℃, 0.3℃, and 0.4℃; The temperature difference change rate range is divided into 10 continuous intervals, including [-0.05℃ / s~-0.04℃ / s], (-0.04℃ / s~-0.03℃ / s], (-0.03℃ / s~-0.02℃ / s], (-0.02℃ / s~-0.01℃ / s], (-0.01℃ / s~0℃ / s], (0℃ / s~0.01℃ / s], (0.01℃ / s~0.0 2℃ / s], (0.02℃ / s~0.03℃ / s], (0.03℃ / s~0.04℃ / s], (0.04℃ / s~0.05℃ / s]; the temperature difference change rate points include -0.04℃ / s, -0.03℃ / s, -0.02℃ / s, -0.01℃ / s, 0.00℃ / s, 0.01℃ / s, 0.02℃ / s, 0.03℃ / s, 0.04℃ / s; The membership degrees include NA, NB, NM, NS, ZO, PS, PM, PB, and PA.
4. The temperature control method for calibrating an exhaled breath alcohol content detector according to claim 1, characterized in that The method of clarifying the fuzzy membership of the control coefficient includes using the formula: Calculate the value of the control parameter; where K is the value of the control parameter, z i is the temperature difference point or temperature difference change rate point of the i-th membership degree, is the value of the i-th membership, i is the serial number of the membership, and n is the number of memberships.
5. A temperature control method for calibrating an exhaled breath alcohol content detector according to claim 4, characterized in that Using triangular membership functions: Calculate the membership value; where c is the membership vertex, a is the left endpoint of the membership, b is the right endpoint of the membership, and x is the temperature difference or the rate of change of the temperature difference.
6. A temperature control method for calibrating an exhaled breath alcohol content detector according to claim 1, characterized in that The PID control formula is: ; in, u k is the fuzzy PID temperature control output, K p is the proportionality coefficient, K i is the differential coefficient, K d is the differential coefficient, e k is the discrete deviation of temperature at the current moment, e k-1 is the temperature discrete deviation at the previous moment, e j is the jth discrete temperature deviation, j is the serial number of the discrete temperature deviation, and k is the number of discrete temperature deviation numbers.
7. The temperature control method for calibrating an exhaled breath alcohol content detector according to claim 1, characterized in that: A temperature sensor is provided on the gas flow path of the exhaled gas alcohol content detector for collecting the current temperature, and a control module is provided to control the temperature sensor.
8. A temperature control method for calibrating an exhaled breath alcohol content detector according to claim 7, characterized in that The control method of the temperature measuring sensor includes: S101 initialization; S102 waits for receiving a message; After receiving the message, S103 determines whether the message verification is successful; if successful, execute step S104; otherwise, discard the message and execute step S102; S104 parses the message and starts saving the new temperature value; determines whether the command field in the message is "end measurement", if so, turns off the timer; if not, executes step S105; S105 determines whether the command field in the message is "start measurement". If so, the timer is started to collect data and a success code is returned; otherwise, step S106 is executed; S106 determines whether the counter value of the data circular queue is greater than a quantity threshold. If so, data of the quantity threshold is taken from the data circular queue; otherwise, all data in the data circular queue is taken out.
9. A temperature control system for calibrating an exhaled breath alcohol content detector, characterized in that include: The temperature acquisition module is used to obtain the current temperature and calculate the temperature difference and temperature difference change rate between the current temperature and the target temperature; A membership degree acquisition module is used to perform fuzzy processing on the temperature difference and the temperature difference change rate to obtain the membership degree corresponding to the temperature difference and the temperature difference change rate; A control parameter membership acquisition module is used to query the membership of the control parameters from a preset fuzzy rule table based on the membership of the temperature difference and the temperature difference change rate; the control parameters are used to perform PID temperature control on the exhaled gas alcohol content detector, including proportional coefficients, integral coefficients, and differential coefficients; The control parameter clarification module is used to clarify the fuzzy membership of the control coefficient and obtain the value of the control coefficient; The control quantity output module is used to substitute the value of the control coefficient into the PID control formula to output the control quantity to control the temperature of the exhaled gas alcohol content detector.
Citation Information
Patent Citations
Digitization experimental laboratory system and data control method thereof
CN101114405A
Adaptive data acquisition device for ocean platform
CN102520612A
Sensor data extraction method and device
CN109918545A
Solution microparticle signal acquisition intelligent control method and device and server
CN111913420A
Temperature and humidity control method of respiratory therapy device and respiratory therapy device
CN114288502A