A transcranial magnetic robotic flexible fitting method and system

By constructing a double-layer dielectric mechanical model and utilizing micro-vibration detection signals, a close fit between the coil and the scalp was achieved, solving the problem of magnetic field attenuation caused by the hair layer and ensuring the therapeutic effect of transcranial magnetic stimulation.

CN121623156BActive Publication Date: 2026-04-21CHONGQING UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHONGQING UNIV
Filing Date
2026-02-05
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In existing transcranial magnetic stimulation (TMS) techniques, the presence of the hair layer creates a hidden physical gap between the coil and the scalp, leading to a decrease in magnetic field strength and affecting the consistency and controllability of treatment effects.

Method used

A dual-layer dielectric mechanical model is constructed. By superimposing micro-vibration detection signals into a composite feed motion, the contact stiffness is calculated in real time, the boundary between the hair layer and the scalp layer is identified, and active retraction and constant force maintenance are performed to ensure a tight fit between the coil and the scalp.

Benefits of technology

This allows for the magnetic field energy to act on the brain target point without attenuation, without damaging the scalp, thus improving the accuracy and consistency of treatment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121623156B_ABST
    Figure CN121623156B_ABST
Patent Text Reader

Abstract

This invention relates to the field of medical robotics technology and discloses a transcranial magnetic stimulation (TMS) robot flexible contact method and system. The method includes: constructing a dual-layer medium mechanical model comprising a nonlinear weak stiffness model of the hair layer and a high stiffness step model of the scalp layer, and determining the force change slope threshold and configuring micro-vibration detection signal parameters; controlling the robotic arm to perform a composite feed motion superimposed with micro-vibration detection signals to generate real-time contact stiffness, and combining the force change slope threshold and the dual-layer medium mechanical model to determine the contact state in real time; when the scalp layer contact state is determined, immediately responding by executing a stop feed and reverse retraction action, and switching to a constant force holding control mode to dynamically adjust the end effector position; this invention enables the robotic arm to accurately distinguish between the hair layer and the scalp layer during the feed process, effectively penetrate the hair layer to achieve a tight fit between the coil and the scalp, eliminate magnetic field dose attenuation caused by soft medium gaps, and improve the consistency and safety of treatment effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical robotics, and more specifically, to a transcranial magnetic stimulation robot flexible fitting method and system. Background Technology

[0002] Transcranial magnetic stimulation (TMS), as a non-invasive neuromodulation technique, has been widely used in the treatment of neuropsychiatric disorders. Its therapeutic effect is highly dependent on the precise fit between the stimulation coil and the target area on the patient's head. With the development of medical robotics technology, the use of robotic arms to assist or automate coil positioning has become an industry trend. This not only reduces the operational burden on medical personnel but also significantly improves the accuracy of repetitive positioning and the standardization of treatment procedures.

[0003] Currently, various control schemes have been proposed in the industry to optimize the positioning and adhesion of coils. For example, Chinese patent CN108187230B discloses a transcranial magnetic stimulation (TMS) navigation and positioning robot system and positioning method. This system uses an infrared locator to track a positioning reference frame installed on the patient's head in real time. By reading the patient's image data and performing registration, it controls the robotic arm to place the coil in the predetermined position and adjusts the coil position according to the patient's real-time movement to solve the problem of area deviation caused by patient movement. In addition, Chinese patent application CN120420609A discloses a control method and device for a transcranial magnetic stimulation robot. This method monitors the pressure value at the end of the robotic arm. Once a non-zero pressure is detected, the control strategy is adjusted according to the relationship between the pressure and a preset threshold to ensure that the stimulation beat does not deviate from the target point and adheres closely to the patient's area to be adhered to, thereby improving the treatment experience.

[0004] However, while existing technologies have made some progress in spatial navigation and contact force maintenance, their commonly used single force threshold feedback mechanism has certain logical blind spots when facing the complex physical environment of the head. In actual clinical scenarios, the patient's head is usually covered with a loose layer of hair of varying thickness. This porous fibrous structure exhibits nonlinear, weak stiffness characteristics. When the robotic arm carrying the coil approaches the head, the force sensor often detects a contact force reaching a preset threshold as soon as it contacts the hair surface and generates slight compression. Based on this, the system mistakenly judges it as "in place" and stops feeding. This "false contact" causes the coil to actually float above the scalp. Due to the obstruction of the hair layer, there is still a certain implicit physical distance (i.e., a soft medium gap) between the coil and the actual scalp. Given that the magnetic field strength decays according to the inverse square law of distance, this gap caused by the hair will cause the stimulation intensity actually acting on the target point in the brain to decay exponentially. Therefore, even if the robotic system provides accurate positioning and pressure, the actual magnetic field dose received by the patient is severely insufficient if the robot fails to physically penetrate the hair layer and establish rigid contact with the scalp. This directly leads to treatment failure and inconsistencies in clinical data. Summary of the Invention

[0005] To overcome the aforementioned deficiencies of existing technologies, this invention provides a transcranial magnetic stimulation (TMS) robot flexible bonding method and system. By constructing a dual-layer medium mechanical model that distinguishes between the hair layer and the scalp layer, and utilizing a composite feed motion with superimposed micro-vibration detection signals to calculate contact stiffness in real time, the robotic arm can accurately identify the boundary between soft and hard media. This approach can guide the coil to safely "penetrate" the fluffy hair layer and perform active retraction and constant force maintenance upon contact with the scalp, completely eliminating the gaps in the soft medium without damaging the scalp, and ensuring that the magnetic field energy acts on the brain target point without attenuation.

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

[0007] A transcranial magnetic stimulation robot flexible fitting method includes:

[0008] A two-layer medium mechanics model was constructed, which included a nonlinear weak stiffness model of the hair layer and a high stiffness step model of the scalp layer. The force change slope threshold was determined, and the parameters of the micro-vibration detection signal were configured.

[0009] The robotic arm end effector is controlled to perform a composite feed motion superimposed with micro-vibration detection signals. The end effector force feedback waveform and axial displacement data are collected. Real-time contact stiffness is generated based on the end effector force feedback waveform and axial displacement data. The real-time contact stiffness is compared with the force change slope threshold and combined with a two-layer medium mechanical model to determine the contact state. The contact state includes hair layer contact state and scalp layer contact state.

[0010] In response to the scalp contact state, the robot executes a stop feed command and reverse retraction action, switches to constant force holding control mode, dynamically adjusts the position of the end of the robotic arm in constant force holding control mode, maintains the effective contact state between the coil and the scalp, and outputs a contact completion signal.

[0011] The nonlinear weak stiffness model of the hair layer and the high stiffness step model of the scalp layer characterize different mechanical response features;

[0012] The mechanical response characteristics represented by the nonlinear weak stiffness model of the hair layer are described by three judgment conditions: hair stiffness numerical condition, stiffness trend condition, and stiffness fluctuation condition.

[0013] The mechanical response characteristics represented by the high-stiffness step model of the scalp layer are described by three judgment conditions: numerical condition of scalp stiffness, abrupt stiffness change condition, and stiffness stability condition.

[0014] The method for obtaining the real-time contact stiffness includes:

[0015] Force and displacement components corresponding to the micro-vibration detection frequency are extracted from the end force feedback waveform and axial displacement data. The force change per unit displacement is calculated based on the force and displacement components as the real-time contact stiffness.

[0016] The method for determining the contact state of the scalp layer includes:

[0017] The time series of real-time contact stiffness is plotted as a stiffness variation curve, and stiffness variation characteristics are extracted from the stiffness variation curve.

[0018] When the real-time contact stiffness changes abruptly and N2 consecutive sampling points are greater than or equal to the force change slope threshold, and the stiffness change characteristics conform to the mechanical response characteristics characterized by the scalp high stiffness step model, the current contact state is determined to be the scalp contact state, where N2 is the number of consecutive sampling points.

[0019] When the contact state is determined to be hair layer contact state, the compound feed motion continues.

[0020] The back-off distance performed by the reverse back-off action is greater than or equal to the additional push-in depth; the additional push-in depth is determined by the system response delay.

[0021] The method for dynamically adjusting the position of the robotic arm's end effector includes:

[0022] Set a target constant force value at the end of the robotic arm. In constant force holding control mode, continuously collect the contact force feedback from the end, compare it with the target constant force value, calculate the force deviation, and dynamically adjust the position of the end of the robotic arm according to the force deviation.

[0023] The method for determining the effective fit is as follows:

[0024] Set an upper limit threshold and a lower limit threshold for force fluctuation. When the contact force at the current sampling time is within the range of the lower limit threshold to the upper limit threshold for force fluctuation, it is determined that the current sampling time is in an effective contact state.

[0025] The output condition of the bonding signal is as follows: the sampling time of continuous effective bonding is accumulated, and the bonding signal is output when the continuous accumulation time of effective bonding reaches the preset time.

[0026] A transcranial magnetic stimulation (TMS) robot flexible fitting system is provided for implementing the aforementioned TMS robot flexible fitting method. The system includes:

[0027] Model building module: used to build a two-layer medium mechanics model that includes a nonlinear weak stiffness model of the hair layer and a high stiffness step model of the scalp layer, determine the force change slope threshold, and configure the parameters of the micro-vibration detection signal;

[0028] Contact determination module: used to control the end effector of the robotic arm to perform a composite feed motion superimposed with micro-vibration detection signals, collect end effector force feedback waveform and axial displacement data, generate real-time contact stiffness based on end effector force feedback waveform and axial displacement data, compare the real-time contact stiffness with the force change slope threshold and combine it with a two-layer medium mechanical model to determine the contact state; the contact state includes hair layer contact state and scalp layer contact state;

[0029] Adhesion control module: In response to the scalp contact state, executes stop feed command and reverse retraction action, switches to constant force holding control mode, dynamically adjusts the position of the end of the robotic arm in constant force holding control mode, maintains the effective adhesion state between the coil and the scalp, and outputs a adhesion in place signal.

[0030] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0031] This invention transforms traditional static contact force detection into active detection of the dynamic stiffness characteristics of the medium by constructing a dual-layer medium mechanical model and executing a composite feed motion with superimposed micro-vibration detection signals. Utilizing the significant mechanical response difference between the nonlinear weak stiffness of the hair layer and the high stiffness step of the scalp layer, it achieves accurate identification of "virtual contact" of the hair layer and "real contact" of the scalp layer during the feed process. This avoids the soft medium gaps caused by the robotic arm misjudging and stopping when only contacting the hair surface due to the fluffy hair. Combined with a reverse retraction action responding to the scalp layer contact state and a constant force holding control mode, the system can eliminate overshoot pressure caused by system delay by actively retracting the coil the moment the actual scalp boundary is identified. Through dynamic position adjustment under constant force control, it continuously maintains a close contact between the coil and the scalp. This ensures that the treatment coil physically penetrates the hair layer and effectively conforms to the curved surface of the skull while guaranteeing patient safety and comfort, thus ensuring the attenuated transmission of transcranial magnetic stimulation magnetic field energy to brain tissue and the true accuracy of the treatment dose. Attached Figure Description

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

[0033] Figure 1 This is a flowchart of a transcranial magnetic stimulation robot flexible fitting method provided in an embodiment of the present invention;

[0034] Figure 2 This is a comparative schematic diagram of the soft dielectric void problem provided in the embodiments of the present invention;

[0035] Figure 3 A flowchart of scalp layer contact state response control provided in an embodiment of the present invention;

[0036] Figure 4 This is a schematic diagram of the reverse rollback action provided in an embodiment of the present invention;

