Multi-mode LED swimming pool lamp control method, system and equipment

Through the progressive adjustment of PWM duty cycle and RGBW four-channel closed-loop control, the problem of color sudden change and current impact of traditional multi-mode LED swimming pool lamps during the switching process is solved, smooth color transition and the stability of LED devices are achieved, and the expressiveness of the lighting effect is enhanced.

CN120568538APending Publication Date: 2025-08-29SHENZHEN LONG SUN OPTOELECTRONICS TECH CO
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510911546.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-02
Publication Date
2025-08-29

AI Technical Summary

Technical Problem

During the mode switching process, traditional multi-mode LED pool lights have problems such as sudden color jumps and strong visual impact, and the direct switching method may cause current impact and shorten service life.

Method used

The progressive adjustment of the PWM duty cycle, combined with the closed-loop control of RGBW four channels, is achieved by establishing a mode compatibility matrix and pre-calculating switching paths, and the track calculation is performed based on the CIE Lab color space, and a PID controller and temperature compensation mechanism are used to ensure smooth color transition and LED device stability.

Benefits of technology

Intelligent path planning between multiple modes is realized, which avoids incompatibility and current impact of traditional switching methods, ensures smoothness and continuity of mode switching, enriches the expressiveness and visual impact of lighting effects, and protects the long-term stability of LED devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120568538A_ABST
    Figure CN120568538A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of LED control, and discloses a multi-mode LED swimming pool lamp control method, system and device. The method comprises the following steps: calculating switching path pre-calculation data based on a remote controller mode switching instruction and color characteristic parameters of E light modes; according to the switching path pre-calculation data, carrying out progressive modulation on the RGBW four-channel PWM duty ratio to obtain a linear transition modulation sequence; on the basis of the linear transition modulation sequence, trajectory calculation is carried out on dynamic change mode color change in a CIE Lab color space, and color transition trajectory parameters are obtained; and closed-loop control is carried out on RGBW four-channel LED currents according to the color transition track parameters, PWM control signals are obtained, progressive adjustment of the PWM duty ratio is achieved, and the visual abrupt sense and the flicker phenomenon caused by traditional abrupt change type switching are eliminated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of LED control technology, and in particular to a multi-mode LED swimming pool light control method, system and device. Background Art

[0002] Traditional multi-mode LED pool lights often experience sudden color jumps and strong visual impact during mode switching. This abrupt switching process not only affects the user's visual experience but can also cause current surges in LED components, shortening their lifespan. Existing technologies typically employ a direct switching approach, where the system immediately switches from the current mode to the target mode upon a remote control command. This approach lacks a sound transition mechanism and path planning.

[0003] Existing LED pool light control systems are relatively backward in color transition processing, primarily due to a lack of color science-based transition algorithms and precise current control mechanisms. Traditional methods often perform simple linear interpolation within the RGB color space, failing to consider the human eye's actual perception of color changes, resulting in unnatural transition effects. Furthermore, existing control systems lack precise control over the rate of change of LED current, which can easily cause current spikes during rapid mode switching. This not only affects color display stability but can also damage the LED chip. Summary of the Invention

[0004] The present invention provides a multi-mode LED swimming pool light control method, system and device, which realizes the gradual adjustment of the PWM duty cycle, eliminating the visual abruptness and flickering caused by traditional sudden switching.

[0005] In a first aspect, the present invention provides a multi-mode LED swimming pool light control method, the multi-mode LED swimming pool light control method comprising: Calculate the switching path pre-calculation data based on the remote control mode switching command and the color feature parameters of E types of lighting modes; According to the pre-calculated data of the switching path, the RGBW four-channel PWM duty cycle is progressively modulated to obtain a linear transition modulation sequence; Based on the linear transition modulation sequence, the trajectory of the color change of the dynamic change mode is calculated in the CIE Lab color space to obtain the color transition trajectory parameters; The RGBW four-channel LED current is closed-loop controlled according to the color transition trajectory parameters to obtain a PWM control signal.

[0006] In combination with the first aspect, in a first implementation of the first aspect of the present invention, the calculating of the switching path pre-calculation data based on the remote control mode switching instruction and the color characteristic parameters of the E lighting modes includes: Based on the remote control mode switching command, feature vectors of the RGB color space coordinates and dynamic change frequency parameters of E lighting modes are extracted to obtain a set of mode feature vectors; According to the pattern feature vector set, a color similarity coefficient, a change speed matching coefficient and a pattern-pattern matching coefficient are weightedly calculated to obtain a pattern compatibility matrix; Based on the mode compatibility matrix, a shortest path search is performed on the switching paths between the E lighting modes to obtain an optimal switching path set; The transition time parameters, intermediate state sequences and PWM modulation parameters in the optimal switching path set are stored in a structured manner to obtain switching path pre-calculation data.

[0007] In combination with the first aspect, in a second implementation of the first aspect of the present invention, performing a shortest path search for switching paths between the E lighting modes based on the mode compatibility matrix to obtain an optimal switching path set includes: According to the mode compatibility matrix, a reciprocal operation is performed on the compatibility coefficient to obtain a path weight matrix; Constructing a mode switching directed graph of E types of light mode nodes and switching path edges according to the path weight matrix; Input the mode switching directed graph into the Dijkstra shortest path algorithm to perform path search to obtain the shortest switching path between any two modes; Based on the shortest switching path, the path length and switching complexity are screened and sorted to obtain an optimal switching path set; Among them, the E lighting modes include 7 static color modes and 8 dynamic change modes. The 7 static color modes include red mode, green mode, blue mode, white mode, yellow mode, purple mode and cyan mode. The 8 dynamic change modes include color transition mode, fade-in and fade-out mode, color change mode, color jumping mode, flashing mode, breathing mode, flowing water mode and rainbow cycle mode.

[0008] In combination with the first aspect, in a third implementation of the first aspect of the present invention, the step of progressively modulating the RGBW four-channel PWM duty cycle according to the pre-calculated switching path data to obtain a linear transition modulation sequence includes: Based on the pre-calculated data of the switching path, the transition time parameters and the PWM modulation parameters are analyzed to obtain the initial duty cycle and target duty cycle of the RGBW four channels; According to the initial duty cycle and target duty cycle of the RGBW four channels, the preset transition buffer time is divided to obtain the segmented modulation timing control parameters; Based on the segmented modulation timing control parameters, the current change rate of the RGBW four-channel LED is constrained and calculated to obtain the PWM change gradient within the current safety control range; A linear transition modulation sequence is generated based on the PWM change gradient and a preset segmented modulation ratio.

[0009] In combination with the first aspect, in a fourth implementation of the first aspect of the present invention, constraining the calculation of the RGBW four-channel LED current change rate based on the segmented modulation timing control parameters to obtain a PWM change gradient within the current safety control range includes: According to the segmented modulation timing control parameters, the ratio of the maximum rated current and the segmented time of the RGBW four-channel LED is calculated to obtain the maximum allowable current change rate of each channel; Based on the maximum allowable current change rate of each channel, a safety threshold is set for the current change rate constraint function to obtain a current safety control constraint condition; Calculating the PWM duty cycle variation based on the current safety control constraint to obtain the PWM maximum variation limit within each time segment; According to the PWM maximum change limit, a gradient constraint calculation is performed on the RGBW four-channel PWM duty cycle change to obtain the PWM change gradient within the current safety control range.

[0010] In combination with the first aspect, in a fifth implementation of the first aspect of the present invention, the step of calculating the trajectory of the color change in the dynamic change mode in the CIE Lab color space based on the linear transition modulation sequence to obtain the color transition trajectory parameters includes: Based on the linear transition modulation sequence, the RGBW four-channel PWM duty cycle is converted into a color space to obtain the starting color coordinates and the target color coordinates in the CIE Lab color space; Selecting a trajectory type based on the visual effects requirements of the dynamic change mode according to the starting color coordinates and the target color coordinates, and obtaining trajectory calculation control parameters corresponding to each dynamic change mode; The trajectory calculation control parameters are input into the CIE Lab color space to optimize the blue-green perception characteristics of the underwater environment to obtain color transition trajectory parameters.

[0011] In combination with the first aspect, in a sixth implementation of the first aspect of the present invention, selecting a trajectory type based on the visual effects requirements of the dynamic change mode according to the starting color coordinates and the target color coordinates to obtain trajectory calculation control parameters corresponding to each dynamic change mode includes: Based on the starting color coordinates and the target color coordinates, geometrically calculating the color distance and direction angle in the CIE Lab color space to obtain color change vector characteristic parameters; Classifying and matching the visual effect types of the dynamic change mode according to the color change vector characteristic parameters to obtain a pattern attribution relationship among a spiral trajectory type, a Bezier curve trajectory type, a polynomial trajectory type, and a piecewise linear trajectory type; The trajectory calculation control parameters corresponding to each dynamic change mode are set based on the mode affiliation relationship.

