Ambient light color automatic calibration method and system

By using RGB single-channel full-scale current calibration and parallel multi-channel LIN communication, combined with PID algorithm to adjust PWM ratio, the problem of ambient light color consistency was solved. This enabled the detection and dimming calibration of color consistency in multi-color ambient light modules, improving testing and calibration efficiency and reducing costs.

CN116105865BActive Publication Date: 2026-06-26PINGJIE ELECTRONIC TECHNOLOGY (JIANGSU) CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PINGJIE ELECTRONIC TECHNOLOGY (JIANGSU) CO LTD
Filing Date
2023-03-29
Publication Date
2026-06-26

Smart Images

  • Figure CN116105865B_ABST
    Figure CN116105865B_ABST
Patent Text Reader

Abstract

The application discloses an atmosphere lamp color automatic calibration method and system, and belongs to the field of atmosphere lamps. The method calibrates all light sources in the atmosphere lamp through RGB single-channel full-range current calibration, realizes fixed temperature compensation and dimming calibration; on the basis of the RGB single-channel full-range current calibration, the method realizes one-key detection of light color of a multi-color atmosphere lamp module by collecting target color coordinate optical data of each target light source in the atmosphere lamp through parallel multi-channel LIN communication; and further, the method realizes light color consistency of the atmosphere lamp by synchronously calibrating all target light sources in the atmosphere lamp according to the collected target color coordinate optical data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of ambient lighting, and in particular to an automatic color calibration method and system for ambient lighting. Background Technology

[0002] Today's ambient lighting styles have evolved from the original dot and line patterns to smart surfaces. Color options have progressed from single-color to RGB64, 125, 256, and even infinitely variable colors. Presentation modes have evolved from static lighting to dynamic, flowing patterns. Ambient lighting is also increasingly integrated with specific scenarios. However, this rapid industry development also faces a series of pain points that urgently need to be addressed. For example, there is currently no unified standard for ambient lighting; different RGB light sources result in poor light mixing consistency due to varying brightness and color intensity; and there are issues with the light color acquisition methods for different light source designs (top-emitting, side-emitting). Summary of the Invention

[0003] The purpose of this invention is to provide an automatic color calibration method and system for ambient lights, which can perform one-click detection and dimming calibration of the light color of multi-color ambient light modules, thereby achieving color consistency of ambient lights.

[0004] To achieve the above objectives, the present invention provides the following solution:

[0005] An automatic color calibration method for ambient lights includes:

[0006] Perform RGB single-channel full-scale current calibration on all light sources in the ambient light to obtain the PWM values ​​of the three color channels of RGB under the condition of consistent operating current.

[0007] Acquire standard color coordinate optical data for each color of a standard light source and determine the theoretical PWM ratio for each color emitted by the standard light source; the theoretical PWM ratio is the ratio of PWM values ​​for the three color channels (RGB) under the condition of consistent operating current.

[0008] Parallel acquisition of target color coordinate optical data for each target light source in ambient lighting based on parallel multi-channel LIN communication;

[0009] The target color coordinate optical data of each target light source is compared with the standard color coordinate optical data of the same color. The target light source whose difference between the target color coordinate optical data and the standard color coordinate optical data of the same color is greater than the color threshold is selected as the target light source to be calibrated.

[0010] Based on the theoretical PWM ratio, standard color coordinate optical data, and target color coordinate optical data of the target light source to be calibrated, the PWM ratio of the target light source to be calibrated is adjusted using a PID algorithm until the difference between the target color coordinate optical data of the target light source to be calibrated and the standard color coordinate optical data of the same color is less than or equal to the color threshold.

[0011] To achieve the above objectives, the present invention also provides the following solution:

[0012] An automatic color calibration system for ambient lighting includes: a main control system, a standard dark box, and multiple calibration dark boxes;

[0013] A standard dark box contains a standard light source, and each calibration dark box contains a light source to be calibrated;

[0014] The standard dark box and multiple calibration dark boxes are all connected to the main control system via parallel multi-channel LIN communication;