[0037] Figure 5 This is a functional block diagram of a transcranial magnetic robotic flexible fitting system provided in an embodiment of the present invention. Detailed Implementation

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

[0039] Example 1

[0040] Please see Figure 1 As shown, this embodiment provides a transcranial magnetic stimulation robot flexible fitting method, including:

[0041] Step S10: Construct a two-layer medium mechanics model that includes a nonlinear weak stiffness model of the hair layer and a high stiffness step model of the scalp layer, determine the force change slope threshold, and configure the parameters of the micro-vibration detection signal.

[0042] Specifically, the core of step S10 lies in providing mechanical judgment criteria, detection excitation parameters, and safety constraints for subsequent contact state identification and flexible fit control. In the context of transcranial magnetic stimulation therapy, see [link to relevant documentation]. Figure 2 , Figure 2 This illustration shows a comparison of the soft medium void problem. The treatment coil needs to be in close contact with the patient's scalp to ensure that the magnetic field energy can effectively penetrate the skull and act on the target brain region. However, the surface of the patient's head is generally covered with hair of varying thickness. When the robotic arm carrying the treatment coil approaches the patient's head, the force feedback sensor installed at the end of the robotic arm will detect a contact force signal when it comes into contact with the fluffy hair surface, such as... Figure 2 The traditional method shown, based on a single force threshold contact determination strategy, may mistakenly identify the hair surface as an effective contact surface and terminate the feeding action. This causes the treatment coil to actually float above the hair layer, forming a soft medium gap filled by the hair layer between the treatment coil and the actual scalp layer. This results in a corresponding decrease in the magnetic field dose. According to the inverse square law of magnetic field strength attenuation with distance, this soft medium gap will significantly reduce the effective magnetic field dose acting on the brain tissue, seriously affecting the consistency and controllability of the treatment effect.

[0043] In order to achieve Figure 2In this scheme, the treatment coil penetrates the hair layer and fits tightly against the scalp layer. Step S10 constructs a dual-layer medium mechanical model to abstractly model the physical characteristics of the contact area on the patient's head. The hair layer is modeled as a nonlinear, weakly stiff medium, while the scalp layer is modeled as a high-stiffness, step-like medium. The significant differences in the mechanical response characteristics of the two media form the physical basis for subsequent contact state identification. The parameter configuration of the micro-vibration detection signal provides an excitation source for actively detecting the stiffness characteristics of the medium. By superimposing tiny axial vibrations of specific frequency and amplitude at the end of the robotic arm, a dynamic mechanical response at the contact interface is excited. Compared to passive static pressure detection, active micro-vibration detection can more sensitively capture subtle changes in medium stiffness. The determination of the force change slope threshold provides a quantitative criterion for distinguishing the contact state between the hair layer and the scalp layer.

[0044] Further, step S10 includes:

[0045] Step S11: The contact area of ​​the patient's head is abstracted into a two-layer medium structure containing a hair layer and a scalp layer. A nonlinear weak stiffness model of the hair layer and a high stiffness step model of the scalp layer are established to characterize the mechanical properties of the hair layer. The nonlinear weak stiffness model of the hair layer and the high stiffness step model of the scalp layer are combined to construct a two-layer medium mechanical model. The nonlinear weak stiffness model of the hair layer and the high stiffness step model of the scalp layer characterize different mechanical response features.

[0046] In real-world treatment scenarios, as the treatment coil gradually approaches and eventually contacts the scalp from a position far from the patient's head, the robotic arm's end effector sequentially contacts the air layer, the hair layer, and the scalp layer. The air layer does not generate contact force feedback, while the hair layer and scalp layer exhibit distinctly different mechanical response characteristics. By abstracting the patient's head contact area as a two-layered structure, with the outer layer defined as the hair layer and the inner layer as the scalp layer, this abstraction ignores the complex microstructure of the hair layer and focuses on its macroscopic mechanical properties. This allows the mechanical modeling to maintain physical validity while also possessing engineering feasibility.

[0047] The establishment of a nonlinear weak stiffness model for hair layers is based on the physical characteristics of hair as a soft fibrous aggregate. The diameter of a single hair is typically on the order of micrometers, possessing a certain degree of bending stiffness. However, when a large number of hairs are aggregated in a fluffy state, numerous air-filled pore spaces exist between them. When an external force is applied to the surface of the hair layer, the initial deformation is mainly manifested as the bending of the hair fibers and the closure of the pore spaces. At this stage, the contact resistance increases slowly with increasing indentation depth, and the rate of increase in resistance, i.e., the stiffness value, is relatively small. As the indentation depth continues to increase, the bending degree of the hair fibers increases, the pore spaces gradually close, and the rate of increase in contact resistance exhibits a certain degree of nonlinear change, but overall it remains at a low stiffness level. This mechanical response characteristic is abstracted into a nonlinear weak stiffness model, mathematically represented as: during the process of the robotic arm's end effector pressing into the hair layer, the end effector contact force F... hair The relationship between the force and the axial displacement x satisfies the derivative dF of the force as a function of the displacement. hair The derivative, characterized by its small value and random fluctuations, represents the hair layer stiffness value as described by the nonlinear weak stiffness model of the hair layer. The distribution range of the hair layer stiffness value is defined as the hair layer stiffness distribution interval Z. hair Interval Z hair The lower limit is denoted as K. hair,min Interval Z hair The upper limit is denoted as K. hair,max Hair layer stiffness eigenvalue K hair Defined as interval Z hair The midpoint value, i.e., K hair =(K hair,min +K hair,max ) / 2. The mechanical response characteristics represented by the nonlinear weak stiffness model of the hair layer are described by the following three judgment conditions: The first condition is the numerical condition of hair stiffness, which requires the real-time contact stiffness K to satisfy K hair,min ≤K≤K hair,max The second condition is a stiffness trend condition, which requires that the absolute value of the rate of change of the mean stiffness of adjacent sliding windows be less than a preset trend threshold R. trend The third condition is the stiffness fluctuation condition, which requires the standard deviation σ of the stiffness values ​​within the sliding window. K Greater than the preset lower limit threshold σ hair,min The three judgment conditions mentioned above are based on the physical characteristics of the hair layer as a nonlinear, weakly stiff medium: the first condition ensures that the stiffness value is within the typical stiffness range of the hair layer, distinguishing it from the zero stiffness of the air layer and the high stiffness of the scalp layer; the second condition utilizes the relatively smooth and non-abrupt stiffness change during hair layer compression, distinguishing it from the step response of the scalp layer at the moment of contact; the third condition utilizes the random fluctuation characteristics of stiffness caused by the uneven fiber distribution and porous structure of the hair layer, distinguishing it from the relatively uniform and stable mechanical response of the scalp layer. The threshold parameter K involved in the above judgment conditions...hair,min K hair,max R trend and σ hair,min The length of the sliding window is determined through the offline calibration test described in step S13. The length of the sliding window is set to cover the number of sampling points corresponding to M micro-vibration detection cycles, where M typically ranges from 2 to 5. For example, when the sampling frequency f... sample 50Hz, micro-vibration detection frequency f dither At 5Hz, a single micro-vibration cycle contains 10 sampling points, and the sliding window length can be set to 20 to 50 sampling points; the step size of the sliding window is set to 1 sampling point, so that the window slides forward one step in each sampling cycle to achieve continuous feature calculation. The real-time contact stiffness K is obtained in step S23.

[0048] The high-stiffness step model of the scalp is based on the anatomical structure of the scalp tissue covering the surface of the skull. The scalp consists of multiple layers of soft tissue, including skin, subcutaneous connective tissue, and periosteum, and is adjacent to the rigid skeletal structure of the skull. Although the soft tissue of the scalp itself has a certain elastic deformation capacity, the elastic modulus of the skull is much higher than that of the soft tissue. When an external force penetrates the hair layer and first contacts the scalp surface and continues to apply pressure, the scalp soft tissue undergoes slight compression deformation in the initial stage. Subsequently, the deformation is rapidly transmitted to the skull surface. Due to the high stiffness of the skull, the continued application of pressure cannot produce significant displacement, which manifests as a sudden surge in contact resistance within a very short displacement range. This mechanical response characteristic is abstracted into a high-stiffness step model, and its mathematical representation is: at the instant the end effector contacts the scalp layer, the end contact force F... scalp The relationship between the force and the axial displacement x satisfies the derivative dF of the force as a function of the displacement. scalp / dx exhibits a steep peak characteristic, the appearance of which is similar to a step response in signal processing. The derivative represents the scalp stiffness value as characterized by the high-stiffness step model of the scalp. The distribution range of the scalp stiffness value is defined as the scalp stiffness distribution interval Z. scalp Interval Z scalp The lower limit is denoted as K. scalp,min Interval Z scalp The upper limit is denoted as K. scalp,max Scalp stiffness eigenvalue K scalp Defined as interval Z scalp The midpoint value, i.e., K scalp =(K scalp,min +K scalp,max ) / 2, K scalp The value is significantly greater than the hair layer stiffness eigenvalue K. hair The mechanical response characteristics represented by the high-stiffness step model of the scalp layer are described by the following three judgment conditions: The first condition is the numerical condition of scalp stiffness, which requires that the real-time contact stiffness K satisfies K≥K scalp,minThe second condition is the stiffness abrupt change condition, which requires that the stiffness difference ΔK between adjacent sampling points be greater than or equal to the preset abrupt change threshold K. jump The third condition is the stiffness stability condition, which requires that the real-time contact stiffness K exceeds the force change slope threshold K. th Within the sampling interval consisting of N2 consecutive sampling points, the standard deviation σ of the stiffness values K Less than the preset stability upper limit threshold σ scalp,max N2 is the number of continuous sampling points, and its specific value range is determined in step S24. The above three judgment conditions are based on the physical characteristics of the scalp layer as a high-stiffness step medium: the first condition sets only a lower limit and not an upper limit because the scalp layer is adjacent to the rigid skull, and its stiffness is much higher than that of the hair layer, with a theoretical upper limit that may reach a large value. Constraining only the lower limit is sufficient to effectively distinguish the scalp layer from the hair layer, avoiding misjudgment due to an improperly set upper limit; the second condition utilizes the characteristic of a drastic change in stiffness at the boundary between the hair layer and the scalp layer. This step response is a hallmark feature of scalp layer contact, distinguishing it from the slow, gradual change in stiffness during hair layer compression; the third condition utilizes the characteristic of the scalp layer exhibiting a stable mechanical response due to its relatively uniform tissue structure and its proximity to the rigid skull, distinguishing it from the random fluctuations in stiffness during hair layer contact and the spike pulse interference caused by local hard points such as hair nodules. The threshold parameter K involved in the above judgment conditions... scalp,min K jump and σ scalp,max Determined through the offline calibration test described in step S13.

[0049] The dual-layer medium mechanics model is constructed by combining a nonlinear weak-stiffness model of the hair layer with a high-stiffness step model of the scalp layer, forming a complete mechanical description framework for the contact process. Within this framework, the complete feeding process of the robotic arm end effector from contact with the hair layer surface to contact with the scalp layer surface is divided into two consecutive mechanical response stages: the hair layer compression stage and the scalp layer contact stage. The hair layer compression stage corresponds to the contact stiffness continuously being within the hair layer stiffness distribution range Z. hair The state that satisfies the three judgment conditions represented by the nonlinear weak stiffness model of the hair layer, the scalp contact stage corresponds to the abrupt change in contact stiffness to the scalp stiffness distribution interval Z. scalpThe state that satisfies the three judgment conditions represented by the high stiffness step model of the scalp layer. The establishment of the two-layer medium mechanics model changes the subsequent contact state identification from judging the absolute value of the contact force to identifying the characteristics of contact stiffness variation. The significance of this change is that the absolute value of the contact force is affected by many factors such as hair layer thickness, fluffiness, and feed speed. Different patients and even different head areas of the same patient may produce significantly different contact force readings, making it difficult for a single force threshold to adapt to all situations. On the other hand, the stiffness variation characteristics reflect the physical properties of the medium itself. The order of magnitude difference in stiffness between the hair layer and the scalp layer is determined by their material properties and has strong stability and universality. Therefore, using stiffness characteristics as the identification basis can significantly improve the reliability and adaptability of contact state judgment.