[0012] In combination with the first aspect, in a seventh implementation of the first aspect of the present invention, performing closed-loop control on the RGBW four-channel LED current according to the color transition trajectory parameter to obtain a PWM control signal includes: Based on the color transition trajectory parameters, the CIE Lab color space is subjected to coordinate inverse conversion processing to obtain the RGBW four-channel target current values; According to the target current value of the RGBW four channels, the LED current of each channel is detected and the error is calculated in real time to obtain the current deviation value; The current deviation value is input into the PID controller for proportional-integral-differential calculation to obtain the PWM duty cycle adjustment value; Based on the PWM duty cycle adjustment amount, a comprehensive analysis is performed on the dead zone control condition and the temperature compensation parameter to obtain a PWM control signal.

[0013] In a second aspect, the present invention provides a multi-mode LED swimming pool light control system, the multi-mode LED swimming pool light control system comprising: A pre-calculation module is used to calculate the pre-calculation data of the switching path based on the remote control mode switching instruction and the color characteristic parameters of E types of lighting modes; A modulation module, configured to progressively modulate the RGBW four-channel PWM duty cycle according to the pre-calculated data of the switching path to obtain a linear transition modulation sequence; A trajectory calculation module is used to calculate the trajectory of the color change of the dynamic change mode in the CIELab color space based on the linear transition modulation sequence to obtain color transition trajectory parameters; The closed-loop control module is used to perform closed-loop control on the RGBW four-channel LED current according to the color transition trajectory parameters to obtain a PWM control signal.

[0014] The third aspect of the present invention provides a multi-mode LED swimming pool light control device, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the multi-mode LED swimming pool light control device executes the above-mentioned multi-mode LED swimming pool light control method.

[0015] The technical solution provided by this invention implements intelligent path planning between multiple modes by establishing a mode compatibility matrix and precalculating switching paths. This avoids the incompatibility and conflict issues caused by blind switching in traditional technologies and ensures smooth and continuous mode switching. By employing segmented modulation timing control and current rate-of-change constraint calculation, precise current control of the RGBW four-channel LED is achieved, effectively avoiding the current surge that can occur with traditional direct switching methods and protecting the long-term stability of the LED devices. Trajectory calculation and color transition processing based on the CIE Lab color space fully consider the actual human eye's perception of color changes, achieving a more natural and smoother color transition effect than the traditional linear interpolation method in the RGB space. Specifically tailored to the unique environment of underwater swimming pool lighting, weighted optimization of the blue-green color perception characteristics compensates for the differential attenuation of light of different wavelengths by water, ensuring the accuracy and consistency of underwater color display. By combining multiple algorithms, including spiral trajectories, Bezier curve trajectories, polynomial trajectories, and piecewise linear trajectories, specifically optimized color transition paths are provided for different dynamic modes, enriching the expressiveness and visual impact of the lighting effects. A closed-loop control mechanism combining a PID controller with dead-band control and temperature compensation enables real-time monitoring and precise adjustment of LED current, ensuring color stability and consistency over long-term use. Four-segment modulation with a 200ms buffer and preset segment ratio control enables gradual adjustment of the PWM duty cycle, eliminating the visual abruptness and flickering caused by traditional abrupt switching. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0017] Figure 1 A flow chart of a multi-mode LED swimming pool light control method provided in an embodiment of the present application; Figure 2 A schematic block diagram of the structure of a multi-mode LED swimming pool light control system provided in an embodiment of the present application; Figure 3This is a schematic block diagram of the structure of the multi-mode LED swimming pool light control device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0018] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0019] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may change based on actual circumstances.

[0020] It should also be understood that the terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.

[0021] It should be further understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0022] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments may be combined with each other.

[0023] See also Figure 1 , Figure 1 This is a flow chart of a multi-mode LED swimming pool light control method provided in an embodiment of the present application, as shown in FIG. Figure 1 As shown, the multi-mode LED swimming pool light control method provided in the embodiment of the present application includes steps S100 to S400.

[0024] Step S100: Calculate pre-calculated data of a switching path based on the remote control mode switching instruction and color characteristic parameters of E lighting modes; It is understandable that the execution subject of the present invention can be a multi-mode LED swimming pool light control system, or a terminal or a server, which is not limited here. The embodiment of the present invention is described by taking the server as the execution subject as an example.

[0025] Specifically, a color behavior modeling process is established, and a switching signal from the remote control is used as a trigger event to initiate a global analysis of the characteristic relationships between all lighting modes. When the user enters a target mode number via the remote control, the control system simultaneously extracts the core parameter information of E preset lighting modes, including each mode's three-dimensional coordinates in the RGB color space and non-static features such as its dynamic change frequency or rhythm. This information is then encoded into a unified format of pattern feature vectors. Each pattern feature vector contains the geometric positional relationship formed by its color values ​​(the brightness ratio of the three R, G, and B channels), as well as data describing the dynamic behavior of the light, such as its category (such as static, gradual, and jumping), and its frequency amplitude, effectively characterizing the color experience characteristics of a pattern in the user's field of view. Based on the set of pattern feature vectors, the transition compatibility between any two modes is quantitatively analyzed using three core similarity evaluation functions. Color similarity is calculated by calculating the Euclidean distance between RGB coordinates and performing reverse normalization. A larger value indicates closer visual perception of the two colors. Speed ​​of change matching is calculated based on frequency difference, with the lowest frequency difference being the highest score. Mode-to-mode matching is empirically weighted based on the type of dynamic mode (e.g., the degree of perceptual jump from a static mode to a color-shifting mode). Each of these three similarity coefficients is multiplied by a pre-set weighting factor (e.g., color similarity has a higher weight, dynamic matching has a lower weight, and mode features have the lowest weight). This weighted summation generates an E×E-dimensional mode compatibility matrix, where the i-th row and j-th column represent the overall compatibility score when switching from mode i to mode j. Higher values ​​indicate a path more suitable for direct or buffered transitions. This mode compatibility matrix is ​​converted into a weighted graph model based on graph theory semantics. Each lighting mode is represented as a node in the graph, and the compatibility score between each pair of modes serves as the edge weight. Through the reverse process, high compatibility is mapped to low-cost paths, thus meeting the shortest path search algorithm's objective. A path optimization search is performed for all possible start-end mode pairs, preferentially employing heuristic path search algorithms such as Dijkstra or A* to find the optimal switching path from any starting mode to the target mode in the graph. Each path includes information about the start and target nodes, as well as the sequence of intermediate modes along the path, a recommended allocation of total transition time, color trends at each stage, and the direction of mode progression. The information on all optimal switching paths is structured to construct a precomputed dataset of switching paths, which is stored in a local lookup table or cache module for real-time access.

[0026] Based on the mode compatibility matrix, the compatibility coefficient is reciprocally calculated. Since each element in the mode compatibility matrix originally represents the degree of compatibility between switching from one mode to another, and the shortest path search algorithm requires that the smaller the path cost, the better, the compatibility value is converted into a path cost through a reciprocal calculation. Using the reciprocally transformed path weight matrix as a foundation, a directed weighted graph structure consisting of E lighting modes is constructed, where each node represents a lighting mode, including seven static color modes (red, green, blue, white, yellow, purple, and cyan) and eight dynamic modes (including color transition, fade-in, fade-out, color change, color jump, flashing, breathing, flowing, and rainbow cycle). The edges between any two nodes represent the cost required to switch from one mode to another. The constructed mode switching graph forms a dense directed graph in terms of topology. Once the graph model is complete, the Dijkstra shortest path algorithm is used to perform a path search for each pair of start and end nodes in the directed graph. The Dijkstra algorithm uses a greedy strategy, starting from the starting node and gradually expanding to the unvisited nodes with the lowest cost. By maintaining a forward path table and accumulated costs, it provides a path sequence with the lowest total cost for each pair of lighting modes. This path includes the sequence of intermediate mode nodes between the starting and ending points and also implicitly contains the compatibility gradient corresponding to each switching step, which is a key basis for the system to achieve "non-abrupt" color transitions. During this process, for mode pairs with low compatibility and large visual differences, the algorithm prioritizes the more compatible intermediate mode to guide the user's visual transition smoothly, effectively avoiding flickering, sudden changes, or discomfort during the switching process. Path results are screened and ranked using a mechanism that evaluates path length and switching complexity. Path length refers to the number of intermediate mode nodes traversed in the path; shorter paths indicate fewer switching steps and faster response. Switching complexity comprehensively considers the frequency of mode category jumps (e.g., from static to dynamic), the color gamut span, and the dynamic amplitude difference within the path, assessing the degree of interference the switching process has on human perception. The optimal switching path set is screened based on preset rules (for example, paths with a path length of less than 3 steps and a switching complexity below a threshold are prioritized). For each path, key attributes such as its source mode, target mode, intermediate state sequence, total path cost, and PWM transition parameter configuration recommendations are recorded.

