Method for automatically detecting temperature of ballast and adjusting output power

By setting a temperature detection voltage circuit and a microcontroller in the ballast, combined with algorithm processing, the accurate monitoring of the ballast temperature and dynamic adjustment of the output power are achieved, which solves the shortcomings of temperature monitoring and control in the existing technology, and improves the stability and energy efficiency of the system.

CN119789257APending Publication Date: 2025-04-08SUZHOU BAIWO PRECISION ELECTRONIC TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510142122.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-10
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

The existing ballast temperature monitoring and control technology has the problems of narrow temperature sensing range, slow reaction speed and low accuracy, and it is difficult to perceive and effectively adjust the temperature in a timely manner, resulting in overheating, damage or failure, affecting the normal operation of the system.

Method used

The temperature detection voltage circuit in the microcontroller is combined with algorithm processing, and the ballast temperature is indirectly collected through the temperature detection voltage circuit, and data is collected in real time, sliding average is calculated, and the model is updated. This makes a quick decision to calculate the optimal power.

Benefits of technology

It significantly broadens the perceived range of ballast temperature, improves the regulation reaction speed and accuracy, avoids overheating and overloading, and ensures efficient and stable operation of the ultraviolet lighting system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119789257A_ABST
    Figure CN119789257A_ABST
Patent Text Reader

Abstract

The invention relates to the field of ballasts, and provides a method for automatically detecting the temperature of a ballast and adjusting the output power, which comprises the following steps of: regularly acquiring a voltage value of a temperature detection voltage circuit, calculating the temperature of the ballast according to the voltage value, and simultaneously acquiring the output power of the ballast; sorting the collected temperature data and output power data, establishing a temperature data sequence and an output power data sequence, and calculating a moving average temperature or a moving average output power; constructing a temperature-output power variable model of the ballast; calculating the optimal output power at the current moving average temperature according to the temperature-output power variable model; and controlling an output power regulation circuit in the ballast to smoothly configure the power of the ballast to the optimal output power. According to the technical scheme, the problems that in the prior art, independent installation and single temperature control modes of a temperature sensor are mostly depended on, and the modes can cause narrow temperature sensing range and slow response speed are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of ballasts, and in particular to a method for automatically detecting ballast temperature and adjusting output power. Background Art

[0002] The ballast is an indispensable key component in the ultraviolet lighting system. Its main function is to limit and stabilize the current passing through the ultraviolet lamp, ensuring that the ultraviolet lamp can work normally under the rated electrical parameters, thereby stably outputting ultraviolet light to meet the needs of many fields such as medical disinfection, food processing, water treatment, etc. for ultraviolet sterilization and purification. The performance of the ballast directly affects the overall working effect, stability and service life of the ultraviolet lighting system.

[0003] In actual applications, ballasts need to operate under a variety of environmental conditions and face many complex working conditions. Different usage scenarios, such as differences in indoor and outdoor environments, different continuous working hours of equipment, and the influence of other surrounding heat sources, will cause the ambient temperature of the ballast to change significantly, and the impact of temperature factors on ballasts is particularly significant.

[0004] At present, there are many deficiencies in ballast temperature monitoring and control technology. On the one hand, most of them rely on a small number of independently installed temperature sensors, and the internal structure of the ballast is complex and the heat distribution is uneven, which leads to a narrow temperature sensing range and cannot accurately reflect the overall real-time temperature. On the other hand, most of them adopt a single temperature control method based on a fixed threshold reaction, which has the problems of slow reaction speed and low accuracy, and is easy to misjudge the temperature. What is particularly critical is that the working state of the ballast is changeable, such as the lighting system switch, power switching, power supply fluctuations, etc., which will cause rapid temperature fluctuations, and the existing system is difficult to perceive and effectively adjust in time, and it is impossible to flexibly adjust the power according to the real-time temperature changes, which can easily cause overheating, damage or failure, affecting the normal operation of the system and reducing safety, stability and energy efficiency. Summary of the invention