[0015] The main control system is used to send Lin messages to the standard dark box to light up the standard light source in the standard dark box;

[0016] The standard cassette is used to upload the standard color coordinate optical data after the standard light source is lit to the main control system;

[0017] The main control system is also used to send Lin messages to multiple calibration boxes and to light up the light sources to be calibrated in multiple calibration boxes in parallel.

[0018] The calibration cassette is used to upload the target color coordinate optical data after the light source to be calibrated is lit to the main control system.

[0019] The main control system is also used to compare the target color coordinate optical data with the standard color coordinate optical data, and select the target light source whose difference between the target color coordinate optical data and the standard color coordinate optical data of the same color is greater than the color threshold as the target light source to be calibrated. At the same time, the PID algorithm is used to adjust the PWM ratio of the target light source to be calibrated until the difference between the target color coordinate optical data of the target light source to be calibrated and the standard color coordinate optical data of the same color is less than or equal to the color threshold.

[0020] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0021] This invention discloses an automatic color calibration method and system for ambient lights. It performs RGB single-channel full-scale current calibration on all light sources in the ambient light to achieve dimming calibration with fixed temperature compensation. Based on the RGB single-channel full-scale current calibration, it acquires the target color coordinate optical data of each target light source in the ambient light in parallel via multi-channel LIN communication, enabling one-click detection of the light color of the multi-color ambient light module. Furthermore, it synchronously dims and calibrates all target light sources in the ambient light according to the parallel acquired target color coordinate optical data, achieving color consistency of the ambient light. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 A flowchart of an automatic color calibration method for ambient lights provided in an embodiment of the present invention;

[0024] Figure 2 This is a schematic diagram illustrating the principle of the automatic color calibration method for a single light source in an ambient light provided in an embodiment of the present invention.

[0025] Figure 3 This is a schematic diagram illustrating the principle of an automatic color calibration method for multiple light sources in an ambient light provided in an embodiment of the present invention.

[0026] Figure 4 A schematic diagram of data transmission for multi-channel parallel LIN communication provided in an embodiment of the present invention;

[0027] Figure 5 This is a schematic diagram of data parsing for multi-channel parallel LIN communication provided in an embodiment of the present invention;

[0028] Figure 6 This is a schematic diagram of an LED operating current sampling method provided in an embodiment of the present invention;

[0029] Figure 7 A flowchart of slave device data processing provided in an embodiment of the present invention;

[0030] Figure 8 A flowchart of the slave response UDS provided in an embodiment of the present invention;

[0031] Figure 9 This is a structural block diagram of an automatic ambient light color calibration system provided in an embodiment of the present invention;

[0032] Figure 10This is a structural block diagram of an RGB single-channel full-scale current calibration system provided in an embodiment of the present invention. Detailed Implementation

[0033] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0034] The purpose of this invention is to provide an automatic color calibration method and system for ambient lights, which can perform one-click detection and dimming calibration of multi-color ambient light modules to achieve color consistency of ambient lights.

[0035] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0036] like Figure 1 As shown, this embodiment of the invention provides a method for automatically calibrating the color of ambient lights, including:

[0037] Step 1: Perform RGB single-channel full-scale current calibration on all light sources in the ambient light to obtain the PWM values ​​of the three color channels of RGB under the condition of consistent operating current.

[0038] The RGB single-channel full-scale current calibration applies to all light sources in the ambient light, achieving fixed temperature compensation dimming calibration for all light sources. Full scale ensures the consistency of the maximum current of the RGB three-color LEDs (light sources). The purpose of full-scale calibration is to confirm the PWM values ​​of the three channels recorded under the condition that the currents of the R, G, and B LEDs are consistent (max = 25mA).

[0039] The specific process of RGB single-channel full-scale current calibration is as follows: Adjust the PWM parameters of the light source for the three color channels R, G, and B respectively, so that the operating current of the light source for the three color channels R, G, and B reaches the preset maximum value, and then collect the voltage AD value on the sampling resistor; based on the voltage AD value of each color channel, determine the PWM value of each color channel under the condition of consistent operating current.