[0027] Step S200: progressively modulate the RGBW four-channel PWM duty cycle according to the pre-calculated data of the switching path to obtain a linear transition modulation sequence; Specifically, the controller extracts the transition time parameters and PWM modulation parameters between the current lighting mode and the target mode from a pre-calculated dataset. These parameters include the total duration of the entire switching process, the initial and target duty cycles of each LED channel, and the brightness trend required to maintain during each transition. This analysis allows the controller to identify the PWM output starting point for the four R, G, B, and W channels in their current state, as well as the desired target PWM values. Based on the extracted transition time parameters, the controller then segments the entire transition buffer window, dividing the total transition time (e.g., 200ms) into several consecutive equal-segment or non-equal-proportional modulation segments, such as 0-50ms, 50-100ms, 100-150ms, and 150-200ms. Each segment corresponds to a linear or non-linear PWM variation interval, known as the segmented modulation timing control parameters, which define the PWM adjustment step size and rhythm structure within each segment. This segmented modulation simulates the human eye's sensitivity to varying rates of change, making the system adaptable when handling static and dynamic mode transitions. For example, dynamic mode is more suitable for an S-shaped curve or slow-fast-slow transition, while static mode switching prefers a linear slope to avoid abrupt visual jumps. After obtaining the segmented timing parameters, the current rate of change during each modulation segment is constrained and calculated based on the electrical characteristics of the LED channel. Because LED chips are extremely sensitive to current surges, especially when switching modes frequently or adjusting brightness dramatically, which can lead to overheating or transient flicker, it is crucial to ensure that PWM increments remain within a safe range. This current rate-of-change limiting mechanism dynamically adjusts the current rate of change by setting a maximum current rate-of-change threshold (for example, a linear increment of no more than 350mA within 200ms). The maximum acceptable PWM gradient within each subsegment is calculated based on the difference between the initial and target PWM values, the duration of the modulation segment, and the LED load response model. The PWM gradient under the aforementioned current constraint is integrated with a pre-set modulation ratio model to generate a complete linear transition modulation sequence. This sequence, with each modulation time segment as a node, records the target duty cycle values ​​and their change directions for the R, G, B, and W channels, enabling the hardware PWM control module to progressively load and execute them. During the actual execution of the modulation sequence, the controller updates the PWM value at a set frequency, with each update incrementally adjusting within the permissible current variation range to ensure a synchronized and smooth transition in each frame of lighting output, both visually and at the current level.

[0028] Based on the segmented modulation timing control parameters, the ratio of the maximum rated current of the four-channel RGBW LED to the segment time is calculated. The maximum rated current values ​​of each RGBW LED channel are obtained, and then the maximum current value of each channel is divided by the current segment time to obtain the maximum allowable current change rate of the corresponding channel within that time period, providing the upper limit of current fluctuation for each modulation segment. Each channel's maximum allowable current change rate is embedded as an input variable into the current change rate constraint function to construct a dynamic safety threshold model. This model not only considers the static rated current limit of the current channel but also incorporates actual operating parameters such as the LED device's thermal response curve, PWM update period, power supply jitter, and temperature drift factors into correction factors. This forms a dynamic threshold function for safety control, which determines whether PWM changes within any time period result in excessive current changes, potentially causing chip thermal shock or light source flickering instability. Based on this, the maximum allowable current change rate within each modulation segment is converted to the maximum change in the PWM duty cycle. Specifically, for a given power supply voltage and LED load characteristics, mA / ms is converted to an equivalent duty cycle / ms change limit, forming the maximum PWM change limit. The target PWM variation for the four RGBW channels within each modulation subsegment is verified using the maximum PWM variation limit. If the initial PWM value for a channel is P1 and the target PWM value is P2, the difference ΔP is calculated and compared with the maximum PWM variation allowed within the current segment. If ΔP exceeds the limit, the variation is split or distributed across multiple modulation segments for gradual execution, ensuring the smoothest and safest progressive adjustment of the PWM value within the entire transition time window. This process, known as the PWM gradient constraint calculation, compares the target PWM variation value with the safety control threshold and determines the actual PWM variation amplitude for each step based on the margin. The controller aggregates the actual PWM variation step sizes obtained through this calculation across all channels and modulation segments to generate a gradient variation sequence.

[0029] Step S300: Based on the linear transition modulation sequence, calculate the trajectory of the color change of the dynamic change mode in the CIE Lab color space to obtain color transition trajectory parameters; Specifically, based on the PWM duty cycle combination of the RGBW channels in each modulation step, the system converts these values ​​to standard sRGB values ​​using a color model conversion function. After linearization and conversion to the D65 white point reference, CIE XYZ values ​​are derived. Ultimately, these values ​​are mapped to the three-dimensional L*, a*, and b* coordinates in CIE Lab. This yields the absolute coordinate positions of the starting and target color points in the perceptual space for the dynamic change process. Based on the starting and target color coordinates, a trajectory type is selected based on the visual effects requirements of the dynamic change mode. The most appropriate trajectory type model is automatically selected based on the currently executing dynamic mode. For example, in fade-in / fade mode, a Bezier curve trajectory is more suitable to create gentle and smooth light intensity changes. In color jump mode, the system prefers a piecewise linear trajectory for instantaneous jumps in color space. In color transition or rainbow cycle modes, spiral or sinusoidal perturbation trajectories are used to achieve multi-point rotational progression of colors around the target center trajectory in Lab space, creating a rich sense of color cycle or fluidity. After the trajectory type is determined, parameters such as pattern type, variation period, dynamic amplitude, and spatial perturbation factor are encapsulated as trajectory calculation control parameters. These parameters directly influence the curvature of the trajectory curve, the speed of color transitions, and the path complexity. These trajectory calculation control parameters are then fed into the color trajectory generation engine in Lab space. A blue-green color perception enhancement optimization mechanism is also introduced for underwater environments. Because light propagation in aquatic environments, such as swimming pools, is significantly affected by wavelength absorption characteristics, with red and purple colors easily absorbed by water and appearing dim, while blue and green colors are more easily perceived underwater by the human eye. Therefore, a set of underwater perception weighting coefficients is introduced on the plane formed by the a and b channels. This automatically amplifies the spatial proportion of the trajectory near blue-green regions, making the transition path more visually consistent with human perception. For example, when the target color approaches green or cyan regions on the a-b plane, the system appropriately increases the path dwell time or enhances the perturbation frequency in that section within the trajectory generation function to enhance the light effect in the blue-green region. The final generated color transition trajectory parameters include the spatial function expression of the trajectory path, the corresponding time step mapping, the color perturbation factor, and the weighted adjusted underwater visual priority area annotation information.

[0030] The color transformation process extends from straightforward RGB value manipulation to geometric modeling in the CIE Lab color space. During this process, the controller converts the RGBW channel outputs into three-dimensional coordinates of L* (lightness), a* (red and green components), and b* (yellow and blue components) in CIE Lab space using a series of color conversion formulas, based on the PWM duty cycle changes defined by the linear transition modulation sequence. This process then extracts the locations of the starting and target colors in Lab space. Geometric vector analysis is performed on these two points to calculate the color distance between them (defined as the Euclidean distance in three-dimensional space, representing the perceived intensity of the color change). The direction angle of the change vector in the ab plane is also calculated to reflect the directional characteristics of the color transition. These calculation results constitute a set of characteristic parameters for the color change vector, including information such as the color difference amplitude, change direction, and brightness gradient. These color change vector characteristic parameters are then matched and classified with a pre-defined dynamic visual effects model to assign the most appropriate trajectory type to each dynamic change pattern. When the color distance is small, the angular changes are gentle, and the brightness changes are not drastic, the system prioritizes "fade-in / fade-out" or "breathing mode," adapting the Bezier curve trajectory type to generate a soft and natural transition path. When the color distance is large, the angular changes exhibit periodic perturbations, or there are multi-angle rotation trends, the system categorizes it as "rainbow cycle" or "color transition" mode, adapting the spiral trajectory type to enhance fluidity and rotation. If the color path requires rapid changes and directional jumps, such as in "color jump" or "flickering" modes, a piecewise linear trajectory is matched to achieve a sharp color transition. When the color path is neither strictly straight nor regularly perturbed, but exhibits multiple slow changes with gradually increasing amplitudes, the system categorizes it as "flowing water" or "multi-color gradient," matching it with a polynomial trajectory to achieve a balance between curvature continuity and control flexibility. Through a classification and matching mechanism corresponding to the geometric characteristics of color changes, eight of the 17 dynamic lighting modes are assigned to the most suitable trajectory model. After the trajectory type classification is completed, the unique trajectory calculation control parameters are set for each type. The parameter set includes the trajectory curvature coefficient, perturbation frequency, control point coordinates (for Bezier curves), rotation radius and phase (for spiral trajectories), order and coefficients (for polynomial trajectories), and jump nodes and interpolation step size (for piecewise linear trajectories).

