The menstrual phototherapy underwear features a detachable module with magnetic power supply and a microcontroller temperature control system.

By applying a restricted detection drive to the phototherapy underwear, voltage and current changes are collected to form magnetic connection status characteristics and determine the reliability. This solves the problem of separation between magnetic power supply connection status detection and temperature closed-loop, and realizes the stability and safety of the temperature control system.

CN123059293APending Publication Date: 2026-11-10JIANGMEN AILAIMEI HEALTH TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611350296.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-02
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

In existing technologies, the detection of magnetic power supply connection status is separated from the microcontroller temperature closed loop, which cannot effectively identify changes in power supply capacity, resulting in unstable temperature control and problems such as temperature overshoot or incorrect power increase.

Method used

By applying at least two restricted detection drives before and during phototherapy operation, voltage, current and temperature changes are collected to form magnetic connection state characteristics, determine connection reliability, and jointly limit the upper limit of phototherapy drive power, power change slope and temperature closed-loop regulation amount. The microcontroller freezes the temperature closed-loop integral state during power supply disturbances to generate a graded power recovery sequence.

Benefits of technology

It effectively reduces erroneous power surges during power supply disturbances, limits temperature overshoots during power supply recovery, and ensures the stability and safety of temperature control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123059293A_ABST
    Figure CN123059293A_ABST
Patent Text Reader

Abstract

This invention relates to the field of program control and microcontroller temperature regulation technology, specifically a magnetic power supply and microcontroller temperature control system for a detachable module of menstrual phototherapy underwear. It includes a magnetic power supply interface, a data acquisition channel, a microcontroller, and a phototherapy drive channel. Before operation and during intervals, the microcontroller outputs limited detection drive signals. Based on voltage, current, and temperature responses, it constructs connection state characteristics and determines connection reliability. Based on connection reliability, it limits the upper limit of drive power, the power change slope, and the temperature closed-loop regulation amount. During magnetic power supply disturbances, it maintains the temperature closed-loop integral state and forms a residual thermal state. After power restoration, it generates a graded power recovery sequence based on connection reliability and the residual thermal state. This system can distinguish between decreased power supply capacity and insufficient normal temperature rise, reducing erroneous power increases during disturbances, limiting power jumps during recovery, and suppressing temperature surges caused by integral accumulation and residual heat superposition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of program control and microcontroller temperature regulation technology, specifically to a magnetic power supply and microcontroller temperature control system for a detachable module of menstrual phototherapy underwear. Background Technology

[0002] The detachable phototherapy module in menstrual phototherapy underwear typically uses magnetic contacts for power connection. A control chip outputs a pulse-width modulation drive signal to the phototherapy load, and the module temperature is acquired through a temperature acquisition channel. Conventional control methods use a preset target temperature as a benchmark, comparing the real-time temperature with the target temperature, and then controlling the output power of the phototherapy load based on proportional regulation, integral regulation, or a segmented power meter. When the temperature is below the target value, the drive duty cycle is increased; when the temperature approaches or exceeds the target value, the drive duty cycle is decreased, and output stops when the temperature exceeds the safety limit. To accommodate detachable use, existing solutions also detect the voltage or on / off status of the magnetic power supply terminal. Upon detecting undervoltage, power failure, or contact detachment, the phototherapy load is shut down, and the temperature control program restarts after power is restored. In this type of solution, the magnetic power supply detection mainly handles connection confirmation and abnormal shutdown functions, while temperature control operates independently based on temperature feedback. There is typically no continuous state transmission between the two to constrain power changes.

[0003] When there is a slight misalignment, change in contact pressure, or disturbance from wearing the device during magnetic power supply connection, the equivalent contact impedance of the power supply circuit will change over time, manifesting as a decrease in input voltage, fluctuation in load current, and a prolonged voltage recovery process. Existing technologies typically use a fixed undervoltage threshold, a fixed current threshold, or a continuous number of samples to determine whether the magnetic connection is abnormal. When the sampled value does not exceed the shutdown threshold, the temperature closed loop continues to increase the drive quantity under normal power supply conditions; when the sampled value exceeds the shutdown threshold, the phototherapy output is directly stopped. Some solutions resume operation according to the drive duty cycle before the power outage after reconnection, or restart control from the preset temperature rise stage. Since a fixed threshold can only reflect the power supply state at a certain moment, it cannot distinguish between transient contact changes and slow resistance changes caused by load temperature rise using voltage and current responses under different drive excitations, nor can it reflect the actual power range that the current magnetic connection can support. Therefore, the power supply detection results are difficult to directly participate in the generation of temperature control parameters and the recovery process.

[0004] The magnetic power supply status detection and the microcontroller's temperature closed loop are separate, making it impossible for the temperature controller to distinguish whether insufficient temperature rise stems from increased heat demand or decreased magnetic connection capability. When the magnetic contact impedance increases before the power supply reaches the shutdown condition, the temperature closed loop continuously increases the drive quantity and accumulates the integral component due to the slower temperature rise. When the contacts re-engage and the power supply voltage recovers, the increased drive quantity, the unreleased integral component, and the residual heat of the module work together to cause a rapid surge in input power, resulting in a temperature spike. If an undervoltage shutdown method is used, repeated stops and restarts under short-term contact disturbances will interrupt or incorrectly reset the temperature control state. Therefore, the core technical problem to be solved is: how to enable the microcontroller to continuously determine the available power supply capacity based on the dynamic response of the magnetic power supply loop and associate it with the power boundary, temperature closed loop state, and power supply recovery process to avoid erroneous power increases during power supply disturbances and temperature spikes after power supply recovery. Summary of the Invention

[0005] The purpose of this invention is to provide a magnetic power supply and microcontroller temperature control system for a detachable module of menstrual phototherapy underwear, which can solve the problems in the background art mentioned above.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows: The magnetic power supply and microcontroller temperature control system for the detachable module of menstrual phototherapy underwear includes a magnetic power supply interface connected to the detachable phototherapy module, an acquisition channel for acquiring the output voltage and load current of the magnetic power supply interface and the temperature of the detachable phototherapy module, a microcontroller connected to the acquisition channel, and a phototherapy drive channel controlled by the microcontroller. The microcontroller is used to output at least two restricted detection drives to the phototherapy drive channel before and during phototherapy operation. It forms magnetic connection state characteristics based on voltage, current and temperature changes during the detection period, determines the connection reliability based on the magnetic connection state characteristics, and jointly limits the upper limit of phototherapy drive power, power change slope and temperature closed-loop adjustment amount according to the connection reliability. The microcontroller is also used to freeze the temperature closed-loop integral state during magnetic power supply disturbances, save the pre-disturbance thermal state, and generate a graded power recovery sequence based on the connection reliability and thermal state after power supply is restored.

[0007] Preferably, at least two restricted detection drives include a first detection segment and a second detection segment, wherein the duration of the first detection segment is shorter than that of the second detection segment, and the driving amplitude of both is lower than the current temperature closed-loop allowable power. The microcontroller extracts the power supply voltage drop, load current increment, voltage recovery time, current ripple distribution, and temperature response start time for each detection segment, and constructs a magnetic connection state vector based on the differential relationship of each characteristic quantity under the two detection drives. The microcontroller performs time-series alignment between the magnetic connection state vector and the reference state vector recorded when the current detachable phototherapy module completes stable engagement, and generates the connection reliability based on the degree of feature deviation after alignment, while eliminating the slow resistance change component caused by the temperature rise of the phototherapy load.

[0008] Preferably, the microcontroller establishes a fast control chain for power supply status and a slow control chain for temperature status; The power supply state fast control chain takes the connection reliability, voltage recovery trend and current jump as input, and outputs the allowable power boundary and allowable power change slope. The temperature state slow control chain takes the acquired temperature, temperature change rate and temperature target as input, and generates the phototherapy driving quantity within the allowable power boundary and the allowable power change slope; The microcontroller updates the power supply state fast control chain according to a control cycle faster than the temperature sampling update cycle, and after each update, it passes the new allowable power boundary to the temperature state slow control chain. The temperature state slow control chain must not output a drive quantity exceeding the allowable power boundary.