[0040] The consistent operating current is max = 25mA. The PWM values ​​recorded under the maximum operating current are the maximum PWM values ​​corresponding to the R, G, and B color channels, respectively.

[0041] LED operating current sampling: Due to the high PWM frequency, sampling current using the traditional voltage integration method requires more external resistors and capacitors, increasing costs. Therefore, a PWM timer overflow interrupt is used to automatically trigger ADC sampling on the rising edge of the PWM high level to obtain the peak current. The LED terminal drive current value is then calculated using the PWM duty cycle. For example... Figure 6 As shown, the corresponding formula for calculating the current is I = V. adc / R*Duty, where V adc This represents the corresponding sampling voltage, R represents the sampling resistor, and Duty represents the PWM duty cycle.

[0042] Step 2: Collect the standard color coordinate optical data of each color from the standard light source and determine the theoretical PWM ratio for each color emitted by the standard light source. The theoretical PWM ratio is the proportion of PWM values ​​for the three color channels (RGB) under the condition of consistent operating current.

[0043] Step 3: Acquire the target color coordinate optical data of each target light source in the ambient light in parallel based on parallel multi-channel LIN communication.

[0044] like Figure 4 As shown, the data transmission method of multi-channel parallel LIN communication is as follows: For multi-channel LIN transmission, a timer + DMA method is used to send the transmission buffer to the GPIO register via DMA at fixed intervals. The LIN reception direction is the opposite. A timer is used to read the GPIO register into the reception buffer via DMA at 4 times the oversampling period. Then, the task listens for DMA events. After the reception is completed, the data in the buffer is parsed.

[0045] The transmit buffer and receive buffer are each a 16-bit (unsigned short) array. Each bit value represents the high or low level of the corresponding communication timing. For example, in the transmit channel 15 synchronization interval, the transmit buffer will have 13 consecutive array bits 15 with a value of 0.

[0046] Data reception and parsing are important components of this solution, such as... Figure 5As shown, according to the signal sampling principle, the sampling frequency must be at least four times the period of the signal being sampled. Therefore, the receiving sampling rate is four times the LIN communication rate. Thus, during data parsing, four signals are parsed into one signal. When the high-level sample value is greater than the low-level sample value among the four sampled signals, the valid signal is high. When the high-level sample value is less than the low-level sample value among the four sampled signals, the valid signal is low. When the high-level sample value is equal to the low-level sample value among the four sampled signals, the valid signal is incorrect, and sampling should be resynchronized. Synchronization means that the high and low level sample values ​​are equal; the signal is deemed invalid, and the next set of signal data is acquired before further information analysis and judgment.

[0047] Parallel multi-channel LIN communication enables one-click detection of any number of mixed colors, improving testing and calibration efficiency and saving R&D and production costs.

[0048] Parallel multi-channel LIN communication uses the UDS protocol, which improves the ease of system automation and modification. The main challenge in implementing UDS based on LIN lies in the response processing of the LIN slave. After the master sends a UDS request, the slave's processing time varies depending on the request type. Without proper processing, the slave may read data incorrectly. To ensure compatibility with the UDS specification, the slave first fills the LIN send buffer with a negative response code to prevent the master from reading data at any time. After processing, it fills the LIN send buffer with the correct response. Upon receiving a negative response, the master should wait for a period of time before attempting to read again. The UDS protocol flow is as follows: Figure 7 As shown, the slave device responds to the UDS process as follows: Figure 8 As shown.

[0049] Step 4: Compare the target color coordinate optical data of each target light source with the standard color coordinate optical data of the same color, and select the target light source whose difference between the target color coordinate optical data and the standard color coordinate optical data of the same color is greater than the color threshold as the target light source to be calibrated.

[0050] Step 5: Based on the theoretical PWM ratio, standard color coordinate optical data, and target color coordinate optical data of the target light source to be calibrated, use a PID algorithm to adjust the PWM ratio of the target light source to be calibrated until the difference between the target color coordinate optical data of the target light source to be calibrated and the standard color coordinate optical data of the same color is less than or equal to the color threshold.