[0031] Step S400: Closed-loop control is performed on the RGBW four-channel LED current according to the color transition trajectory parameters to obtain a PWM control signal.

[0032] Specifically, based on the perceptual target in color space, the color transition trajectory parameters are reverse-projected through a mathematical mapping method. Each trajectory point in the CIE Lab color space is converted back into corresponding RGB color values. The mapping and decomposition of the four RGBW channels are then completed by combining the light source configuration and the characteristics of the white light channel. This reverse conversion process sequentially completes the calculations from Lab to XYZ, XYZ to linear RGB, and linear RGB to gamma-corrected RGB. Finally, based on the system's white light channel control strategy, the neutral color component in the original RGB signal is split into the W channel to obtain the target current value for the four RGBW channels corresponding to the current trajectory point. Each target value represents the ideal brightness current output by the LED lamp at that trajectory position. Using the theoretical target current value as a reference input, it is compared with the four-channel LED current values ​​collected in real time by a high-precision current sensor (such as the INA219) in the actual circuit. The current deviation value for each channel during the current control cycle is calculated as the difference between the actual current and the target current. These current deviation values ​​reflect the instantaneous error between the LED output and the visual target. To convert current deviations into PWM control commands, the four current deviation values ​​are fed into a PID controller for proportional (P), integral (I), and differential (D) calculations. The controller dynamically weights and sums the current error amplitude (P term), the cumulative error trend (I term), and the error rate of change (D term) for each channel to calculate the required PWM duty cycle adjustment for the current cycle. During the design phase, PID controller parameters (such as Kp, Ki, and Kd) are optimized based on the LED load response characteristics and the desired system response speed to ensure fast response, low overshoot, and stable convergence during the control process, avoiding oscillation or overshoot. A dead-band control mechanism is introduced: when the current error is less than a set threshold (e.g., ±2mA), PWM adjustment is not performed. This avoids flickering or wasted control resources caused by frequent adjustments within a very small error range. Furthermore, considering the impact of temperature on LED electrical performance, especially for the white light channel, where light output decreases as temperature rises, the system uses a temperature sensor to collect the current LED substrate temperature and incorporates it into the PWM compensation model. This adjusts the PWM duty cycle based on a preset temperature drift coefficient to ensure near-constant visual brightness output under varying thermal conditions. The result of comprehensive consideration of the duty cycle adjustment, dead-band constraints, and temperature compensation is the PWM control signal for the current control cycle. This signal is used to drive the PWM generators for the four RGBW channels, generating a duty cycle waveform that controls LED current changes, ensuring that the luminous flux output of the LED fixture remains highly consistent with the color trajectory target.

[0033] In an embodiment of the present invention, by establishing a mode compatibility matrix and pre-calculating switching paths, intelligent path planning between multiple modes is achieved, avoiding the incompatibility and conflict issues caused by blind switching in traditional technologies and ensuring smooth and continuous mode switching. By employing segmented modulation timing control and current rate-of-change constraint calculation, precise current control of the four-channel RGBW LEDs is achieved, effectively avoiding the current surge that can occur with traditional direct switching methods and protecting the long-term stability of the LED devices. Trajectory calculation and color transition processing based on the CIE Lab color space fully consider the actual human eye's perception of color changes, achieving a more natural and smoother color transition effect than the traditional linear interpolation method in the RGB space. Specifically tailored to the unique environment of underwater swimming pool lighting, weighted optimization of the blue-green color perception characteristics compensates for the differential attenuation of light of different wavelengths by water, ensuring accurate and consistent underwater color display. By combining multiple algorithms, including spiral trajectories, Bezier curve trajectories, polynomial trajectories, and piecewise linear trajectories, specifically optimized color transition paths are provided for different dynamic modes, enriching the expressiveness and visual impact of the lighting effects. A closed-loop control mechanism combining a PID controller with dead-band control and temperature compensation enables real-time monitoring and precise adjustment of LED current, ensuring color stability and consistency over long-term use. Four-segment modulation with a 200ms buffer and preset segment ratio control enables gradual adjustment of the PWM duty cycle, eliminating the visual abruptness and flickering caused by traditional abrupt switching.

[0034] In a specific embodiment, the process of executing step S100 may specifically include the following steps: Based on the remote control mode switching command, feature vectors of the RGB color space coordinates and dynamic change frequency parameters of E lighting modes are extracted to obtain a set of mode feature vectors; According to the pattern feature vector set, the color similarity coefficient, the change speed matching coefficient and the pattern-pattern matching coefficient are weightedly calculated to obtain the pattern compatibility matrix; Based on the mode compatibility matrix, the shortest path search is performed on the switching paths between E types of lighting modes to obtain the optimal switching path set; The transition time parameters, intermediate state sequences and PWM modulation parameters in the optimal switching path set are stored in a structured manner to obtain switching path pre-calculated data.

[0035] Specifically, when the user sends a mode switch command via the remote control, the system initiates a feature vector extraction and path precalculation process. Based on the E defined lighting modes in the system, the system extracts the three-channel luminance coordinates in the RGB color space for each mode as its static color features. This is combined with characteristic parameters such as whether the mode is dynamic, its dynamic change frequency, change amplitude, and color perturbation period to form a pattern feature vector. Once the feature vectors for all E modes are extracted, a bidirectional similarity calculation is performed between all modes, primarily measuring color similarity, change rate matching, and pattern type matching. Color similarity is calculated based on the Euclidean distance in RGB space, with smaller distances indicating higher similarity. Change rate matching is scored based on the proximity of the two dynamic modes in frequency and change rhythm. For example, a breathing pattern and a fade-in / fade-out pattern have a high matching degree when their frequencies are consistent. Pattern-to-pattern matching primarily reflects the subjective compatibility of visual coherence between pattern categories. For example, the perceptual impact of switching from a static red mode to a dynamic color transition mode is significantly less than that of switching from a red mode to a rainbow-like mode. After normalization, the three indicators are weighted and summed according to empirically determined weights (e.g., color similarity has the highest weight, speed of change has the second highest weight, and type matching has the lowest weight). This results in an E×E-dimensional mode compatibility matrix. The value of each element in this matrix represents the overall compatibility score for switching from mode i to mode j, with higher scores indicating a more natural transition. The mode compatibility matrix is ​​numerically inverted, taking the reciprocal of each score or using its inversely proportional mapping as the path cost weight, to generate a corresponding path weight matrix. Based on this matrix, a directed weighted graph is constructed, abstracting the E lighting modes into E graph nodes. The edge weight between each node represents the cost of switching between the two modes. The Dijkstra shortest path algorithm is used to traverse this graph structure. Starting from each mode, the system sequentially calculates the shortest path from it to all other target modes. During the path search process, if the cost of switching directly from the starting mode to the ending mode is high, while the total cost is lower if it passes through one or two intermediate modes, the algorithm automatically selects the path structure containing the intermediate nodes. After obtaining the optimal path for all start-end mode pairs, the content of each path is structured and stored to form pre-calculated switching path data that can be quickly called up. This structured data includes the start and target mode numbers, the sequence of intermediate transition modes, the transition time parameters required for each switching segment (which can be dynamically adjusted based on the compatibility between modes, with high compatibility resulting in a shorter time and low compatibility resulting in a longer buffer), the corresponding PWM modulation parameter sequence (referring to the initial PWM, target PWM, and change gradient for the R, G, B, and W channels within each segment), and modulation strategy recommendations (such as whether to enable fade-in and fade-out, whether to enable color perturbation, etc.). All of this information is cached in the local path database by the system in the form of an index structure or hash map.

[0036] In a specific embodiment, the step of performing a shortest path search for switching paths between E lighting modes based on the mode compatibility matrix to obtain an optimal switching path set may specifically include the following steps: According to the mode compatibility matrix, the compatibility coefficient is reciprocally calculated to obtain the path weight matrix; According to the path weight matrix, a mode switching directed graph of E types of light mode nodes and switching path edges is constructed; Input the mode switching directed graph into the Dijkstra shortest path algorithm to perform path search and obtain the shortest switching path between any two modes; Based on the shortest switching path, the path length and switching complexity are screened and sorted to obtain the optimal switching path set; Among them, the E lighting modes include 7 static color modes and 8 dynamic change modes. The 7 static color modes include red mode, green mode, blue mode, white mode, yellow mode, purple mode and cyan mode. The 8 dynamic change modes include color transition mode, fade-in and fade-out mode, color change mode, color jump mode, flashing mode, breathing mode, flowing water mode and rainbow cycle mode.