[0005] The present invention proposes a method that can automatically detect the temperature of the ballast and dynamically adjust the power output according to the actual temperature value, thereby effectively avoiding overheating and overload phenomena and comprehensively improving the comprehensive performance of the ultraviolet lighting system.

[0006] The technical solution of the present invention is as follows:

[0007] A method for automatically detecting ballast temperature and adjusting output power comprises the following steps:

[0008] S100, a temperature detection voltage circuit is provided in the ballast, and the output pin of the temperature detection voltage circuit is connected to the input pin of the single-chip microcomputer in the ballast, the single-chip microcomputer regularly collects the voltage value of the pin connected to the temperature detection voltage circuit, and calculates the temperature of the ballast according to the voltage value, and the single-chip microcomputer collects the output power of the ballast while collecting the pin voltage value;

[0009] S200, sorting the collected temperature data and output power data in chronological order, establishing a temperature data sequence and an output power data sequence, and when the number of new temperature data or the number of output power data in the temperature data sequence or the output power data sequence reaches a preset value, calculating the sliding average temperature or the sliding average output power, and storing the temperature data, the output power data, the sliding average temperature and the sliding average output power;

[0010] S300, constructing a temperature-output power variable model of the ballast according to historical temperature data, output power data, sliding average temperature and sliding average output power;

[0011] S400, according to the temperature-output power variable model, substituting the current sliding average temperature, and calculating the optimal output power at the current sliding average temperature;

[0012] S500, controlling the output power regulating circuit in the ballast to smoothly configure the output power of the ballast to the optimal output power.

[0013] Furthermore, in step S100, the temperature detection voltage circuit includes a fixed resistor R401 and an NTC thermistor RT401, one end of the fixed resistor R401 is connected to a power supply, one end of the NTC thermistor RT401 is grounded, the fixed resistor R401 and the NTC thermistor RT401 are connected in series to form a voltage divider, a voltage point T_sensor is provided between the fixed resistor R401 and the NTC thermistor RT401, the voltage point T_sensor is connected to a pin of a single-chip microcomputer of the ballast, and the single-chip microcomputer of the ballast indirectly collects the temperature of the ballast by detecting the voltage of the voltage point T_sensor.

[0014] Furthermore, the step of indirectly collecting the temperature of the ballast by detecting the voltage at the voltage point T_sensor is as follows:

[0015] S110, converting the voltage value collected at the voltage point T_sensor into the resistance value of the NTC thermistor RT401 through a conversion formula;

[0016] The conversion formula is:

[0017]

[0018] Among them, Rntc is the resistance value of NTC thermistor RT401, V adc is the voltage value collected at the voltage point T_sensor, R is the resistance value of the fixed resistor R401, V supply It is the microcontroller supply voltage of the ballast.

[0019] S120, according to the resistance value of the NTC thermistor RT401, find the corresponding temperature in a preset resistance-temperature conversion table.

[0020] Furthermore, in step S200, the calculation formula for calculating the sliding average temperature or the sliding average output power is:

[0021]

[0022] in, is the sliding average temperature or sliding average output power, N is the size of the sliding window, x j is the jth data point in the temperature data sequence or the output power data sequence;

[0023] The preset value is the size of the sliding window, and the size of the sliding window can be dynamically adjusted according to the fluctuation of temperature data and output power data.

[0024] Furthermore, the steps of dynamic adjustment are:

[0025] S210, initializing the size N of the sliding window;

[0026] S220, calculating the standard deviation σ of the temperature or output power data sequence at regular time intervals;

[0027] S230, setting standard deviation threshold σ th1 and σ th2 , σ th1 Less than σ th2 , when σ is greater than σ th2 When , the sliding window size N is reduced by a preset fixed value ΔN, but N is not less than the preset minimum value N min , when σ is less than σ th1 When , the sliding window size N is increased by a preset fixed value ΔN, but N is not greater than a maximum value N max .

[0028] Furthermore, the calculation formula of the standard deviation σ is:

[0029]

[0030] in, is the mean of the data series and n is the number of data points.