[0050] Step S12: Set the parameters of the micro-vibration detection signal at the end of the robotic arm. The parameters of the micro-vibration detection signal include the micro-vibration detection frequency and the micro-vibration detection amplitude. At the same time, configure the sampling frequency of the force feedback sensor according to the micro-vibration detection frequency.

[0051] Micro-vibration detection signals refer to minute axial reciprocating vibration signals superimposed on the macroscopic feed motion of a robotic arm's end effector. Their mechanism lies in actively detecting the dynamic stiffness response of the contact interface through periodic, minute displacement excitation, transforming the stiffness information implicit in the static contact force into a measurable dynamic force change waveform, thus achieving real-time sensing of the mechanical properties of the contact medium. The micro-vibration detection frequency f... dither The setting of the micro-vibration detection frequency needs to comprehensively consider three factors: dynamic response sensitivity, human perception threshold, and system control bandwidth. From the perspective of dynamic response sensitivity, the micro-vibration detection frequency needs to be higher than the characteristic frequency of the robotic arm's macroscopic feed motion, so that the force changes caused by micro-vibrations can be separated from the force changes generated by macroscopic feed, forming an independent and identifiable signal component. From the perspective of human perception threshold, human skin's perception of mechanical vibration is frequency-dependent; when the vibration frequency is within a certain range, the skin's perception sensitivity is high. The micro-vibration detection frequency setting needs to avoid the high-sensitivity frequency band of human skin to prevent discomfort to the patient during treatment. From the perspective of system control bandwidth, the micro-vibration detection frequency needs to be lower than the upper limit of the robotic arm's servo control system bandwidth to ensure that the robotic arm can accurately execute micro-vibration motion commands without response distortion. Considering the above factors, the micro-vibration detection frequency f... dither The typical value range is between 1 / 10 and 1 / 5 of the robotic arm's servo control bandwidth. For example, when the robotic arm's servo control bandwidth is 50Hz, the micro-vibration detection frequency f... dither It can be set to around 5Hz. This frequency can ensure the effective separation of micro-vibration signals and macro-feed motion, while it is in a frequency band that is relatively insensitive to human skin perception, and it is also within the range of the robotic arm's servo control capability.

[0052] Micro-vibration detection amplitude A dither The setup needs to balance both stiffness sensing accuracy and patient comfort. From a stiffness sensing accuracy perspective, the micro-vibration detection amplitude needs to be greater than the sum of the displacement resolution of the force feedback sensor and the positioning accuracy of the robotic arm's end effector. This ensures that the micro-vibration motion produces a real displacement change that can be detected by the sensor, thereby triggering a measurable force change. From a patient comfort perspective, the micro-vibration detection amplitude needs to be controlled within a range below or slightly above the human perception threshold. When the micro-vibration amplitude is too large, the patient may feel slight vibrations in their head, causing discomfort or tension, affecting the treatment experience, and even leading to active head movement that interferes with positioning accuracy. Micro-vibration detection amplitude A dither The typical value range is between 10 and 50 times the displacement resolution of the force feedback sensor. For example, when the displacement resolution of the force feedback sensor is 0.01 mm, the micro-vibration detection amplitude A... dither It can be set to about 0.1mm, which is sufficient to generate a detectable stiffness response signal. At the same time, its energy is mainly absorbed by the viscoelasticity of the hair layer and scalp layer, and will not cause overall displacement of the patient's head or produce obvious vibration perception.

[0053] The sampling frequency f of the force feedback sensor sample The configuration needs to meet the requirements of the Nyquist sampling theorem to ensure complete capture of the force change waveform during micro-vibration detection. According to the Nyquist sampling theorem, the sampling frequency needs to be greater than twice the highest frequency component of the sampled signal; otherwise, aliasing will occur, leading to signal distortion. During micro-vibration detection, the main frequency component of the force feedback waveform is the micro-vibration detection frequency f. dither And its harmonic components, considering that the nonlinear characteristics of the actual contact interface may excite higher harmonics, the sampling frequency f of the force feedback sensor. sample It needs to be set to the micro-vibration detection frequency f dither More than 10 times higher, to fully capture the detailed features of the force change waveform and provide sufficient data density for subsequent signal filtering and stiffness calculations. For example, when the micro-vibration detection frequency f dither When set to 5Hz, the sampling frequency f of the force feedback sensor sample It should be set to 50Hz or higher. The standard sampling mode of the force feedback sensor can be used, or the sampling frequency can be configured by software as needed.

[0054] The micro-vibration detection signal parameters and sampling frequency configured in step S12 directly determine the excitation characteristics during the compound feed motion in subsequent step S21 and the data quality when acquiring the force feedback waveform in step S22. A micro-vibration detection frequency that is too low will result in an excessively long detection cycle, failing to respond promptly to rapid changes in the contact state, potentially leading to continued feeding after scalp contact and causing overpressure. A micro-vibration detection frequency that is too high will exceed the servo control bandwidth of the robotic arm, causing the actual motion trajectory to deviate from the commanded trajectory, distorting the micro-vibration signal, and failing to elicit an effective stiffness response. A micro-vibration detection amplitude that is too small will cause the force change signal to be submerged in sensor noise, making it impossible to extract effective stiffness information. A micro-vibration detection amplitude that is too large will cause discomfort to the patient, and may even cause the patient's head to move evasively, disrupting the established positioning and registration relationship. Insufficient sampling frequency of the force feedback sensor will cause aliasing and distortion of the force change waveform, resulting in a deviation between the real-time contact stiffness calculated in step S23 and the actual stiffness, thus affecting the accuracy of the contact state determination in step S24.

[0055] The parameter configuration in step S12 provides the excitation signal source and data acquisition guarantee for the contact state identification in step S20. The micro-vibration detection signal, as an active excitation method, transforms the passive detection mode, which originally relied on the absolute value of the contact force for judgment, into an active detection mode that relies on changes in contact stiffness for identification. In the passive detection mode, the force feedback sensor can only detect the magnitude of the static contact force. However, the static contact force is affected by multiple factors such as the contact area, contact angle, and the degree of hair fluffiness. Under different conditions, the same static contact force may correspond to two completely different states: hair layer contact or scalp layer contact, leading to ambiguity in the judgment results. In the active detection mode, the dynamic force response excited by the micro-vibration signal directly reflects the stiffness characteristics of the contact interface. Stiffness, as an inherent property of materials, has high consistency under the same medium conditions. The significant difference in stiffness between the hair layer and the scalp layer allows the two contact states to be reliably distinguished, eliminating the ambiguity in the judgment under the passive detection mode. Through the high-frequency micro-amplitude micro-vibration detection signal configured in step S12, the robotic arm end effector continuously performs micro-stiffness detection during the macro-feeding process. Each micro-vibration cycle is equivalent to a stiffness sampling of the medium in front, enabling the system to immediately sense changes in the contact state, providing time margin for the real-time judgment in step S24 and the timely response in step S30. The dual-layer medium mechanics model established in steps S12 and S11 forms a correspondence between requirements and implementation. The dual-layer medium mechanics model defines the difference in stiffness characteristics between the hair layer and the scalp layer, and the design goal of the micro-vibration detection signal is to excite and capture this stiffness difference. The selection of the micro-vibration detection frequency needs to ensure that the excited force response can fully reflect the stiffness characteristics of different media, the selection of the micro-vibration detection amplitude needs to produce a sufficiently significant stiffness contrast while ensuring safety and comfort, and the configuration of the sampling frequency needs to ensure complete recording of the details of stiffness changes. This correspondence between requirements and implementation ensures that the parameters configured in step S12 can effectively serve the contact state identification task within the framework of the dual-layer medium mechanics model, rather than being isolated parameter settings detached from the application scenario.

[0056] Step S13: Determine the force change slope threshold based on the two-layer medium mechanics model, and set the maximum allowable feed depth and target constant force value at the end of the robotic arm.

[0057] Force change slope threshold K th The determination of this threshold needs to be based on a two-layer medium mechanical model. This threshold is a quantitative criterion for distinguishing the contact state between the hair layer and the scalp layer. In the two-layer medium mechanical model, the hair layer stiffness distribution range Z... hair Scalp stiffness distribution range Z scalp There is a significant numerical difference between them, due to the interval Z. hair The upper limit K hair,max Less than the interval Z scalp The lower limit K scalp,minA non-overlapping dividing zone is formed between the two intervals. Force change slope threshold K th It needs to be set within this dividing zone, that is, set at K. hair,max With K scalp,min Within the range between K, the contact stiffness is lower than K. th This can be determined to be a hair-layer contact state, with a contact stiffness higher than K. th This can be determined as a scalp-layer contact state. Force change slope threshold K th Specific values ​​can be obtained through offline calibration experiments. The calibration experiment is conducted as follows: Several representative volunteers are selected, covering different hair types such as straight, curly, fine, and coarse hair, as well as varying hair thicknesses. Under safe and controlled conditions, a force feedback sensor is used to measure the contact stiffness of the volunteers' heads. During the measurement, the sensor is controlled to press into the hair layer at a constant low speed and penetrate to the scalp layer. The force feedback waveform and displacement data during the pressing process are recorded simultaneously. The instantaneous stiffness value at each displacement point is calculated based on the ratio of the force component to the displacement component. Statistical analysis is performed on the collected stiffness data to extract the distribution range of the stiffness value during the hair layer compression stage and determine the interval Z. hair The lower limit K hair,min With upper limit K hair,max Extract the distribution range of stiffness values ​​in the scalp contact phase and determine the interval Z. scalp The lower limit K scalp,min With upper limit K scalp,max Force change slope threshold K th Set as interval Z hair Upper limit value K hair,max With interval Z scalp Lower limit value K scalp,min The values ​​between these two values ​​can be taken as their arithmetic or geometric mean to obtain a better classification margin. Simultaneously, a trend threshold R is determined based on the calibration data. trend Fluctuation lower limit threshold σ hair,min Mutation threshold K jump and the stability upper limit threshold σ scalp,max The specific values, including the trend threshold R trend The lower limit threshold σ is set as the 95th percentile of the statistical value of the rate of change of stiffness during the hair layer compression stage. hair,min The mutation threshold K is set to the 5th percentile of the standard deviation of stiffness during the hair layer compression stage. jump Set as the threshold K for the slope of force change th The stability upper limit threshold σ is between 0.2 and 0.5 times that of the previous value. scalp,max K was set as the 95th percentile of the standard deviation of stiffness during the scalp contact phase. K was determined using statistical data from multiple volunteers. th It has a certain degree of universality and can adapt to the individual differences of different patients.