[0051] The calculation process of the PID algorithm:

[0052] e(k) = Standard light source color setpoint (k) - Color measurement of the light source to be calibrated (k)

[0053]

[0054] PWM(k) = PWM(k-1) + ΔPWM(k)

[0055] Figure 2 This diagram illustrates the principle of an automatic calibration method for the color of a single light source in an ambient light. Figure 3 This diagram illustrates the principle of an automatic color calibration method for multiple light sources in ambient lighting. Figure 2 and Figure 3 As shown, if the difference between the target color coordinate optical data and the standard color coordinate optical data of the same color is less than or equal to the color threshold, then record the PWM values ​​of the current RGB three color channels of the target light source and the current operating temperature of the target light source; plot all the recorded PWM values ​​of the current RGB three color channels and the current operating temperature into a curve to obtain the temperature-PWM curve with the operating temperature as the horizontal axis and the PWM value of each color channel as the vertical axis.

[0056] Steps 1 to 5 achieve the basic dimming calibration of the ambient light.

[0057] After the ambient lights are put into use, the operating temperature of the light source in the ambient lights will change. In order to ensure the consistency of the ambient light color, dynamic temperature compensation dimming calibration is also required. The process of dynamic temperature compensation dimming calibration algorithm is as follows: after the ambient lights with calibrated colors are put into use, according to the real-time operating temperature of the ambient lights, the PWM values ​​of the corresponding RGB three color channels are obtained from the temperature-PWM correspondence curve, and the ambient lights are adjusted according to the obtained PWM values ​​of the three RGB color channels to achieve dynamic temperature compensation dimming calibration of the ambient lights.

[0058] A single calibration performs a comparison of the basic colors to determine the PWM color mixing relationship (based on the basic color scale to determine the PWM configuration ratio of the RGB 3-color LEDs). Fixed temperature compensation is used as a rapid calibration method to improve production efficiency. Dynamic fitting and dimming correction are performed across the entire temperature range based on the LED characteristic parameters from previous calibrations.

[0059] This invention combines multi-path parallel LIN communication and has independently developed a basic dimming calibration algorithm, a fixed-temperature-compensation dimming calibration algorithm, and a dynamic-temperature-compensation dimming calibration algorithm. From R&D to production, it achieves mass production of ambient lighting components with consistent light color, thus ensuring color consistency for the ambient lighting. If the ambient lighting is installed inside a vehicle, it can guarantee the color consistency of the entire intelligent cockpit.

[0060] This invention is based on parallel multi-channel LIN communication to complete dimming calibration, fixed temperature compensation dimming calibration, and dynamic temperature compensation dimming calibration. It is suitable for mass production and ambient light module PCBA panel products. Multiple channels can be tested simultaneously and calibration parameters can be written in parallel to perform light color quality detection and optimization calibration of multi-color ambient light modules.

[0061] This invention also provides an automatic ambient light color calibration system, such as... Figure 9 As shown, it includes: a main control system, a standard dark box, and multiple calibration dark boxes.

[0062] Each standard cassette contains a standard light source, and each calibration cassette contains one light source to be calibrated. The standard cassettes and multiple calibration cassettes are connected to the main control system via parallel multi-channel LIN communication. The main control system sends LIN messages to the standard cassettes to illuminate the standard light source within them. The standard cassettes then upload the standard color coordinate optical data of the illuminated standard light source to the main control system.

[0063] The main control system also sends LIN messages to multiple calibration boxes, simultaneously illuminating the light sources to be calibrated in these boxes. The calibration boxes upload the target color coordinate optical data of the illuminated light source to the main control system. The main control system further compares the target color coordinate optical data with the standard color coordinate optical data, selecting a target light source whose difference from the standard color coordinate optical data of the same color is greater than a color threshold. This target light source is then used as the calibration target light source. Simultaneously, a PID algorithm is used to adjust the PWM ratio of the calibration target light source until the difference between the target color coordinate optical data and the standard color coordinate optical data of the same color is less than or equal to the color threshold.