[0031] Furthermore, in step S300, the temperature-output power variable model is obtained by finding the relationship between temperature and output power through a linear regression method, and the temperature-output power variable model is P=aT+b, wherein P is the output power data, a and b are coefficients obtained by fitting the historical sliding average data, and T is the temperature data.

[0032] Furthermore, in step S400, the calculation formula of the optimal output power is:

[0033]

[0034] in, is the sliding average temperature, and a and b are coefficients obtained by fitting the historical sliding average data.

[0035] Furthermore, in step S500, the smoothing configuration is to calculate the current actual output power P actual One or more adjustments are made, with the step size of each adjustment being a preset ΔP, until the optimal output power is reached.

[0036] Further, in step S500, the power regulation circuit includes a gate drive chip U301, a MOS power drive module Q301 and a MOS power drive module Q302. The gate drive chip U301 is connected to the single-chip microcomputer of the ballast, the MOS power drive module Q301 and the MOS power drive module Q302. The single-chip microcomputer of the ballast outputs PWM_H and PWM_L signals to the gate drive chip U301. The gate drive chip U301 amplifies the input PWM_H and PWM_L signals and outputs them to the MOS power drive module Q301 and the MOS power drive module Q302. The MOS power drive module Q301 and the MOS power drive module Q302 output corresponding currents according to the corresponding PWM_H and PWM_L signals, thereby indirectly changing the output power.

[0037] The working principle and beneficial effects of the present invention are:

[0038] 1. The present invention uses the temperature detection voltage circuit in the single-chip microcomputer combined with algorithm processing, rather than simply relying on a limited number of sensors, but using the circuit voltage change to indirectly reflect the overall temperature condition of the ballast. Subsequent processing such as sliding average and model building can mine the temperature change trend from a global perspective, broadening the perception range of the ballast temperature.

[0039] 2. The present invention collects data in real time, calculates the sliding average in real time, updates the model in real time, and makes rapid decisions and calculates the optimal power based on this. Once the temperature has a fluctuation trend, it can respond quickly, greatly speeding up the control response speed.

[0040] 3. The present invention uses a multi-data fusion model to comprehensively consider the historical and real-time temperature and output power changes, accurately locate the output power required by the current ballast, and avoid temperature misjudgment caused by a single factor. The accuracy of temperature monitoring and output power adjustment is significantly improved, and the difficulties of the existing technology in ballast temperature monitoring and control are fully solved, ensuring the efficient and stable operation of the ultraviolet lighting system. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0042] Figure 1 It is a structural block diagram of the present invention;

[0043] Figure 2 is a circuit diagram of a temperature detection voltage circuit in the present invention;

[0044] Figure 3 is a circuit diagram of a power regulation circuit in the present invention;

[0045] Figure 4 A circuit diagram of a single chip microcomputer of the ballast in the present invention;

[0046] Figure 5 It is a schematic diagram of part of the content of the resistance-temperature conversion table in the present invention. DETAILED DESCRIPTION

[0047] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions 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 creative work are within the scope of protection of the present invention.

[0048] like Figure 1 As shown, this embodiment provides a method for automatically detecting ballast temperature and adjusting output power, comprising the following steps:

[0049] S100, a temperature detection voltage circuit is set in the ballast, and the output pin of the temperature detection voltage circuit is connected to the input pin of the single-chip microcomputer in the ballast. The single-chip microcomputer periodically collects the voltage value of the pin connected to the temperature detection voltage circuit, and calculates the temperature of the ballast according to the voltage value. The single-chip microcomputer collects the output power of the ballast while collecting the pin voltage value.