[0058] Maximum permissible feed depth D max The settings are based on considerations of the possible range of hair layer thickness in patients. When performing a feeding motion that penetrates the hair layer, the system needs to preset an upper limit for the feeding depth as a safety protection boundary. When the cumulative feeding depth exceeds this upper limit and no scalp layer contact is detected, the system determines that an abnormality may exist and triggers the feeding over-limit protection, pausing the feeding motion to prevent accidental injury. Maximum allowable feeding depth D max The value needs to be greater than the maximum hair layer thickness observed in clinical statistics, while being less than the distance margin that might cause interference between the robotic arm and other parts of the patient, such as the face and ears. Maximum allowable feed depth D max The typical value range is between 1.5 and 2 times the statistical maximum hair layer thickness. This setting provides sufficient feed margin for penetrating thicker hair layers while preventing safety risks in case of feed runaway through reasonable depth limits.

[0059] Target constant force value F target The settings serve the constant force maintenance control stage after effective adhesion is achieved in step S32. Once the system determines that it has contacted the scalp layer and performs a retraction action to release the overshoot pressure, the robotic arm needs to be switched to the constant force maintenance control mode, ensuring the treatment coil adheres to the scalp surface with a constant contact force. Target constant force value F target Two constraints need to be met: firstly, the force must be greater than the minimum force F required to maintain stable coil contact. min This ensures the coil won't lose contact due to vibration or slight movements by the patient; on the other hand, the force value F must be less than the upper limit that would cause the patient pain or discomfort. pain This ensures comfort during the treatment process. For example, the target constant force value F... target Can be set to F min With F pain The weighted average, i.e., F target =α×F min +(1-α)×F pain Where α is a weighting coefficient, and the value of α ranges from 0.6 to 0.8. This setting ensures that the target constant force value is at the minimum contact force F. min With pain threshold F pain The contact force is minimized to improve patient comfort while ensuring stable coil contact.

[0060] The three parameters determined in step S13 form a direct input-output relationship with the functional execution of steps S20 and S30. Force change slope threshold K th In step S24, the contact stiffness is referenced as a decision criterion and is related to K. thThe comparison result determines the system's output judgment on the current contact state; the maximum permissible feed depth D max In step S22, it is monitored as a safety limit, and the cumulative feed depth is related to D. max The comparison result determines whether to trigger the feed over-limit protection; the target constant force value F target In step S32, it is set as the force control target, and the force feedback is related to F. target The deviation drives the constant force holding controller to adjust the position of the robotic arm's end effector. If K th Setting it too high may cause the hair layer to be misidentified as the scalp layer, prematurely stopping the feed. If K th Setting it too low may cause overpressure as the feed continues even after the scalp has made contact; if D max If the setting is too small, patients with thick hair may not be able to complete the application. If D max If F is set too large, the safety boundary constraints become ineffective; if F target If the setting is too low, the fit will be unstable. target Setting the temperature too high can cause discomfort to the patient.

[0061] Step S10 establishes a two-layer medium mechanics model, including a nonlinear weak stiffness model of the hair layer and a high stiffness step model of the scalp layer. This abstracts the complex head contact environment into a physical structure with significant stiffness differences, providing a clear theoretical basis for distinguishing between "virtual contact" (hair) and "real contact" (scalp). Addressing the shortcomings of traditional single force threshold determination, which is prone to misjudgment due to interference from fluffy hair, the formation of "soft medium gaps," and severe attenuation of magnetic field effectiveness, this step transforms passive static force detection into active dynamic stiffness detection by configuring the parameters and sampling frequency of a high-frequency, low-amplitude micro-vibration detection signal. By using micro-vibration excitation to stimulate the dynamic response of the medium, it can keenly capture the stiffness abrupt change from soft hair to hard scalp, resolving the ambiguity of static force signals. Based on this, a standardized quantitative judgment boundary was set according to the "force change slope threshold" determined by the model characteristics. This allows the system to automatically adapt to individual differences in hair quality and thickness. While penetrating the hair layer, it can immediately identify and respond to the slope step upon contact with the scalp, eliminating reliance on human experience and preventing inertial overshoot. Combined with the setting of safety constraints such as the maximum permissible feed depth and the target constant force value, step S10 ensures that the treatment coil can physically penetrate the hair layer to guarantee the true magnetic field dose, while constructing a tight safety boundary to prevent overpressure injury and equipment malfunction. Ultimately, this provides a solid guarantee for the consistency of treatment efficacy, standardized operation, and patient comfort throughout the entire treatment process.

[0062] Step S20: Control the end of the robotic arm to perform a composite feed motion with superimposed micro-vibration detection signals, collect the end force feedback waveform and axial displacement data, generate real-time contact stiffness based on the end force feedback waveform and axial displacement data, compare the real-time contact stiffness with the force change slope threshold, and combine it with the double-layer medium mechanical model to determine the contact state.

[0063] Specifically, step S20 applies the dual-layer media mechanics model and configured micro-vibration detection parameters to the actual robotic arm feeding process. Through a closed-loop control process of real-time acquisition, calculation, and judgment, the type of media layer currently in which the robotic arm end is located is accurately identified, providing accurate state input for the response control in the subsequent step S30. In transcranial magnetic stimulation (TMS) therapy, the traditional robotic arm approach strategy uses constant-speed feeding combined with a single force threshold detection. When the contact force detected by the force feedback sensor reaches the preset threshold, it is determined that contact has been completed and feeding is terminated. However, due to the fluffy nature of the patient's hair layer, the contact force generated when the robotic arm end contacts the hair surface may have reached or even exceeded the preset threshold, causing the system to misjudge that it has contacted the scalp and terminate feeding prematurely. The treatment coil is actually suspended above the hair layer, forming a soft media gap. According to the inverse square law of magnetic field strength attenuation with distance, this gap leads to a significant reduction in the effective magnetic field dose acting on the brain tissue. Step S20 involves superimposing micro-vibration detection signals into macro-feed motion to form composite feed motion. Micro-vibration excitation is used to actively detect the dynamic stiffness response of the contact interface. The collected force feedback waveform and displacement data are jointly processed to generate real-time contact stiffness, which is then compared with the force change slope threshold determined in step S10. The contact state is determined by combining the stiffness characteristics of the dual-layer medium mechanical model, thereby achieving reliable differentiation between the hair layer and the scalp layer.

[0064] In the comparison between real-time contact stiffness and the force change slope threshold, the two-layer medium mechanics model serves as a reference standard for classification and a feature matching template. Real-time contact stiffness K and K... th Numerical comparisons can only determine the level of stiffness, and are insufficient to confirm the reliability of the contact state. The nonlinear weak-stiffness model of the hair layer and the high-stiffness step model of the scalp layer, defined in the dual-layer medium mechanics model, describe the complete mechanical response characteristics of the two media, including the absolute level of stiffness, the temporal trend of stiffness changes, and the stochastic characteristics of stiffness fluctuations, among other multi-dimensional information. During the comparison process, the system verifies and matches the calculated real-time contact stiffness and its variation characteristics against the three judgment conditions defined in the two models of the dual-layer medium mechanics model. By providing a structured feature description framework, the dual-layer medium mechanics model upgrades simple threshold comparisons to multi-dimensional feature matching judgments, effectively filtering out instantaneous abnormal fluctuations in stiffness caused by hair nodules, fiber slippage, or sensor noise, preventing false positives or false negatives, and improving the reliability and robustness of contact state identification.

[0065] Further, step S20 includes:

[0066] Step S21: Control the end effector of the robotic arm to move towards the target point of the patient's head at a preset feed speed, and superimpose the configured micro-vibration detection signal onto the axial movement command of the end effector of the robotic arm to form a compound feed motion.

[0067] Step S21 involves kinematically superimposing the micro-vibration detection signal configured in step S10 with the macroscopic feed motion of the robotic arm to form a composite feed motion that combines proximity and detection functions. The preset feed speed v... feed The determination of the feed rate needs to comprehensively consider three factors: detection accuracy, safe response time, and treatment efficiency. From the perspective of detection accuracy, the feed rate needs to be sufficiently low to ensure that the system has enough sampling points to detect sudden changes in stiffness at the moment the robotic arm penetrates from the hair layer to the scalp layer. If the feed rate is too high, it may cross the boundary between the hair layer and the scalp layer within a single sampling cycle, missing the detection of the sudden change. From the perspective of safe response time, the feed rate needs to match the system's control cycle, communication latency, and robotic arm braking performance to ensure that the feed can stop before overpressure occurs after detecting contact with the scalp layer. From the perspective of treatment efficiency, the feed rate should not be too low; otherwise, the excessive time spent penetrating the hair layer will affect the compactness of the treatment process. The preset feed rate v... feed The typical range of values ​​is the micro-vibration detection amplitude A. dither With the micro-vibration detection frequency f dither Between 1 / 10 and 1 / 5 of the product.

[0068] The compound feed motion is achieved by superimposing micro-vibration detection signals onto the axial motion command at the end effector of the robotic arm. The robotic arm control system generates an end-effector position command within each control cycle, and the macroscopic feed motion corresponds to a constant speed v. feed The position component that continuously increases along the target direction corresponds to the micro-vibration detection signal at the micro-vibration detection frequency f. dither The position component changes periodically. Let the axial position command of the robotic arm's end effector at time t be x. total (t), the macroscopic feed position component is x feed (t), the micro-vibration detection position component is x dither (t), then the position command for the composite feed motion can be expressed as x total (t) equals x feed (t) and x dither The sum of (t). Macroscopic feed position component x feed (t) equals v feed Multiplying by t and adding the initial position x0, it shows a linear growth trend with time. The micro-vibration detection position component x... dither(t) takes the form of a sine function, i.e., x dither (t)=A dither ×sin(2πf dither ×t), presented as A dither For amplitude, f dither The frequency is a periodic oscillation. The superposition of the two position components causes the end effector of the robotic arm to move closer to the patient's head while simultaneously exhibiting a small reciprocating vibration along the feed axis. This composite motion mode continuously applies periodic micro-excitation to the contact interface without interrupting the feed process. Each micro-vibration cycle is equivalent to performing a stiffness sampling test on the medium in front.

[0069] The composite feeding motion is employed to achieve simultaneous detection and feeding. Traditional step-by-step strategies require the robotic arm to stop feeding, apply detection excitation, complete stiffness measurement, determine the medium type, and then continue feeding. This process, during hair penetration, involves repeatedly executing a "stop-detect-determine-feed" cycle, which not only prolongs the contact time but also increases the control complexity and wear risk of the robotic arm due to frequent start-stop actions. The composite feeding motion integrates detection excitation into the continuous feeding process. The robotic arm's end effector automatically performs stiffness detection while simultaneously performing macroscopic feeding. The detection results are fed back to the status determination module in real time, allowing the acquisition of the current medium's stiffness information without interrupting feeding. When the determination result indicates scalp contact, the system directly triggers a stop feeding response. The entire process is smooth, continuous, and without redundant movements. The composite feeding motion enables the robotic arm to immediately obtain dynamic mechanical feedback upon contact with any medium, eliminating the blind spots between detection steps in the step-by-step detection strategy and ensuring reliable instantaneous capture of the hair-scalp boundary.

[0070] Step S22: During the execution of the compound feed motion, the force feedback waveform at the end is collected in real time by the force feedback sensor according to the set sampling frequency. At the same time, the axial displacement data synchronized with the end force feedback waveform is collected by the robot arm joint encoder, and the cumulative feed depth is monitored in real time. When the cumulative feed depth exceeds the set maximum allowable feed depth, the feed over-limit protection is triggered.