[0064] To obtain the chromaticity optical data of the light source in the dark box, a color sensor module is installed in both the standard dark box and each calibration dark box. The color sensor module is used to collect the chromaticity optical data of the light source after it is turned on in the standard or calibration dark box and upload it to the main control system.

[0065] Furthermore, after the difference between the target color coordinate optical data and the standard color coordinate optical data of the same color is less than or equal to the color threshold, the main control system records the current PWM values ​​of the three RGB color channels of the target light source and the current operating temperature of the target light source, and plots all the recorded current PWM values ​​of the three RGB color channels and the current operating temperature into a curve to obtain a temperature-PWM curve with the operating temperature as the horizontal axis and the PWM value of each color channel as the vertical axis.

[0066] Reference Figure 10The ambient light color automatic calibration system also includes an RGB single-channel full-scale current calibration system. The RGB single-channel full-scale current calibration system includes an LED driver and an LED current sampling circuit. The LED driver is connected to both the main control system and the ambient light; the LED driver is used to adjust the ambient light according to the ambient light PWM parameters of the R, G, and B color channels output by the main control system. The LED current sampling circuit is connected to both the ambient light and the main control system; the LED current sampling circuit is used to collect the ambient light operating current of the R, G, and B color channels and upload it to the main control system. The main control system is used to obtain the voltage AD value across the sampling resistor when the ambient light operating current of the R, G, and B color channels are all at preset maximum values, and based on the voltage AD value of each color channel, determine the maximum PWM value of each color channel, and determine the ratio of the maximum PWM values ​​of the three color channels as the theoretical PWM ratio.

[0067] The RGB single-channel full-scale current calibration system also includes a low-dropout linear regulator. The low-dropout linear regulator is connected to the main control system and is used to input a stable voltage to the main control system. Figure 10 In this context, LDO stands for Low Dropout Linear Regulator.

[0068] This invention provides an automatic color calibration system for ambient lights, suitable for use, maintenance, and replacement of ambient lights. It enables multi-channel, rapid detection of optical parameters, algorithm verification, one-click detection of any number of mixed colors, improved testing and calibration efficiency, and reduced R&D and production costs.

[0069] Corresponding to the automatic ambient light color calibration method provided in the embodiments of this invention, this invention also designs a calibration PC software terminal. The calibration PC software terminal includes: a communication connection area, a message log area, a test display area, a firmware burning area, an ID setting area, a current calibration area, and a functional test area.

[0070] Communication Connection Area: Used to establish a connection with the test system. The connection methods are network connection and serial port connection. When using a network connection, you need to enter the network address and network port according to the actual situation. When using a serial port connection, you need to select the serial port number and baud rate according to the actual situation.

[0071] Message log area: Used to display working status, sent and received messages.

[0072] Test display area: Used to display the calibration and test status of 32 ambient lights. The background color is green when all items pass the test; the background color is red when any item fails the test.

[0073] Firmware flashing area: Open the firmware to be flashed and send it to the test system. Click "Flash" to complete the firmware flashing of 32 ambient light channels in parallel via Lin UDS.

[0074] ID setting area: Select ID number and click setting to complete the ID setting of a total of 32 ambient lights in parallel via Lin.

[0075] Current calibration area: Click "Calibrate" to obtain the standard relationship between the PWM duty cycle and LED terminal drive current values ​​of 32 channels via Lin. Click "Save" to save the standard relationship to the ambient light's memory in parallel via Lin.

[0076] Functional Testing Area: Complete the corresponding functional tests by clicking the different functional test buttons. The test results will be displayed in area 3.