[0050] In this embodiment, the single-chip microcomputer refers to a microcontroller, which is often abbreviated as MCU (Microcontroller Unit). It is an integrated circuit chip that integrates functional components such as a central processing unit (CPU), a random access memory (RAM), a read-only memory (ROM), an input and output interface (I / O interface), a timer / counter, etc. on a single chip. It has the characteristics of small size, low power consumption, and strong control function. It is widely used in various electronic devices, such as home appliances, industrial control, automotive electronics, intelligent instruments, etc. In this embodiment, it is used to realize related functions such as temperature detection and output power regulation control of ballasts. The single-chip microcomputer collects the voltage value of the pin connected to the temperature detection voltage circuit, that is, collects the output voltage value of the temperature detection voltage circuit, which utilizes the characteristics of high integration and strong processing power of the single-chip microcomputer, and can accurately and regularly obtain key information. Calculating temperature based on voltage value reduces the cost and installation complexity brought by additional temperature sensors compared to the traditional direct temperature measurement method. At the same time, the output power is collected, which provides first-hand information for the subsequent correlation of temperature and output power changes, ensures the synchronization and correlation of data, and lays the foundation for precise control.

[0051] S200. Sort the collected temperature data and output power data in chronological order, establish a temperature data sequence and an output power data sequence, and when the number of new temperature data or the number of output power data in the temperature data sequence or the output power data sequence reaches a preset value, calculate the sliding average temperature or the sliding average output power, and store the temperature data, output power data, sliding average temperature and sliding average output power.

[0052] The data is sorted in chronological order and a sequence is established to facilitate subsequent analysis and mining of the inherent laws of the data. When the amount of new data reaches the preset value, the sliding average temperature or output power is calculated. The sliding average algorithm can effectively smooth out the random noise and short-term fluctuations in the data, highlighting the long-term trend of the data, so that subsequent model construction and analysis are based on more stable and reliable data, improving the accuracy of the entire system's judgment of temperature and output power changes. Storing various types of data provides rich materials for subsequent retrospective analysis and model optimization.

[0053] S300: construct a temperature-output power variable model of the ballast according to historical temperature data, output power data, sliding average temperature and sliding average output power.

[0054] The temperature-output power variable model is constructed based on a large amount of historical and real-time processed temperature and output power data. This model is the core decision-making basis for the entire control strategy. It is no longer limited to simple fixed threshold judgments, but deeply explores the complex internal relationship between temperature and output power. It can adapt to the dynamic change relationship between temperature and output power of the ballast under different working conditions and environments, greatly improving the scientificity and accuracy of the control.

[0055] S400 , according to the temperature-output power variable model, the current sliding average temperature is substituted to calculate the optimal output power at the current sliding average temperature.

[0056] Substituting the current sliding average temperature into the carefully constructed model to calculate the optimal output power, this step realizes the transformation from data monitoring and analysis to real-time decision-making. The output power value calculated based on the model is in line with the actual operating state requirements of the current ballast, which not only ensures that the ballast does not overheat, but also enables it to operate in an efficient state, avoiding energy waste and improving overall energy utilization efficiency.

[0057] S500, controlling the output power regulating circuit in the ballast to smoothly configure the output power of the ballast to the optimal output power.

[0058] It is very important to control the smooth configuration of the output power of the output power regulation circuit, which avoids the sudden change of output power causing electrical shock to the ballast and related equipment such as ultraviolet lamps, ensuring the stable operation of the equipment and extending the service life. Smooth configuration is a collection of technologies and methods used to optimize the performance of a system or process, aiming to make the operation of the system smoother and more continuous, reduce fluctuations and mutations, and thus improve the stability, reliability and user experience of the system. The smooth configuration process enables the ballast to smoothly transition to the optimal working state and maintain the continuous and stable output of the ultraviolet lighting system.

[0059] like Figure 2 , Figure 4 As shown, in step S100 of this embodiment, the temperature detection voltage circuit includes a fixed resistor R401 and an NTC thermistor RT401, one end of the fixed resistor R401 is connected to a power supply, one end of the NTC thermistor RT401 is grounded, the fixed resistor R401 and the NTC thermistor RT401 are connected in series to form a voltage divider, a voltage point T_sensor is set between the fixed resistor R401 and the NTC thermistor RT401, the voltage point T_sensor is connected to the pin of the ballast microcontroller, and the ballast microcontroller indirectly collects the temperature of the ballast by detecting the voltage at the voltage point T_sensor.