[0037] Specifically, based on the mode compatibility matrix, the compatibility coefficients are reciprocally calculated to obtain a path weight matrix. Each element in the mode compatibility matrix represents the visual compatibility or naturalness of switching from mode i to mode j. Larger values ​​indicate closer modes and smoother switching. To transform this similarity information into a cost model for path search, the reciprocal operation is performed on all non-zero compatibility coefficients to form a path weight matrix. Once this path weight matrix is ​​obtained, a directed weighted graph is constructed based on it. This graph uses E light modes as nodes, including seven static color modes—red, green, blue, white, yellow, purple, and cyan—and eight dynamic modes, including color transition, fade-in / fade-out, color change, color jump, blinking, breathing, flowing water, and rainbow cycle. In this graph, if any two mode nodes have a non-zero compatibility coefficient, a directed edge is established between them, and the edge is assigned a weight equal to the corresponding value in the weight matrix. This directed graph construction method effectively preserves the directional differences in mode switching during actual control. Specifically, the path costs associated with switching from mode A to B and switching from mode B to A differ. In particular, switching between dynamic modes in certain directions must be avoided due to visual rhythm conflicts. This characteristic can be fully captured through graph-directed modeling. Once the directed graph is constructed, the structure is used as input to initiate the Dijkstra shortest path algorithm for path search. The Dijkstra algorithm is a greedy search strategy that aims to minimize cumulative weight. In each iteration, it prioritizes expanding the path node with the lowest current cost and updates the shortest path estimate from the starting point to all remaining nodes. The algorithm starts with each mode and repeats E times, searching and recording the shortest switching paths from any mode to any other. Each path includes node information for its starting and ending points, as well as the sequence of intermediate mode nodes it traverses and the path cost weights corresponding to each node to the next. The set of paths generated by this algorithm constitutes the theoretically optimal switching path network for E×E mode combinations. A path screening mechanism is introduced to perform a structured evaluation and sorting of all shortest path sets. This evaluation mechanism is based on two core indicators: the first is the path length, that is, the number of intermediate nodes contained in the path. The shorter the path, the fewer stages the switch goes through, and the lower the switching time and computing resources occupied. The second is the switching complexity, which is a comprehensive indicator that considers whether the path contains jumps from static to dynamic, or dynamic to high-frequency dynamic modes, and whether there are visual impact factors such as drastic changes in color phase or abrupt changes in brightness change curves. The lower the complexity, the more suitable the path is for deployment and execution in daily frequent use scenarios. Based on the preset multi-level sorting rules, the system prioritizes paths with a path length less than or equal to 3 and a switching complexity score below the set threshold, and forms the final optimal switching path set.The resulting optimal path set is used to construct a switching path pre-calculation library. Each record in the library includes the start and end pattern numbers, the sequence of intermediate states contained in the path, the transition time required for each jump, the PWM modulation parameters of each stage, and the color trajectory recommendation.

[0038] In a specific embodiment, the process of executing step S200 may specifically include the following steps: Based on the pre-calculated data of the switching path, the transition time parameters and PWM modulation parameters are analyzed to obtain the initial and target duty cycles of the RGBW four channels; According to the initial duty cycle and target duty cycle of the RGBW four channels, the preset transition buffer time is divided to obtain the segmented modulation timing control parameters; Based on the segmented modulation timing control parameters, the current change rate of the RGBW four-channel LED is constrained and calculated to obtain the PWM change gradient within the current safety control range. A linear transition modulation sequence is generated based on the PWM change gradient and the preset segmented modulation ratio.

[0039] Specifically, when the remote controller issues a mode switch command, the system retrieves a path record matching the mode pair from the pre-calculated path database. This record contains key information, including the transition time parameters between the starting and target modes, the intermediate states during the transition, and the corresponding PWM modulation parameters for each mode. The system then parses the start and end PWM parameters in the path data and deconstructs them into the initial and target duty cycle values ​​for the four R, G, B, and W channels. These values ​​represent the duty cycle settings for each channel in the current and target states of the LEDs, forming the baseline boundaries for subsequent transition modulation. Based on the initial and target duty cycles of the RGB and W channels, combined with the transition time parameters included in the path record, the entire transition process is divided into multiple modulation sub-stages in the time domain, constructing a time control model for segmented modulation. A fixed buffer duration, such as 200ms, is used as the total transition time, which is divided into four equal modulation segments, each lasting 50ms. Each segment defines a modulation node, and the interval between nodes serves as the minimum time window for the system to perform PWM updates. By evenly or weightedly dividing the total time into several modulation segments, the PWM variation is precisely controlled within each segment, resulting in a perceived gradual change in LED brightness: a slow start, mid-range acceleration, and a smooth final stage, consistent with the human eye's response to light changes. After the time segment division is complete, current constraints are evaluated to ensure that the current change rate within each modulation segment meets the operating safety specifications of the LED chip. Based on the maximum rated current of each LED channel (e.g., 350mA for the R, G, and B channels and 400mA for the W channel), and the current segment duration (e.g., 50ms), the system calculates the maximum current change rate tolerance for each channel: the rated current divided by the segment duration. For example, the upper limit for the R channel current change rate is 7mA / ms. Based on the functional relationship between PWM and current, the maximum current change rate is converted into the corresponding PWM gradient limit through reverse calculation. This process considers the linear response range of PWM duty cycle changes to output current, as well as engineering factors such as power supply driver characteristics, LED thermal response lag, and filter buffering, to form a set of channel-level PWM change constraints that meet safety margins. If the initial duty cycle of a channel is 20% and the target is 80%, the 60% duty cycle span must be checked to see if it exceeds the rate-of-change threshold within a given time period. If so, automatic segmented leveling or slope buffering is implemented to prevent excessive current changes within a cycle from causing flicker, voltage drops, or chip overload. After the current limit range is determined, PWM interpolation is performed based on the allowable change in each segment and the proportional weights set in the modulation stage. A segmented proportional modulation strategy is used, for example, setting the change proportions of the first segment to 20%, the second segment to 35%, the third segment to 35%, and the fourth segment to 10%, to proportionally split the total PWM span.Based on this, target PWM values ​​are generated within each segment. For example, when the R channel increases from 20% to 80%, the changes in the four segments are 12%, 21%, 21%, and 6%, respectively. This creates an S-shaped modulation curve that progresses from slow to fast and then slows back down, avoiding sudden changes and enhancing visual smoothness. This modulation sequence controls the PWM increment within each cycle and also sets its operating period, ensuring that the LED follows the established trajectory throughout the transition period. Whether it is static color switching or dynamic mode progression, the control effect is smooth and continuous color, natural brightness changes, and minimized visual impact. This set of modulation steps is paired with the timing to form a linear transition modulation sequence. This sequence is indexed by time and records the target duty cycle value of the RGBW four-channel PWM in each modulation stage.

[0040] In a specific embodiment, the step of performing constraint calculation on the RGBW four-channel LED current change rate based on the segmented modulation timing control parameters to obtain the PWM change gradient within the current safety control range may specifically include the following steps: According to the segmented modulation timing control parameters, the ratio of the maximum rated current and segment time of the RGBW four-channel LED is calculated to obtain the maximum allowable current change rate of each channel; Based on the maximum allowable current change rate of each channel, a safety threshold is set for the current change rate constraint function to obtain the current safety control constraint condition; Calculate the PWM duty cycle variation based on the current safety control constraint conditions to obtain the maximum PWM variation limit within each time segment; According to the maximum PWM change limit, the gradient constraint calculation is performed on the RGBW four-channel PWM duty cycle change to obtain the PWM change gradient within the current safety control range.