[0077] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0078] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for automatically calibrating the color of an ambient light, characterized in that, include: The full-scale current calibration of RGB single-channel is performed on all light sources in the ambient light to obtain the PWM values ​​of the three color channels of RGB under the condition of consistent working current; the PWM timer overflow interrupt is used to correspond to the LED working current principle, and the ADC sampling is automatically triggered by the rising edge of the PWM high level to obtain the peak current, and the LED terminal drive current value is obtained by converting the PWM duty cycle. Acquire standard color coordinate optical data for each color of a standard light source and determine the theoretical PWM ratio for each color emitted by the standard light source; the theoretical PWM ratio is the ratio of PWM values ​​for the three color channels (RGB) under the condition of consistent operating current. Parallel acquisition of target color coordinate optical data for each target light source in ambient lighting based on parallel multi-channel LIN communication; The data transmission method of multi-channel parallel LIN communication is as follows: For multi-channel LIN transmission, a timer + DMA approach is used. The transmit buffer is sent to the GPIO register via DMA at fixed intervals. The LIN receive direction is reversed; a timer is used at 4 times the oversampling period to read the GPIO register into the receive buffer via DMA. A task is then implemented to monitor DMA events. Once reception is complete, the data in the buffer is parsed. During data parsing, four signals are parsed into one signal. When the high-level sample value is greater than the low-level sample value among the four sampled signals, the valid signal is high. When the high-level sample value is less than the low-level sample value among the four sampled signals, the valid signal is low. When the high-level sample value equals the low-level sample value among the four sampled signals, the valid signal is incorrect, and re-synchronization is required. The target color coordinate optical data of each target light source is compared with the standard color coordinate optical data of the same color. The target light source whose difference between the target color coordinate optical data and the standard color coordinate optical data of the same color is greater than the color threshold is selected as the target light source to be calibrated. Based on the theoretical PWM ratio, standard color coordinate optical data, and target color coordinate optical data of the target light source to be calibrated, the PID algorithm is used to adjust the PWM ratio of the target light source to be calibrated until the difference between the target color coordinate optical data of the target light source to be calibrated and the standard color coordinate optical data of the same color is less than or equal to the color threshold. If the difference between the target color coordinate optical data and the standard color coordinate optical data of the same color is less than or equal to the color threshold, then record the current PWM values ​​of the three RGB color channels of the target light source and the current operating temperature of the target light source. Plot the recorded PWM values ​​of all three current RGB color channels and the current operating temperature into a curve to obtain a temperature-PWM curve with the operating temperature on the x-axis and the PWM value of each color channel on the y-axis. After the ambient light with the calibrated color is put into use, the PWM values ​​of the corresponding RGB three color channels are obtained from the temperature-PWM corresponding curve according to the real-time operating temperature of the ambient light, and the ambient light is adjusted according to the obtained PWM values ​​of the three RGB color channels to realize the dimming calibration of the ambient light with dynamic temperature compensation. The automatic color calibration method for ambient light is applicable to mass-produced ambient light module PCBA panel products. The calibration PC software includes: firmware burning area, ID setting area, and current calibration area.

2. The method for automatically calibrating the color of ambient lights according to claim 1, characterized in that, The process of performing RGB single-channel full-scale current calibration on all light sources in the ambient light to obtain the PWM values ​​of each of the three color channels under the condition of consistent operating current specifically includes: Adjust the PWM parameters of the light source for the three color channels R, G, and B respectively, so that the operating current of the light source for the three color channels R, G, and B reaches the preset maximum value, and then collect the voltage AD value on the sampling resistor. Based on the voltage AD value of each color channel, determine the PWM value of each color channel under the condition of consistent operating current.

3. The method for automatically calibrating the color of ambient lights according to claim 2, characterized in that, The operating current of the light source is sampled using a PWM timer overflow interrupt.