[0071] Step S22 requires the simultaneous completion of three tasks during the execution of the compound feed motion: force signal acquisition, displacement signal acquisition, and feed depth monitoring. The force feedback sensor is a six-dimensional force / torque sensor mounted on the end effector of the robotic arm. This sensor can measure the force and torque components experienced by the end effector in three-dimensional space. In transcranial magnetic stimulation coil application, the axial contact force component along the feed axis is primarily considered. The force feedback sensor operates at the sampling frequency f set in step S12. sampleThe end-effector contact force is periodically sampled, with each sample capturing the axial contact force value at the current moment. Continuous sampling forms a time-series end-effector force feedback waveform F(t). The end-effector force feedback waveform F(t) contains information on the change of the reaction force exerted by the contact interface on the end of the robotic arm during the composite feed motion. It includes both the quasi-static force component generated by the gradual pressing into the hair layer or contact with the scalp layer by macroscopic feed, and the dynamic force component excited by the micro-vibration detection signal. The superposition of the two types of components constitutes the complete force feedback waveform.

[0072] Axial displacement data is acquired through encoders at each joint of the robotic arm. Each joint of the six-DOF robotic arm is equipped with a high-precision rotary encoder to measure the rotation angle of each joint in real time. The control system converts the six joint angle values ​​into position coordinates of the robotic arm's end effector in Cartesian space through forward kinematics calculation. During the execution of the compound feed motion, the control system operates at the same sampling frequency f as the force feedback sensor. sample The joint encoder is read and forward kinematics calculation is performed to obtain the position coordinates of the robot arm end effector along the feed axis at the current moment. Continuous sampling forms axial displacement data x(t) in time series form. Synchronous sampling by the force feedback sensor and the joint encoder ensures that the end effector force feedback waveform F(t) and the axial displacement data x(t) are strictly aligned in timestamps. The force value and displacement value at each sampling moment correspond one-to-one, providing paired independent and dependent variable data for the subsequent step S23 to calculate the real-time contact stiffness.

[0073] Real-time monitoring of the cumulative feed depth is achieved by calculating the difference between the axial displacement data x(t) and the initial position x0. Let the axial position of the robotic arm's end effector at the start of feeding be x0, and the current axial position be x(t), then the cumulative feed depth D(t) = x(t) - x0. The cumulative feed depth D(t) characterizes the total distance the robotic arm's end effector has moved along the target direction since the start of feeding, and this distance continuously increases as the feeding process progresses. In each sampling cycle, the system compares the cumulative feed depth D(t) with the maximum allowable feed depth D set in step S13. max Comparison, when D(t) exceeds D max The feed over-limit protection mechanism is triggered when the robotic arm end has penetrated a hair layer thicker than expected without detecting scalp contact. This may indicate sensor malfunction, improper stiffness threshold setting, or abnormally fluffy hair in the patient. The system immediately suspends the feed motion to prevent potential safety risks caused by continuous feed and issues a warning signal to prompt the operator to conduct manual inspection and intervention.

[0074] The purpose of synchronously acquiring force and displacement signals is to provide a complete data foundation for real-time contact stiffness calculation. Stiffness, as a representation of the relationship between force and displacement, requires simultaneous acquisition of force and displacement values ​​at corresponding moments. The absence of either or misaligned timestamps will distort the stiffness calculation results. If only force signals are acquired while displacement signals are ignored, it becomes impossible to distinguish the stiffness differences corresponding to different displacements under the same force value, thus losing the information basis for distinguishing between soft and hard media. If there is a deviation in the sampling times of the force and displacement signals, the calculated stiffness value will reflect an incorrect force-displacement relationship, potentially misclassifying the hair layer as the scalp layer or vice versa. The synchronous sampling configuration of the force feedback sensor and joint encoder ensures a strict correspondence between the force and displacement values ​​at each sampling moment, providing high-quality input data for the stiffness calculation in subsequent step S23. The cumulative feed depth monitoring and feed over-limit protection settings provide safety boundary constraints for the feed process penetrating the hair layer. Under normal operating conditions, the cumulative feed depth of the robotic arm end-effector penetrating the hair layer and contacting the scalp layer should be less than the maximum allowable feed depth D. max The contact state determination in step S24 will occur when D is reached. max Previously, the scalp contact state was identified and subsequent responses were triggered. The feed over-limit protection serves as a backup safety mechanism when the contact state determination fails, preventing the robotic arm from feeding without limit under extreme abnormal conditions, reflecting a multi-layered safety protection design concept.

[0075] Step S23: Extract the force component and displacement component corresponding to the micro-vibration detection frequency from the end force feedback waveform and axial displacement data. Calculate the force change per unit displacement based on the force component and displacement component as the real-time contact stiffness, and extract the stiffness change characteristics.

[0076] Both the end-effector force feedback waveform F(t) and the axial displacement data x(t) are composite signals, containing a low-frequency quasi-static component generated by the macroscopic feed motion and a high-frequency dynamic component excited by the micro-vibration detection signal, as well as superimposed sensor noise and mechanical vibration interference. The calculation of real-time contact stiffness needs to be based on the dynamic component excited by the micro-vibration detection signal, because this component directly reflects the stiffness response characteristics of the contact interface to periodic micro-excitations. The quasi-static component generated by the macroscopic feed mainly reflects the overall force level resulting from the cumulative indentation depth and cannot effectively distinguish the stiffness differences between soft and hard media.

[0077] Extract the frequency f corresponding to the micro-vibration detection frequency from the end force feedback waveform F(t) and the axial displacement data x(t). dither The corresponding force component F dither (t) and displacement component x dither (t) is achieved using a bandpass filter. The center frequency of the bandpass filter is set to the micro-vibration detection frequency f. dither The bandwidth is set to f ditherThe bandwidth is between 1 / 5 and 1 / 3 of the original frequency. This bandwidth retains the micro-vibration detection frequency component while filtering out low-frequency macroscopic feed components and high-frequency noise components far from this frequency. The bandpass filter can be in the form of a digital filter. In the signal processing module of the control system, the acquired raw time series data is filtered point by point, and the output is a filtered time series containing only the micro-vibration detection frequency component. The extracted force component F dither (t) and displacement component x dither (t) exhibits a periodic oscillating waveform with the same frequency as the micro-vibration detection signal. Force component F dither (t) reflects the force response of the contact interface to the micro-vibration displacement excitation, with the displacement component x dither (t) reflects the actual micro-displacement of the robotic arm's end effector. Under ideal linear elastic contact conditions, there is a proportional relationship between the force component and the displacement component, and this proportionality coefficient is the stiffness of the contact interface. However, the mechanical response of the actual contact interface has nonlinear characteristics, especially the hair layer, which exhibits significant nonlinear weak stiffness characteristics. Therefore, it is necessary to use differential calculation methods to obtain the instantaneous stiffness rather than the average stiffness over the entire period.