[0041] Specifically, based on the segmented modulation timing control parameters, the ratio of the maximum rated current of the RGBW four-channel LED to the segment time is calculated to determine the maximum allowable current change rate for each channel within the current control segment. For example, assuming the maximum rated current of the R, G, and B channels is 350mA and the maximum rated current of the W channel is 400mA. If the system sets each modulation segment time to 50ms, the maximum current change rate of the R channel is 350mA / 50ms = 7mA / ms, and the maximum change rate of the W channel is 8mA / ms. These values ​​represent the upper limit of current fluctuation per unit time that each channel can tolerate without compromising chip life, causing thermal shock, flicker, or driving instability. The maximum allowable current change rate of each channel is normalized and embedded in the current change rate constraint function, creating a dynamic safety control function that comprehensively considers the LED thermal response characteristics, voltage drive stability, and load balancing. This constraint function incorporates a series of correction factors based on factors such as the current LED lamp operating temperature, PWM control frequency, channel coupling, and the known jitter range of the electrical drive system. For example, when the current LED operating temperature exceeds 35°C, a negative temperature correction factor is introduced, automatically reducing the maximum rate of change by 10% to reduce chip stress concentration caused by heat accumulation. If power supply stability indicators deteriorate or the driver chip frequently enters overcurrent protection, the system dynamically adjusts the safety threshold of the current constraint model based on the operation log, resulting in a gentler response of the PWM modulation curve, thereby ensuring long-term operational stability. The constraint function outputs a set of current safety control boundary values, providing clear limits for setting the PWM modulation amplitude. Based on the current safety control constraints, the PWM duty cycle change is calculated, and the absolute upper limit of the current rate of change is reverse-mapped to the maximum PWM duty cycle change. This conversion process relies on the current-brightness linear relationship model of the LED channel and the response characteristics of the driver circuit. The PWM duty cycle and LED current have a relatively stable linear relationship, especially in the medium and low brightness ranges. Therefore, by establishing a calibration lookup table or function fitting curve between the channel-level PWM duty cycle and current output, the maximum allowable current rate of change is converted into the PWM change allowed in each time period. For example, if the R channel linearly corresponds to a current output of 0–350mA over a duty cycle range of 0–100%, a change rate of 7mA / ms corresponds to a maximum PWM change rate of 2% / ms. If a single segment duration is 50ms, the maximum PWM change amplitude of the R channel within that segment is 100%. During actual modulation, due to the different initial and target values ​​of different channels, this 100% is a theoretical limit. The system trims and dynamically calculates this limit based on the actual change direction and the total path span to ensure that the visual transition integrity is maintained as much as possible while limiting the modulation rate.After completing the PWM variation limit calculation, the system enters the final stage of modulation sequence generation. Based on the aforementioned calculation results, the system performs gradient constraint calculations on the duty cycle changes of the four RGBW channels, generating a PWM progressive modulation curve that meets the current limit bounds. The system denotes the known initial and target duty cycles as P1 and P2, respectively, and calculates their total difference, ΔP. The gradient variation of ΔP within each time segment is then constrained to a safe range determined by the maximum PWM variation. If ΔP exceeds the single-segment variation, the system automatically implements a cross-segment modulation mechanism, evenly distributing the variation across multiple control segments for gradual increases or decreases. If ΔP is less than or equal to the maximum variation within a segment, a complete transition is achieved within that segment, shortening response time and improving control efficiency. After the multi-segment modulation sequence is concatenated, the system performs a round of terminal fading, ensuring that the slope of the final variation curve gradually approaches zero as it approaches the target value, thereby avoiding visual judder caused by abrupt control stops. The entire PWM gradient constraint process ultimately generates a set of progressive modulation gradient data sequences that meet the current safety control range. This sequence contains the PWM duty cycle value change amplitude that should be adjusted for each channel within each modulation time period. During the modulation execution process, it is sent frame by frame to the PWM control module to drive the LED channel to work, realizing dynamic color change, smooth brightness progression, and thermal load control of the driver device simultaneously.

[0042] In a specific embodiment, the process of executing step S300 may specifically include the following steps: Based on the linear transition modulation sequence, the color space conversion is performed on the RGBW four-channel PWM duty cycle to obtain the starting color coordinates and target color coordinates in the CIELab color space; According to the starting color coordinates and the target color coordinates, the trajectory type is selected according to the visual effect requirements of the dynamic change mode, and the trajectory calculation control parameters corresponding to each dynamic change mode are obtained; The trajectory calculation control parameters are input into the CIE Lab color space to optimize the blue-green perception characteristics of the underwater environment and obtain the color transition trajectory parameters.

[0043] Specifically, the PWM duty cycle values ​​of each RGBW channel at the start and target times are extracted from the linear transition modulation sequence. These duty cycles represent the current luminous intensity or luminous flux control signal of each LED and are the basis for color synthesis. To convert this set of electrical signals into color parameters that reflect human eye perception, three-level color space transformations are performed in sequence: PWM to linear RGB, linear RGB to XYZ, and XYZ to Lab. In the first-level transformation, the PWM duty cycle is gamma-corrected and brightness normalized based on the spectral distribution characteristics and current response curve of the LED light source to generate standard linear RGB three-channel values. Since the W channel in RGBW is usually high color temperature white light, its brightness is distributed according to the color temperature, brightness weight, and the proportional mixing strategy of the three RGB colors. The system uses weighted superposition or channel separation to incorporate the influence of white light into the brightness correction of the RGB main channels, thereby ensuring the accuracy of the color tristimulus values. After obtaining linear RGB values, the colors are projected into the CIEXYZ color space using a standard RGB-to-XYZ transformation matrix. The nonlinear transformation functions in the CIE 1976 color difference definition are then used to calculate the L* (lightness), a* (red-green axis), and b* (yellow-blue axis) values ​​in Lab space, completing the transformation from physical signals to visual perception. The system performs this transformation on both the initial and target PWM duty cycle sequences, obtaining the corresponding starting and target color coordinates. These coordinates are then used as the basis for dynamic color trajectory modeling. After obtaining the starting and target color coordinates, the trajectory type is selected based on the selected dynamic change mode and the visual effects requirements of the user experience layer. The system uses the three-dimensional Lab space distance between the starting and target color coordinates as a basic parameter and, in combination with factors such as their direction vector, brightness change trend, and hue rotation angle, calculates the geometric feature vectors of the color transformation. Based on these vector features, the current transition task is matched to one of four defined typical trajectory types: spiral, Bezier curve, polynomial, or piecewise linear. If the color change involves extensive a and b channel offsets, and the hue shows periodic perturbations or rotation trends, such as rainbow cycles or color transition patterns, the spiral trajectory type is matched to form a dynamic path that spirals upward along the ab plane; if the color change is slow and slow, and the brightness gradually changes from low to high or high to low, such as breathing, fade-in and fade-out patterns, the Bezier curve trajectory is used to achieve smooth curvature control by setting control points; if the change trend is nonlinear but continuous, such as flowing water or color sliding effects, the polynomial trajectory is matched; and in color jump or flashing patterns, the color change is sudden and lacks intermediate states, so the system uses a piecewise linear trajectory to construct a direct path between several high-contrast color points.Each trajectory type is accompanied by a set of trajectory calculation control parameters, including trajectory curvature, perturbation frequency, number of control points, number of interpolation steps, segment division, and tempo, which define the control logic for trajectory generation. The selected trajectory type and its calculation control parameters are input into the Lab space trajectory generation engine. During this process, a module is introduced to optimize the perceptual characteristics of the blue-green band in underwater environments. In aquatic environments such as swimming pools, due to the significant differences in the absorption rate of water molecules for different wavelengths of light, red and violet colors attenuate faster during propagation, while blue and green colors have higher penetration and perceived brightness. Therefore, on the a* (red-green axis) and b* (yellow-blue axis) planes in Lab space, a weighted enhancement process is applied to the blue-green region. This increases the dwell time of trajectories near negative a values ​​and positive b values, reduces path curvature, or increases perturbation frequency, thereby enhancing the visual saturation and lingering effect of the blue-green band. This optimization process is implemented through a set of spatial sensitivity weighting functions. These functions determine whether a trajectory path point falls into a high-visibility underwater area based on its position in the ab plane. If so, a weighting factor is applied to the trajectory segment, extending the display time of the color in the high-visibility underwater area and increasing the weight priority of the blue-green channel during PWM modulation, thereby achieving visual optimization. Based on the starting Lab coordinates, target Lab coordinates, trajectory type, and optimization function, the color transition trajectory parameters are generated. This parameter set describes the manner, rhythm, and direction of color change in the perceptual space from the starting point to the end point. It also includes the Lab value sequence of all intermediate trajectory points, the corresponding PWM modulation suggestions, and the color change rhythm and perturbation characteristics.

[0044] In a specific embodiment, the step of selecting a trajectory type based on the starting color coordinates and the target color coordinates according to the visual effect requirements of the dynamic change mode and obtaining trajectory calculation control parameters corresponding to each dynamic change mode may specifically include the following steps: Based on the starting color coordinates and the target color coordinates, the color distance and direction angle in the CIE Lab color space are geometrically calculated to obtain the color change vector characteristic parameters; According to the color change vector feature parameters, the visual effect types of the dynamic change pattern are classified and matched, and the pattern affiliation relationships of the spiral trajectory type, Bezier curve trajectory type, polynomial trajectory type and piecewise linear trajectory type are obtained; The trajectory calculation control parameters corresponding to each dynamic change mode are set based on the mode affiliation relationship.