4. An automatic color calibration system for ambient lighting, characterized in that, include: Main control system, standard dark box and multiple calibration dark boxes; A standard dark box contains a standard light source, and each calibration dark box contains a light source to be calibrated; The standard dark box and multiple calibration dark boxes are all connected to the main control system via parallel multi-channel LIN communication. The data transmission method of the multi-channel parallel LIN communication is as follows: For multi-channel LIN transmission, a timer + DMA approach is used to send the transmit buffer to the GPIO register via DMA at fixed intervals. The LIN receiving direction is reversed; a timer is used at four times the oversampling period to read the GPIO register into the receive buffer via DMA. The system then monitors DMA events and, upon detecting completion of reception, begins parsing the data in the buffer. During data parsing, four signals are parsed into one signal. When the high-level sample value is greater than the low-level sample value among the four sampled signals, the valid signal is high. When the high-level sample value is less than the low-level sample value among the four sampled signals, the valid signal is low. When the high-level sample value equals the low-level sample value among the four sampled signals, the valid signal is incorrect, and resynchronization is required. The main control system is used to send Lin messages to the standard dark box to light up the standard light source in the standard dark box; The standard cassette is used to upload the standard color coordinate optical data after the standard light source is lit to the main control system; The main control system is also used to send Lin messages to multiple calibration boxes and to light up the light sources to be calibrated in multiple calibration boxes in parallel. The calibration cassette is used to upload the target color coordinate optical data after the light source to be calibrated is lit to the main control system. The main control system is also used to compare the target color coordinate optical data with the standard color coordinate optical data, and select the target light source whose difference between the target color coordinate optical data and the standard color coordinate optical data of the same color is greater than the color threshold as the target light source to be calibrated. At the same time, the PID algorithm is used to adjust the PWM ratio of the target light source to be calibrated until the difference between the target color coordinate optical data of the target light source to be calibrated and the standard color coordinate optical data of the same color is less than or equal to the color threshold. The main control system is used to record the PWM values ​​of the current RGB three color channels of the target light source and the current operating temperature of the target light source after the difference between the target color coordinate optical data and the standard color coordinate optical data of the same color is less than or equal to the color threshold. The system then plots all the recorded PWM values ​​of the current RGB three color channels and the current operating temperature into a curve to obtain a temperature-PWM curve with the operating temperature as the horizontal axis and the PWM value of each color channel as the vertical axis. After the ambient light with the calibrated color is put into use, the PWM values ​​of the corresponding RGB three color channels are obtained from the temperature-PWM corresponding curve according to the real-time operating temperature of the ambient light, and the ambient light is adjusted according to the obtained PWM values ​​of the three RGB color channels to realize the dimming calibration of the ambient light with dynamic temperature compensation. It also includes: an RGB single-channel full-scale current calibration system, which performs RGB single-channel full-scale current calibration on all light sources in the ambient light to obtain the PWM values ​​of the three color channels of RGB under the condition of consistent working current; the corresponding LED working current principle adopts PWM timer overflow interrupt, and the rising edge of the corresponding PWM high level automatically triggers ADC sampling to obtain the peak current, and the LED terminal drive current value is obtained by converting the PWM duty cycle.

5. The ambient light color automatic calibration system according to claim 4, characterized in that, A color sensor module is provided in both the standard dark box and each calibration dark box; The color sensor module is used to collect color coordinate optical data after the light source in the standard or calibration box is lit, and upload it to the main control system.

6. The ambient light color automatic calibration system according to claim 4, characterized in that, The RGB single-channel full-scale current calibration system includes: an LED driver and an LED current sampling circuit; The LED driver is connected to both the main control system and the ambient light; the LED driver is used to adjust the ambient light according to the ambient light PWM parameters of the R, G, and B color channels output by the main control system. The LED current sampling circuit is connected to both the ambient light and the main control system. The LED current sampling circuit is used to collect the ambient light operating current of the three color channels R, G, and B, and upload it to the main control system. The main control system is used to obtain the voltage AD value on the sampling resistor when the ambient light operating current of the three color channels R, G, and B are respectively the preset maximum values, and to determine the maximum PWM value of each color channel based on the voltage AD value of each color channel, and to determine the ratio of the maximum PWM values ​​of the three color channels as the theoretical PWM ratio.

7. The ambient light color automatic calibration system according to claim 6, characterized in that, The RGB single-channel full-scale current calibration system also includes: a low-dropout linear regulator; The low-dropout linear regulator is connected to the main control system and is used to input a stable voltage to the main control system.