Intelligent control method for transcranial magnetic stimulation intensity
By using the LCC resonant converter and inverter bridge structure in the transcranial magnetic stimulation device, voltage sampling and nonlinear correction are performed, combined with filtering of historical voltage data, dynamic charging control is realized, which solves the problem that the actual stimulation intensity is difficult to match the prescription intensity, and improves the accuracy and safety of the treatment effect.
Patent Information
- Application Number
- CN202411906705.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-03-28
AI Technical Summary
Due to voltage control errors, the actual stimulation intensity of existing transcranial magnetic stimulation equipment is difficult to match the prescription intensity, resulting in unsatisfactory treatment effect.
The PWM signal is generated by the LCC resonant converter, the MOSFET of the inverter bridge is driven, voltage sampling and nonlinear correction are performed, and the historical voltage data filtering process is used to realize dynamic charging control.
Accurately control the voltage, realize linear control of stimulation intensity, and ensure the accuracy and safety of device control.
Smart Images

Figure CN119701214A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of transcranial magnetic stimulation control, and in particular to a method for intelligently controlling the intensity of transcranial magnetic stimulation. Background Art
[0002] Transcranial magnetic stimulation products are based on the principles of electromagnetic induction and electromagnetic conversion. The energy storage capacitor discharges to the stimulation coil. The magnetic field generated by the current of the stimulation coil passes through the skull or other internal tissues, inducing biocurrent in the biological tissues at the stimulation site, causing changes in the potential of internal cells or excitement or inhibition. It can stimulate the brain or peripheral nerves non-destructively and painlessly, thereby stimulating nerve cell activity and producing a series of biological effects. According to the brain function status of different patients, the intensity and frequency, stimulation site, coil direction, etc. are adjusted so that the stimulated local nerves can affect the functions of multiple parts through the connection and interaction between neural networks to treat patients. However, at present, transcranial magnetic stimulation devices are seriously affected by voltage control errors in actual applications. Due to various factors such as circuit design, component performance differences, and external environmental interference, the actual voltage output by the device often deviates from the preset target voltage. The mismatch between the actual stimulation intensity and the prescribed intensity greatly reduces the treatment effect and has limited therapeutic effect on the disease.
[0003] The existing technology is affected by voltage control errors, and the actual stimulation intensity is difficult to match the prescribed intensity, resulting in unsatisfactory device control. Summary of the invention
[0004] The present application provides a method for intelligent control of transcranial magnetic stimulation intensity, which is used to solve the problem in the prior art that the actual stimulation intensity is difficult to match the prescribed intensity due to the influence of voltage control errors, resulting in unsatisfactory device control.
[0005] In view of the above problems, the present application provides a method for intelligent control of transcranial magnetic stimulation intensity, the method comprising:
[0006] Through the LCC resonant converter, a PWM signal is generated, which is used to drive the four MOSFETs of the inverter bridge respectively; through the voltage sampling module, voltage sampling is performed when the four MOSFETs are all turned off to obtain a sampled voltage; according to the sampled voltage, a correction coefficient is matched using a binary method, and a nonlinear correction is performed on the voltage value according to the correction coefficient to obtain an actual voltage value; using historical voltage data, the actual voltage value is filtered to obtain a standard voltage value; the standard voltage value is compared with a preset expected voltage value, and dynamic charging control is performed based on the comparison result.
[0007] The second aspect of the present application provides a transcranial magnetic stimulation intensity intelligent control device, the device comprising:
[0008] A PWM signal generation module, the PWM signal generation module is used to generate a PWM signal through an LCC resonant converter, which is used to drive the four MOSFETs of the inverter bridge respectively; a sampling voltage acquisition module, the sampling voltage acquisition module is used to sample the voltage when the four MOSFETs are all turned off through a voltage sampling module to obtain a sampling voltage; an actual voltage value acquisition module, the actual voltage value acquisition module is used to match the correction coefficient using a binary method according to the sampling voltage, and perform nonlinear correction on the voltage value according to the correction coefficient to obtain the actual voltage value; a standard voltage value acquisition module, the standard voltage value acquisition module is used to filter the actual voltage value using historical voltage data to obtain a standard voltage value; a dynamic charging control module, the dynamic charging control module is used to compare the standard voltage value with a preset expected voltage value, and perform dynamic charging control based on the comparison result.
[0009] One or more technical solutions provided in this application have at least the following technical effects or advantages:
[0010] Through the LCC resonant converter, a PWM signal is generated, which is used to drive the four MOSFETs of the inverter bridge respectively; through the voltage sampling module, voltage sampling is performed to obtain a sampled voltage; according to the sampled voltage and the correction coefficient, the voltage value is nonlinearly corrected to obtain an actual voltage value; the actual voltage value is filtered to obtain a standard voltage value; the standard voltage value is compared with a preset expected voltage value, and dynamic charging control is performed based on the comparison result. The technical effect of achieving linear control of the stimulation intensity by accurately controlling the voltage and ensuring the accuracy and safety of the device control is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in 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 only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0012] Figure 1 A schematic diagram of a flow chart of a method for intelligently controlling the intensity of transcranial magnetic stimulation provided in an embodiment of the present application;
[0013] Figure 2 A schematic diagram of a voltage value nonlinear correction process of a method for intelligent control of transcranial magnetic stimulation intensity provided in an embodiment of the present application;
[0014] Figure 3 This is a schematic diagram of the structure of a transcranial magnetic stimulation intensity intelligent control device provided in an embodiment of the present application.
[0015] Explanation of the reference numerals: PWM signal generating module 10 , sampling voltage acquiring module 20 , actual voltage value acquiring module 30 , standard voltage value acquiring module 40 , dynamic charging control module 50 . DETAILED DESCRIPTION
[0016] The present application provides a method for intelligent control of transcranial magnetic stimulation intensity, which is used to solve the problem in the prior art that the actual stimulation intensity is difficult to match the prescribed intensity due to the influence of voltage control errors, resulting in unsatisfactory device control.
[0017] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0018] Embodiment 1, as Figure 1 As shown, the present application provides a method for intelligent control of transcranial magnetic stimulation intensity, the method comprising:
[0019] Step S100: Generate PWM signals through the LCC resonant converter, which are used to drive four MOSFETs of the inverter bridge respectively.
[0020] Specifically, a PWM signal is generated by an LCC resonant converter, which is used to drive the four MOSFETs of the inverter bridge. In this step, the working principle of the LCC (inductor-capacitor-inductor) resonant converter is first used to control its circuit to generate two PWM (pulse width modulation) signals. The two PWM signals are used to drive the four MOSFET switching devices in the inverter bridge to achieve efficient conversion and control of electric energy. The inverter bridge is a common topology in power electronic equipment. By switching four MOSFETs, direct current is converted into alternating current, or electrical signals of different voltages and frequencies are output by modulation. The OC1 and OC2 channels of the timer TIM1 output a PWM signal respectively. In order to avoid the two PWM signals appearing at the same time at a high level, thereby causing a short circuit of the MOSFET, an appropriate dead time is introduced in the design. The dead time is a delay time that ensures that the two MOSFETs are not turned on at the same time. The delay control can effectively prevent the risk of MOSFET short circuit and ensure safety and stability. The generated PWM signal controls the switching state of the MOSFET in the inverter bridge, thereby adjusting the working voltage and current of the transcranial magnetic stimulation device, providing a basis for subsequent voltage sampling and dynamic control. This step not only ensures the safe operation of the circuit, but also lays a solid foundation for subsequent precise voltage control.
[0021] Step S200: using a voltage sampling module to perform voltage sampling when the four MOSFETs are all turned off, to obtain a sampled voltage.
[0022] Specifically, in this step, the voltage sampling module is used to detect and obtain the real-time voltage value in the system. In order to ensure the accuracy of sampling, the voltage sampling is carried out when all four MOSFETs of the inverter bridge are turned off. This design takes into account that when the MOSFET is turned off, the voltage is more stable, and the influence of switching noise and transient current is small, so as to avoid interference problems in the voltage sampling process. The ADC (analog-to-digital converter) module is triggered by the timer TIM8 to perform voltage sampling at the moment when the MOSFET is turned off. This design can effectively ensure the accuracy of the sampled voltage, making the subsequent voltage control and correction more reliable. The voltage sampling value at this time is considered to be a true reflection of the current state of the system and is not affected by the fluctuations caused by the instantaneous switching operation. Through this precise voltage sampling step, the device can accurately obtain the current voltage value and provide a reliable data basis for subsequent nonlinear correction and dynamic control. This step plays a vital role in the entire system, because high-precision sampling is the key to realizing intelligent control.
[0023] Step S300: According to the sampled voltage, a correction coefficient is matched using a binary method, and a nonlinear correction is performed on the voltage value according to the correction coefficient to obtain an actual voltage value.
[0024] Specifically, in this step, by processing the sampled voltage, the corresponding correction coefficient is quickly matched using the binary method, and the sampled voltage is nonlinearly corrected to obtain a more accurate actual voltage value. The core of this process is to determine the current voltage situation based on the voltage value collected by the ADC (analog-to-digital converter). However, the relationship between the sampled voltage value and the actual voltage value is not linear, but presents a nonlinear curve, so the voltage range cannot be simply processed in segments. In order to effectively handle this nonlinear relationship, the voltage range from 0V to 2000V is divided into multiple intervals, with a step of 20V between each adjacent voltage value, and a correction coefficient is defined for each voltage interval. These correction coefficients are stored in an array of size 100, called g_coefficient
[100] . When sampling the voltage, the sampled voltage value (g_voltage) is matched with the voltage interval in the array by the binary method to find the closest voltage coefficient. Next, the sampled voltage value is multiplied by the corresponding correction coefficient to obtain the current actual voltage value. This method can ensure that high-precision voltage readings are obtained in real-time operation, and further control and adjustment can be performed based on the actual voltage value. The use of the dichotomy method greatly improves the speed and efficiency of voltage correction, allowing precise control of voltage at high frequencies to ensure that the intensity of transcranial magnetic stimulation achieves the desired therapeutic effect. This step plays a vital role in the real-time and accuracy of the entire system.
[0025] Step S400: Utilizing historical voltage data, filtering the actual voltage value to obtain a standard voltage value.
[0026] Specifically, in this step, in order to ensure the accuracy of voltage sampling, the historical voltage data is processed using a filtering algorithm to eliminate interference signals such as spikes and noise that may occur during the charging process. These interference signals will affect the accurate judgment of the voltage, resulting in an error between the actual voltage value and the expected value. Therefore, the accuracy of voltage sampling can be improved through filtering processing to ensure that each sampling value is within a reasonable error range. Each collected voltage value is stored in an array variable g_voltage_last of size 20 in sequence. g_voltage_last
[19] in the array represents the voltage value collected at the earliest moment, and g_voltage_last[0] represents the voltage value collected at the latest moment. Whenever a new voltage value is collected, the data in the g_voltage_last array will be shifted back in sequence, the latest voltage value is stored in g_voltage_last[0], and the earliest voltage value g_voltage_last
[19] will be removed. In this way, a dynamically updated voltage sampling history is maintained to ensure that the latest sampling data is always in the array. Next, two key variables are calculated based on the data in the array: g_new_voltage and g_old_voltage. g_new_voltage represents the average value of the most recent 10 sampling values in the array (g_voltage_last[0] to g_voltage_last[9]), and g_old_voltage represents the average value of the earlier 10 sampling values in the array (g_voltage_last
[10] to g_voltage_last
[19] ). The variable expect_voltage represents the preset target voltage value. In order to determine whether the expected charging voltage has been reached, g_new_voltage is compared with expect_voltage. If g_new_voltage is greater than or equal to expect_voltage, and the difference between expect_voltage and g_old_voltage is less than 10, it indicates that the charging process has reached the preset voltage value, and charging will be stopped and the drive signal output will be turned off. This filtering process ensures that interference signals are eliminated in real time, a stable standard voltage value is obtained, and precise charging control is achieved.
[0027] Step S500: Compare the standard voltage value with a preset expected voltage value, and perform dynamic charging control based on the comparison result.
[0028] Specifically, in this step, the standard voltage value processed by the filtering algorithm is compared with the preset expected voltage value to determine whether to continue charging or make dynamic adjustments. This process is a key step in achieving precise charging control, ensuring that the system can make intelligent decisions based on the voltage conditions collected in real time to avoid overcharging or undercharging. First, obtain the current standard voltage value (obtained by the previous filtering step S400) and the preset expected voltage value (expect_voltage). Compare these two values. If the standard voltage value is greater than or equal to the expected voltage value, and the difference between the current standard voltage value and the previous historical voltage value is less than the set threshold (such as 10V), it is judged that the current charging has reached the expected target, indicating that charging is complete, and the drive signal output is turned off, thereby stopping the charging process. If the standard voltage value does not reach the expected charging voltage, the charging process will continue to be dynamically adjusted. During the adjustment process, the charging voltage will be gradually increased or decreased by adjusting the duty cycle of the PWM signal to ensure that the voltage value gradually approaches the set expected value. By adjusting the charging current in real time, precise charging control is achieved and the voltage is ensured to be stable within the expected range. The core of this dynamic charging control process is to intelligently respond to voltage changes through real-time voltage feedback, and dynamically adjust the charging process according to the voltage change trend to ensure the safety and effectiveness of the charging process, thereby achieving the best transcranial magnetic stimulation effect. This step ensures that the ideal voltage range can always be maintained during operation, thereby ensuring the stability of the equipment and the safety of the user.
[0029] In a possible manner, step S100 further includes:
[0030] Step S110: the PWM signal is generated by a timer, the timer includes an OC1 channel and an OC2 channel, each channel outputs a PWM signal, four MOSFETs of the inverter bridge are driven respectively by the two PWM signals, and a dead time is configured between the two PWM signals.
[0031] Specifically, two PWM (pulse width modulation) signals are generated by the timer, which are used to control the four MOSFET switch devices in the inverter bridge. The two channels OC1 and OC2 of the timer TIM1 output one PWM signal respectively. The OC1 channel and the OC2 channel operate independently to ensure that each PWM signal can accurately control the conduction and shutdown of the corresponding MOSFET switch. The two PWM signals are used to control the upper half bridge and the lower half bridge of the inverter bridge respectively, so as to achieve accurate regulation of current and voltage. In order to avoid the two PWM signals appearing at a high level at the same time (that is, the two MOSFETs are turned on at the same time), an appropriate dead time is configured between the two PWM signals. The dead time is a delay between the switching of the PWM signals to ensure that the upper and lower MOSFETs will not be turned on at the same time, thereby preventing the occurrence of short circuit. This setting is crucial for the safe operation of the inverter bridge, because if the two MOSFETs are turned on at the same time, the current may be directly short-circuited, causing equipment damage or safety hazards. Through this design, the precise control of the PWM signal is ensured, while the safe operation of the MOSFET is guaranteed to the maximum extent, and the misleading turn-on phenomenon caused by high-frequency switching is avoided. This step provides a stable and reliable electrical foundation for the subsequent voltage control and sampling process, ensuring high efficiency and safety during operation.
[0032] In one possible approach, Figure 2 As shown, step S300 also includes:
[0033] Step S310: Divide the sampled voltage into multiple intervals, and use a binary search method to match the voltage intervals in the correction coefficient table to obtain a voltage interval matching result.
[0034] Step S320: Obtain a correction coefficient according to the voltage interval matching result.
[0035] Step S330: multiplying the sampled voltage by the correction coefficient to obtain an actual voltage value.
[0036] Specifically, in this step, the collected sampled voltage is first divided into multiple intervals in order to process the voltage value more accurately. Since the relationship between the sampled voltage and the actual voltage is nonlinear, the entire voltage range is divided into several intervals from 0V to 2000V, and the step value of each interval is 20V. Each interval corresponds to a correction coefficient, which is used to correct the voltage value in the interval. In this way, the voltage value is divided into multiple small intervals that are easy to handle, ensuring that the correction process of each interval is more refined and accurate. In order to improve the matching efficiency, the binary search method is used to find the voltage interval that best matches the sampled voltage in the correction coefficient table. The binary search method is an efficient search algorithm that can quickly find close values in a large range of data. By continuously halving the search range, the interval where the sampled voltage is located can be quickly located. In this process, the voltage intervals in the correction coefficient table will be checked in turn until the interval closest to the current sampled voltage is found. Through this method of multi-segment interval division and binary matching, the interval in which the sampling voltage is located can be determined quickly and accurately, and the corresponding correction coefficient can be obtained. This step ensures the efficiency and accuracy of the system when dealing with nonlinear voltage relationships, thereby providing a solid foundation for subsequent voltage correction and control.
[0037] According to the voltage interval matched by the dichotomy method, the correction coefficient corresponding to the interval is accurately obtained. Each voltage interval is pre-associated with a correction coefficient, which is used to correct the nonlinear relationship between the sampled voltage and the actual voltage. The voltage interval is divided into several step intervals from 0V to 2000V, and the voltage step of each interval is 20V. In each step interval, the relationship between the actual value of the sampled voltage and the sampled value is not linear, so a specific correction coefficient is required for conversion. After determining the interval to which the sampled voltage belongs, the correction coefficient corresponding to the interval is directly extracted from the correction coefficient table. This correction coefficient is calibrated through multiple experiments and set according to the hardware characteristics of the device. Through this process, it is ensured that in different voltage ranges, the sampled voltage can be converted to a voltage closer to the actual value through an appropriate correction coefficient, which greatly improves the accuracy and reliability of voltage measurement. This provides important support for subsequent dynamic charging control and precise operation of the equipment.
[0038] Multiply the correction coefficient obtained in the previous step by the sampled voltage to accurately calculate the current actual voltage value. Since the relationship between the sampled voltage and the actual voltage is nonlinear, there will be errors when directly using the sampled voltage for judgment, so correction through the correction coefficient is a key step. After sampling the voltage value, use the binary method to quickly locate the voltage interval to which the sampled voltage belongs, and obtain the correction coefficient corresponding to the interval. Next, multiply the sampled voltage value (g_voltage) by the correction coefficient to obtain a more accurate actual voltage value. This process is the key to nonlinear correction of the sampled data. For example, assuming that the current sampled voltage is 26V, and the matching voltage interval correction coefficient is 0.400, perform the following calculation: 26*0.400, and the result is the current actual voltage value. For a specific example, taking the sampling of low voltage as an example, assume that the voltage parameter data is shown in Table 1 below:
[0039]
[0040] At a certain moment, the voltage value sampled by the ADC is 26V. After comparing the standard value closest to 20V by binary search, the coefficient corresponding to the voltage of 20V is 0.400, so 26*0.400 is the real voltage value. Through this calculation process, the error caused by the nonlinear change of voltage can be effectively corrected, so that the deviation between the sampled voltage and the actual voltage is minimized. This correction step ensures that in different voltage ranges, whether it is low voltage or high voltage, the sampled voltage can be converted into a voltage close to the actual value by adjusting the correction coefficient. Ultimately, this step ensures that the system can obtain accurate voltage readings during operation, thereby supporting subsequent voltage control and charging management, and improving the reliability and safety of the equipment.
[0041] In a possible manner, step S310 further includes:
[0042] Step S311: Divide the total voltage interval into multiple correction intervals and establish a correction coefficient table.
[0043] Step S312: using a binary search method to match the sampled voltage with a plurality of correction intervals in the correction coefficient table to obtain the voltage interval matching result.
[0044] Specifically, the entire voltage range is divided into multiple correction intervals, and a correction coefficient is assigned to each interval. The voltage range from 0V to 2000V is divided into several small intervals, and the step of each interval is usually 20V. The correction coefficient of each interval is used to correct the nonlinear relationship between the sampled voltage and the actual voltage. To this end, it is necessary to establish a table containing multiple correction coefficients through multiple experimental measurements and calibrations, that is, a correction coefficient table, which associates different voltage intervals with corresponding correction coefficients. Each interval has a unique correction coefficient, which can reflect the actual change law of the voltage within the interval. In this way, when processing the sampled voltage, the corresponding correction coefficient can be quickly found and applied to ensure the accuracy of the voltage value. As a specific example, taking the sampled voltage as an example, it is assumed that the voltage parameter data are shown in Table 2 below:
[0045] Standard voltage 800 820 840 860 880 900 920 Correction factor 1.129 1.140 1.142 1.143 1.145 1.147 1.163 Sampling voltage 807 825 842 852 871 908 925 Actual voltage 807*1.129 825*1.140 842*1.142 852*1.143 871*1.145 908*1.147 925*1.163
[0046] The sampled voltage is matched with the voltage interval in the correction coefficient table by binary division to quickly determine the correction interval corresponding to the sampled voltage. The binary division method is an efficient search algorithm, which is particularly suitable for processing large amounts of data. By gradually narrowing the search range, the target interval can be quickly located. The correction coefficient table contains multiple voltage intervals, each of which corresponds to a correction coefficient. After the voltage value is collected, the voltage interval of the correction coefficient table is first divided into two parts, and then the sampled voltage value is checked in which part. For example, if the sampled voltage is between 0V and 2000V, it will first determine whether it falls between 0V and 1000V or 1000V to 2000V. After determining that it falls in a certain part, the part will continue to be divided into two again, such as 1000V to 1500V or 1500V to 2000V, and so on, until the specific interval where the sampled voltage is located is accurately found. The advantage of this binary division method is that with each division, the search range will be reduced by half, and finally the correction interval where the sampled voltage is located can be quickly locked. After reaching the matching interval, the correction coefficient corresponding to the interval can be obtained, and preparation can be made for the subsequent voltage correction. Matching the voltage interval by binary division not only improves the matching efficiency, but also ensures a fast response to the voltage data collected in real time, thereby ensuring the accuracy and timeliness of voltage control.
[0047] In a possible manner, step S400 further includes:
[0048] Step S410: Record each sampled voltage value to form a historical sampled voltage data array.
[0049] Step S420: sorting the data in the historical sampled voltage data array, calculating the average value, removing the interfering voltage spikes and clutter signals, and obtaining the standard voltage value.
[0050] Specifically, each collected voltage value is recorded in real time, and these sampled data are stored in a historical sampled voltage data array in chronological order. The array is used to store the voltage sampling results over a period of time and is usually composed of a fixed number of storage units, such as 20 positions. Whenever a new voltage value is collected, the value is stored in the first position of the array (i.e., g_voltage_last[0]), and each voltage value in the original array is moved back one position in turn, and the earliest collected voltage value is removed from the array. Through this circular storage method, the voltage data is dynamically updated to ensure that the array always contains the latest sampled value. This design tracks the trend of voltage changes over a period of time and provides reliable historical data support for subsequent filtering and analysis steps. The historical sampled voltage data array can not only reflect the instantaneous state of the voltage, but also help identify abnormal conditions in voltage changes, such as sudden voltage spikes or interference signals. This historical voltage recording mechanism ensures that the voltage sampling data can be effectively managed during real-time operation and provides a basic guarantee for subsequent voltage judgment and control.
[0051] The voltage values in the array of historical sampled voltage data are processed to eliminate interference caused by voltage spikes or clutter signals and ensure that the acquired voltage values are accurate and stable. First, the voltage values in the array are sorted and the collected voltage values are arranged in order from small to large. This sorting process helps to identify and exclude abnormal voltage data (such as extremely high or extremely low spike values) caused by external interference or noise. Once the sorting is completed, the average value of the valid voltage data after excluding the abnormal values is calculated. The calculated average value can reflect the voltage stability level over a period of time and is called the standard voltage value. Compared with a single sampled voltage, this standard voltage value can more truly reflect the actual voltage state of the system because it eliminates the influence of instantaneous voltage fluctuations and clutter interference. Through this filtering process, not only can the accuracy of voltage measurement be improved, but also the voltage judgment can be ensured to be reliable in the presence of electromagnetic interference or other adverse conditions. This standard voltage value will play a key role in subsequent voltage control, ensuring that charging or discharging operations can be carried out under stable voltage conditions, thereby improving the safety and efficiency of the equipment.
[0052] In a possible manner, step S500 further includes:
[0053] Step S510: the most recently sampled standard voltage value is stored in the first position of the historical sampled voltage data array, and the other voltage values in the array are shifted back in sequence, with the earliest voltage value being stored in the last position.
[0054] Step S520: taking the average of the voltage values of the most recent N samplings in the historical sampling voltage data array as the new voltage value, and taking the average of the earlier N voltage values as the old voltage value.
[0055] Step S530: When the new voltage value is greater than or equal to the preset expected voltage value, and the difference between the new voltage value and the old voltage value is less than the preset difference, it is determined that charging is completed and charging is stopped.
[0056] Specifically, the latest sampled standard voltage value will first be stored in the first position of the historical sampled voltage data array. This operation is based on the consideration of data timeliness and importance. The latest data often better reflects the actual operating status of the current system. Putting it in the first place helps to quickly obtain the most critical information in the subsequent analysis process. Next, in order to ensure the orderliness and integrity of the array, other voltage values in the array need to be moved back in sequence. This process is an orderly sequential adjustment process. For example, the voltage value originally located in the first position will be moved to the second position, and the space it occupies will be replaced by new data. The voltage value at the second position will be moved to the third position, and so on. This sequential shifting method ensures that the relative position of each data in the array has changed reasonably, and no data will be lost, and the new data can be smoothly integrated into the array structure. Finally, the earliest voltage value will be stored in the last position. This makes the historical sampled voltage data array present a time series integrity, starting from the latest data and arranging in sequence to the earliest data. Through this processing method, the entire array is like a timeline that records the history of system voltage changes, providing a comprehensive and orderly data basis for various subsequent analyses and judgments based on these data. For example, this ordered array of historical sampled voltage data will play an indispensable role in the subsequent calculation of average values to evaluate the overall operating status of the system, or in judging whether the charging process is normal by comparing data at different time points.
[0057] For the array of historical sampled voltage data, a specific time period range is determined to calculate the mean value. Here, the voltage values of the most recent N samples in the array are selected for processing. The voltage values of these N samples are regarded as a set of data that can reflect the system voltage status in the current relatively recent time period. By summing the voltage values of these N samples and dividing them by N, the result is the new voltage value. This new voltage value represents an average level of the recent system voltage, which is of great significance for judging the current voltage status and comparing with other reference values. At the same time, attention will also be paid to the voltage values of the earlier N samples, which are relative to the most recent N samples mentioned above. Similarly, the voltage values of these earlier N samples are summed and divided by N, and the result is the old voltage value, which reflects the average voltage situation in a relatively earlier time period. By calculating the new voltage value and the old voltage value respectively, the voltage situation in different time periods is quantified and compared. This comparison helps to understand the trend of voltage change over time, and provides an important basis for subsequent judgment of whether charging is completed and whether corresponding adjustments are needed.
[0058] After the new voltage value and the old voltage value are calculated through the previous steps, the new voltage value will be compared with the preset expected voltage value, and the difference between the new voltage value and the old voltage value will be considered. If the new voltage value is greater than or equal to the preset expected voltage value, this indicates that the current voltage has reached or exceeded the expected target value. However, satisfying this condition alone is not enough to determine that charging is complete, and the difference between the new voltage value and the old voltage value needs to be further examined. When the difference between the new voltage value and the old voltage value is less than the preset difference, it means that the voltage change is very small and is in a relatively stable state, which means that the expected voltage level has been reached, and there has been no large fluctuation in the voltage in the near future, and the charging process has achieved the expected effect relatively stably. Only when these two conditions are met at the same time, that is, the new voltage value is greater than or equal to the preset expected voltage value, and the difference between the new voltage value and the old voltage value is less than the preset difference, will the charging be determined to be complete. Once it is determined that charging is complete, the charging operation will be stopped to avoid overcharging from causing adverse effects on the device or treatment process, ensuring that the intensity of transcranial magnetic stimulation is controlled within an appropriate range, and ensuring the effectiveness and safety of the treatment.
[0059] In a possible manner, step S100 further includes:
[0060] Step S120: adjusting the duty cycle of the PWM signal in real time to gradually adjust the charging voltage.
[0061] Step S130: When the charging voltage reaches a preset expected value, the controller gradually reduces the duty cycle of the PWM signal to reduce the charging current.
[0062] Specifically, in the process of intelligent control of transcranial magnetic stimulation intensity, the charging voltage is gradually adjusted by adjusting the duty cycle of the PWM signal in real time. The duty cycle of a PWM signal, i.e. a pulse width modulation signal, refers to the ratio of the duration of a high level to the duration of the entire cycle in a pulse cycle, and this ratio directly affects the average output voltage. In actual operation, when the charging voltage needs to be increased, the duty cycle of the PWM signal is increased in real time. For example, if the initial duty cycle is 20%, the duty cycle is gradually increased to 25%, 30% or even higher according to the gap between the current voltage and the preset expected value. As the duty cycle increases, the duration of the high level becomes longer in a pulse cycle, which increases the average output voltage accordingly, thereby achieving a gradual increase in the charging voltage. On the contrary, when the charging voltage needs to be reduced, the duty cycle of the PWM signal is reduced in real time. For example, it is gradually reduced from 30% to 25%, 20%, etc. At this time, the duration of the high level becomes shorter in the pulse cycle, and the average output voltage decreases accordingly. By adjusting the PWM signal duty cycle in real time, the charging voltage can be flexibly and accurately controlled according to the actual needs of the charging process, so that it gradually approaches the preset expected value, laying the foundation for subsequent charging control and accurate control of the transcranial magnetic stimulation intensity.
[0063] When the charging voltage reaches the preset expected value through the previous adjustment mechanism, it means that the charging process has approached or reached the ideal voltage level. However, in order to avoid overcharging and control the charging current, the controller will immediately start the corresponding control strategy. At this time, the controller begins to gradually reduce the duty cycle of the PWM signal. The duty cycle of the PWM signal directly determines the average voltage and current of the output. As the duty cycle gradually decreases, the duration of the high level becomes shorter in a pulse cycle, resulting in a gradual decrease in the average voltage of the output, thereby reducing the charging current accordingly. For example, if the duty cycle of the PWM signal is 50% when the charging voltage reaches the preset expected value, the controller will gradually reduce it to 45%, 40%, etc. In this way, the charging current will gradually decrease from a higher value, avoiding damage to the device caused by excessive charging current, and at the same time ensuring that the charging process can stabilize in a suitable state after reaching the preset expected value, ensuring the accuracy and safety of transcranial magnetic stimulation intensity control. This precise control of the charging current is an important guarantee for the effective and safe implementation of transcranial magnetic stimulation.
[0064] Embodiment 2, based on the same inventive concept as the method for intelligently controlling the intensity of transcranial magnetic stimulation in the above embodiment, Figure 3 As shown, the present application provides a transcranial magnetic stimulation intensity intelligent control device, and the device and method embodiments in the present application embodiments are based on the same inventive concept. The device includes:
[0065] The PWM signal generating module 10 is used to generate a PWM signal through an LCC resonant converter, and is used to drive four MOSFETs of the inverter bridge respectively.
[0066] The sampling voltage acquisition module 20 is used to perform voltage sampling when the four MOSFETs are all turned off through the voltage sampling module to obtain a sampling voltage.
[0067] The actual voltage value acquisition module 30 is used to match the correction coefficient using the binary method according to the sampled voltage, and perform nonlinear correction on the voltage value according to the correction coefficient to obtain the actual voltage value.
[0068] The standard voltage value acquisition module 40 is used to filter the actual voltage value using historical voltage data to acquire a standard voltage value.
[0069] The dynamic charging control module 50 is used to compare the standard voltage value with a preset expected voltage value, and perform dynamic charging control based on the comparison result.
[0070] Furthermore, the PWM signal generating module 10 further includes:
[0071] A dead time configuration unit, wherein the PWM signal is generated by a timer, wherein the timer includes an OC1 channel and an OC2 channel, each channel outputs a PWM signal, and the four MOSFETs of the inverter bridge are driven respectively by the two PWM signals, and the dead time is configured between the two PWM signals.
[0072] Furthermore, the actual voltage value acquisition module 30 also includes:
[0073] A voltage interval matching result acquisition unit is used to divide the sampled voltage into multiple intervals, and use a binary method to match the voltage intervals in the correction coefficient table to obtain a voltage interval matching result.
[0074] A correction coefficient acquisition unit is used to acquire a correction coefficient according to the voltage interval matching result.
[0075] An actual voltage value acquisition unit is used to multiply the sampled voltage by a correction coefficient to obtain an actual voltage value.
[0076] Furthermore, the voltage interval matching result acquisition unit further includes:
[0077] The correction coefficient table establishing unit is used to divide the total voltage interval into a plurality of correction intervals and establish a correction coefficient table.
[0078] A voltage interval matching unit is used to match the sampled voltage with a plurality of correction intervals in the correction coefficient table by using a binary method to obtain the voltage interval matching result.
[0079] Furthermore, the standard voltage value acquisition module 40 also includes:
[0080] The historical sampling voltage data array forming unit is used to record the voltage value sampled each time to form a historical sampling voltage data array.
[0081] The interference voltage removal unit is used to sort the data in the historical sampling voltage data array, calculate the average value, remove the interference voltage spikes and clutter signals, and obtain the standard voltage value.
[0082] Furthermore, the dynamic charging control module 50 further includes:
[0083] The standard voltage value storage unit is used to store the latest sampled standard voltage value in the first position of the historical sampled voltage data array, and the other voltage values in the array are shifted back in sequence, and the earliest voltage value is stored in the last position.
[0084] A voltage value mean sampling unit is used to use the mean of the voltage values of the most recent N samplings in the historical sampling voltage data array as the new voltage value and use the mean of the earlier N voltage values as the old voltage value.
[0085] A charging completion judgment unit is used to judge that charging is completed and stop charging when the new voltage value is greater than or equal to a preset expected voltage value and the difference between the new voltage value and the old voltage value is less than a preset difference.
[0086] Furthermore, the PWM signal generating module 10 further includes:
[0087] The duty cycle adjustment unit is used to adjust the duty cycle of the PWM signal in real time to gradually adjust the charging voltage.
[0088] The charging current reducing unit is used for the controller to gradually reduce the duty cycle of the PWM signal to reduce the charging current when the charging voltage reaches a preset expected value.
[0089] It should be noted that the above-mentioned sequence of the embodiments of the present application is only for description and does not represent the advantages and disadvantages of the embodiments. And the above-mentioned specific embodiments of this specification are described. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0090] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
[0091] This specification and the drawings are merely exemplary illustrations of the present application and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, a person skilled in the art may make various modifications and variations to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the present application and its equivalents, the present application intends to include these modifications and variations.
Claims
1. A method for intelligent control of transcranial magnetic stimulation intensity, characterized in that: The method comprises: Through the LCC resonant converter, a PWM signal is generated to drive the four MOSFETs of the inverter bridge respectively; By means of a voltage sampling module, voltage sampling is performed when the four MOSFETs are all turned off to obtain a sampled voltage; According to the sampled voltage, a correction coefficient is matched using a binary method, and a voltage value is nonlinearly corrected according to the correction coefficient to obtain an actual voltage value; Using historical voltage data, filtering the actual voltage value to obtain a standard voltage value; The standard voltage value is compared with a preset expected voltage value, and dynamic charging control is performed based on the comparison result.
2. A method for intelligent control of transcranial magnetic stimulation intensity as claimed in claim 1, characterized in that: The PWM signal is generated by a timer, which includes an OC1 channel and an OC2 channel. Each channel outputs a PWM signal. The four MOSFETs of the inverter bridge are driven respectively by the two PWM signals, and a dead time is configured between the two PWM signals.
3. The method for intelligent control of transcranial magnetic stimulation intensity according to claim 1, characterized in that: Using a binary method to match the correction coefficient, and performing nonlinear correction on the voltage value according to the correction coefficient, including: Divide the sampled voltage into multiple intervals, and use a binary search method to match the voltage intervals in the correction coefficient table to obtain a voltage interval matching result; Obtaining a correction coefficient according to the voltage interval matching result; The sampled voltage is multiplied by the correction coefficient to obtain an actual voltage value.
4. A method for intelligent control of transcranial magnetic stimulation intensity as claimed in claim 3, characterized in that: The sampled voltage is divided into multiple intervals, and matched with the voltage intervals in the correction coefficient table using a binary method to obtain a voltage interval matching result, including: Divide the total voltage interval into multiple correction intervals and establish a correction coefficient table; The sampled voltage is matched with a plurality of correction intervals of the correction coefficient table using a binary search method to obtain the voltage interval matching result.
5. The method for intelligently controlling the intensity of transcranial magnetic stimulation according to claim 1, characterized in that: The actual voltage value is filtered using historical voltage data to obtain a standard voltage value, including: Record the voltage value of each sample to form a historical sampled voltage data array; The data in the historical sampled voltage data array are sorted, and the average value is calculated to remove the interfering voltage spikes and clutter signals to obtain the standard voltage value.
6. A method for intelligent control of transcranial magnetic stimulation intensity as claimed in claim 5, characterized in that: The standard voltage value is compared with a preset expected voltage value, and dynamic charging control is performed based on the comparison result, including: The most recently sampled standard voltage value is stored in the first position of the historical sampled voltage data array, and the other voltage values in the array are shifted back in sequence, with the earliest voltage value being stored in the last position; The average of the voltage values of the most recent N samplings in the historical sampling voltage data array is used as the new voltage value, and the average of the earlier N voltage values is used as the old voltage value; When the new voltage value is greater than or equal to the preset expected voltage value, and the difference between the new voltage value and the old voltage value is less than the preset difference, it is determined that charging is completed and charging is stopped.
7. The method for intelligently controlling the intensity of transcranial magnetic stimulation according to claim 1, characterized in that: The method further comprises: Adjust the duty cycle of the PWM signal in real time to gradually adjust the charging voltage; When the charging voltage reaches a preset expected value, the controller gradually reduces the duty cycle of the PWM signal to reduce the charging current.
8. A transcranial magnetic stimulation intensity intelligent control device, characterized in that: The device comprises: A PWM signal generation module, wherein the PWM signal generation module is used to generate a PWM signal through an LCC resonant converter, and is used to drive four MOSFETs of an inverter bridge respectively; A sampling voltage acquisition module, wherein the sampling voltage acquisition module is used to perform voltage sampling when the four MOSFETs are all turned off through the voltage sampling module to obtain a sampling voltage; An actual voltage value acquisition module, the actual voltage value acquisition module is used to match the correction coefficient using a binary method according to the sampled voltage, and perform nonlinear correction on the voltage value according to the correction coefficient to obtain the actual voltage value; A standard voltage value acquisition module, wherein the standard voltage value acquisition module is used to filter the actual voltage value using historical voltage data to acquire a standard voltage value; A dynamic charging control module is used to compare the standard voltage value with a preset expected voltage value, and perform dynamic charging control based on the comparison result.