[0045] Specifically, the starting and target colors are defined using coordinates in three-dimensional Lab space. These coordinates represent the perceived positions of the colors on the lightness, red-green, and yellow-blue axes, respectively. The system constructs a color change vector using vectorized calculations and then calculates its modulus to assess the perceived difference between the two colors. The system also calculates the angle of the projection of the change vector onto the ab plane. This angle is used to determine the color's rotational tendency on the two-dimensional hue plane. An angle close to 0 or 180 degrees indicates that the color change is primarily along the red-green axis; an angle close to 90 or 270 degrees indicates that the change is primarily along the yellow-blue axis. The brightness gradient is also evaluated to determine whether the color change is accompanied by a simultaneous lightness transition. For example, a shift from dark red to bright blue or from bright white to dark purple indicates not only a hue change but also a parallel adjustment in the lightness component. Based on the geometric analysis of the color change vector, the system then determines the dynamic characteristics of the color transition using pre-set feature thresholds, thereby matching the trajectory model best suited to the desired performance requirements. When the color difference is large and the direction angle shows a spiral rise or discontinuous curvature trend, while the brightness change component is not strong and the hue rotation is obvious, the system tends to classify this color transition as a spiral trajectory type, which is suitable for rainbow cycles, color rotation, or multi-segment continuous dynamic lighting modes. When the color difference is moderate and the direction angle is stable, the brightness change component is strong, the hue is not drastic, but there is a clear gradual change in brightness, the system classifies it as a Bezier curve trajectory type, which is suitable for gentle gradual transition modes such as breathing, fade-in and fade-out, and warm white to cool white. If the color change is nonlinear but stable and the change amplitude is smooth, such as there is a certain curvature perturbation without obvious jumps or discontinuities, it is judged as a polynomial trajectory, which is suitable for scenes such as flowing lights, soft waves, and rhythmic changes. When the color difference is large but the direction angle tends to be abrupt, and the color change jumps directly without intermediate transitions, such as high-contrast changes from red to blue or from cyan to yellow, the system classifies it as a piecewise linear trajectory type, which is suitable for high-rhythm, high-contrast visual modes such as color jumps, flashing, and alarms. Matching trajectory calculation control parameters are set for each type of attribution result. These parameters are input into the trajectory generation engine to determine how the color trajectory is constructed, sampled, and modulated in the CIE Lab space.Taking the spiral trajectory as an example, the control parameters include the spiral radius, rotation frequency, rotation phase and rotation center coordinates. The system controls the rotation speed of the trajectory on the ab plane by adjusting the frequency and starting angle, and controls its color coverage density and change amplitude by the spiral radius and total number of steps; the Bezier trajectory requires setting control points, such as the three control point coordinates of the cubic curve. The system automatically generates primary control points based on the start and end color coordinates, and then adjusts the curvature and acceleration based on the brightness change value, so that the transition path visually presents a natural flow that first slows down, then speeds up, and then slows down again; in the polynomial trajectory type, the system sets the curve order, each coefficient, color perturbation factor, etc., and realizes color perturbation performance by constructing a high-order continuous curve; the piecewise linear trajectory clarifies the color points of each segment, the transition time of each segment, the duty cycle jump boundary and the anti-flicker filter coefficient, so as to ensure that the visual change process has both speed and hard switching clear perception.

[0046] In a specific embodiment, the process of executing step S400 may specifically include the following steps: Based on the color transition trajectory parameters, the CIE Lab color space is reversely transformed to obtain the RGBW four-channel target current value; According to the target current value of the RGBW four channels, the LED current of each channel is detected and the error is calculated in real time to obtain the current deviation value; The current deviation value is input into the PID controller for proportional-integral-differential calculation to obtain the PWM duty cycle adjustment value; Based on the PWM duty cycle adjustment, the dead zone control conditions and temperature compensation parameters are comprehensively analyzed to obtain the PWM control signal.

[0047] Specifically, the perceived target values ​​in the color space—the color transition trajectory parameters in the CIE Lab color space—are mapped back to the corresponding physical drive current control signals, i.e., the target current values ​​for the four RGBW channels, through an inverse transformation. This process follows the standard inverse color space transformation path, inferring the intermediate coordinates in the CIE XYZ space from the target Lab values. Based on the inverse function of the CIE 1976 standard color difference formula, the inverse operation of the nonlinear luminance function is used to obtain the X, Y, and Z chromaticity coordinates. These XYZ values ​​are then inverse-transformed using the standard sRGB color matrix to obtain linear RGB color components. Gamma gain compensation is then applied to complete the gamma correction for each channel, resulting in the target values ​​in the standard RGB space. Furthermore, the contribution of the W channel is considered. Since the W channel is typically a high-brightness white LED, its spectral distribution is roughly equivalent to the D65 standard white light at a fixed color temperature and cannot be directly obtained through a simple inverse RGB transformation, the system, during the inverse transformation stage, separates the white light brightness from the three RGB channels based on a pre-defined RGBW light-split weighting model or light-mixing model and maps it to the W channel target value. This separation process is based on the color neutrality index corresponding to the current target Lab coordinate. When the system determines that the target color is close to the gray axis (i.e., the a and b components approach zero), the W channel contribution is increased and the RGB contributions are reduced. In saturated color regions, the RGB ratio is enhanced and the W channel current target value is compressed to achieve a reasonable balance between color temperature and brightness. Through the aforementioned inverse transformation logic, the system obtains the target current values ​​for the R, G, B, and W channels at that frame trajectory point. These current values ​​serve as expected inputs for real-time comparison with the actual LED currents. In the control phase, the real-time LED current feedback values ​​are compared channel by channel with the target current values, and the instantaneous current deviation values ​​for each of the four channels are calculated. This current error reflects the degree of deviation between the actual LED luminous intensity and the planned color trajectory and serves as the basis for subsequent dynamic PWM control. To effectively suppress this deviation and achieve current precision control, a multi-channel PID controller architecture is introduced. The current error of each channel is input into the corresponding PID module for proportional (P), integral (I), and differential (D) processing. The proportional term adjusts the PWM output trend based on the current error. The integral term corrects steady-state deviations through error accumulation. The differential term applies advance correction based on the rate of error change to suppress system oscillations. The PID controller calculates the current deviation within each control cycle and outputs a corresponding PWM duty cycle adjustment, ΔPWM. This adjustment is either positive (indicating a need to increase luminous intensity) or negative (indicating excessive current and a need to reduce brightness). This adjustment is applied to the PWM value of the previous cycle to generate a new PWM reference command for the current cycle. Based on the PWM duty cycle adjustment, combined with the system's current control state and environmental conditions, a round of safety margin and environmental factor correction is performed.A dead-band control condition is established: when the absolute value of the current error falls below a preset threshold (e.g., ±2mA), the system assumes the error has minimal impact on the final visual effect and suspends PWM updates. This prevents flickering or waste of control resources caused by frequent fine-tuning. A temperature compensation mechanism is implemented, using a temperature sensor to detect the current temperature of the LED panel and dynamically adjust the PWM value based on the thermal drift coefficient α of each channel. When the ambient temperature rises above a reference temperature (typically 25°C), the system adjusts the current PWM value by multiplying the temperature offset by the drift coefficient. This compensates for the LED brightness loss caused by temperature rise, maintaining a constant visual output. This compensation, along with PID adjustment, forms the final processing step of the PWM command generation logic, ensuring that the final PWM output not only converges to the target value for current regulation but also maintains color and brightness consistency for the visual output. The resulting PWM control signal is written to the registers of the driver's PWM generation module, driving the LEDs for the next frame of light output during the hardware cycle.

[0048] See also Figure 2 , Figure 2 This is a schematic block diagram of the structure of the multi-mode LED swimming pool light control system 200 provided in an embodiment of the present application, as shown in FIG. Figure 2 As shown, the multi-mode LED swimming pool light control system 200 includes: A pre-calculation module 210 is configured to calculate pre-calculation data for a switching path based on a remote control mode switching instruction and color characteristic parameters of E lighting modes; The modulation module 220 is used to progressively modulate the RGBW four-channel PWM duty cycle according to the pre-calculated data of the switching path to obtain a linear transition modulation sequence; The trajectory calculation module 230 is used to calculate the trajectory of the color change of the dynamic change mode in the CIELab color space based on the linear transition modulation sequence to obtain the color transition trajectory parameters; The closed-loop control module 240 is used to perform closed-loop control on the RGBW four-channel LED current according to the color transition trajectory parameters to obtain a PWM control signal.

[0049] Through the collaborative efforts of the aforementioned components, the present invention achieves intelligent path planning between multiple modes by establishing a mode compatibility matrix and precalculating switching paths. This avoids the incompatibility and conflicts caused by blind switching in traditional technologies and ensures smooth and continuous mode switching. Using segmented modulation timing control and current rate-of-change constraint calculation, precise current control of the four-channel RGBW LEDs is achieved, effectively avoiding the current surges that can occur with traditional direct switching methods and protecting the long-term stability of the LED devices. Trajectory calculation and color transition processing based on the CIE Lab color space fully consider the actual human eye's perception of color changes, achieving a more natural and smoother color transition effect than traditional linear interpolation methods in the RGB space. Specifically tailored to the unique environment of underwater swimming pool lighting, weighted optimization of the blue-green color perception characteristics compensates for the differential attenuation of light of different wavelengths by water, ensuring accurate and consistent underwater color display. By combining multiple algorithms, including spiral trajectories, Bezier curve trajectories, polynomial trajectories, and piecewise linear trajectories, specifically optimized color transition paths are provided for different dynamic modes, enriching the expressiveness and visual impact of the lighting effects. A closed-loop control mechanism combining a PID controller with dead-band control and temperature compensation enables real-time monitoring and precise adjustment of LED current, ensuring color stability and consistency over long-term use. Four-segment modulation with a 200ms buffer and preset segment ratio control enables gradual adjustment of the PWM duty cycle, eliminating the visual abruptness and flickering caused by traditional abrupt switching.