[0009] Preferably, after the magnetic power supply disturbance is identified, the microcontroller records the input power, acquisition temperature and temperature change rate for multiple consecutive control cycles before the disturbance occurs, and forms a residual thermal state based on the time integral of the input power, the decay trend of the temperature change rate and the duration of the disturbance. The microcontroller maintains the integral component in the temperature closed loop at the value at the time of the disturbance, and uses the residual thermal state to replace the temperature feedback missing during the interruption in the calculation of the recovery of the initial drive quantity. Once a valid temperature sample is obtained again, the microcontroller gradually releases the maintained integral component according to the deviation between the residual thermal state and the actual temperature, and restricts the direction of increase of the integral component before the deviation converges.

[0010] Preferably, the microcontroller establishes a power-side response sequence and a load-side response sequence for the first detection segment and the second detection segment, respectively, and resamples the two types of response sequences using the detection drive start edge as a common time reference; The power supply side response sequence includes the power supply voltage drop, recovery slope, and recovery settling time; the load side response sequence includes the load current build-up slope, steady-state current deviation, and current ripple envelope. The microcontroller separates the transient component caused by the change in magnetic contact from the slowly changing component caused by the thermal drift of the phototherapy load by comparing the change direction and change rate of the two types of response sequences at the same time position, and writes only the transient component into the magnetic connection state vector.

[0011] Preferably, the power supply status fast control chain forms a reliability decline segment, a reliability maintenance segment, and a reliability recovery segment based on continuously updated connection reliability, and maintains mutually continuous allowable power boundaries for each segment; During the confidence decline phase, the microcontroller first reduces the allowable power change slope, and then reduces the allowable power upper limit; During the confidence preservation segment, the microcontroller maintains that the allowable power boundary does not rise with the temperature closed-loop request; During the confidence recovery phase, the microcontroller gradually relaxes the allowable power change slope and the allowable power upper limit based on the consistency between the voltage recovery trend and the current jump, and the allowable power boundary of the next control cycle is updated based on the condition that the connection confidence has not fallen back.

[0012] Preferably, the microcontroller writes the residual thermal state into the state variable set of the temperature closed loop, and corrects the proportional component, integral component and feedforward component of the temperature closed loop according to the combination value of the residual thermal state and the current collected temperature. When the residual thermal state is higher than the steady-state thermal state corresponding to the current acquisition temperature, the microcontroller suppresses the increase of the integral component and reduces the feedforward component. When the residual thermal state is lower than the steady-state thermal state, the microcontroller only adds a feedforward component within the upper limit of the phototherapy drive power; The synthesis result of the proportional component, the integral component, and the feedforward component is sequentially passed through the power change slope and the upper limit of the phototherapy drive power before being output to the phototherapy drive channel.

[0013] Preferably, the microcontroller classifies magnetic power supply disturbances into transient contact disturbances, restricted power supply disturbances, and mismatched power supply disturbances based on the disturbance duration, the lowest power supply voltage during the disturbance, the voltage recovery time after power supply is restored, and the change in temperature after re-acquisition relative to the temperature before the disturbance. For the transient contact disturbance, maintain the continuity of the residual thermal state and restore the temperature target before the disturbance; For the aforementioned power supply disturbance, the temperature target remains unchanged and the recovery drive is limited to the updated upper limit of the phototherapy drive power. For the aforementioned mismatched power supply disturbance, clear the temperature closed-loop integral state and re-execute the restricted detection drive until a new connection confidence is formed.

[0014] Preferably, the microcontroller establishes a cross-detection segment consistency verification matrix for transient components across detection segments; The rows of the cross-detection segment consistency verification matrix correspond to the voltage and current responses in the first detection segment, and the columns correspond to the voltage and current responses in the second detection segment. The pairing relationship between each response in terms of time position, direction of change, and rate of change is also written. The magnetic connection state vector is corrected based on the remaining pairing relationships, and the connection confidence and the upper limit of the phototherapy driving power corresponding to the connection confidence are updated when the corrected magnetic connection state vector remains consistent for multiple consecutive control cycles.

[0015] Preferably, the microcontroller establishes a recovery phase index after the power supply constraint disturbance ends; The recovery phase index is determined by the connection reliability recovery level, the residual thermal state level, and the temperature closed-loop integral retention. The microcontroller selects the starting trajectory segment from the pre-generated continuous power trajectory set according to the recovery phase index, and determines the next trajectory segment in each control cycle based on the combination value of actual temperature and residual thermal state, the current upper limit of phototherapy driving power and the driving amount of the previous cycle. When the connection reliability decreases or the residual thermal state deviates from the steady-state thermal state corresponding to the current acquisition temperature, the microcontroller reverts to the recovery phase index and simultaneously limits the release rate of the integral component and the slope of the power change.