[0060] The resistance of the fixed resistor R401 is 10K, the power supply connected to the fixed resistor R401 is 3.3V, the nominal resistance of the NTC thermistor RT401 at 25℃ is 10K, and the resistance of the NTC resistor RT401 will change with the temperature: when the temperature rises, the resistance of RT401 decreases; when the temperature decreases, the resistance increases. The voltage point T_sensor is connected to the PA02 pin of the ballast microcontroller. By connecting the fixed resistor R401 and the NTC thermistor RT401 in series to form a voltage divider, the voltage at the voltage point T_sensor will change with the temperature change of the NTC resistor RT401, and the ballast microcontroller acquires the voltage value of the voltage point T_sensor by collecting the voltage value of its own PA02 pin, and then converts the voltage value into the resistance value of the NTC thermistor RT401, so as to find out the temperature corresponding to the resistance value by looking up the table, thereby realizing indirect acquisition of temperature data. This circuit has a simple structure and is mainly based on two resistor elements. Compared with some high-precision and complex traditional temperature sensors, it is cheaper. The ballast temperature is indirectly collected by detecting the voltage at the voltage point T_sensor. This method can utilize the existing voltage detection function of the microcontroller. At the software level, the collected voltage signal can be processed and analyzed more flexibly, which is convenient for subsequent coordinated control with other circuit functions, such as combining with the output power regulation circuit to realize intelligent temperature-output power control. Resistor elements usually have high stability and reliability. Compared with some traditional temperature sensors that may be affected by environmental factors (such as humidity, electromagnetic interference, etc.) and cause performance degradation, the circuit composed of fixed resistors and NTC thermistors can maintain relatively stable performance within the normal working range, reducing the risk of temperature detection errors due to sensor failure.

[0061] In this embodiment, the steps of indirectly collecting the ballast temperature by detecting the voltage at the voltage point T_sensor are as follows:

[0062] S110 , converting the voltage value collected at the voltage point T_sensor into the resistance value of the NTC thermistor RT401 through a conversion formula.

[0063] The conversion formula is:

[0064]

[0065] Among them, R ntc is the resistance value of NTC thermistor RT401, V adc is the voltage value collected at the voltage point T_sensor, R is the resistance value of the fixed resistor R401, V supply It is the microcontroller supply voltage of the ballast.

[0066] The collected voltage value is converted into the resistance value of the NTC thermistor RT401 through a specific conversion formula. This process is based on the voltage division principle of the series circuit in electricity and is a conversion method with a clear physical basis.

[0067] S120, according to the resistance value of NTC thermistor RT401, in the preset resistance-temperature conversion table ( Figure 5 ) to find the corresponding temperature.

[0068] According to the calculated resistance value of the NTC thermistor RT401, the corresponding temperature can be found with the help of a pre-set resistance-temperature conversion table, and the temperature can be determined based on the precise temperature-resistance characteristic relationship of the NTC thermistor itself. Compared with some methods that directly rely on real-time measurement of physical quantities for temperature conversion, the use of a pre-set conversion table can reduce the impact of external environmental factors (such as electromagnetic interference, instantaneous voltage fluctuations, etc.) on the temperature conversion process. As long as the hardware circuit works normally, looking up the temperature according to the established conversion table can ensure that the temperature acquisition process is relatively stable, reduce the risk of abnormal temperature detection due to real-time measurement errors or interference, enhance the reliability of the entire temperature detection system, and help the ballast to operate stably in complex environments.

[0069] In this embodiment, in step S200, the calculation formula for calculating the sliding average temperature or the sliding average output power is:

[0070]

[0071] in, is the sliding average temperature or sliding average output power, N is the size of the sliding window, x j is the jth data point in the temperature data sequence or the output power data sequence;

[0072] The preset value is the size of the sliding window, and the size of the sliding window can be dynamically adjusted according to the fluctuation of the temperature data and the output power data.

[0073] Dynamically adjustable sliding window frame size has the following benefits:

[0074] 1. During the operation of the ballast, the fluctuation of temperature data and output power data is complex and changeable, and may change due to various factors such as working state switching and ambient temperature changes. Dynamic adjustment of the sliding window size can make the sliding average calculation automatically adapt to such changes. When the data fluctuates violently, reducing the sliding window size can more keenly capture the rapid change trend of the data and timely reflect the real-time status of the ballast; when the data is relatively stable, increasing the sliding window size can better smooth the data, filter out short-term noise interference, and more accurately present the long-term stable trend of temperature and output power, thereby improving the accuracy of analysis based on these data (such as building a temperature-output power model, etc.).

[0075] 2. For the output power regulation of the ballast, the dynamic adjustment of the sliding window size is of great significance. When there is a sudden change in temperature or output power data (such as a sudden overload of the ballast causing a sharp rise in temperature), a smaller sliding window allows the system to respond quickly and adjust the power output in time to avoid damage to the ballast due to overheating, thereby improving the timeliness of output power regulation; in the normal and stable operation stage, a larger sliding window helps to maintain a relatively stable power output, avoiding unnecessary frequent output power adjustments due to too frequent small data fluctuations, ensuring the stability of the ballast operation, extending the service life of the equipment, and also helping to improve the energy efficiency of the entire ultraviolet lighting system.

[0076] 3. Under different usage scenarios and working conditions, the working conditions faced by the ballast vary greatly. Dynamic adjustment of the sliding window size enables the entire temperature-output power regulation system to have stronger adaptive capabilities. Whether in an industrial environment with frequent starts and stops and large load changes, or in a relatively stable indoor lighting environment, the system can flexibly adjust the sliding window according to the actual data fluctuations, and process the temperature and output power data in the most appropriate way, ensuring that the ballast temperature can be effectively monitored and accurate output power regulation can be achieved under various complex working conditions, improving the versatility and robustness of the system.

[0077] In this embodiment, the steps of dynamic adjustment are:

[0078] S210: Initialize the size N of the sliding window.

[0079] S220. Calculate the standard deviation σ of the temperature or output power data sequence at regular time intervals.

[0080] The standard deviation can reflect the degree of dispersion of data relative to the mean. When the standard deviation is large, it means that the data fluctuates violently. At this time, the sliding window size should be reduced to capture the changing trend of the data more quickly; when the standard deviation is small, it means that the data is relatively stable. At this time, the sliding window size can be increased to better smooth the data.

[0081] S230, setting standard deviation threshold σ th1 and σ th2 , σ th1 Less than σ th2 , when σ is greater than σ th2 When , the sliding window size N is reduced by a preset fixed value ΔN, but N is not less than the preset minimum value N min , to prevent the window from being too small and losing its meaning; when σ is less than σ th1 When , the sliding window size N is increased by a preset fixed value ΔN, but N is not greater than a maximum value N max , to prevent the window from being too large and over-smoothing the data.

[0082] In this embodiment, the calculation formula of the standard deviation σ is:

[0083]

[0084] in, is the mean of the data series and n is the number of data points.

[0085] In this embodiment, in step S300, the temperature-output power variable model is obtained by finding the relationship between temperature and output power through a linear regression method, and the temperature-output power variable model is obtained as P=aT+b, wherein P is the output power data, a and b are coefficients obtained by fitting the historical sliding average data, and T is the temperature data.

[0086] Linear regression is a statistical method used to establish a linear relationship model between variables. It assumes that there is a linear relationship between the dependent variable and one or more independent variables, that is, a linear equation can be used to approximate the relationship between them. In this embodiment, linear regression assumes that there is a linear relationship between temperature (independent variable, represented by T) and output power (dependent variable, represented by P), that is, a linear equation such as P = aT + b can be used to describe the relationship between them. Where a is the slope, which represents the change in output power for each unit change in temperature; b is the intercept, which is the value of the output power when the temperature is 0.

[0087] The calculation steps of coefficients a and b are:

[0088] S310, establish sliding average temperature sequence and the moving average output power series

[0089] S320, calculate the average value of the sliding mean temperature and the average of the sliding average output power