[0050] See also Figure 3 , Figure 3 This is a schematic block diagram of the structure of a multi-mode LED swimming pool light control device 300 provided in an embodiment of the present application. The multi-mode LED swimming pool light control device 300 includes a processor 301 and a memory 302. The processor 301 and the memory 302 are connected via a system bus 303, wherein the memory 302 may include a non-volatile storage medium and an internal memory.

[0051] The non-volatile storage medium may store a computer program including program instructions, which, when executed by the processor 301 , may cause the processor 301 to execute any of the above-mentioned multi-mode LED swimming pool light control methods.

[0052] The processor 301 is used to provide computing and control capabilities to support the operation of the entire multi-mode LED swimming pool light control device 300.

[0053] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor 301, the processor 301 can execute any of the above-mentioned multi-mode LED swimming pool light control methods.

[0054] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the present application scheme, and does not constitute a limitation on the multi-mode LED swimming pool light control device 300 involved in the present application scheme. The specific multi-mode LED swimming pool light control device 300 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0055] It should be understood that the processor 301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0056] It should be noted that technical personnel in the relevant field can clearly understand that for the convenience and conciseness of description, the specific working process of the multi-mode LED swimming pool light control device 300 described above can refer to the corresponding process of the aforementioned multi-mode LED swimming pool light control method, and will not be repeated here.

[0057] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0058] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program code.

[0059] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A multi-mode LED swimming pool light control method, characterized in that: include: Calculate the switching path pre-calculation data based on the remote control mode switching command and the color feature parameters of E types of lighting modes; According to the pre-calculated data of the switching path, the RGBW four-channel PWM duty cycle is progressively modulated to obtain a linear transition modulation sequence; Based on the linear transition modulation sequence, the trajectory of the color change of the dynamic change mode is calculated in the CIE Lab color space to obtain the color transition trajectory parameters; The RGBW four-channel LED current is closed-loop controlled according to the color transition trajectory parameters to obtain a PWM control signal.

2. The multi-mode LED swimming pool light control method according to claim 1, characterized in that: The switching path pre-calculation data is calculated based on the remote control mode switching instruction and the color characteristic parameters of E lighting modes, including: Based on the remote control mode switching command, feature vectors of the RGB color space coordinates and dynamic change frequency parameters of E lighting modes are extracted to obtain a set of mode feature vectors; According to the pattern feature vector set, a color similarity coefficient, a change speed matching coefficient and a pattern-pattern matching coefficient are weightedly calculated to obtain a pattern compatibility matrix; Based on the mode compatibility matrix, a shortest path search is performed on the switching paths between the E lighting modes to obtain an optimal switching path set; The transition time parameters, intermediate state sequences and PWM modulation parameters in the optimal switching path set are stored in a structured manner to obtain switching path pre-calculation data.

3. The multi-mode LED swimming pool light control method according to claim 2, characterized in that: The shortest path search is performed on the switching paths between the E lighting modes based on the mode compatibility matrix to obtain an optimal switching path set, including: According to the mode compatibility matrix, a reciprocal operation is performed on the compatibility coefficient to obtain a path weight matrix; Constructing a mode switching directed graph of E types of light mode nodes and switching path edges according to the path weight matrix; Input the mode switching directed graph into the Dijkstra shortest path algorithm to perform path search to obtain the shortest switching path between any two modes; Based on the shortest switching path, the path length and switching complexity are screened and sorted to obtain an optimal switching path set; Among them, the E lighting modes include 7 static color modes and 8 dynamic change modes. The 7 static color modes include red mode, green mode, blue mode, white mode, yellow mode, purple mode and cyan mode. The 8 dynamic change modes include color transition mode, fade-in and fade-out mode, color change mode, color jumping mode, flashing mode, breathing mode, flowing water mode and rainbow cycle mode.

4. The multi-mode LED swimming pool light control method according to claim 1, characterized in that: The step of progressively modulating the RGBW four-channel PWM duty cycle according to the pre-calculated data of the switching path to obtain a linear transition modulation sequence includes: Based on the pre-calculated data of the switching path, the transition time parameters and the PWM modulation parameters are analyzed to obtain the initial duty cycle and target duty cycle of the RGBW four channels; According to the initial duty cycle and target duty cycle of the RGBW four channels, the preset transition buffer time is divided to obtain the segmented modulation timing control parameters; Based on the segmented modulation timing control parameters, the current change rate of the RGBW four-channel LED is constrained and calculated to obtain the PWM change gradient within the current safety control range; A linear transition modulation sequence is generated based on the PWM change gradient and a preset segmented modulation ratio.

5. The multi-mode LED swimming pool light control method according to claim 4, characterized in that: The method of performing constraint calculation on the RGBW four-channel LED current change rate based on the segmented modulation timing control parameters to obtain the PWM change gradient within the current safety control range includes: According to the segmented modulation timing control parameters, the ratio of the maximum rated current and the segmented time of the RGBW four-channel LED is calculated to obtain the maximum allowable current change rate of each channel; Based on the maximum allowable current change rate of each channel, a safety threshold is set for the current change rate constraint function to obtain a current safety control constraint condition; Calculating the PWM duty cycle variation based on the current safety control constraint to obtain the PWM maximum variation limit within each time segment; According to the PWM maximum change limit, a gradient constraint calculation is performed on the RGBW four-channel PWM duty cycle change to obtain the PWM change gradient within the current safety control range.

6. The multi-mode LED swimming pool light control method according to claim 1, characterized in that: The method of calculating the trajectory of the color change in the dynamic change mode in the CIE Lab color space based on the linear transition modulation sequence to obtain color transition trajectory parameters includes: Based on the linear transition modulation sequence, the RGBW four-channel PWM duty cycle is converted into a color space to obtain the starting color coordinates and the target color coordinates in the CIELab color space; Selecting a trajectory type based on the visual effects requirements of the dynamic change mode according to the starting color coordinates and the target color coordinates, and obtaining trajectory calculation control parameters corresponding to each dynamic change mode; The trajectory calculation control parameters are input into the CIE Lab color space to optimize the blue-green perception characteristics of the underwater environment to obtain color transition trajectory parameters.

7. The multi-mode LED swimming pool light control method according to claim 6, characterized in that: The step of selecting a trajectory type based on the visual effects requirements of the dynamic change mode according to the starting color coordinates and the target color coordinates, and obtaining trajectory calculation control parameters corresponding to each dynamic change mode, includes: Based on the starting color coordinates and the target color coordinates, geometrically calculating the color distance and direction angle in the CIE Lab color space to obtain color change vector characteristic parameters; Classifying and matching the visual effect types of the dynamic change mode according to the color change vector characteristic parameters to obtain a pattern attribution relationship among a spiral trajectory type, a Bezier curve trajectory type, a polynomial trajectory type, and a piecewise linear trajectory type; The trajectory calculation control parameters corresponding to each dynamic change mode are set based on the mode affiliation relationship.

8. The multi-mode LED swimming pool light control method according to claim 1, characterized in that: The closed-loop control of the RGBW four-channel LED current according to the color transition trajectory parameter to obtain a PWM control signal includes: Based on the color transition trajectory parameters, the CIE Lab color space is subjected to coordinate inverse conversion processing to obtain the RGBW four-channel target current values; According to the target current value of the RGBW four channels, the LED current of each channel is detected and the error is calculated in real time to obtain the current deviation value; The current deviation value is input into the PID controller for proportional-integral-differential calculation to obtain the PWM duty cycle adjustment value; Based on the PWM duty cycle adjustment amount, a comprehensive analysis is performed on the dead zone control condition and the temperature compensation parameter to obtain a PWM control signal.

9. A multi-mode LED swimming pool light control system, characterized in that: The method for controlling a multi-mode LED swimming pool light according to any one of claims 1 to 8 comprises: A pre-calculation module is used to calculate the pre-calculation data of the switching path based on the remote control mode switching instruction and the color characteristic parameters of E types of lighting modes; A modulation module, configured to progressively modulate the RGBW four-channel PWM duty cycle according to the pre-calculated data of the switching path to obtain a linear transition modulation sequence; A trajectory calculation module is used to calculate the trajectory of the color change of the dynamic change mode in the CIE Lab color space based on the linear transition modulation sequence to obtain color transition trajectory parameters; The closed-loop control module is used to perform closed-loop control on the RGBW four-channel LED current according to the color transition trajectory parameters to obtain a PWM control signal.

10. A multi-mode LED swimming pool light control device, characterized in that: The multi-mode LED swimming pool light control device includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor calls the instructions in the memory to enable the multi-mode LED swimming pool light control device to execute the multi-mode LED swimming pool light control method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Brightness control method and operation control device of LED lamp, lamp and storage medium

    CN121586125A

  • Dynamic HSV dimming control method and system based on local input and lighting device

    CN121940917A