[0078] The real-time contact stiffness K is calculated using the derivative of the force component with respect to the displacement component, i.e., K = d Fdither (t) / dx dither (t). Due to the force component F dither (t) and displacement component x dither (t) represents discretely sampled time series data, and the derivative is calculated using the finite difference method. Let t be the time series data at sampling time t. i The force component is F dither (t i The displacement component is x dither (t i ), at the next sampling time t i+1 The force component is F dither (t i+1 The displacement component is x dither (t i+1 If the sampling time t is 1, then the sampling time t is 1. i Real-time contact stiffness The differential calculation is performed once in each sampling period to generate a time series K(t) of the real-time contact stiffness.

[0079] The time series of real-time contact stiffness K(t) can be plotted as a stiffness variation curve, with time on the horizontal axis and the real-time contact stiffness value on the vertical axis. Stiffness variation features are extracted from the curve, including real-time contact stiffness, stiffness difference value, sliding window stiffness mean, stiffness variation trend, and stiffness fluctuation amplitude. The stiffness difference value ΔK is obtained by calculating the difference in stiffness values ​​between adjacent sampling points, i.e., ΔK(t). i )=K(ti )-K(t i-1 ), where K(t) i-1 (t) represents the sampling time. i-1 The real-time contact stiffness, with stiffness difference values ​​reflecting the change in stiffness within a single sampling period, is used to detect abrupt stiffness changes at the moment of scalp contact. The sliding window stiffness mean K... mean The stiffness value is obtained by taking the arithmetic mean of the stiffness values ​​within a sliding window. The sliding window covers the number of sampling points corresponding to M micro-vibration cycles, with M typically ranging from 2 to 5. The mean of the sliding window is used to smooth transient noise to obtain the steady-state level of stiffness. The stiffness variation trend is obtained by calculating the rate of change of the mean of adjacent sliding windows, where the rate of change Rk is equal to the mean of the current sliding window K. mean (t i Subtract the mean K of the previous sliding window mean (t i-1 Dividing by the time span of the sliding window, the absolute value of the rate of change characterizes the drasticness of the stiffness trend change. The stiffness fluctuation amplitude is calculated by determining the standard deviation σ of the stiffness values ​​within the sliding window. K The larger the standard deviation, the more drastic the stiffness fluctuation, reflecting the uniformity and stability of the contact interface. The extraction of these stiffness variation characteristics provides multi-dimensional input criteria for the contact state determination in step S24. A single stiffness numerical comparison can only provide a high or low judgment, while the introduction of stiffness variation characteristics allows the determination logic to comprehensively consider the absolute level, trend, and fluctuation characteristics of stiffness. This enables multi-dimensional matching with the three judgment conditions of the two models in the two-layer medium mechanics model established in step S11, improving the reliability and robustness of the determination.

[0080] Step S24: Compare the real-time contact stiffness with the force change slope threshold, and determine the contact state using the dual-layer medium mechanics model: When the real-time contact stiffness is less than the force change slope threshold for N1 consecutive sampling points and the stiffness change characteristics conform to the mechanical response characteristics represented by the hair layer nonlinear weak stiffness model, the current contact state is determined to be the hair layer contact state and the composite feed motion continues; when the real-time contact stiffness undergoes a sudden change and is greater than or equal to the force change slope threshold for N2 consecutive sampling points, and the stiffness change characteristics conform to the mechanical response characteristics represented by the scalp layer high stiffness step model, the current contact state is determined to be the scalp layer contact state.

[0081] The contact state determination adopts a dual-condition joint determination logic. The first condition is the real-time contact stiffness K and the force change slope threshold K. th The numerical comparison is based on the degree of matching between the stiffness variation characteristics and the mechanical response characteristics of the two models in the two-layer medium mechanical model. The corresponding contact state determination result is confirmed only when both conditions are met simultaneously.

[0082] During the contact state determination process, when the real-time contact stiffness K is continuously less than the lower limit K of the hair layer stiffness distribution range... hair,min If the signal is not detected, it indicates that the robotic arm's end effector has not yet made effective contact with the hair layer. The system continues to execute the compound feed motion until a valid contact signal is detected. The conditions for determining the contact state of the hair layer include: the real-time contact stiffness K is less than the force change slope threshold K for N1 consecutive sampling points. th Furthermore, the stiffness variation characteristics conform to the mechanical response characteristics characterized by the nonlinear weak stiffness model of the hair layer. Determining the number of continuous sampling points N1 requires a comprehensive consideration of the balance between decision reliability and response speed. If N1 is too small, it is easily affected by instantaneous disturbances, leading to misjudgments; if N1 is too large, it prolongs the decision response time, potentially missing timely detection of the medium boundary. A typical range for N1 is [sampling frequency f]. sample With the micro-vibration detection frequency f dither The ratio is between 1 / 2 and 2, that is, the number of sampling points covering half to two micro-vibration cycles. For example, when the sampling frequency f... sample 50Hz, micro-vibration detection frequency f dither At 5Hz, a single micro-vibration cycle contains 10 sampling points, and N1 can be set between 5 and 20. The mechanical response characteristics represented by the nonlinear weak stiffness model of the hair layer are determined by three judgment conditions defined in step S11: hair stiffness numerical condition, stiffness trend condition, and stiffness fluctuation condition. When all three conditions are met simultaneously, the stiffness change characteristics are determined to conform to the mechanical response characteristics represented by the nonlinear weak stiffness model of the hair layer. When the real-time contact stiffness simultaneously meets the above numerical conditions and feature matching conditions, the system determines the current contact state to be a hair layer contact state and controls the robotic arm to continue performing compound feed motion to penetrate the fluffy hair layer and approach the scalp layer. When the real-time contact stiffness K is at the upper limit K of the hair layer stiffness distribution range... hair,max With the threshold of the slope of the force change K th When K exceeds the hair layer stiffness distribution range but has not yet reached the scalp layer determination threshold, the system neither determines it as a hair layer contact state nor a scalp layer contact state. At this time, the compound feed motion continues to be executed and the stiffness change is continuously monitored until the stiffness meets the scalp layer determination condition or falls back to the hair layer stiffness distribution range.

[0083] The criteria for determining the scalp contact state include: a sudden change in real-time contact stiffness K and a force change slope threshold K being greater than or equal to the threshold value K for N2 consecutive sampling points. th Furthermore, the stiffness variation characteristics conform to the mechanical response characteristics characterized by the high-stiffness step model of the scalp layer. The abrupt change is determined by comparing the stiffness difference value ΔK calculated in step S23 with the abrupt change threshold K. jump The comparison is implemented when the stiffness difference value ΔK is greater than or equal to the abrupt change threshold K. jumpThis is considered a sudden change. The real-time contact stiffness of N2 consecutive sampling points is greater than or equal to K. th The requirements are used to confirm the stability of the stiffness exceeding the threshold state rather than a transient occurrence. The number of continuous sampling points N2 adopts the same N1 parameter as the hair layer judgment, i.e., N2=N1, to ensure that the response time of the two state judgments is consistent. The mechanical response characteristics represented by the high-stiffness step model of the scalp layer are verified and matched through the three judgment conditions defined in step S11, namely, the numerical condition of scalp stiffness, the condition of stiffness mutation, and the condition of stiffness stability; specifically, the real-time contact stiffness and the lower limit K of the stiffness distribution interval are compared. scalp,min A comparison is made to verify the numerical condition of scalp stiffness. The "abrupt change in real-time contact stiffness K" corresponds to the verification of the stiffness abrupt change condition. This is achieved by comparing the stiffness difference value ΔK calculated in step S23 with the abrupt change threshold K. jump The comparison is implemented when the stiffness difference value ΔK is greater than or equal to the abrupt change threshold K. jump If the stiffness abrupt change condition is met, the real-time contact stiffness K will exceed the force change slope threshold K. th The stiffness fluctuation amplitude σ calculated in step S23 is obtained within the sampling interval consisting of N2 consecutive sampling points. K With the upper limit threshold of stability σ scalp,max The comparison is performed to verify the stiffness stability condition; when the above three conditions are met simultaneously, it is determined that the stiffness change characteristics conform to the mechanical response characteristics characterized by the scalp layer high-stiffness step model. When the real-time contact stiffness simultaneously meets the above numerical conditions and feature matching conditions, the system determines that the current contact state is the scalp layer contact state and triggers the response control process of step S30.

[0084] The design intent of the dual-condition joint judgment logic is to improve the reliability and robustness of contact state identification. While a single numerical threshold comparison is computationally simple, it is susceptible to misjudgments due to outliers. For example, when the robotic arm's end effector encounters a hair knot or hairpin or other localized hard point during the compression of a hair layer, the instantaneous stiffness may briefly exceed the threshold K. th If only numerical comparison is used, it will immediately be misjudged as a scalp layer contact state and trigger a stop feeding, causing the adhesion process to break inside the hair layer rather than the actual scalp surface. After introducing the pattern matching condition of stiffness change characteristics, even if the instantaneous stiffness exceeds the threshold, the system will still check whether the stiffness change trend shows a step characteristic and whether the stiffness exceeding the threshold state is stable and continuous. The instantaneous high stiffness caused by hair nodules usually manifests as a spike pulse rather than a stable step, which cannot meet the feature matching condition and is thus correctly excluded from the scalp layer judgment. Similarly, when the robotic arm end just touches the edge of the scalp layer, if the initial stiffness reading is slightly lower than the threshold due to measurement noise, a single numerical comparison will misjudge that it is still in the hair layer and continue feeding, resulting in overpressure. However, the feature matching condition will detect the abrupt change characteristics of the stiffness trend, and even if the instantaneous stiffness is slightly lower than the threshold, it will trigger a review judgment process to avoid missed detection.

[0085] The two-layer medium mechanics model provides feature templates for two contact states: the hair layer and the scalp layer, and the force change slope threshold K. th Numerical boundaries between the two states are provided. The judgment logic in step S24 applies these preset templates and thresholds to the stiffness data acquired and processed in real time, completing the state identification process from perception to cognition. The judgment result of step S24 directly drives the response control in the subsequent step S30. When the state is determined to be hair layer contact, the system maintains the current composite feed motion state. When the state is determined to be scalp layer contact, the system triggers a stop feed and retraction action. Without the contact state judgment in step S24, the system will not be able to distinguish the type of medium layer it is currently in. It will either feed blindly until the force overload protection is triggered, or stop feeding immediately when the contact force is detected for the first time. Neither of these extreme cases can achieve the goal of flexible fit that penetrates the hair layer while protecting the scalp layer.

[0086] Step S20 seamlessly integrates active stiffness detection into the macroscopic feeding process by executing a composite feed motion that superimposes micro-vibration detection signals. This eliminates the timing blind spots and start-stop losses inherent in traditional step-by-step detection strategies, while ensuring real-time dynamic mechanical feedback at the moment of contact interface change. Based on this, using synchronously acquired force-potential data and signal processing algorithms, the system successfully decouples real-time contact stiffness from complex composite signals, accurately reflecting the inherent properties of the material. This overcomes the ambiguity in traditional static force feedback caused by contact angle and hair interference. Furthermore, by introducing a dual-condition joint judgment logic based on a two-layer medium mechanics model, the system upgrades single numerical threshold comparison to multi-dimensional feature pattern matching, effectively filtering out the risk of misjudgment caused by instantaneous disturbances such as hair nodules, thus constructing a highly robust state recognition mechanism. The implementation of step S20 enables the system to "penetrate" the fluffy hair layer while ensuring safety. This not only eliminates the magnetic field dose attenuation caused by the "soft medium gap" and ensures the consistency of transcranial magnetic stimulation efficacy, but also provides a reliable triggering time and state input for the precise force control in the subsequent step S30, realizing a closed-loop safety guarantee from perception to control.

[0087] Step S30: In response to the scalp layer contact state, execute the stop feed command and reverse retraction action, switch to constant force holding control mode, dynamically adjust the position of the end of the robotic arm in constant force holding control mode, maintain the effective contact state between the coil and the scalp layer and output the contact in place signal.

[0088] Specifically, step S30 transforms the contact state identification result from step S20 into the execution function of actual control actions. Its core task is to ensure that the robotic arm can safely and accurately complete the transition from feeding motion to stable contact after detecting the scalp contact state, eliminating overshoot pressure caused by mechanical system response delay and inertia, and continuously maintaining an effective contact state between the coil and the scalp during treatment. In transcranial magnetic stimulation (TMS) therapy, the contact state between the treatment coil and the scalp directly affects the efficiency of magnetic field energy transmission to brain tissue. Excessive contact pressure can cause pain and discomfort to the patient or even damage to the scalp tissue, while insufficient contact pressure or unstable contact may cause the coil to detach from contact during treatment due to the patient's breathing or slight head movement, resulting in fluctuations in magnetic field dose and affecting the consistency of treatment effects. Step S30 eliminates overshoot pressure by coordinating the timing of the stop feed command and the reverse retraction action, achieves dynamic stability of the contact force through the introduction of a constant force holding control mode, and compensates for distance changes caused by the patient's micro-movements through force deviation-driven position fine-tuning. This maintains a stable contact between the coil and the scalp while ensuring patient safety and comfort, thus ensuring the true effectiveness of the transcranial magnetic stimulation (TMS) treatment dose. Step S20 uses a composite feed motion and dual-condition joint judgment logic to complete real-time identification of the hair layer contact state and the scalp layer contact state. When the judgment result indicates that the current state is in scalp layer contact, the control flow of step S30 is triggered. Without the response control of step S30, the contact state identification result of step S20 cannot be translated into effective control action. The robotic arm will continue its original feed motion after detecting scalp layer contact, leading to continuous pressure on the scalp layer and causing overpressure damage. Alternatively, it may suddenly stop moving completely after detecting contact but lack a pressure release and stabilization mechanism, leaving the treatment coil in an unstable contact state and unable to perform effective treatment.

[0089] Further, see Figure 3 Step S30 includes:

[0090] Step S31: When the contact state is scalp contact state, immediately send a stop feed command to the robotic arm to terminate the compound feed motion, and control the end of the robotic arm to perform a reverse retraction action of a preset retraction distance in the opposite direction of the axial direction.

[0091] The stop feed command is a motion termination command sent to the robotic arm servo control system. This command terminates the compound feed motion established in step S21, stopping the robotic arm's end effector's feed motion towards the patient's head and the superimposed micro-vibration detection vibration. The timing of the stop feed command directly affects the magnitude of the overshoot pressure. There is a system response delay T between the determination of the scalp contact state in step S24 and the actual cessation of the robotic arm's end effector's motion. delayThis delay consists of three parts: signal transmission delay, control cycle delay, and robotic arm braking response time. Signal transmission delay depends on the communication architecture and bus cycle of the control system; control cycle delay depends on the execution cycle of the control algorithm; and robotic arm braking response time depends on the braking performance of the servo motor and the current movement speed. The system response delay T... delay The following data was obtained through offline testing: In a safe experimental environment, the robotic arm was controlled to move at a set feed speed. At a certain moment, a stop command was sent, and the time difference between the moment the stop command was sent and the actual moment the robotic arm stopped was recorded as the system response delay T. delay This offline test is performed during system initialization or periodic maintenance, and the test results are stored in the control system as preset parameters for use in step S31. During system response delay T... delay During this period, the end effector of the robotic arm continues to feed at a speed of v. feed Continue moving towards the scalp layer, creating an additional indentation depth Δx overshoot This additional indentation depth is approximately equal to the feed rate v. feed With system response delay T delay The product of, i.e., Δx overshoot =v feed ×T delay Additional indentation depth Δx overshoot This causes the contact force applied to the scalp to exceed the force value at the moment of contact, resulting in an overshoot force F. overshoot Overshoot pressure F overshoot With additional indentation depth Δx overshoot The relationship between them is determined by the stiffness characteristics of the scalp layer. Based on the high-stiffness step model of the scalp layer established in step S11, the eigenvalue K of the scalp layer stiffness is... scalp Much higher than the hair layer stiffness eigenvalue K hair Therefore, even with an additional indentation depth Δx overshoot The overshoot pressure F is very small. overshoot It may still reach levels that cause discomfort to patients.

[0092] See Figure 4 This is a schematic diagram of the reverse rollback action provided in the embodiments of this application. Figure 4 The diagram illustrates the treatment coil, the scalp layer, and the transition from an overshoot state to a retraction state. The execution of the reverse retraction motion is used to eliminate... Figure 4 The overshoot pressure, as indicated by the overshoot condition, brings the contact force back to a safe and comfortable range. The reverse retraction action refers to controlling the end effector of the robotic arm in the opposite direction along the axial direction. Figure 4 The arrow indicates the direction away from the patient's head, indicating a preset retraction distance Δx. retract The movement motion. Preset backtracking distance Δx retractThe determination of this requires comprehensive consideration of both overshoot pressure relief and effective contact maintenance. From the perspective of overshoot pressure relief, the preset retraction distance Δx... retract It needs to be greater than or equal to the additional indentation depth Δx overshoot To ensure that the position of the robotic arm's end effector does not exceed the position at the instant of contact with the scalp after retraction, thus eliminating overshoot pressure caused by system response delay; from the perspective of effective contact maintenance, a preset retraction distance Δx is used. retract The distance should not be too large, otherwise the coil may detach from the scalp surface and fall into the hair layer area after retraction, losing effective contact. Preset retraction distance Δx retract The typical range of values ​​is the additional indentation depth Δx overshoot The value should be between 1 and 1.5 times the normal value. This range eliminates overshoot pressure while retaining a small safety margin, ensuring that the coil remains in slight contact with the scalp after retraction, rather than completely disengaging. Figure 4 As shown in the retraction state, after the retraction action is completed, the end of the robotic arm is in an ideal position where it just contacts the scalp surface without overpressure. At this point, the contact force is within a safe and comfortable range, providing a stable initial state for the constant force maintenance control mode switching in the subsequent step S32. The timing coordination of the stop feed command and the reverse retraction action in step S31 ensures that the entire process from detecting scalp contact to eliminating overshoot pressure is completed in a short time. The stop feed command is issued immediately after the judgment result is output, and the reverse retraction action is executed immediately after the stop feed command takes effect, with no redundant waiting time between the two actions. This timing coordination compresses the duration of overshoot pressure to an extremely short range allowed by the mechanical system's response capability, making the patient almost unaware of the overshoot pressure and improving the comfort of the treatment process. Figure 4 The active retraction shown eliminates overshoot pressure, and the execution of the reverse retraction action has the significance of active pressure release. Compared with passively waiting for the contact force to decay naturally, active retraction can adjust the contact force to the target range in a shorter time, thus accelerating the transition from contact detection to stable fit.

[0093] Step S32: After the reverse retraction action is completed, the contact force control target is set to the target constant force value, and the robotic arm is controlled to switch from the position control mode to the constant force holding control mode.

[0094] Position control mode is the control mode used by the robotic arm during the compound feed motion of step S21. In this mode, the robotic arm control system controls the end effector to move along a preset trajectory according to the position command. The force feedback signal is only used for status monitoring and safety protection and does not participate in the motion control loop. Constant force holding control mode refers to a force control mode with contact force as the control target. In this mode, the robotic arm control system adjusts the end effector position according to the deviation between the force feedback signal and the force control target, keeping the contact force near the target value. Switching between control modes is achieved by modifying the controller parameters and feedback loop configuration of the robotic arm servo control system. In position control mode, the outer loop controller of the servo control system is a position controller, and the inner loop controllers are, in sequence, a speed controller and a current controller, forming a three-loop cascaded control structure of position-speed-current. When switching to constant force holding control mode, the outer loop controller is replaced by a force controller instead of a position controller. The force controller outputs a position correction amount according to the deviation between the force feedback and the force control target. This position correction amount serves as the input to the inner loop position controller, forming a four-loop cascaded control structure of force-position-speed-current. The constant force holding control mode can be achieved by using an impedance control method or a force-position hybrid control method. Both methods enable the robotic arm end to maintain a certain degree of compliance while maintaining the target contact force, and can adapt to the slight displacement changes of the patient's head.

[0095] The basic principle of impedance control is to establish the desired impedance relationship between the robotic arm's end effector and the environment, transforming the force control problem into a position control problem. In impedance control, the desired impedance parameters include virtual mass. Virtual damping and virtual stiffness When the end contact force deviates from the target constant force value, the controller determines the appropriate response based on the impedance relationship. Calculate the corresponding position correction amount ,in To mitigate force deviation, the distal end exhibits a pre-defined compliant behavior, achieving indirect control of the contact force. The basic principle of the force-position hybrid control method is to employ force control and position control in different directions in Cartesian space. Force control is used in the normal contact direction to maintain a constant contact force, while position control is used in the tangential contact direction to maintain a stable tangential position of the coil relative to the scalp. The force controller can employ a proportional-integral control structure, directly calculating the position correction based on the force deviation. The control mode switching in step S32 provides the control framework support for the force deviation calculation and dynamic position adjustment in step S33. The establishment of the constant force holding control mode allows subsequent steps to continuously maintain stable contact force under the closed-loop control of the force control loop. Without the control mode switching in step S32, the robotic arm will remain in position control mode, unable to automatically adjust the distal end position to maintain stable contact force when the patient's head moves slightly, causing the contact force to fluctuate significantly with the patient's head displacement, affecting the safety and comfort of the treatment process.

[0096] Step S33: In the constant force holding control mode, the contact force fed back by the end is continuously collected and compared with the target constant force value. The force deviation is calculated, and the position of the end of the robotic arm is dynamically adjusted according to the force deviation to compensate for the distance change caused by the patient's micro-movement, so as to maintain the effective contact state between the coil and the scalp layer. When the effective contact state is maintained for a preset time, the contact signal is output.

[0097] Step S33 requires the continuous execution of four cyclical tasks in constant force maintenance control mode: force feedback acquisition, force deviation calculation, dynamic position adjustment, and contact state determination, until a contact status signal is output. Force feedback acquisition continues the force signal acquisition mechanism established in step S22. The force feedback sensor samples the end-effector contact force according to the sampling frequency, obtaining the contact force at each sampling point. The contact forces at all sampling points form a contact force time series for the constant force maintenance control phase. The contact force time series reflects the actual changes in contact force under constant force maintenance control mode, and its fluctuation characteristics are affected by factors such as patient head micro-movements, respiratory movements, and changes in muscle tension. Force deviation is obtained by subtracting the target constant force value from the contact force value at the current sampling moment. The sign and magnitude of the force deviation indicate the direction and degree of deviation of the current contact force relative to the target value. A positive force deviation indicates that the current contact force is higher than the target value, and the contact force needs to be reduced by increasing the distance between the coil and the scalp. A negative force deviation indicates that the current contact force is lower than the target value, and the contact force needs to be increased by decreasing the distance between the coil and the scalp. The larger the absolute value of the force deviation, the greater the degree of deviation, and the greater the amount of position adjustment required.

[0098] The dynamic adjustment of the robotic arm's end effector position based on force deviation relies on the constant force holding control mode established in step S32. Under the impedance control method, the controller calculates the position correction amount based on the impedance relationship. In engineering implementation, the inertia term is usually ignored. To simplify the calculation, the impedance relationship is simplified to: Under steady-state conditions, the position correction Δx is approximately equal to the force deviation ΔF divided by the virtual stiffness K. d When the force deviation is positive (i.e., the contact force is too large), the position correction is positive, and the end effector of the robotic arm moves away from the patient's head to reduce the contact force. When the force deviation is negative (i.e., the contact force is too small), the position correction is negative, and the end effector of the robotic arm moves closer to the patient's head to increase the contact force. Under the force-position hybrid control method, the position correction in the contact normal direction is calculated directly from the force deviation by the force controller, which employs a proportional-integral control structure. The position correction consists of a proportional term and an integral term. The proportional term equals the current force deviation multiplied by the proportional gain, and the integral term equals the cumulative force deviation from the start of the constant force holding control mode to the current time multiplied by the integral gain. The proportional term directly generates the corresponding position correction based on the current force deviation, providing rapid response capability. The integral term, by accumulating historical force deviations, eliminates the steady-state error that may remain when relying solely on proportional control, ensuring that the contact force eventually converges to the target constant force value. The position of the robotic arm end effector is fine-tuned in each control cycle based on the calculated position correction, achieving closed-loop regulation of the contact force.

[0099] The distance variation caused by patient micromovements is the primary source of disturbance that needs to be compensated for in constant force maintenance control. During transcranial magnetic stimulation (TMS) therapy, the patient's head may undergo minute displacements due to respiratory movements, involuntary muscle contractions, or postural adjustments. These displacements cause changes in the distance between the coil and the scalp, leading to fluctuations in contact force. Without an effective compensation mechanism, the contact force will fluctuate significantly with the patient's head displacement: when the patient's head moves towards the coil, the decreased distance leads to an increased contact force, potentially exceeding the pain threshold and causing patient discomfort; when the patient's head moves away from the coil, the increased distance leads to a decreased contact force, even dropping to zero, causing the coil to detach from the scalp surface and lose effective contact. The constant force maintenance control mode uses dynamic position adjustment driven by force deviation to ensure that the position of the robotic arm's end effector follows the patient's head displacement, compensating for the impact of distance variations on the contact force and maintaining stable fluctuations in the contact force around the target value.

[0100] The definition and determination of effective contact state are prerequisites for outputting the contact completion signal in step S33. Effective contact state refers to a state where the coil and scalp maintain stable contact and the contact force remains near the target constant force value. The determination of effective contact state is achieved by monitoring the fluctuation characteristics of the contact force time series. An upper limit threshold and a lower limit threshold for force fluctuation are set. The upper limit threshold is set as the sum of the target constant force value and the allowable fluctuation amplitude, and the lower limit threshold is set as the difference between the target constant force value and the allowable fluctuation amplitude. In each sampling period, an instantaneous determination of the effective contact state is performed: when the contact force at the current sampling moment is within the range of the lower limit threshold to the upper limit threshold, the current sampling moment is determined to be in an effective contact state; when the current contact force exceeds this range, the current sampling moment is determined to be out of the effective contact state. The system accumulates the sampling moments continuously in the effective contact state. When the continuous accumulation time of the effective contact state reaches the preset duration Tstable, the contact completion signal is output; if a sampling moment of being out of the effective contact state occurs during the accumulation process, the accumulation time is reset to zero and the timing restarts. The determination of the allowable fluctuation range needs to comprehensively consider the adjustment accuracy of the control system and the patient's comfort requirements. If the allowable fluctuation range is too small, the control system will struggle to maintain the contact force within the allowable range, frequently resulting in a loss of effective contact. If the allowable fluctuation range is too large, it will relax the constraints on force fluctuations, potentially affecting the consistency of treatment efficacy. The typical range for the allowable fluctuation range is between 0.1 and 0.3 times the target constant force value. The preset duration Tstable is used to confirm the stability of the effective contact state rather than momentary occurrences, avoiding situations where the contact force briefly falls within the effective range, outputs a contact signal, and then loses effective contact. The determination of the preset duration Tstable needs to consider the typical frequency and amplitude characteristics of the patient's head micro-movements. Tstable should be greater than the typical cycle of the patient's head micro-movements, ensuring that the contact force remains within the effective range after experiencing a sufficient number of micro-movement cycles within the preset duration, thus confirming that the constant force maintenance control system can effectively compensate for disturbances caused by the patient's micro-movements. The typical range for the preset duration Tstable is the time length corresponding to several respiratory cycles. For example, the respiratory rate of a normal adult is 12 to 20 breaths per minute, corresponding to a respiratory cycle of 3 to 5 seconds. The preset duration Tstable can be set to 1 to 3 times this respiratory cycle. The output of the fit signal marks the completion of the transcranial magnetic stimulation robot's flexible fit method, and the system enters the treatment-ready state. The fit signal can be sent to the host computer or treatment system in digital form through the output interface of the control system, triggering the start of the transcranial magnetic stimulation treatment program. After the fit signal is output, the constant force maintenance control task in step S33 continues to run to maintain the effective fit between the coil and the scalp during the treatment process until the treatment program ends or the operator issues a stop command.

[0101] Step S30, through the timing coordination of the stop-feed command and the reverse retraction action, the switching of the control mode from position control to constant force holding, and the dynamic position adjustment driven by force deviation, realizes a complete control process from detecting scalp contact to maintaining a stable fit. The execution of the reverse retraction action actively eliminates the overshoot pressure caused by system response delay, allowing the robotic arm end effector to retract from the overpressure position to the ideal position where it just contacts the scalp surface, releasing the instantaneous overshoot force applied to the scalp. The passive waiting method for the contact force to decay naturally relies on the viscoelastic relaxation characteristics of the contact interface, resulting in a slow decay process and an uncontrollable final equilibrium force value. The active retraction method directly changes the contact state through position adjustment, adjusting the contact force to the target range in a very short time, significantly improving the response speed from contact detection to pressure elimination, making the patient almost unaware of the overshoot pressure and improving the comfort of the treatment process. The switch from position control to constant force holding control gives the robotic arm end effector compliance to adapt to external disturbances, establishing a closed-loop control circuit with the contact force as the control target, enabling the contact force to remain stable through automatic position adjustment when external conditions change. In position control mode, the robotic arm's end effector position remains fixed, failing to adapt to the patient's minute head movements, resulting in significant fluctuations in contact force with distance. In constant force maintenance control mode, the robotic arm's end effector position dynamically adjusts based on force deviation, maintaining the contact force around a target value, ensuring contact stability during prolonged treatment. The cyclical execution of force deviation calculation and dynamic position adjustment enables real-time compensation for patient micro-movements, allowing the robotic arm's end effector position to follow the patient's head movement and eliminating the impact of distance variations on contact force. Micro-movements of the patient's head during treatment, such as breathing and posture adjustments, are unavoidable sources of disturbance. Without an effective compensation mechanism, the contact force will continuously fluctuate during treatment, affecting the stability of the magnetic field dose and the repeatability of the treatment effect. Force deviation-driven dynamic position adjustment allows the robotic arm's end effector to adapt to the patient's micro-movements, automatically adjusting its position to maintain a constant contact force as the patient's head moves, ensuring a stable output of the magnetic field dose during treatment. The continuous and stable determination of effective contact and the output of the contact completion signal provide reliable prerequisites for initiating the treatment procedure. Transcranial magnetic stimulation (TMS) is only allowed to start after confirming that the constant force maintenance control system has successfully established a stable contact state and can effectively compensate for disturbances caused by the patient's micro-movements. Outputting the contact completion signal too early may cause treatment to start before the contact is stable, and the coil may disengage during stimulation, resulting in an interruption of the magnetic field dose. Requiring a preset duration of continuous and stable effective contact before outputting the contact completion signal ensures the sustainability of the contact state at the start of treatment, guaranteeing the safety and effectiveness of subsequent treatment processes.

[0102] Example 2

[0103] This embodiment, based on Embodiment 1, provides a transcranial magnetic stimulation robot flexible fitting system, such as... Figure 5 As shown, it includes:

[0104] Model building module: used to build a two-layer medium mechanics model that includes a nonlinear weak stiffness model of the hair layer and a high stiffness step model of the scalp layer, determine the force change slope threshold, and configure the parameters of the micro-vibration detection signal;

[0105] Contact determination module: used to control the end effector of the robotic arm to perform a composite feed motion superimposed with micro-vibration detection signals, collect end effector force feedback waveform and axial displacement data, generate real-time contact stiffness based on end effector force feedback waveform and axial displacement data, compare the real-time contact stiffness with the force change slope threshold and combine it with a two-layer medium mechanical model to determine the contact state; the contact state includes hair layer contact state and scalp layer contact state;

[0106] Adhesion control module: In response to the scalp contact state, executes stop feed command and reverse retraction action, switches to constant force holding control mode, dynamically adjusts the position of the end of the robotic arm in constant force holding control mode, maintains the effective adhesion state between the coil and the scalp, and outputs a adhesion in place signal.

[0107] Furthermore, in the model building module, the nonlinear weak stiffness model of the hair layer and the high stiffness step model of the scalp layer represent different mechanical response characteristics;

[0108] The mechanical response characteristics represented by the nonlinear weak stiffness model of the hair layer are described by three judgment conditions: hair stiffness numerical condition, stiffness trend condition, and stiffness fluctuation condition.

[0109] The mechanical response characteristics represented by the high-stiffness step model of the scalp layer are described by three judgment conditions: numerical condition of scalp stiffness, abrupt stiffness change condition, and stiffness stability condition.

[0110] Furthermore, in the contact determination module, the method for obtaining the real-time contact stiffness includes:

[0111] Force and displacement components corresponding to the micro-vibration detection frequency are extracted from the end force feedback waveform and axial displacement data. The force change per unit displacement is calculated based on the force and displacement components as the real-time contact stiffness.

[0112] The method for determining the contact state of the scalp layer includes:

[0113] The time series of real-time contact stiffness is plotted as a stiffness variation curve, and stiffness variation characteristics are extracted from the stiffness variation curve.

[0114] When the real-time contact stiffness changes abruptly and N2 consecutive sampling points are greater than or equal to the force change slope threshold, and the stiffness change characteristics conform to the mechanical response characteristics characterized by the scalp high stiffness step model, the current contact state is determined to be the scalp contact state, where N2 is the number of consecutive sampling points.

[0115] The methods and systems of this application may be implemented in many ways. For example, they may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the method is for illustrative purposes only, and the steps of the method of this application are not limited to the order specifically described above, unless otherwise specifically stated.

[0116] In addition, the parts of the technical solutions provided in the embodiments of this application that are consistent with the implementation principles of the corresponding technical solutions in the prior art have not been described in detail, so as to avoid excessive elaboration.

[0117] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the invention. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A transcranial magnetic stimulation robot flexible fitting method, characterized in that, The method includes: A two-layer medium mechanics model was constructed, which included a nonlinear weak stiffness model of the hair layer and a high stiffness step model of the scalp layer. The force change slope threshold was determined, and the parameters of the micro-vibration detection signal were configured. The robotic arm end effector is controlled to perform a composite feed motion superimposed with micro-vibration detection signals. The end effector force feedback waveform and axial displacement data are collected. Real-time contact stiffness is generated based on the end effector force feedback waveform and axial displacement data. The real-time contact stiffness is compared with the force change slope threshold and the contact state is determined by combining the two-layer medium mechanical model. The contact state includes hair layer contact state and scalp layer contact state. In response to the scalp contact state, the robot executes a stop feed command and reverse retraction action, switches to constant force holding control mode, dynamically adjusts the position of the end of the robotic arm in constant force holding control mode, maintains the effective contact state between the coil and the scalp, and outputs a contact completion signal.

2. The transcranial magnetic stimulation robot flexible fitting method according to claim 1, characterized in that, The nonlinear weak stiffness model of the hair layer and the high stiffness step model of the scalp layer characterize different mechanical response features; The mechanical response characteristics represented by the nonlinear weak stiffness model of the hair layer are described by three judgment conditions: hair stiffness numerical condition, stiffness trend condition, and stiffness fluctuation condition.

3. The transcranial magnetic stimulation robot flexible fitting method according to claim 2, characterized in that, The mechanical response characteristics represented by the high-stiffness step model of the scalp layer are described by three judgment conditions: numerical condition of scalp stiffness, abrupt stiffness change condition, and stiffness stability condition.

4. The transcranial magnetic stimulation robot flexible fitting method according to claim 3, characterized in that, The method for obtaining the real-time contact stiffness includes: Force and displacement components corresponding to the micro-vibration detection frequency are extracted from the end force feedback waveform and axial displacement data. The force change per unit displacement is calculated based on the force and displacement components as the real-time contact stiffness.

5. The transcranial magnetic stimulation robot flexible fitting method according to claim 4, characterized in that, The method for determining the contact state of the scalp layer includes: The time series of real-time contact stiffness is plotted as a stiffness variation curve, and stiffness variation characteristics are extracted from the stiffness variation curve. When the real-time contact stiffness changes abruptly and N2 consecutive sampling points are greater than or equal to the force change slope threshold, and the stiffness change characteristics conform to the mechanical response characteristics characterized by the scalp high stiffness step model, the current contact state is determined to be the scalp contact state, where N2 is the number of consecutive sampling points.

6. The transcranial magnetic stimulation robot flexible fitting method according to claim 5, characterized in that, When the contact state is determined to be hair layer contact state, the compound feed motion continues.

7. The transcranial magnetic stimulation robot flexible fitting method according to claim 6, characterized in that, The back-off distance performed by the reverse back-off action is greater than or equal to the additional push-in depth; the additional push-in depth is determined by the system response delay.

8. The transcranial magnetic stimulation robot flexible fitting method according to claim 7, characterized in that, The method for dynamically adjusting the position of the robotic arm's end effector includes: Set a target constant force value at the end of the robotic arm. In constant force holding control mode, continuously collect the contact force feedback from the end, compare it with the target constant force value, calculate the force deviation, and dynamically adjust the position of the end of the robotic arm according to the force deviation.

9. A transcranial magnetic stimulation robot flexible fitting method according to claim 8, characterized in that, The method for determining the effective fit is as follows: Set an upper limit threshold and a lower limit threshold for force fluctuation. When the contact force at the current sampling time is within the range of the lower limit threshold to the upper limit threshold for force fluctuation, it is determined that the current sampling time is in an effective contact state. The output condition of the bonding signal is as follows: the sampling time of continuous effective bonding is accumulated, and the bonding signal is output when the continuous accumulation time of effective bonding reaches the preset time.

10. A transcranial magnetic stimulation (TMS) robot flexible fitting system, used to implement the TMS robot flexible fitting method according to any one of claims 1-9, characterized in that, The system includes: Model building module: used to build a two-layer medium mechanics model that includes a nonlinear weak stiffness model of the hair layer and a high stiffness step model of the scalp layer, and to determine the force change slope threshold and configure the parameters of the micro-vibration detection signal; Contact determination module: used to control the end effector of the robotic arm to perform a composite feed motion superimposed with micro-vibration detection signals, collect end effector force feedback waveform and axial displacement data, generate real-time contact stiffness based on end effector force feedback waveform and axial displacement data, compare the real-time contact stiffness with the force change slope threshold and combine it with a two-layer medium mechanical model to determine the contact state; the contact state includes hair layer contact state and scalp layer contact state; Adhesion control module: In response to the scalp contact state, executes stop feed command and reverse retraction action, switches to constant force holding control mode, dynamically adjusts the position of the end of the robotic arm in constant force holding control mode, maintains the effective adhesion state between the coil and the scalp, and outputs a adhesion in place signal.

Citation Information

Patent Citations

  • Transcranial magnetic stimulation navigation and positioning robot system and positioning method

    CN108187230B

  • Method and device for controlling transcranial magnetic robot

    CN120420609A

  • Transcranial magnetic stimulation coil positioning control method and system and electronic equipment

    CN115154907A

  • Stimulation point positioning device for transcranial magnetic treatment of dyskinesia after cerebral apoplexy

    CN119113403A