[0090] Average value of sliding mean temperature The calculation formula is The average value of the sliding average output power The calculation formula is

[0091] S330, calculating coefficients a and b;

[0092] The calculation formula of coefficient a is: The calculation formula of coefficient b is:

[0093] In this embodiment, in step S400, the calculation formula for the optimal output power is:

[0094]

[0095] in, is the sliding average temperature, and a and b are coefficients obtained by fitting the historical sliding average data.

[0096] In this embodiment, in step S500, the smoothing configuration is to calculate the current actual output power P actual Perform one or more (increase or decrease) adjustments, with each adjustment step being a preset ΔP, until the optimal output power is reached; if the output power is to be reduced, the current actual output power P actual Adjust to less than or equal to the optimal output power; if you want to increase the output power, then the current actual output power P actual Adjust to be greater than or equal to the optimal output power.

[0097] like Figure 3 , Figure 4 As shown, in this embodiment, in step S500, the output power regulation circuit includes a gate driver chip U301, a MOS power driver module Q301 and a MOS power driver module Q302. The gate driver chip U301 is connected to the single-chip microcomputer of the ballast, the MOS power driver module Q301 and the MOS power driver module Q302. The single-chip microcomputer of the ballast outputs PWM_H and PWM_L signals to the gate driver chip U301. The gate driver chip U301 amplifies the input PWM_H and PWM_L signals and outputs them to the MOS power driver module Q301 and the MOS power driver module Q302. The MOS power driver module Q301 and the MOS power driver module Q302 output corresponding currents according to the corresponding PWM_H and PWM_L signals, thereby indirectly changing the output power.

[0098] The output power regulation circuit also includes resistors R304, R305, R302, R306, R318, R307, a diode D302, a capacitor C304, and an inductor L301A. The gate drive chip U301 is connected to the PB14 and PB15 pins of the single chip microcomputer of the ballast.

[0099] Resistors R304, R305, R302, R306, R318, and R307 are mainly used for current limiting and voltage division in the circuit. Diode D302 can play multiple roles in the circuit, such as rectification, limiting, and protection. The main function of capacitor C304 is to store electrical energy and filter. It can smooth voltage fluctuations in the circuit. When the power supply voltage fluctuates momentarily or there is high-frequency interference in the circuit, the capacitor can absorb or release electrical energy to keep the voltage relatively stable. Inductor L301A has the characteristic of hindering current changes in the circuit. The inductor and capacitor work together to form a filter circuit, which filters the AC component in the power supply to make the output current smoother.

[0100] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for automatically detecting ballast temperature and adjusting output power, characterized in that: The following steps are involved: S100, a temperature detection voltage circuit is provided in the ballast, and the output pin of the temperature detection voltage circuit is connected to the input pin of the single-chip microcomputer in the ballast, the single-chip microcomputer regularly collects the voltage value of the pin connected to the temperature detection voltage circuit, and calculates the temperature of the ballast according to the voltage value, and the single-chip microcomputer collects the output power of the ballast while collecting the pin voltage value; S200, sorting the collected temperature data and output power data in chronological order, establishing a temperature data sequence and an output power data sequence, and when the number of new temperature data or the number of output power data in the temperature data sequence or the output power data sequence reaches a preset value, calculating the sliding average temperature or the sliding average output power, and storing the temperature data, the output power data, the sliding average temperature and the sliding average output power; S300, constructing a temperature-output power variable model of the ballast according to historical temperature data, output power data, sliding average temperature and sliding average output power; S400, according to the temperature-output power variable model, substituting the current sliding average temperature, and calculating the optimal output power at the current sliding average temperature; S500, controlling the output power regulating circuit in the ballast to smoothly configure the output power of the ballast to the optimal output power.

