A dynamic hsv dimming control method and system based on local input and a lighting device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHUHAI SHENGCHANG ELECTRONICS CO LTD
- Filing Date
- 2026-03-11
- Publication Date
- 2026-07-21
Smart Images

Figure CN121940917B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent lighting control technology, specifically to a dynamic HSV dimming control method, system, and lighting device based on local input. Background Technology
[0002] As smart lighting evolves towards higher quality and personalization, existing technologies struggle to meet the stringent requirements of high-end scenarios for local dimming experiences. Traditional dual-channel dimming is unintuitive and cannot achieve full-color adjustment; app-based remote control lacks physical feedback and suffers from latency; even local devices using the HSV color space suffer from uneven adjustment, unresponsive handling, and flickering at low brightness due to static linear mapping and fixed-parameter filtering. In particular, potentiometer noise and encoder jitter directly impact adjustment stability, and existing filtering algorithms cannot balance noise suppression with dynamic response. Therefore, an innovative solution is urgently needed that can achieve high-precision, high-smoothness local dimming through adaptive signal processing, intelligent color mapping, and smooth multi-mode switching. Summary of the Invention
[0003] To address the shortcomings of the aforementioned dimming systems and methods, this invention provides a dynamic HSV dimming control method, system, and lighting device based on local input. It aims to solve problems such as unintuitive adjustment, unresponsiveness, abrupt color transitions, and abrupt mode switching in the prior art. Through an innovative signal processing flow, the local input (potentiometer / rotary encoder) is efficiently and with high quality converted into precise control signals that drive multiple LEDs.
[0004] The present invention achieves the above objectives through the following technical solutions: A dynamic HSV dimming control method based on local input includes: S1: Acquire raw brightness and raw color temperature values from the local input device; S2: Convert the original color temperature value into the first hue component through inverse linear mapping, and convert the original brightness value into the first lightness component through piecewise nonlinear mapping; S3: Perform weighted smoothing on the first hue component and the first lightness component based on the history buffer to obtain smoothed hue value and smoothed lightness value; S4: Calculate the dynamic speed factor based on the rate of change of the first hue component and adjust the interpolation speed; S5: Using the adjusted interpolation speed, interpolate the smoothed hue value and the smoothed brightness value respectively to obtain the second hue component and the second brightness component; S6: Convert the second hue component, saturation component, and second lightness component to RGB values; S7: Switches between RGB / RGBW / RGBCW / CW target modes according to user instructions, and generates PWM signals to drive multiple LEDs based on the target mode and RGB values, so as to drive the corresponding LED combination to achieve dynamic dimming effect.
[0005] According to the dynamic HSV dimming control method based on local input provided by the present invention, in step S2, the calculation formula for the inverse linear mapping is as follows: H1 raw = M - (Original color temperature value × M / N) Among them, H1 raw The first hue component after mapping, M is the preset maximum hue angle used to limit the hue output range, and N is the maximum allowable input value of the original color temperature value, corresponding to the quantization upper limit of the input device; For H1 raw Perform a modulo 360° calculation to ensure that the output hue value is within the 0-360° range of the standard hue circle.
[0006] According to the dynamic HSV dimming control method based on local input provided by the present invention, in step S2, the piecewise nonlinear mapping includes the following rules: When the original brightness value is less than or equal to the first threshold, the first brightness component is set to the minimum non-zero brightness value; When the original brightness value is greater than the first threshold and less than the second threshold, the first brightness component transitions linearly between the minimum brightness value and an intermediate brightness value. The intermediate brightness value is obtained based on the original brightness value after gamma correction. When the original luminance value is greater than or equal to the second threshold, the first luminance component is set to the value after gamma correction of the original luminance value.
[0007] According to the present invention, a dynamic HSV dimming control method based on local input is provided, wherein the value of the first threshold ranges from 5 to 20, and is used to define the input brightness boundary point between the dim brightness holding area and the smooth transition area; The second threshold ranges from 50 to 200 and is used to define the input brightness boundary between the smooth transition zone and the gamma correction zone. The gamma correction factor ranges from 2.0 to 2.5, and is used to match the non-linear perception characteristics of human eye for brightness. The minimum brightness value ranges from 1 / 10000 to 1 / 2000, serving as the fixed lower limit of the output for the dim brightness maintenance zone.
[0008] According to the present invention, a dynamic HSV dimming control method based on local input is provided. In step S3, the first hue component H1(ti) and the first lightness component V1(ti) of N consecutive cycles are stored in a circular buffer in chronological order, wherein the latest sampled value overwrites the oldest data to ensure that the buffer length is constant. The smoothed hue value H is obtained by calculating the hue and lightness sequences in the circular buffer using an exponentially decaying weighted function. smooth and smooth brightness value V smooth It can be expressed as the following formula:
[0009]
[0010] Where N is the number of historical periods, i.e., the number of historical data points involved in the smoothing calculation, w is the decay coefficient, and the weights are... The number of historical cycles decreases exponentially; The buffer length and attenuation coefficient w are dynamically adjusted based on the fluctuation frequency of the input signal.
[0011] According to the present invention, a dynamic HSV dimming control method based on local input is provided. In step S4, within each control cycle, the absolute value ΔH of the difference between the first hue component of the current cycle and the previous cycle is calculated to quantify the instantaneous change amplitude of hue. Based on the hue change ΔH, the dynamic speed factor speed_factor is calculated using a nonlinear normalization function and expressed as: speed_factor=
[0012] Wherein, K is the hue change sensitivity threshold, which is used to control the intensity of the influence of hue change on the interpolation speed; Based on the base interpolation speed T, the adjusted interpolation speed dynamic_speed is calculated using a weighted mixing formula and expressed as: dynamic_speed =T×(A + B× speed_factor) Where A is the static velocity component, used to ensure the basic interpolation rate; B is the dynamic acceleration component, used to amplify the effect of hue change on the interpolation rate adjustment; the value range of dynamic_speed is [T×A, T×(A+B)], realizing smooth acceleration of the interpolation rate during hue abrupt changes and stable control during steady state.
[0013] According to the dynamic HSV dimming control method based on local input provided by the present invention, in step S6, the determination method of the saturation component includes: When the system detects that the current working mode is RGB mode, the saturation component S is set to 1; When the system detects that the current working mode is RGBW or RGBCW, the saturation component is set to 0. <S<1; When the system detects that the current working mode is CW mode, it skips the HSV color space conversion and directly generates the driving signals for the warm and cool light LED channels based on the original brightness and color temperature values.
[0014] According to the present invention, a dynamic HSV dimming control method based on local input is provided. When the system is in RGBW mode or RGBCW mode, the static preset value of the saturation component is set to S_preset = 0.9 to maintain a higher level of color purity than usual when mixing the white light channel. When the system detects a switch from RGB mode to RGBW / RGBCW mode, a dynamic smooth transition mechanism for the saturation component is activated. The specific steps are as follows: Transition period setting: Define the duration of smooth transition as Δt to match the human eye's perception threshold for color changes; Transition curve calculation: During the transition period, the current saturation value S(t) is calculated by time linear interpolation or exponential decay curve.
[0015] If the mode switching command cancellation is detected during the transition period, the current transition process is immediately terminated, and a smooth transition to S=1 is executed in reverse to avoid repeated jumps of the saturation component near the critical value.
[0016] A dynamic dimming control system based on local input, used to implement the above method, includes: The input acquisition module is used to obtain the original brightness value and the original color temperature value; The mapping module, connected to the input acquisition module, is used to perform inverse linear mapping and piecewise nonlinear mapping; The smoothing module, which connects to the mapping module, includes a circular buffer and a weighted calculation unit for performing weighted smoothing processing. The speed adaptive module, connected to the mapping module, is used to calculate the dynamic speed factor and adjust the interpolation speed; The interpolation calculation module, connected to the smoothing processing module and the speed adaptation module, is used to perform interpolation and output the second hue component and the second brightness component. The color conversion module, connected to the interpolation calculation module, is used to perform the conversion of HSV values to RGB values; The mode decision module, connected to the color conversion module, is used to receive user instructions and determine the target mode of RGB / RGBW / RGBCW / CW; The PWM generation module connects the mode decision module and the color conversion module. It is used to generate PWM signals to drive multiple LEDs based on the target mode and RGB values, so as to drive the corresponding LED combination to achieve dynamic dimming effect.
[0017] A lighting device includes the aforementioned dynamic dimming control system and an LED light source module driven by a PWM signal, wherein the LED light source module includes at least red LEDs, green LEDs, blue LEDs, cool white LEDs, and warm white LEDs.
[0018] Therefore, compared with the prior art, the dynamic HSV dimming control method, system, and lighting device based on local input proposed in this invention significantly improves the immersiveness, personalized adaptation capability, and computational efficiency of spatial audio, and has the following beneficial effects: 1. Traditional dimming methods are stiff and unintuitive to operate, while this invention directly collects brightness and color temperature values through local physical input devices (such as potentiometers and rotary encoders), and combines inverse linear mapping and piecewise nonlinear mapping technology to achieve a smooth dimming effect that conforms to the nonlinear visual characteristics of the human eye.
[0019] 2. Existing technologies using static linear mapping and fixed-parameter filtering result in uneven adjustment and response delays. This invention achieves adaptive control by dynamically adjusting the interpolation speed in real-time by calculating the rate of change of the input signal, enabling both slow, fine-tuning and rapid, agile response. In fine-tuning scenarios (such as stage lighting), the system can respond slowly to avoid jitter; in fast-tuning scenarios (such as everyday lighting), the system can immediately follow input changes, improving real-time performance.
[0020] 3. Potentiometer noise and encoder jitter directly affect adjustment stability, and traditional filtering algorithms struggle to balance noise suppression and dynamic response. This invention employs a weighted average algorithm based on a cyclic history buffer, effectively suppressing random noise through exponentially decaying weight coefficients while maintaining dynamic response capability. Even with minor jitter in the input device, the system can output stable color changes, avoiding flickering or abrupt changes and improving visual comfort.
[0021] 4. Traditional systems are prone to abrupt color or brightness changes during mode switching, affecting user experience. This invention supports four output modes: RGB, RGBW, RGBCW, and CW, and can intelligently switch according to user commands or saturation parameters, while achieving a smooth transition in color and brightness during mode transitions. Users can freely switch modes as needed (such as switching from warm light mode to full color mode), and the system will automatically adjust hue, saturation, and brightness to avoid abrupt changes and ensure visual continuity.
[0022] 5. Traditional systems are prone to flickering or color distortion at low brightness levels. This invention, however, utilizes gamma correction and a low-brightness maintenance zone design to ensure stable light output even at extremely low brightness levels, while optimizing energy efficiency. In scenarios requiring low-brightness lighting (such as cinemas and bedrooms), the system can provide uniform and flicker-free light while reducing energy consumption and extending LED lifespan.
[0023] 6. Different output modes have different saturation requirements (e.g., RGB mode requires high saturation, while RGBW mode requires moderately reduced saturation to avoid overexposure). This invention automatically adjusts the saturation components according to the mode and achieves a smooth transition when switching modes. Users do not need to manually adjust the saturation; the system will automatically optimize color performance according to the mode, avoiding visual discomfort caused by excessively high or low saturation.
[0024] Therefore, through the above technical solution, this invention achieves a smooth, precise, stable, and human-eye-perceptually-compliant full-color dynamic dimming effect through a simple local physical operation interface, significantly improving the user experience of high-end intelligent lighting products. This invention is applicable to fields with stringent requirements for light and color quality, such as intelligent lighting, film and television lighting, and art installations, and has broad market prospects and commercial value.
[0025] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. Attached Figure Description
[0026] Figure 1 This is a flowchart of an embodiment of a dynamic HSV dimming control method based on local input according to the present invention.
[0027] Figure 2 This is a flowchart illustrating an embodiment of a dynamic HSV dimming control method based on local input according to the present invention.
[0028] Figure 3 This is a schematic diagram illustrating the reverse linear mapping process from color temperature value to hue component in an embodiment of a dynamic HSV dimming control method based on local input according to the present invention.
[0029] Figure 4 This is a schematic diagram illustrating the segmented characteristics of the nonlinear mapping from brightness to luminance in an embodiment of the dynamic HSV dimming control method based on local input according to the present invention.
[0030] Figure 5 This is a schematic diagram of the calculation and response curve of the dynamic speed factor in an embodiment of a dynamic HSV dimming control method based on local input according to the present invention.
[0031] Figure 6 This is a schematic diagram of an embodiment of a dynamic dimming control system based on local input according to the present invention. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0033] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0034] An embodiment of a dynamic HSV dimming control method based on local input See Figure 1 This embodiment provides a dynamic HSV dimming control method based on local input, including: S1: Acquire raw brightness and raw color temperature values from the local input device; S2: Convert the original color temperature value into the first hue component through inverse linear mapping, and convert the original brightness value into the first lightness component through piecewise nonlinear mapping; S3: Perform weighted smoothing on the first hue component and the first lightness component based on the history buffer to obtain smoothed hue value and smoothed lightness value; S4: Calculate the dynamic speed factor based on the rate of change of the first hue component and adjust the interpolation speed. S5: Using the adjusted interpolation speed, interpolate the smooth hue value and smooth brightness value respectively to obtain the second hue component and the second brightness component. The interpolation of the hue component adopts the surround perception algorithm. S6: Convert the second hue component, saturation component, and second lightness component into RGB values. The value of the saturation component is determined according to the current output mode and can be updated by receiving external commands via wireless communication. S7: Switches between RGB / RGBW / RGBCW / CW target modes according to user instructions, and generates PWM signals to drive multiple LEDs based on the target mode and RGB values, so as to drive the corresponding LED combination to achieve dynamic dimming effect.
[0035] In step S1, a potentiometer or a rotary encoder is used as a local input device. The potentiometer acquires the voltage signal through an analog-to-digital converter (ADC), and the rotary encoder acquires the rotation angle signal through a pulse counter or an absolute position encoder. The original signals of the two input devices are read simultaneously through the ADC module of the microcontroller unit (MCU) or a dedicated encoder interface, which correspond to the brightness adjustment channel and the color temperature adjustment channel, respectively. Perform the following operations on the acquired raw signals: Filtering and noise reduction: Use hardware low-pass filters or software moving average algorithms to eliminate high-frequency noise in the input signal; Limiting: The original brightness value Braw is limited to the preset range [10, 4000], and the original color temperature value Traw is limited to [0, 4000]. Values outside the range are automatically clamped to the boundary values. Array mapping: The filtered raw signal is mapped to the internal processing range of the MCU in a linear proportion. The brightness value mapping formula is as follows:
[0036] Its color temperature value mapping formula is:
[0037] in, =10, =4000、 =0、 =4000 is the input device range. , , , This refers to the parameters within the MCU's internal processing range. In step S2, the formula for calculating the reverse linear mapping is: H1 raw = M - (Original color temperature value × M / N) Among them, H1 raw The first hue component after mapping is in degrees (°). M is the preset maximum hue angle, with a value of 300°, limiting the hue output range to 0-300°. N is the maximum allowable input value of the original color temperature value, with a value of 4000, corresponding to the quantization limit of the input device. For H1 raw Perform modulo 360° calculation (H1) raw (% 360), ensuring that the output hue value is within the standard hue circle range of 0-360°, and adapting to the limited range of 0-300° through truncation processing.
[0038] As can be seen, this mapping relationship linearly converts the original color temperature value into a hue value, and allows for flexible adjustment of the hue output range through the configuration of parameters M and N. At the same time, it ensures the periodic validity of the hue value through modulo operation.
[0039] In step S2, the piecewise nonlinear mapping includes the following rules: When the original brightness value is less than or equal to the first threshold, the first brightness component is set to the minimum non-zero brightness value; When the original luminance value Braw is greater than the first threshold and less than the second threshold, the first luminance component Vraw transitions linearly between the minimum luminance value and an intermediate luminance value, which is obtained based on the original luminance value after gamma correction. When the original luminance value is greater than or equal to the second threshold, the first luminance component is set to the value after gamma correction of the original luminance value.
[0040] Where 10 < original luminance value Braw < second threshold (100), the first luminance component Vraw is calculated according to the following formula: Calculate the linear transition ratio Vmid = (Braw - 10) / (100 - 10); Gamma correction was applied to the original luminance value (coefficient γ = 2.2), resulting in Vgam = (Braw / 4000). γ ; The final brightness value Vraw = 1 / 4000 + (Vgam - 1)×Vmid achieves a smooth gradient from the minimum brightness value to the gamma correction value; When the original luminance value Braw ≥ the second threshold (100), gamma correction is directly applied to the original luminance value (coefficient γ = 2.2), resulting in Vraw = (Braw / 4000). γ This ensures that high-brightness input conforms to the non-linear perception characteristics of the human eye.
[0041] It is evident that this segmented mapping mechanism, through a combination of threshold division and gamma correction, solves the flickering problem in the low-brightness range and the perceptual unevenness problem in the high-brightness range of traditional linear mapping, while ensuring the naturalness of brightness transition.
[0042] The first threshold value ranges from 5 to 20, and is used to define the input brightness boundary between the dim brightness holding area and the smooth transition area. The preferred value is 10, so as to balance the response sensitivity and anti-interference ability in the low brightness range. The second threshold ranges from 50 to 200 and is used to define the input brightness boundary between the smooth transition zone and the gamma correction zone. The preferred value is 100 to adapt to the dynamic range characteristics of different input devices. The gamma correction coefficient ranges from 2.0 to 2.5 to match the non-linear perception characteristics of human eye for brightness, with a preferred value of 2.2 to achieve a balance between output smoothness and dynamic range compression when high brightness input is applied. The minimum brightness value ranges from 1 / 10000 to 1 / 2000, serving as the fixed lower limit of the output in the low-brightness maintenance zone. The preferred value is 1 / 4000, which balances the perceptible light output intensity under low brightness input with the energy consumption control requirements of the device.
[0043] As can be seen, this parameter range, through experimental verification and perception model optimization, covers the brightness mapping requirements of different application scenarios (such as home lighting and display devices). At the same time, by setting the optimal value, a standardized implementation scheme is provided to ensure the robustness and compatibility of the method in dynamic dimming control.
[0044] In step S3, the first hue component H1(ti) and the first lightness component V1(ti) (i=0,1,…,N-1) for N consecutive periods (N≥5) are stored in a circular buffer in chronological order, where the latest sampled value overwrites the oldest data to ensure that the buffer length is constant. The smoothed hue value H is obtained by calculating the hue and lightness sequences in the circular buffer using an exponentially decaying weighted function. smooth and smooth brightness value V smooth It can be expressed as the following formula:
[0045]
[0046] Where N is the number of historical periods, i.e., the number of historical data points involved in the smoothing calculation, w is the attenuation coefficient (preferred range 0.7 ≤ w ≤ 0.95), and weight... The number of historical cycles decreases exponentially; Perform a modulo 360° operation (H) on the hue component calculation results. smooth (% 360), ensuring that the smoothed hue values are continuous and conform to the hue cycle characteristics; The buffer length and attenuation coefficient w are dynamically adjusted according to the fluctuation frequency of the input signal. In high-frequency fluctuation scenarios, N takes a smaller value (e.g., 5-10), while in low-frequency fluctuation scenarios, N takes a larger value (e.g., 10-20).
[0047] As can be seen, the above-mentioned weighted smoothing mechanism strengthens the influence of recent data on the output results through exponential decay weight allocation, while suppressing noise interference from historical data. Combined with dynamic parameter adaptation, it can meet the differentiated requirements of response speed and stability for different application scenarios (such as stage lighting and intelligent lighting).
[0048] In step S4, within each control period, calculate the absolute value ΔH of the difference in the first hue component between the current period and the previous period to quantify the instantaneous change amplitude of the hue. According to the hue change amount ΔH, calculate the dynamic speed factor speed_factor through a non-linear normalization function: speed_factor =
[0049] where K is the hue change sensitivity threshold (preferred range 5° ≤ K ≤ 30°) for controlling the influence intensity of hue change on the interpolation speed; the value range of speed_factor is [0, 1], and it reaches the maximum value of 1.0 when ΔH ≥ K. According to the basic interpolation speed T (T > 0), calculate the adjusted interpolation speed dynamic_speed through a weighted mixing formula: dynamic_speed = T × (A + B × speed_factor) where A is the static speed component (preferred range 0.5 ≤ A ≤ 1.0) to ensure the basic interpolation rate; B is the dynamic acceleration component (preferred range 0.2 ≤ B ≤ 0.8) to amplify the adjustment effect of hue change on the interpolation speed; in this embodiment, K is 10.0, A is 0.15, and B is 0.35; the value range of dynamic_speed is [T × A, T × (A + B)], achieving smooth acceleration of the interpolation speed during hue mutation and stable control during the steady state.
[0050] It can be seen that through real-time detection and normalization processing of the hue change amount, the interpolation speed can adaptively match the visual perception requirements, improve the response sensitivity in scenes with rapid hue change (such as stage lighting effect switching), and at the same time maintain low computational overhead during the hue stable stage, taking into account both dynamic effects and system efficiency.
[0051] In step S6, the determination method of the saturation component includes: When the system detects that the current working mode is the RGB mode (only including the red, green, and blue primary color channels), forcibly set the saturation component S = 1 to ensure that the output color is a pure color (i.e., the maximum saturation state on the hue circle), avoiding gray interference caused by low saturation. When the system detects that the current working mode is the RGBW mode (including the red, green, blue, and white four channels) or the RGBCW mode (including the red, green, blue, cold white, and warm white five channels), set the saturation component 0 < S < 1, and the specific value is dynamically adjusted according to the following rules: If the original brightness value Braw ≤ the first threshold (10), set S = 0.2, and preferentially increase the brightness and reduce the power consumption through the white light channel. If 10 < Braw < the second threshold value (100), calculate S = 0.2 + 0.8×(Braw - 10) / (100 - 10) by linear interpolation to achieve a gradual enhancement of saturation as the brightness increases; If Braw ≥ 100, set S = 1 and completely switch to RGB channel output to maintain color purity; When the system detects that the current working mode is the CW mode (only including the cold white and warm white dual channels), skip the HSV color space conversion and directly generate the drive signals for the cold and warm light LED channels based on the original brightness value Braw and the original color temperature value CCT: The intensity of the cold light channel C = Braw × (CCT max - CCT) / (CCT max - CCT min ); The intensity of the warm light channel W = Braw - C; Where CCT max and CCT min are the maximum and minimum color temperature values supported by the system (unit: K), respectively.
[0052] It can be seen that through working mode recognition and parameter dynamic adaptation, the contradiction between color purity and brightness efficiency in a multi-channel lighting system is solved. Color expressiveness is guaranteed in the RGB mode, energy efficiency is optimized in the mode with a white light channel, and the control logic is simplified in the CW mode, which is applicable to diverse scenarios such as intelligent lighting and stage lighting.
[0053] When the system is in the RGBW mode (red, green, blue, white four channels) or the RGBCW mode (red, green, blue, cold white, warm white five channels), set the static preset value of the saturation component as S_preset = 0.9 to maintain a color purity higher than the conventional level when mixing the white light channel and avoid visual color deviation caused by a sudden drop in saturation; When it is detected that the system switches from the RGB mode (S = 1) to the RGBW / RGBCW mode, start the dynamic smooth transition mechanism of the saturation component. The specific steps are as follows: Transition period setting: Define the duration of the smooth transition as Δt (preferred range 50ms ≤ Δt ≤ 500ms) to match the perception threshold of the human eye for color changes; Transition curve calculation: Within the transition period, calculate the current saturation value S(t) by linear interpolation in time or an exponential decay curve (recommended exponential coefficient α = 0.5 - 0.8).
[0054] If a mode switching command cancellation is detected during the transition period (such as switching back from RGBW mode to RGB mode), the current transition process is immediately terminated, and a smooth transition to S=1 is executed in reverse to avoid repeated jumps in the saturation component near the critical value. Based on system load or user preferences, S_preset (range 0.7 ≤ S_preset ≤ 0.95) and transition time Δt can be dynamically adjusted, with Δt being shortened first in high-load scenarios to reduce computational latency.
[0055] As can be seen, by optimizing preset values and controlling smooth transitions, the problem of abrupt saturation changes during mode switching is solved, improving visual comfort while maintaining color performance. It is suitable for scenarios with stringent requirements for dynamic color response, such as smart lighting and film lighting.
[0056] In step S6, a conversion algorithm based on hue wheel segmentation is used to convert the second hue component. H 2. Saturation component S and the second brightness component V 2. Mapping to the RGB color space involves the following steps: According to the second hue component H The value of 2 ranges from 0° to 360°, which is divided into 6 equal intervals (each interval is 60°), corresponding to the six primary hue regions: red (R), yellow (Y), green (G), cyan (C), blue (B), and magenta (M).
[0057] Within each hue interval, calculate the relative position of the hue. H rel = H 2mod60°) and interval index ( i = ), and calculate intermediate variables.
[0058] Based on range index i Select the corresponding RGB component combination and obtain the final RGB value through linear interpolation: when i =0 or i When =5, R = C , G = X , B =0; when i When =1, R = X , G = C , B =0; when i When =2, R=0, G = C , B = X ; when i When =3, R =0, G = X , B = C ; when i When =4, R = X , G =0, B = C; The final RGB values are obtained through R out =( R + m )×255、 G out =( G + m )×255、 B out =( B + m )×255 normalized to the integer range of 0-255.
[0059] In RGB mode, saturation component S Set to 1 to achieve full color saturation output; In RGBW / RGBCW mode S The default value is 0.9, and it features a smooth transition during mode switching. In CW mode, the HSV to RGB conversion is skipped directly, and the warm and cool light LED channels are driven according to the original brightness and color temperature values.
[0060] For those outside the hue range ( H 2<0° or H Values greater than 360° are used to perform modulo 360° calculations. When saturation S When =0, the RGB output is forced to grayscale value. R = G = B = V 2×255); When the brightness V When 2=0, the RGB output is forced to be (0, 0, 0), ignoring the hue and saturation parameters.
[0061] As can be seen, this embodiment can ensure the accuracy and stability of color conversion, while supporting smooth transitions in multiple modes, meeting the stringent requirements of high-end lighting scenarios for light color quality.
[0062] In step S7, the user mode switching command is received through a local physical input device (such as a combination of button and encoder operation) or a wireless communication interface; the mode recognition module parses the target mode according to the command type (single trigger / long press / combined encoding), supports mutual exclusion switching of four modes: RGB, RGBW, RGBCW, and CW, and stores the current mode state in non-volatile memory.
[0063] In RGB mode, the converted RGB values are used directly. R out , G out , B out Turn off the white LED channel (W / CW); In RGBW mode, RGB values are mixed proportionally to create a warm white (W) component, and a cool white (CW) channel is added to the RGBW base. The ratio of warm to cool light is dynamically determined by the color temperature (CCT) value. In CW mode, the original brightness value is used directly. L The color temperature (CCT) value generates the PWM duty cycle for warm and cool light, skipping the RGB conversion process.
[0064] The logic for generating multiple PWM signals includes the following: Channel mapping: Assign PWM output channels according to the target mode, where: RGB mode: Enables R, G, and B channels; RGBW mode: Enables four channels: R, G, B, and W; RGBCW mode: Enables five channels: R, G, B, CW, and W; CW mode: Enables only CW and W dual channels; For each enabled channel, generate the PWM duty cycle according to the following rules ( D ): Color channels (R / G / B / CW): D = V 2 × channel scaling factor, where the scaling factor is determined by the color mixing algorithm; White channel (W): D = W (RGBW mode) or D = V 2 CW (RGBCW mode); The PWM timer module of the MCU generates phase-aligned multi-channel PWM signals to ensure that all channels are updated simultaneously and to avoid light flickering. During mode switching, a gradual transition is performed on the PWM duty cycle (duration adjustable from 100 to 500 ms), and the transition curve adopts an exponential decay or S-curve algorithm.
[0065] Furthermore, overcurrent detection is performed: the LED drive current is monitored in real time, and when the current of any channel exceeds the threshold, the corresponding PWM duty cycle is automatically reduced to a safe range; Furthermore, overheat protection is implemented: the LED module temperature is monitored by a temperature sensor, and when the temperature exceeds 60°C, it is forcibly switched to a low brightness mode. V (2≤30%) and disable color temperature adjustment; Furthermore, short-circuit isolation is implemented: each PWM channel is configured with an independent drive transistor, and the channel is automatically shut down when any channel is short-circuited, without affecting the normal operation of other channels.
[0066] Therefore, this implementation defines in detail the instruction parsing for multi-mode switching, color space adaptation, PWM signal generation, and hardware protection mechanisms to ensure that the system can achieve high-precision and high-reliability multi-channel LED driving in complex lighting scenarios, while meeting the user's dual needs for dynamic adjustment of light color and equipment safety.
[0067] An embodiment of a dynamic dimming control system based on local input like Figure 6 As shown, this embodiment provides a dynamic dimming control system based on local input, used to implement the method of the above embodiment, including: The input acquisition module is used to obtain the original brightness value and the original color temperature value; The mapping module, connected to the input acquisition module, is used to perform inverse linear mapping and piecewise nonlinear mapping; The smoothing module, which connects to the mapping module, includes a circular buffer and a weighted calculation unit for performing weighted smoothing processing. The speed adaptive module, connected to the mapping module, is used to calculate the dynamic speed factor and adjust the interpolation speed; The interpolation calculation module, connected to the smoothing processing module and the speed adaptation module, is used to perform interpolation and output the second hue component and the second brightness component. The color conversion module, connected to the interpolation calculation module, is used to perform the conversion of HSV values to RGB values; The mode decision module, connected to the color conversion module, is used to receive user instructions and determine the target mode of RGB / RGBW / RGBCW / CW; The PWM generation module, connected to the connection mode decision module and the color conversion module, is used to generate PWM signals for driving multiple LEDs based on the target mode and RGB values, so as to drive the corresponding LED combinations to achieve a dynamic dimming effect.
[0068] This embodiment also provides a lighting device, including the above dynamic dimming control system, and an LED light source module driven by PWM signals. The LED light source module at least includes red LEDs, green LEDs, blue LEDs, cold white LEDs, and warm white LEDs.
[0069] In practical applications, the dimming system of the present invention is implemented on a general hardware platform including a microcontroller unit (MCU), a user input unit (two potentiometers), and a light source driving unit.
[0070] As Figure 2 shown, the overall processing flow of the present invention includes: using an ADC through the user input unit to collect the original brightness value Braw and the color temperature value Traw of two potentiometers. After the collection is completed, the original brightness value Braw and the color temperature value Traw are filtered and subjected to an array range mapping process to obtain the brightness value L and the color temperature value CCT; where the range of the brightness L is [10 - 4000], and the range of the color temperature CCT is [0, 4000]; then an adaptive non-linear mapping is performed: (1) Mapping from color temperature to hue As Figure 3 shown, the mapping from color temperature to hue is implemented through the following function: Hraw = 300.0 Traw×300.0 / 4000; and perform a modulo operation of 360 on the result to make it within the standard hue ring of 0 - 360 degrees.
[0071] (2) The mapping from brightness to lightness is processed in three segments: As Figure 4 shown, the mapping from brightness to lightness is processed in three segments, divided into three regions: a slightly bright retention area, a smooth transition area, and a gamma correction area: When Braw≤10, set Vraw = 1 / 4000 to maintain the lowest visible light (slightly retained area).
[0072] When 10 < Braw < 100, calculate Vmid = (Braw - 10) / (100 - 10), then perform a gamma calculation of 2.2 on Braw / 4000 to obtain Vgam, and finally calculate Vraw = 1 / 4000 + (Vgam - 1)×Vmid to achieve a smooth transition (smooth transition area).
[0073] When Braw>=100, Vraw (gamma correction region) is obtained by performing a gamma calculation of Braw / 4000 with a factor of 2.2.
[0074] (3) Historical weighted smoothing The system maintains a circular buffer with a depth of 5, using decaying weighting coefficients {0.5, 0.25, 0.125, 0.0625, 0.0625}. A weighted average of the hue and lightness sequences within the buffer is calculated to obtain the smoothing value H. smooth and V smooth .
[0075] (4) Dynamic speed adaptive control like Figure 5 As shown, the dynamic velocity factor exhibits a piecewise linear response to the rate of hue change: 1. Calculate the rate of hue change and the speed factor: SF = min((|ΔH|) / 10.0,1.0); 2. Speed of generating dynamic interpolation: DS = 0.1×(0.15+0.35×SF); 3. Perform surround-perception interpolation. For hue, ensure interpolation along the shortest path on the hue circle; for lightness, perform standard linear interpolation with DS as the coefficient, and output the final values H and V.
[0076] (5) Color conversion and mode output The system converts H, the predetermined saturation S (value depends on the mode), and V into RGB values. It supports four output modes (CW, RGB, RGBW, RGBCW). Users can switch modes via physical buttons or specific encoder commands. Different output modes correspond to different saturation setting rules: in RGB mode, saturation S is fixed at 1.0; in RGBW or RGBCW mode, saturation S is preset to a value less than 1 (preferably 0.9); in CW mode, the warm and cool channels are directly driven by brightness L and color temperature CCT, without HSV-to-RGB color space conversion.
[0077] In summary, the dynamic HSV dimming control system and method based on local input proposed in this invention efficiently converts the original signal of the local physical input (potentiometer / encoder) into hue and brightness values that conform to the perceptual characteristics of the human eye through inverse linear mapping and piecewise nonlinear mapping technology. This solves the problems of stiff operation and unnatural color transition in traditional dimming methods, and achieves smooth dimming across the entire range from dim to bright.
[0078] Furthermore, this invention acquires the original brightness and color temperature dimming values through signal acquisition and preprocessing, and performs preliminary calibration and amplitude limiting processing on them.
[0079] Furthermore, this invention maps the color temperature input value to a limited hue sub-range of 0-300 degrees through an inverse linear relationship, and maps the brightness input value to the lightness value through a piecewise function that includes dim brightness preservation, smooth transition and gamma correction. This design conforms to the non-linear visual characteristics of the human eye.
[0080] Furthermore, this invention employs a weighted average algorithm based on a circular history buffer to perform time-series filtering on the mapped hue and brightness, effectively suppressing random noise.
[0081] Furthermore, this invention calculates the rate of change of the input signal in real time and dynamically adjusts the interpolation response speed accordingly, thereby achieving adaptive human-computer interaction with "slow and fine adjustment and fast and agile response".
[0082] Furthermore, this invention converts the processed HSV values into RGB values. The system supports four output modes: RGB, RGBW, RGBCW, and CW, and can intelligently switch according to user commands or saturation parameters, achieving a smooth transition between color and brightness during mode switching.
[0083] Furthermore, the present invention calculates and generates a synchronous multi-channel PWM signal based on the selected output mode and mixing ratio to drive the corresponding LED combination.
[0084] Therefore, this invention solves the pain points of traditional dimming systems, such as unintuitive adjustment, response delay, and abrupt color transitions, by using key technologies such as signal acquisition optimization, adaptive mapping, intelligent smoothing, and dynamic response. It achieves a high-precision and high-smoothness local dimming experience that is "what you see is what you get," providing an innovative solution for high-end intelligent lighting products.
[0085] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0086] The above embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of protection of the present invention. Any non-substantial changes and substitutions made by those skilled in the art based on the present invention shall fall within the scope of protection claimed by the present invention.
Claims
1. A dynamic HSV dimming control method based on local input, characterized in that, include: S1: Acquire raw brightness and raw color temperature values from the local input device; S2: Convert the original color temperature value into the first hue component through inverse linear mapping, and convert the original brightness value into the first lightness component through piecewise nonlinear mapping; S3: Perform weighted smoothing on the first hue component and the first lightness component based on the history buffer to obtain smoothed hue value and smoothed lightness value; S4: Calculate the dynamic speed factor based on the rate of change of the first hue component and adjust the interpolation speed; S5: Using the adjusted interpolation speed, interpolate the smoothed hue value and the smoothed brightness value respectively to obtain the second hue component and the second brightness component; S6: Convert the second hue component, saturation component, and second lightness component to RGB values; S7: Switches between RGB / RGBW / RGBCW / CW target modes according to user instructions, and generates PWM signals to drive multiple LEDs based on the target mode and RGB values, so as to drive the corresponding LED combination to achieve dynamic dimming effect.
2. The method according to claim 1, characterized in that, In step S2, the formula for calculating the reverse linear mapping is: H1 raw = M - (Original color temperature value × M / N) Among them, H1 raw M is the first hue component after mapping, M is the preset maximum hue angle used to limit the hue output range, and N is the maximum allowable input value of the original color temperature value, corresponding to the quantization upper limit of the input device. For H1 raw Perform a modulo 360° calculation to ensure that the output hue value is within the 0-360° range of the standard hue circle.
3. The method according to claim 1, characterized in that, In step S2, the piecewise nonlinear mapping includes the following rules: When the original brightness value is less than or equal to the first threshold, the first brightness component is set to the minimum non-zero brightness value; When the original brightness value is greater than the first threshold and less than the second threshold, the first brightness component transitions linearly between the minimum brightness value and an intermediate brightness value. The intermediate brightness value is obtained based on the original brightness value after gamma correction. When the original luminance value is greater than or equal to the second threshold, the first luminance component is set to the value after gamma correction of the original luminance value.
4. The method according to claim 3, characterized in that: The first threshold value ranges from 5 to 20 and is used to define the input brightness boundary between the dim brightness preservation area and the smooth transition area. The second threshold ranges from 50 to 200 and is used to define the input brightness boundary between the smooth transition zone and the gamma correction zone. The gamma correction factor ranges from 2.0 to 2.5, and is used to match the non-linear perception characteristics of human eye for brightness. The minimum brightness value ranges from 1 / 10000 to 1 / 2000, serving as the fixed lower limit of the output for the dim brightness maintenance zone.
5. The method according to claim 1, characterized in that: In step S3, the first hue component H1(ti) and the first lightness component V1(ti) of N consecutive periods are stored in a circular buffer in chronological order, where the latest sampled value overwrites the oldest data to ensure that the buffer length is constant. The smoothed hue value H is obtained by calculating the hue and lightness sequences in the circular buffer using an exponentially decaying weighted function. smooth and smooth brightness value V smooth It can be expressed as the following formula: Where N is the number of historical periods, i.e., the number of historical data points involved in the smoothing calculation, w is the decay coefficient, and the weights are... The number of historical cycles decreases exponentially; The buffer length and attenuation coefficient w are dynamically adjusted based on the fluctuation frequency of the input signal.
6. The method according to claim 1, characterized in that: In step S4, within each control cycle, the absolute value ΔH of the difference between the first hue component of the current cycle and the previous cycle is calculated to quantify the instantaneous change amplitude of hue. Based on the hue change ΔH, the dynamic speed factor speed_factor is calculated using a nonlinear normalization function and expressed as: speed_factor= Wherein, K is the hue change sensitivity threshold, which is used to control the intensity of the influence of hue change on the interpolation speed; Based on the base interpolation speed T, the adjusted interpolation speed dynamic_speed is calculated using a weighted mixing formula and expressed as: dynamic_speed =T×(A + B× speed_factor) Where A is the static velocity component, used to ensure the basic interpolation rate; B is the dynamic acceleration component, used to amplify the effect of hue change on the interpolation rate adjustment; the value range of dynamic_speed is [T×A, T×(A+B)], realizing the smooth acceleration of the interpolation rate during hue abrupt changes and the stable control during steady state.
7. The method according to claim 1, characterized in that, In step S6, the determination of the saturation component includes: When the system detects that the current working mode is RGB mode, the saturation component S is set to 1; When the system detects that the current working mode is RGBW or RGBCW, the saturation component is set to 0. <S<1; When the system detects that the current working mode is CW mode, it skips the HSV color space conversion and directly generates the driving signals for the warm and cool light LED channels based on the original brightness and color temperature values.
8. The method according to claim 7, characterized in that: When the system is in RGBW or RGBCW mode, set the static preset value of the saturation component to S_preset = 0.9 to maintain a higher level of color purity than usual when mixing the white light channel. When the system detects a switch from RGB mode to RGBW / RGBCW mode, a dynamic smooth transition mechanism for the saturation component is activated. The specific steps are as follows: Transition period setting: Define the duration of smooth transition as Δt to match the human eye's perception threshold for color changes; Transition curve calculation: During the transition period, the current saturation value S(t) is calculated by time linear interpolation or exponential decay curve; If the mode switching command cancellation is detected during the transition period, the current transition process is immediately terminated, and a smooth transition to S=1 is executed in reverse to avoid repeated jumps of the saturation component near the critical value.
9. A dynamic dimming control system based on local input, characterized in that, For implementing the method of any one of claims 1-8, the system comprises: The input acquisition module is used to obtain the original brightness value and the original color temperature value; The mapping module, connected to the input acquisition module, is used to perform inverse linear mapping and piecewise nonlinear mapping; The smoothing module, which connects to the mapping module, includes a circular buffer and a weighted calculation unit for performing weighted smoothing processing. The speed adaptive module, connected to the mapping module, is used to calculate the dynamic speed factor and adjust the interpolation speed; The interpolation calculation module, connected to the smoothing processing module and the speed adaptation module, is used to perform interpolation and output the second hue component and the second brightness component. The color conversion module, connected to the interpolation calculation module, is used to perform the conversion of HSV values to RGB values; The mode decision module, connected to the color conversion module, is used to receive user instructions and determine the target mode of RGB / RGBW / RGBCW / CW; The PWM generation module connects the mode decision module and the color conversion module. It is used to generate PWM signals to drive multiple LEDs based on the target mode and RGB values, so as to drive the corresponding LED combination to achieve dynamic dimming effect.
10. A lighting device, characterized in that, It includes the dynamic dimming control system as described in claim 9, and an LED light source module driven by a PWM signal, wherein the LED light source module includes at least red LEDs, green LEDs, blue LEDs, cool white LEDs, and warm white LEDs.
Citation Information
Patent Citations
Light color shift control method and system
CN120529455A
Method and system for controlling color gradient of creative and creative lamplight
CN120583568A