[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. By applying at least two restricted detection drives before and during phototherapy operation, corresponding voltage, current, and temperature changes are collected to form magnetic connection state characteristics and determine connection reliability, enabling the microcontroller to characterize the available power supply capacity as the contact state changes. Connection reliability is simultaneously used to limit the upper limit of phototherapy drive power, the power change slope, and the temperature closed-loop regulation, preventing the temperature controller from directly interpreting a slowdown in temperature rise as insufficient heat when the magnetic connection capacity decreases. After a power supply disturbance, the temperature closed-loop integral state is maintained, and the input power, temperature, and temperature change rate before the disturbance are used to form the residual thermal state. After power supply recovery, the microcontroller generates a graded power recovery sequence based on the connection reliability and the residual thermal state. This control relationship integrates power supply capacity reduction, integral accumulation, and residual heat release into the same control link, reducing erroneous power increase during disturbances, limiting power jumps during power recovery, and suppressing temperature surges caused by the superposition of integral holding and residual heat.

[0017] 2. By establishing power supply-side and load-side response sequences through probes of varying durations, and extracting power supply voltage drop, recovery slope, load current establishment slope, and current ripple envelope according to a common time base, transient components formed by magnetic contact changes and slowly varying components formed by thermal drift of the phototherapy load are separated from the connection state characteristics. Cross-probe consistency verification can eliminate isolated responses that only appear in a single probe segment, reducing the impact of sampling fluctuations on connection reliability updates. The fast control chain for power supply status first generates the allowable power boundary, while the slow control chain for temperature status outputs the drive quantity within the boundary, separating the processing cycle of power supply changes from the temperature regulation cycle. Different state maintenance and recovery paths are used for transient contact disturbances, constrained power supply disturbances, and mismatched power supply disturbances. By continuously selecting the power trajectory through the recovery stage index, short-term disturbances can be avoided from being misjudged as restart conditions, while maintaining the consistency between power boundaries, integral release rate, and temperature status during the recovery process. Attached Figure Description

[0018] Figure 1 Flowchart for magnetic power supply status identification, power boundary generation, and temperature closed-loop collaborative control of the detachable module of menstrual phototherapy underwear; Figure 2 This is a schematic diagram of the connection reliability calculation results; Figure 3 This is a schematic diagram showing the actual allowable power limit and drive output; Figure 4 This is a schematic diagram of the recursive results for the residual thermal state; Figure 5 This is a schematic diagram showing the separation results of the slowly varying components and the transient components. Detailed Implementation

[0019] In one embodiment, please refer to Figure 1 The magnetic power supply and microcontroller temperature control system of the detachable module of the menstrual phototherapy underwear includes a magnetic power supply interface connected to the detachable phototherapy module, an acquisition channel for acquiring the output voltage and load current of the magnetic power supply interface and the temperature of the detachable phototherapy module, a microcontroller connected to the acquisition channel, and a phototherapy drive channel controlled by the microcontroller. Before and during phototherapy operation, the microcontroller outputs at least two restricted detection drives to the phototherapy drive channel. Based on the voltage, current and temperature changes during the detection period, the magnetic connection state characteristics are formed. The connection reliability is determined based on the magnetic connection state characteristics. The upper limit of the phototherapy drive power, the power change slope and the temperature closed-loop adjustment amount are jointly limited according to the connection reliability. The microcontroller also freezes the temperature closed-loop integral state and saves the thermal state before the disturbance during magnetic power supply disturbance. After the power supply is restored, a graded power recovery sequence is generated according to the connection reliability and thermal state. Thus, a closed-loop control structure is formed in which power supply state identification, power boundary generation, temperature closed-loop adjustment and recovery process management are interconnected.

[0020] Specifically, the magnetic power supply interface is used to establish a separable electrical connection between the power supply end of the underwear body and the power receiving end of the detachable phototherapy module. The acquisition channel acquires the output voltage of the power supply interface, the load current flowing through the phototherapy drive channel, and the temperature sampling value corresponding to the active area of ​​the phototherapy module according to a unified time reference. Each sampling value is written into the timing buffer maintained by the microcontroller. The microcontroller performs isolated pulse removal, unified sampling interval, and detection start edge alignment processing on the voltage and current sampling values, and performs continuity checks and trend calculations on the temperature sampling values. The phototherapy drive channel adjusts the actual input power of the phototherapy load according to the drive control quantity output by the microcontroller. The unified time reference ensures that the start time of the detection drive, the change time of the power supply side response, the change time of the load side response, and the start time of the temperature response can correspond in the same control cycle sequence, avoiding the time offset formed by asynchronous sampling being mistaken for a change in the magnetic contact state.

[0021] In this embodiment, after confirming the magnetic connection, the microcontroller does not directly enter the target temperature closed loop. Instead, it first outputs a detection drive limited by the safety boundary. The drive quantity of the detection drive is lower than the current allowable power boundary, and the duration is insufficient to allow the temperature to enter a sustained rise phase. Before the detection drive starts, the microcontroller records the no-load or low-load baseline. During the detection drive, it records the voltage drop, current build-up, and temperature response. After the detection drive ends, it records the voltage recovery, current drop, and temperature inertia. The detection drive in the operation interval is inserted into the control window where the change in the conventional phototherapy drive quantity is small. During the insertion, the update of the temperature closed loop integral quantity is paused and the original target temperature is maintained. This ensures that the voltage and current changes formed during the detection process correspond to the known drive excitation and are not masked by the synchronous increase or decrease in power of the temperature closed loop. After the detection is completed, the conventional temperature control calculation is resumed based on the updated connection reliability.

[0022] The magnetic connection state characteristics are represented by a combination of normalized deviations. Let the connection confidence level in the k-th detection cycle be . The voltage response deviation is The deviation of the current response is The voltage recovery deviation is The temperature initial response deviation is The corresponding non-negative weights are respectively , , and The connection reliability is calculated according to the following formula: ; Each deviation is obtained by dividing the difference between the current response and the stable baseline response by the corresponding baseline change scale. The sum of the weights is 1 and determined according to the repeatability of each acquired quantity. For example, when the four deviations are successively 0.10, 0.15, 0.20, and 0.05, and all four weights are 0.25, the exponent term is 0.125. In the near-stable connection range, the microcontroller maintains a relatively wide allowable power boundary. When both the voltage recovery deviation and the current response deviation increase simultaneously, the exponential term increases accordingly, resulting in... Reduce and trigger power boundary contraction.

[0023] Please refer to Figure 2 , Figure 2 The horizontal axis represents the detection cycle, covering control cycles 12 to 128. The vertical axis represents the connection reliability of the magnetic power supply interface, with values ​​ranging from 0 to 1. The solid black line represents the main curve of connection reliability, the gray dotted line represents the first warning threshold, and the black dashed line represents the second warning threshold. Figure 2 The calculation process for connection reliability, which corresponds to the deviation of voltage response, deviation of current response, deviation of voltage recovery, and deviation of temperature initial response in the text, is used to uniformly convert multiple types of physical responses into continuous state quantities that can be called by a fast control chain.

[0024] from Figure 2 As can be seen, the main curve of connection reliability remains between approximately 0.87 and 0.98, consistently above the two-level warning threshold, indicating that the connection state between the detachable phototherapy module and the magnetic power supply terminal is generally stable in this embodiment. Local high values ​​appear near the 40th and 80th cycles, indicating that the voltage drop, current build-up, and voltage recovery processes after the two limited detection drives are close to the baseline state. Although the curve shows a slight decrease and short-term fluctuations in the later cycles, it still maintains sufficient stability margin and does not form a continuous power supply disturbance.

[0025] The stable bonding reference response is not a fixed, single factory curve. Instead, it is formed when the magnetic interface is confirmed to be in a continuous and stable state, the temperature changes before and after detection are within a comparable range, and the voltage and current responses remain consistent in adjacent detection cycles. The microcontroller calculates the median feature of multiple sets of responses that meet the conditions according to their time positions and uses the median feature as the reference state vector of the current detachable phototherapy module. When the module is reinstalled and the initial detection response is not significantly different from the original reference, the original reference is continued and corrected with a lower update weight. When the response after reinstallation forms a new stable cluster in multiple detection cycles, the microcontroller retains the old reference and establishes a new reference version. At the same time, it records the temperature range and power supply stage corresponding to the new reference. In subsequent comparisons, the reference version that matches the temperature range and drive stage is selected to avoid normal resistance changes caused by module temperature rise being written into the contact abnormality feature.

[0026] The microcontroller generates the upper limit of the phototherapy drive power and the power change slope based on the connection reliability. Let the reference allowable power in the k-th control cycle be... The connection trust level is The residual thermal confinement factor is The disturbance recovery constraint factor is The actual allowable power limit is Then calculate according to the following formula: ; in, and All values ​​are taken between 0 and 1 and are determined by the residual thermal state and the recovery stage, respectively. For example, Take the normalized value of 1. Take 0.8, Take 0.7, When the value is 0.6, the result is The value is 0.336. Even with a higher driving force, the temperature closed-loop can only output within this upper limit. When connection reliability recovers but residual heat remains high, only... Increase It remains at a relatively low value, so there will be no sudden increase due to the combination of power restoration and residual heat.

[0027] Please refer to Figure 3 , Figure 3 The horizontal axis represents the control cycle, and the vertical axis represents the normalized power. The solid black line represents the actual drive power, the dashed gray line represents the upper limit of the allowable power calculated by the microcontroller, and the dotted black line represents the reference requested power. Figure 3 The corresponding control loop, which generates the actual allowable power limit based on the reference allowable power, connection reliability, residual thermal constraint factor, and disturbance recovery constraint factor, is used to illustrate that the temperature closed-loop candidate output cannot directly exceed the boundary given by the power supply state fast control chain.

[0028] from Figure 3 As can be seen, the reference requested power remains close to full capacity for a long period, while the upper limit of the allowed power varies between approximately 0.87 and 0.98 depending on the connection reliability and thermal constraints. The actual drive power gradually increases from a low level to around 0.58, and remains below the upper limit of the allowed power. The curve shows a step-like increase in the early stage, indicating that the microcontroller does not release the target power all at once, but gradually increases the output under the condition of stable connection reliability and no excessive accumulation of residual heat. The actual drive power increases significantly around the 80th cycle, corresponding to the power reconnection process after the restrictions are relaxed in the recovery phase.

[0029] In a preferred embodiment, the power change slope is not obtained by direct differential from the allowable power limit, but is jointly determined by the direction of change in connection reliability, the continuous hold time, and the voltage recovery trend. The microcontroller establishes slope states for reliability decrease, reliability hold, and reliability recovery respectively. When the temperature continuously decreases, first reduce the allowable power increase slope while maintaining the controlled power reduction channel, so that the temperature closed loop cannot continue to rapidly increase the drive quantity. When held within a restricted range, the allowed power increase slope is frozen while allowing a slight power decrease. When the voltage recovery trend is consistent with the current establishment trend, the allowable power increase slope is gradually relaxed. If the confidence drops in any control cycle, it will revert to the previous slope state. The state switching adopts continuous confirmation of adjacent cycles instead of single-point threshold triggering.

[0030] The temperature closed loop employs a fast control chain for power supply status and a slow control chain for temperature status operating in tandem. The fast control chain updates the connection reliability, allowable power limit, and allowable power change slope in each voltage and current sampling cycle. After the temperature sampling update, the slow control chain calculates candidate drive quantities based on the target temperature, current temperature, temperature change rate, and integral state. The candidate drive quantities are first pruned by the allowable power limit and then written into the phototherapy drive channel after being limited by the allowable power change slope. The update cycle of the fast control chain is shorter than that of the slow control chain, and the fast control chain can cover the candidate drive quantities that the slow control chain has not yet executed after each update. The slow control chain must not widen the boundary formed by the fast control chain in the reverse direction. This separates the fast electrical response to contact changes from the slow thermal response to module temperature rise.

[0031] In a preferred embodiment, the candidate driving quantity of the temperature closed loop is synthesized from a proportional component, an integral component, and a feedforward component based on the thermal state. The proportional component is generated based on the current difference between the target temperature and the sampled temperature. The integral component is generated based on the actual temperature difference accumulation after being constrained by the allowable power boundary. The feedforward component is generated based on the residual thermal state, recent input power, and temperature change rate. The integral component is only increased when the magnetic connection reliability is in the updateable range, the temperature sampling is continuous, and the driving quantity is not pruned by the power boundary for a long time. When the candidate driving quantity is continuously pruned by the power boundary, the microcontroller deducts the pruning difference from the integral update quantity to keep the integral state consistent with the actual applicable power and avoid the formation of unexecutable integral accumulation during periods of limited power supply.

[0032] The identification of magnetic power supply disturbances is based on the joint conditions of sudden changes in connection reliability, sustained voltage drop, and consistency of current response. When the voltage drops at a single point but the current response does not change accordingly, the microcontroller marks the sample as pending confirmation. After subsequent sampling recovery, the mark is deleted. When voltage drop and current establishment anomaly occur simultaneously and connection reliability continuously decreases, the microcontroller enters a disturbance state. Within the same control cycle of entering the disturbance state, the current temperature closed-loop integral, recent actual input power sequence, temperature sampling sequence, temperature change rate sequence, and current drive stage are saved, and the integral is stopped from increasing further. The phototherapy drive quantity is reduced or maintained according to the boundary given by the fast control chain. During the saving process, the same timestamp is used to encapsulate each state quantity to ensure that the data referenced during recovery is the same thermal stage before the disturbance occurred.

[0033] The thermal state before the disturbance is represented by the residual thermal state quantity. Let the residual thermal state in the k-th temperature control cycle be... The residual thermal state of the previous cycle was The actual input power is The rate of temperature change The difference between the collected temperature and the reference temperature is The thermal memory coefficient is The power mapping coefficient is The rate of change mapping coefficient is The temperature difference mapping coefficient is Then, the recursion is performed according to the following formula: ; in, The value is between 0 and 1, representing the degree of heat retention in the previous cycle. , and Maintain the same calibration direction, for example, when the input power has decreased to a small value but the temperature is still rising. For positive and Still relatively large, the result It does not decrease immediately with power reduction, thus the microcontroller maintains a strong residual thermal constraint.

[0034] Please refer to Figure 4 , Figure 4 The horizontal axis represents the temperature control cycle, and the vertical axis represents the normalized results of thermal state, power, and temperature change. The solid black line represents the residual thermal state, the dashed gray line represents the actual drive power, and the dotted black line represents the rate of temperature change. Figure 4 Corresponding to the residual thermal state recursion process in the text, it shows how the microcontroller incorporates the thermal memory of the previous cycle, the current actual input power, the rate of temperature change, and the difference between the acquired temperature and the reference temperature into the recovery control judgment.

[0035] from Figure 4As can be seen, the actual driving power gradually increases in the initial stage and enters a higher output range after the 80th cycle. The amplitude of the residual thermal state is consistently lower than that of the power curve, with a maximum value of approximately 0.09, indicating that the current heat accumulation is within a controllable range. The temperature change rate curve fluctuates around zero, with local positive increases and negative decreases, reflecting short-term thermal hysteresis between the skin interface, encapsulation material, and fabric layer. Even after the power decreases or the change slows down, the residual thermal state may still persist for a period of time, indicating that temperature safety judgment cannot rely solely on instantaneous power.

[0036] The thermal memory coefficient and mapping coefficient are determined by the data from the heating, steady-state and cooling stages during normal operation. The microcontroller selects a control segment with a stable power supply connection and continuous temperature sampling, uses the actual input power as the external excitation, and the subsequent temperature change rate and temperature difference as the response. It updates each coefficient using a recursive minimum residual method. During the update, the sign of the coefficient is limited to be consistent with the direction of heat transfer. The update stops when the difference between the coefficients obtained from adjacent control segments exceeds the allowable range, and the most recent stable coefficient is used. The coefficient update does not change the safe temperature boundary and the allowable power boundary. It is only used to describe the heat delay and release process of the same module in the current wearing state, so that the residual thermal state quantity can reflect the thermal inertia that continues to exist after the power interruption.

[0037] After power is restored, the microcontroller does not directly use the pre-disturbance driving quantity, but instead re-executes short-term constrained detection to obtain the connection reliability and voltage recovery trend after restoration. At the same time, it reads the disturbance duration, the saved residual thermal state, the temperature collected at the time of restoration, and the rate of temperature change. When the temperature collected at the time of restoration is still higher than the predicted value of the temperature trend before the disturbance, the microcontroller increases the residual thermal constraint and keeps the integral quantity frozen. When the temperature collected at the time of restoration is lower than the predicted value and the connection reliability is stable, the feedforward component is allowed to gradually increase within the power boundary. The integral quantity is released in segments according to the deviation between the actual temperature and the residual thermal state. The release direction must not conflict with the current power boundary clipping direction until the integral state is consistent with the re-established temperature closed-loop state.

[0038] In one embodiment, at least two restricted detection drives include a first detection segment and a second detection segment. The duration of the first detection segment is shorter than that of the second detection segment, and the driving amplitude of both is lower than the current temperature closed-loop allowable power. The microcontroller extracts the power supply voltage drop, load current increment, voltage recovery time, current ripple distribution, and temperature response start time for each detection segment. It constructs a magnetic connection state vector based on the differential relationship of each characteristic quantity under the two detection drives. The microcontroller performs time-series alignment of the magnetic connection state vector with the reference state vector recorded when the current detachable phototherapy module completes stable connection. It generates connection reliability based on the degree of deviation of the aligned multi-features and removes the slow resistance change component caused by the temperature rise of the phototherapy load. The first detection segment is used to characterize the transient establishment process of the contact interface, and the second detection segment is used to characterize the recovery and maintenance process of the power supply circuit under continuous load.

[0039] A response fallback window is set between the first and second detection segments. The microcontroller monitors the voltage recovery direction and current fallback direction within the fallback window. The second detection segment only begins when both types of signals return to their respective baseline neighborhoods. If the temperature continues to rise due to the previous detection segment at the end of the fallback window, the rising trend is recorded and the corresponding slowly varying component is subtracted from the characteristics of the second detection segment. The two detection drives can use the same drive amplitude to highlight the difference in duration, or they can use different but limited drive amplitudes to form an amplitude ratio of the electrical response. The microcontroller selects the detection amplitude based on the current temperature closed-loop allowable power, so that the detection drive is always within the current executable power boundary.

[0040] In this embodiment, the power supply side response sequence includes the supply voltage drop, recovery slope, and recovery settling time; the load side response sequence includes the load current build-up slope, steady-state current deviation, and current ripple envelope. The microcontroller resamples the two types of response sequences using the probe drive start edge as a common time reference, and separates the transient and slowly varying components by comparing the direction and rate of change at the same time position. Let the aligned original response sequence be... , by a symmetric weight of length L The slowly varying components formed are The transient component is Then it is processed according to the following formula:

[0041] ; in, These are non-negative numbers that sum to 1, for example, when the response sequence increases slowly at adjacent positions. Follow this change Approaching 0, when the magnetic attraction suddenly drops at a certain moment, Still maintaining the neighborhood trend Preserving the drop component, the microcontroller only... Write the magnetic connection state vector.

[0042] Please refer to Figure 5 , Figure 5 The horizontal axis represents the aligned sampling points, ranging from 0 to 35, and the vertical axis represents the probe response amplitude. The solid black line represents the original response, the gray dashed line represents the slowly varying baseline calculated by symmetric weights, the black dotted line represents the transient residual, and the horizontal dashed line represents the residual review threshold. Figure 5 The corresponding process described in the paper involves separating the slowly varying components and transient components of the detection response. This process is used to isolate the low-frequency changes caused by temperature rise, material thermal drift, and slow load changes from the transient changes in magnetic contact.

[0043] from Figure 5 As can be seen, the overall original response increases with the number of sampling points, and the slowly varying baseline basically follows this long-term trend, indicating that the separated slow changes mainly come from the response background under the continuous driving force. The transient residuals show alternating positive and negative changes at multiple sampling points, with amplitudes ranging from approximately -0.046 to +0.045, which does not exceed the residual review threshold, indicating that no sharp response sufficient to be identified as a serious contact anomaly in this round of detection. The residual fluctuations are relatively concentrated around sampling points 10 to 18, making them suitable as candidate feature intervals for subsequent cross-detection segment consistency verification.

[0044] The overall trend indicates that separating gradual and transient changes can prevent normal temperature rises or power supply background changes from being misjudged as magnetic contact disturbances. The microcontroller only continues to enter the consistency matrix pairing when the transient residuals show similar time positions, directions of change, and amplitude patterns in different detection segments; if the residuals only exhibit isolated peaks, they can be treated as noise or transient movement of the wearer. Figure 5 This provides a clear explanation of the input sources for the subsequent consistency matrix and the basis for anomaly removal.

[0045] The window length of the slowly varying component is not a fixed hardware parameter, but is determined based on the ratio of the current temperature change timescale to the voltage and current response timescale. The microcontroller calculates the sampling length required for the voltage and current to reach the stable range within a stable detection period, and calculates the sampling length required for the temperature change rate to remain in the same direction. The former is used as the transient timescale and the latter as the thermal slowly varying timescale. A window length that can cover the transient timescale and is smaller than the thermal slowly varying timescale is selected. When the wearing state changes and the temperature change accelerates, the window length shrinks with the thermal slowly varying timescale, but it must not be less than the length that covers the complete electrical response, thereby maintaining the separability between transient contact changes and thermal drift.

[0046] The microcontroller establishes a cross-detection segment consistency check matrix. The rows of the matrix correspond to the voltage and current responses in the first detection segment, and the columns correspond to the voltage and current responses in the second detection segment. The matrix also records the pairing relationships of each response in terms of time position, direction of change, and rate of change. Let the normalized time of the i-th transient feature in the first detection segment be . , direction symbol is Normalization rate is The corresponding quantity of the j-th transient feature in the second detection segment is , and Consistent elements are Then calculate according to the following formula: ; in, , and They are respectively represented as , and The corresponding non-negative numbers sum to 1, for example, when two features are close in time position, both in the downward direction, and both at similar rates. If the values ​​are close to 1, they form a pair. If the directions are opposite, the direction term is 0. Even if the times are close, they cannot be considered as a common source contact response.

[0047] After the consistency verification matrix is ​​formed, the microcontroller retains only the second probe segment feature with the largest consistency element as a candidate pair for each first probe segment feature, and checks whether the candidate pair has bidirectional uniqueness. Isolated responses that do not form bidirectional unique pairs are not written into the connection state vector. Responses that form pairs are written into the connection state vector after being weighted according to the consistency elements. The connection confidence is updated only when the corrected connection state vector maintains the same direction of change for multiple consecutive control cycles. If the pairing relationship changes frequently in different control cycles, the previous confidence is maintained and the allowable power increase slope is tightened to avoid sampling noise or single action impact directly changing the temperature control boundary.

[0048] In another embodiment, the power supply state fast control chain forms a confidence decrease segment, a confidence hold segment, and a confidence recovery segment based on continuously updated connection confidence. It maintains mutually continuous allowable power boundaries for each segment. In the confidence decrease segment, the microcontroller first reduces the allowable power change slope and then reduces the allowable power upper limit. In the confidence hold segment, the microcontroller keeps the allowable power boundary from rising with the temperature closed-loop request. In the confidence recovery segment, the microcontroller gradually relaxes the allowable power change slope and the allowable power upper limit based on the consistency between the voltage recovery trend and the current jump. The allowable power boundary of the next control cycle is updated based on the condition that the connection confidence has not fallen back. The segment states are determined by the continuous change direction and hold length of confidence rather than by a single threshold switching.

[0049] In the confidence decline phase, the reduction in the allowable power increase slope occurs earlier than the reduction in the allowable power limit, causing the phototherapy drive quantity to stop rising rapidly as soon as the power supply capacity begins to decline. At the same time, a slow power reduction path is retained. If the confidence recovers in subsequent cycles, the power limit can be maintained at its original value without undergoing a shutdown and restart. In the confidence maintenance phase, the microcontroller freezes the upward direction of the power limit and allows power reduction requests based on excessively high temperatures. In the confidence recovery phase, the voltage recovery trend and the current jump variable need to satisfy a positive improvement relationship. If the voltage recovers but the current establishment is still abnormal, the current recovery level is maintained to avoid judging that the magnetic connection is stable based solely on the recovery of the no-load voltage.

[0050] In a preferred embodiment, the microcontroller writes the residual thermal state into the set of state variables of the temperature closed loop, and corrects the proportional component, integral component, and feedforward component according to the combination value of the residual thermal state and the current acquisition temperature. When the residual thermal state is higher than the steady-state thermal state corresponding to the current acquisition temperature, the increase of the integral component is suppressed and the feedforward component is reduced. When the residual thermal state is lower than the steady-state thermal state, the feedforward component is only increased within the upper limit of the phototherapy drive power. The synthesis result of the proportional component, integral component, and feedforward component is output to the phototherapy drive channel after being limited by the power change slope and the upper limit of the phototherapy drive power in sequence. The steady-state thermal state is determined by the median value of the historical residual thermal state under the same temperature range and similar actual input power during the connection stabilization period.

[0051] To avoid erroneous comparisons between the residual thermal state and the current temperature caused by temperature sampling lag, the microcontroller performs a short-term extrapolation of the current sampled temperature based on the temperature change rate. The extrapolated temperature and the residual thermal state are used together for component correction. When the temperature change rate is positive and the residual thermal state is high, the feedforward component continues to decrease. Only when the temperature change rate is negative and the residual thermal state is close to the steady-state thermal state is the integral component allowed to be released gradually. The amount of integral release is limited by the current allowed power increase slope. If the synthesized drive quantity after release is pruned by the power limit, the unexecuted part continues to be retained in the integral holding quantity and is not written into the active integral state, so that the integral release process corresponds to the actual output power.

[0052] The microcontroller classifies magnetic power supply disturbances into transient contact disturbances, limited power supply disturbances, and mismatched power supply disturbances based on the disturbance duration, the lowest supply voltage during the disturbance, the voltage recovery time after power restoration, and the change in temperature after re-acquisition relative to the temperature before the disturbance. Transient contact disturbances correspond to situations where the electrical response deviates for a short time and the connection state vector after restoration is similar to that before the disturbance. Limited power supply disturbances correspond to situations where the connection reliability decreases but limited power output can still be maintained. Mismatched power supply disturbances correspond to situations where the connection state vector lacks continuity with the existing benchmark and the restoration detection cannot form a stable pair. The classification results are generated by the combination relationship of multiple state variables and require confirmation during continuous control cycles.

[0053] For transient contact disturbances, the microcontroller maintains the residual thermal state continuously and restores the temperature target before the disturbance. The integral state is maintained until the temperature is re-acquired and the residual thermal state is consistent before being released. For power supply disturbances, the microcontroller keeps the temperature target unchanged, limits the restored drive quantity to the updated upper limit of the phototherapy drive power, and prohibits the temperature closed loop from actively raising the power upper limit according to the boundary of the confidence retention segment. For power supply mismatch disturbances, the microcontroller clears the active integral state but retains the disturbance record, re-executes the restricted detection drive and establishes a new benchmark comparison context until a continuous and stable connection confidence is formed before entering normal temperature control.

[0054] During the re-initialization process after a power mismatch disturbance, the microcontroller will re-acquire the temperature as the new closed-loop initial temperature and use the residual thermal state before the disturbance as the upper bound information for safety constraints only, instead of directly restoring the original integral quantity. The two re-executed detection drives are still limited by the current temperature and the upper bound of the residual thermal state. If the temperature is still rising, the detection interval is extended and a lower allowable power limit is maintained. If the temperature has fallen and the new connection state vector is continuously stable, a new connection credibility is established and the temperature closed loop is entered from the low recovery stage. This process avoids the incorrect splicing of the power supply state after the module is reconnected with the state before the disturbance.

[0055] In a further embodiment, the microcontroller establishes a recovery phase index after the power-constrained disturbance ends. This recovery phase index is jointly determined by the connection reliability recovery level, the residual thermal state level, and the temperature closed-loop integral retention value. The normalized value of the connection reliability recovery level is set to... The inverse normalized value of the residual thermal state level is The inverse normalized value of the integral is maintained. The corresponding weight is , and The continuous indicators during the recovery phase are Then calculate according to the following formula: ; in, , and They are respectively represented as , The corresponding non-negative numbers sum to 1. and The larger the value, the lower the residual heat and the less the integral to be released, respectively. For example, , , When the values ​​are successively 0.8, 0.4, and 0.5, and each weight is 1 / 3, When in the intermediate recovery range, the microcontroller selects the mid-range power trajectory instead of directly entering the full recovery phase.

[0056] The continuous index of the recovery phase is mapped to multiple adjacent recovery intervals. Each recovery interval corresponds to a set of continuous power trajectory segments. The starting point of the trajectory segment is consistent with the ending point of the previous recovery interval. The microcontroller selects the starting trajectory segment according to the current recovery phase index and determines the next trajectory segment in each control cycle based on the combination value of actual temperature and residual thermal state, the current upper limit of phototherapy driving power and the driving amount of the previous cycle. If the connection reliability decreases or the residual thermal state deviates from the steady-state thermal state corresponding to the current acquisition temperature, the recovery phase index is rolled back, and the release rate of integral components and the slope of power change are limited simultaneously. The recovery phase can only advance step by step or roll back according to the degree of abnormality. It cannot skip intermediate stages and directly recover to the driving amount before the disturbance.

[0057] The continuous power trajectory is updated using a recursive method based on boundary projection. Let the actual drive power in the previous control cycle be... The current candidate increment for closed-loop temperature measurement is The recovery phase allows for an increment of The actual driving power in the current cycle is Then it is determined according to the following formula: ; The inner minimum operation ensures that the temperature closed-loop request cannot exceed the allowable increment during the recovery phase, while the outer minimum operation ensures that the update result does not exceed the power limit given by the power supply status fast control chain. For example, if the temperature closed-loop request increment is 0.12 and the allowable increment during the recovery phase is 0.05, only 0.05 is used for recursion. Even if the recursion result is still higher than the current power limit, it is still pruned to the power limit by the outer operation.

[0058] In a preferred embodiment, the continuous power trajectory set does not pre-save complete curves of a fixed time length, but instead saves incremental generation rules for different recovery stages. The incremental generation rules take the connection reliability change rate, residual thermal state change rate, temperature change rate, and integral hold-up amount as inputs and output the allowable increment for the current cycle. When the connection reliability increases while the residual thermal state decreases, the increment is allowed to gradually increase. When the connection reliability remains but the residual thermal state is still high, the increment is allowed to remain or decrease. When the temperature change rate turns from negative to positive and the integral hold-up amount is still to be released, the increment increase is paused. The rules only generate local trajectories limited by power boundaries and slope boundaries, thus enabling the subsequent power path to be corrected according to the real-time state during power restoration.

[0059] When a single sample loss occurs in the acquisition channel, the microcontroller does not immediately change the disturbance classification. Instead, it uses the local trend formed by consecutive sampling to perform bounded interpolation on the missing sample location. The interpolated value is only used to maintain timing alignment and does not participate in the update of the reference state vector. When consecutive sample losses reach the point where the correspondence between voltage, current and temperature cannot be determined, the microcontroller freezes the direction of connection confidence adjustment, maintains the integral quantity and tightens the slope of allowable power change. After the sampling is restored, the detection drive is re-executed. If the response after the sampling is restored is continuous with the state before the sample loss, the original state is used. If there is no continuity, it is treated as a power supply mismatch disturbance. Data processing ensures that state identification depends on verifiable timing response.

[0060] The microcontroller cyclically stores the baseline state vector, connection reliability sequence, residual thermal state sequence, and recovery phase index formed during operation. Each record contains the corresponding detection drive identifier, temperature range, drive phase, and time sequence. Cyclic storage only retains records that can pass the cross-detection segment consistency check and have continuous power supply status. When a mismatch power supply disturbance occurs, the records before and after the disturbance are divided into different state segments. Subsequent benchmark selection must not directly calculate the average value across state segments. When a transient contact disturbance occurs, the same state segment is allowed to be retained, but the disturbance interval is marked. Subsequent coefficient updates and benchmark updates skip the disturbance interval.

[0061] Furthermore, the deviations in voltage response, current response, voltage recovery, and temperature onset response are all normalized using a discrete scale of similar benchmark characteristics. The discrete scale is formed by the median absolute deviation of multiple detection responses under stable connection conditions. When the discrete scale of a certain acquisition quantity is too small and may amplify small sampling fluctuations, the microcontroller replaces the discrete scale with the smallest resolvable change in adjacent detection cycles. The normalized deviation is then corrected according to the baseline of the current temperature range. The baseline between temperature ranges is continuously interpolated between adjacent ranges to avoid jumps in connection reliability when crossing temperature ranges. If a certain acquisition quantity continuously lacks a comparable benchmark, the corresponding weight is temporarily reduced and the remaining weights are renormalized instead of using an unverified fixed substitute value.

[0062] In terms of temperature sampling processing, the microcontroller performs a physical consistency check between the collected temperature and the recent actual input power, temperature change rate, and residual thermal state. When the actual input power remains constant and the residual thermal state is positive, an isolated reverse mutation occurs in the temperature sampling. The sample is marked as an anomaly and replaced by an interpolated value defined by the preceding and following trends. When the temperature sampling continuously deviates from the change direction jointly determined by the power input and the residual thermal state, the microcontroller stops integral updates and switches the temperature closed loop to a boundary hold state. In the boundary hold state, the power is still limited by the fast control chain of the power supply state. After subsequent continuous temperature sampling meets the consistency of change direction and change rate again, the slow control chain is restored. Abnormal sampling does not participate in the update of thermal model coefficients and steady-state thermal state.

[0063] The fast control chain for power supply status and the slow control chain for temperature status exchange data through a shared state buffer. When writing connection reliability, allowable power limit, and allowable power change slope, the fast control chain appends an update sequence number. When reading, the slow control chain verifies the consistency of the update sequence numbers of the three quantities. If the fast control chain updates again during the reading process, the current candidate drive quantity is discarded and recalculated based on the latest boundary. The phototherapy drive channel only receives drive commands that simultaneously have the latest fast control sequence number and the current temperature control sequence number. After a power supply disturbance is confirmed, the fast control chain can directly invalidate slow candidate drive quantities that have not yet been issued, preventing drive quantities under the old power boundary from entering the phototherapy drive channel due to asynchronous task execution.

[0064] In the recursive update of the residual thermal state, the microcontroller maintains reliable coefficient labels for the heating phase, temperature holding phase, and power fall-off phase. The heating phase is used to verify the positive correspondence between input power and temperature change rate. The temperature holding phase is used to verify the correspondence between the residual thermal state and steady-state temperature. The power fall-off phase is used to verify the decay process described by the thermal memory coefficient. The thermal memory coefficient and mapping coefficient are only allowed to be updated when at least two of the three phases are consistent. If the current wearable state causes a sudden change in heat dissipation conditions, the microcontroller retains the original coefficients as a backup version and forms a new version with a smaller update range. When restoring control, the same coefficient version as the one before the disturbance is preferred.

[0065] Disturbance type confirmation adopts state path constraints. Normal power supply state can only enter the unconfirmed disturbance state. The unconfirmed disturbance state can return to normal power supply state or enter one of transient contact disturbance, limited power supply disturbance, and mismatched power supply disturbance. Limited power supply disturbance enters the recovery state after the connection reliability is continuously restored and cannot directly return to normal power supply state. Mismatched power supply disturbance can only enter the low recovery state after the limited detection is completed again and a new reference context is formed. The microcontroller saves the connection state vector, residual thermal state and integral hold value at the time of each state transition. If the subsequent data negates the previous transition conditions, it will fall back to the saved previous state and will not continue to release the power boundary along the wrong path.

[0066] In the recovery phase, integral release and power trajectory update are settled in the same control cycle. The microcontroller first determines the allowable increment for the recovery phase based on connection reliability and residual thermal state, then calculates the releaseable portion of the integral hold in this cycle. After adding the release portion to the temperature closed-loop candidate increment, it performs power recursion subject to boundary projection. If the candidate increment is pruned by the allowable increment or power limit of the recovery phase, the pruned integral portion is rewritten back to the integral hold. If the actual temperature change direction is opposite to the expected direction of the release integral, the subsequent release is stopped and the recovery phase index is rolled back until continuous temperature sampling and residual thermal state re-establish a consistent relationship. Therefore, the integral state, actual driving quantity, and recovery phase are always updated synchronously according to the actual execution results.

[0067] The continuity of the power boundary is maintained through boundary memory. During each fast control chain update, the microcontroller compares the newly calculated power upper limit with the actual power of the previous cycle. If the new power upper limit is lower than the actual power of the previous cycle, a transition boundary is generated according to the allowable power reduction slope and gradually converges to the new upper limit in subsequent cycles. If the connection state has entered a mismatch power supply disturbance, the transition boundary is skipped and the regular phototherapy drive is stopped. If the new power upper limit is higher than the boundary of the previous cycle, it is allowed to be increased only when the connection confidence is in the recovery phase, the voltage recovery trend and the current establishment trend form a stable pair, and the residual thermal constraint is not enhanced. If any condition fails during the boundary increase process, it is maintained or rolled back. The power reduction request calculated by the slow temperature control chain can be executed directly through the increase limit, but the power increase request is always constrained by the boundary memory, so that the boundary change direction is consistent with the joint change of the power supply state and the thermal state.

[0068] The version switching of the baseline state vector adopts bidirectional verification. After the current probe response enters the candidate new baseline, the microcontroller simultaneously calculates its deviation from the old baseline and the candidate new baseline. Only when the deviation of the continuous probe response from the candidate new baseline remains convergent and the deviation from the old baseline remains stably separated, is the candidate new baseline set as the current comparison baseline. If the subsequent response approaches the old baseline again, the old baseline version is restored and the candidate version record is retained. During the version switching, the connection confidence is generated according to the lower value of the two baseline calculation results.

[0069] In a specific application, after the detachable phototherapy module is connected via the magnetic power supply interface, the acquisition channel establishes a synchronous sampling sequence of voltage, current, and temperature. The microcontroller completes low-load baseline recording and outputs two segments of restricted detection drive. Based on the two segments of detection response, a connection state vector is constructed and the connection reliability is calculated. The connection reliability enters the power supply state fast control chain to generate the allowable power upper limit and allowable power change slope. The temperature state slow control chain outputs the phototherapy drive quantity within the boundary. If the magnetic interface is briefly disturbed due to wearing action during operation, the microcontroller saves the integral state and residual thermal state and limits the drive quantity. After the connection is restored, it is re-detected and a recovery stage index is generated. The recovery is carried out step by step through continuous power trajectory until the connection reliability, temperature change trend, and residual thermal state meet the conventional temperature control conditions again.

[0070] In another specific application, the magnetic interface was not completely disconnected, but the contact capability continued to decrease. The first detection segment showed a transient drop in voltage and a delay in current establishment. The second detection segment showed an extended recovery time. The two responses formed a stable pair through the consistency matrix. The connection reliability continued to decrease. The fast control chain first tightened the allowable power increase slope and then reduced the power limit. When the temperature closed-loop candidate drive quantity increased due to the slower temperature rise, it was subject to boundary restrictions. The integral update quantity was corrected according to the actual executable drive quantity. After the contact capability was restored, the connection reliability entered the recovery segment. However, the residual thermal state was still in a high range. Therefore, the recovery stage index remained in the low to medium range. The continuous power trajectory continued to recover slowly until the temperature change rate and the residual thermal state both fell back.

[0071] In another specific application, after the detachable phototherapy module is reinstalled, it generates voltage and current responses that differ significantly from the original reference. The microcontroller marks the connection state as a mismatched power supply disturbance and clears the active integral state. Subsequently, under the constraints of the current temperature and the upper limit of residual heat, the two-stage restricted detection drive is re-executed. After multiple sets of detection responses are time-aligned, transiently separated, and cross-detection segment consistency verified, a new stable cluster is formed. The microcontroller establishes a new reference state vector for the stable cluster and generates a new connection credibility. The temperature closed loop starts running from the low recovery stage. The old reference is still retained but does not participate in the current access state comparison until the subsequent access state meets the same temperature range and response continuity conditions as the old reference.

[0072] Through the above implementation, the electrical response of the magnetic power supply interface, the temperature response of the detachable phototherapy module, and the control state of the microcontroller are processed under a unified time reference. The constrained detection drive provides comparable known stimuli, the connection reliability converts multi-feature deviations into a continuous power supply capability characterization, and the power supply state fast control chain forms an insurmountable power boundary for the temperature closed loop. The residual thermal state and integral retention quantity are entered into the disturbance recovery calculation, the cross-detection segment consistency check eliminates isolated responses, and the recovery stage index and continuous power trajectory constrain the drive changes after power supply recovery. All processing revolves around the coordination of phototherapy power and temperature closed loop under the changing conditions of magnetic power supply.

Claims

1. A magnetic power supply and microcontroller temperature control system for a detachable module of menstrual period phototherapy underwear, characterized in that: It includes a magnetic power supply interface connected to a detachable phototherapy module, a data acquisition channel for acquiring the output voltage and load current of the magnetic power supply interface and the temperature of the detachable phototherapy module, a microcontroller connected to the data acquisition channel, and a phototherapy drive channel controlled by the microcontroller. The microcontroller is used to output at least two restricted detection drives to the phototherapy drive channel before and during phototherapy operation. It forms magnetic connection state characteristics based on voltage, current and temperature changes during the detection period, determines the connection reliability based on the magnetic connection state characteristics, and jointly limits the upper limit of phototherapy drive power, power change slope and temperature closed-loop adjustment amount according to the connection reliability. The microcontroller is also used to freeze the temperature closed-loop integral state during magnetic power supply disturbances, save the pre-disturbance thermal state, and generate a graded power recovery sequence based on the connection reliability and thermal state after power supply is restored.

2. The magnetic power supply and microcontroller temperature control system for the detachable module of the menstrual phototherapy underwear according to claim 1, characterized in that, The at least two restricted detection drives include a first detection segment and a second detection segment, wherein the duration of the first detection segment is shorter than that of the second detection segment, and the driving amplitude of both is lower than the current temperature closed-loop allowable power. The microcontroller extracts the power supply voltage drop, load current increment, voltage recovery time, current ripple distribution, and temperature response start time for each detection segment, and constructs a magnetic connection state vector based on the differential relationship of each characteristic quantity under the two detection drives. The microcontroller performs time-series alignment between the magnetic connection state vector and the reference state vector recorded when the current detachable phototherapy module completes stable engagement, and generates the connection reliability based on the degree of feature deviation after alignment, while eliminating the slow resistance change component caused by the temperature rise of the phototherapy load.

3. The magnetic power supply and microcontroller temperature control system for the detachable module of the menstrual phototherapy underwear according to claim 1, characterized in that, The microcontroller establishes a fast control chain for power supply status and a slow control chain for temperature status. The power supply state fast control chain takes the connection reliability, voltage recovery trend and current jump as input, and outputs the allowable power boundary and allowable power change slope. The temperature state slow control chain takes the acquired temperature, temperature change rate and temperature target as input, and generates the phototherapy driving quantity within the allowable power boundary and the allowable power change slope; The microcontroller updates the power supply state fast control chain according to a control cycle faster than the temperature sampling update cycle, and after each update, it passes the new allowable power boundary to the temperature state slow control chain. The temperature state slow control chain must not output a drive quantity exceeding the allowable power boundary.

4. The magnetic power supply and microcontroller temperature control system for the detachable module of the menstrual phototherapy underwear according to claim 1, characterized in that, After the magnetic power supply disturbance is identified, the microcontroller records the input power, acquisition temperature and temperature change rate for multiple consecutive control cycles before the disturbance occurs, and forms the residual thermal state based on the time integral of the input power, the decay trend of the temperature change rate and the duration of the disturbance. The microcontroller maintains the integral component in the temperature closed loop at the value at the time of the disturbance, and uses the residual thermal state to replace the temperature feedback missing during the interruption in the calculation of the recovery of the initial drive quantity. Once a valid temperature sample is obtained again, the microcontroller gradually releases the maintained integral component according to the deviation between the residual thermal state and the actual temperature, and restricts the direction of increase of the integral component before the deviation converges.

5. The magnetic power supply and microcontroller temperature control system for the detachable module of the menstrual phototherapy underwear according to claim 2, characterized in that, The microcontroller establishes a power-side response sequence and a load-side response sequence for the first detection segment and the second detection segment, respectively, and resamples the two types of response sequences using the detection drive start edge as a common time reference. The power supply side response sequence includes the power supply voltage drop, recovery slope, and recovery settling time; the load side response sequence includes the load current build-up slope, steady-state current deviation, and current ripple envelope. The microcontroller separates the transient component caused by the change in magnetic contact from the slowly changing component caused by the thermal drift of the phototherapy load by comparing the change direction and change rate of the two types of response sequences at the same time position, and writes only the transient component into the magnetic connection state vector.

6. The magnetic power supply and microcontroller temperature control system for the detachable module of the menstrual phototherapy underwear according to claim 3, characterized in that, The power supply status fast control chain forms a reliability decline segment, a reliability maintenance segment, and a reliability recovery segment based on the continuously updated connection reliability, and maintains mutually continuous allowable power boundaries for each segment; During the confidence decline phase, the microcontroller first reduces the allowable power change slope, and then reduces the allowable power upper limit; During the confidence preservation segment, the microcontroller maintains that the allowable power boundary does not rise with the temperature closed-loop request; During the confidence recovery phase, the microcontroller gradually relaxes the allowable power change slope and the allowable power upper limit based on the consistency between the voltage recovery trend and the current jump, and the allowable power boundary of the next control cycle is updated based on the condition that the connection confidence has not fallen back.

7. The magnetic power supply and microcontroller temperature control system for the detachable module of the menstrual phototherapy underwear according to claim 4, characterized in that, The microcontroller writes the residual thermal state into the state variable set of the temperature closed loop, and corrects the proportional component, integral component and feedforward component of the temperature closed loop according to the combination value of the residual thermal state and the current acquired temperature. When the residual thermal state is higher than the steady-state thermal state corresponding to the current acquisition temperature, the microcontroller suppresses the increase of the integral component and reduces the feedforward component. When the residual thermal state is lower than the steady-state thermal state, the microcontroller only adds a feedforward component within the upper limit of the phototherapy drive power; The synthesis result of the proportional component, the integral component, and the feedforward component is sequentially passed through the power change slope and the upper limit of the phototherapy drive power before being output to the phototherapy drive channel.

8. The magnetic power supply and microcontroller temperature control system for the detachable module of the menstrual phototherapy underwear according to claim 4, characterized in that, The microcontroller classifies magnetic power supply disturbances into transient contact disturbances, restricted power supply disturbances, and mismatched power supply disturbances based on the disturbance duration, the lowest power supply voltage during the disturbance, the voltage recovery time after power supply is restored, and the change in temperature relative to the temperature before the disturbance. For the transient contact disturbance, maintain the continuity of the residual thermal state and restore the temperature target before the disturbance; For the aforementioned power supply disturbance, the temperature target remains unchanged and the recovery drive is limited to the updated upper limit of the phototherapy drive power. For the aforementioned mismatched power supply disturbance, clear the temperature closed-loop integral state and re-execute the restricted detection drive until a new connection confidence is formed.

9. The magnetic power supply and microcontroller temperature control system for the detachable module of the menstrual phototherapy underwear according to claim 5, characterized in that, The microcontroller establishes a cross-detection segment consistency verification matrix for transient components across detection segments; The rows of the cross-detection segment consistency verification matrix correspond to the voltage and current responses in the first detection segment, and the columns correspond to the voltage and current responses in the second detection segment. The pairing relationship between each response in terms of time position, direction of change, and rate of change is also written. The magnetic connection state vector is corrected based on the remaining pairing relationships, and the connection confidence and the upper limit of the phototherapy driving power corresponding to the connection confidence are updated when the corrected magnetic connection state vector remains consistent for multiple consecutive control cycles.

10. The magnetic power supply and microcontroller temperature control system for the detachable module of the menstrual phototherapy underwear according to claim 8, characterized in that, The microcontroller establishes a recovery phase index after the power supply disturbance ends; The recovery phase index is determined by the connection reliability recovery level, the residual thermal state level, and the temperature closed-loop integral retention. The microcontroller selects the starting trajectory segment from the pre-generated continuous power trajectory set according to the recovery phase index, and determines the next trajectory segment in each control cycle based on the combination value of actual temperature and residual thermal state, the current upper limit of phototherapy driving power and the driving amount of the previous cycle. When the connection reliability decreases or the residual thermal state deviates from the steady-state thermal state corresponding to the current acquisition temperature, the microcontroller reverts to the recovery phase index and simultaneously limits the release rate of the integral component and the slope of the power change.