2. A method for automatically detecting ballast temperature and adjusting output power according to claim 1, characterized in that: In the step S100, the temperature detection voltage circuit includes a fixed resistor R401 and an NTC thermistor RT401, one end of the fixed resistor R401 is connected to a power supply, one end of the NTC thermistor RT401 is grounded, the fixed resistor R401 and the NTC thermistor RT401 are connected in series to form a voltage divider, a voltage point T_sensor is provided between the fixed resistor R401 and the NTC thermistor RT401, the voltage point T_sensor is connected to the pin of the ballast microcontroller, and the ballast microcontroller indirectly collects the temperature of the ballast by detecting the voltage of the voltage point T_sensor.

3. A method for automatically detecting ballast temperature and adjusting output power according to claim 2, characterized in that: The steps of indirectly collecting the temperature of the ballast by detecting the voltage at the voltage point T_sensor are as follows: S110, converting the voltage value collected at the voltage point T_sensor into the resistance value of the NTC thermistor RT401 through a conversion formula, The conversion formula is: Among them, R ntc is the resistance value of NTC thermistor RT401, V adc is the voltage value collected at the voltage point T_sensor, R is the resistance value of the fixed resistor R401, V supply is the microcontroller supply voltage of the ballast; S120, according to the resistance value of the NTC thermistor RT401, find the corresponding temperature in a preset resistance-temperature conversion table.

4. The method for automatically detecting ballast temperature and adjusting output power according to claim 1, characterized in that: In step S200, the calculation formula for calculating the sliding average temperature or the sliding average output power is: in, is the sliding average temperature or sliding average output power, N is the size of the sliding window, x j is the ,th data point in the temperature data series or the output power data series; The preset value is the size of the sliding window, and the size of the sliding window can be dynamically adjusted according to the fluctuation of temperature data and output power data.

5. A method for automatically detecting ballast temperature and adjusting output power according to claim 4, characterized in that: The steps of dynamic adjustment are: S210, initializing the size N of the sliding window; S220, calculating the standard deviation σ of the temperature or output power data sequence at regular time intervals; S230, setting standard deviation threshold σ th1 and σ th2 , σ th1 Less than σ th2 , when σ is greater than σ th2 When , the sliding window size N is reduced by a preset fixed value ΔN, but N is not less than the preset minimum value N min , when σ is less than σ th1 When , the sliding window size N is increased by a preset fixed value ΔN, but N is not greater than a maximum value N max .

6. A method for automatically detecting ballast temperature and adjusting output power according to claim 5, characterized in that: The calculation formula of the standard deviation σ is: in, is the mean of the data series and n is the number of data points.

7. The method of automatically detecting ballast temperature and adjusting output power according to claim 1, characterized in that: In step S300, the temperature-output power variable model is obtained by finding the relationship between temperature and output power through a linear regression method, and the temperature-output power variable model is P=aT+b, wherein P is the output power data, a and b are coefficients obtained by fitting the historical sliding average data, and T is the temperature data.

8. The method for automatically detecting ballast temperature and adjusting output power according to claim 1, characterized in that: In step S400, the calculation formula of the optimal output power is: in, is the sliding average temperature, and a and b are coefficients obtained by fitting the historical sliding average data.

9. The method for automatically detecting ballast temperature and adjusting output power according to claim 1, characterized in that: In step S500, the smoothing configuration is to calculate the current actual output power P actual Perform one or more adjustments, with the step size of each adjustment being the preset AP, until the optimal output power is reached.

10. The method for automatically detecting ballast temperature and adjusting output power according to claim 1, characterized in that: In step S500, the output power regulation circuit includes a gate driving chip U301, a MOS power driving module Q301 and a MOS power driving module Q302. The gate driving chip U301 is connected to the single-chip microcomputer of the ballast, the MOS power driving module Q301 and the MOS power driving module Q302. The single-chip microcomputer of the ballast outputs PWM_H and PWM_L signals to the gate driving chip U301. The gate driving chip U301 amplifies the input PWM_H and PWM_L signals and outputs them to the MOS power driving module Q301 and the MOS power driving module Q302. The MOS power driving module Q301 and the MOS power driving module Q302 output corresponding currents according to the corresponding PWM_H and PWM_L signals, thereby indirectly changing the output power.