Force feedback instruction output method and system in neurosurgical operation simulation
The neurosurgical simulation system, which utilizes high-frequency control and multi-channel coordination, solves the problems of delayed tactile feedback and multi-instrument coordination, achieving six-degree-of-freedom force feedback and improving the training effect and safety of neurosurgical simulation.
Patent Information
- Application Number
- CN202511254906.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-04
- Publication Date
- 2026-01-16
AI Technical Summary
Existing neurosurgical simulation systems suffer from problems such as high tactile feedback delay, inability to support multi-instrument collaborative operation, insufficient force feedback dimension, and lack of safety protection mechanisms, resulting in poor training effects and increased risks.
Employing high-frequency control (1kHz~5kHz), multi-channel collaboration, six-degree-of-freedom modeling, and safety monitoring, the system initializes the force feedback device, collects and analyzes encoder data in real time, dynamically adjusts the biomechanical model, generates six-degree-of-freedom force feedback commands, and monitors the device status to ensure safety.
It achieves sub-millisecond haptic feedback accuracy, supports two-handed collaborative operation, improves the realism and safety of operation, reduces the risk of misoperation, integrates an emergency stop protection mechanism, and significantly improves training effect.
Smart Images

Figure CN121349291A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of surgical simulation, and more particularly to a method and system for outputting force feedback commands in neurosurgical simulation. Background Technology
[0002] Neurosurgery, due to its confined operating space, complex anatomical structures (such as the brainstem and basal ganglia, which are submillimeter-sized structures), and high risks (such as massive hemorrhage caused by accidental vascular injury), demands extremely high precision and adaptability from surgeons. Traditional training relies on cadaver manipulation and animal experiments, which suffers from ethical limitations, high costs (over $5,000 per cadaver training session), and biomechanical distortions (dehydration and hardening of cadaver tissue, and significant differences between animal and human brain structures). In recent years, virtual reality (VR) surgical simulation systems have partially solved the visual training problem through 3D visualization technology, but the lack of tactile feedback prevents surgeons from perceiving tissue resistance, instrument clamping angles, and unexpected situations (such as sudden loss of force when a blood vessel ruptures) during actual surgery, severely limiting training effectiveness. A 2022 report by the World Federation of Neurosurgical Societies (WFNS) indicated that 83% of neurosurgeons considered tactile feedback to be the core bottleneck of surgical simulation systems.
[0003] In the field of neurosurgery, force feedback technology provides surgeons with a dynamic tactile connection to a virtual or remote operating environment by simulating the mechanical interactions experienced in real surgery. This technology can sense and provide feedback in real time on the forces between instruments and human tissues, such as the softness of brain tissue, the differences in tumor hardness, and the elastic characteristics of blood vessel walls. This helps surgeons control the force and direction of manipulation more precisely during training or actual surgery. By recreating the mechanical changes under complex anatomical structures (such as tissue deformation under pressure and instrument traction resistance), force feedback technology not only enhances the realism of surgical simulation training but also strengthens the operator's perception of the remote robotic arm in robot-assisted surgery, effectively reducing the risk of tissue injury due to tactile loss. It provides crucial sensory support for high-precision, high-risk neurosurgical procedures.
[0004] In existing technologies, force feedback technology has the following drawbacks:
[0005] (1) High tactile feedback delay: Existing technologies typically use low-frequency control cycles (≤100Hz), resulting in tactile delays exceeding 10ms, which is difficult to meet the precision requirements of neurosurgical procedures for sub-millisecond real-time feedback.
[0006] (2) Unable to support multi-device collaboration: Most systems rely on a single force feedback channel, which limits training for complex operations.
[0007] (3) Insufficient force feedback dimension: Traditional solutions only support three-dimensional force feedback (linear force), ignoring the simulation of torque components (such as the rotational resistance of the instrument), resulting in distorted operation feel and significantly increasing the risk of misoperation.
[0008] (4) Lack of safety protection mechanism: The existing solution lacks real-time monitoring and feedback status and emergency stop function, which can easily cause hardware damage or training accidents when the equipment is overloaded or communication is abnormal. Summary of the Invention
[0009] To address the aforementioned problems, the present invention aims to provide a method and system for outputting force feedback commands in neurosurgical simulation. Through high-frequency control, multi-channel collaboration, six-degree-of-freedom modeling, and safety monitoring, it systematically solves the core pain points of tactile feedback in neurosurgical simulation, providing reliable technical support for high-precision, high-risk surgical training.
[0010] The above-mentioned objective of this invention is achieved through the following technical solutions:
[0011] A method for outputting force feedback commands in neurosurgical simulation includes the following steps:
[0012] S1: Initialize the force feedback device, create a high-frequency service loop thread, and configure the independent control channels for the left and right hands of the surgical instruments respectively;
[0013] S2: Real-time acquisition of information from the force feedback device, including encoder data, joint angles, and the end-effector pose;
[0014] S3: Analyze the data stream of the encoder data, extract the clamping angle status signal of the surgical instrument, the suction force status signal of the suction device and the instrument replacement control signal, and convert the original hardware signals into operating parameters used by the biomechanical model;
[0015] S4: Dynamically adjust the biomechanical model according to the operating parameters, and dynamically calculate the interaction force between the nerve tissue and the surgical instruments based on the biomechanical model to generate a six-degree-of-freedom force feedback command.
[0016] S5: Send the six-degree-of-freedom force feedback command to the force feedback device and simultaneously update the instrument model status in the three-dimensional surgical scene;
[0017] S6: Monitor the operating status of the force feedback device, and shut down the feedback output and release resources when there is an abnormality or the operation is terminated.
[0018] Further, in step S1, the force feedback device is initialized, a high-frequency service loop thread is created, and the independent control channels for the left and right hands of the surgical instruments are configured respectively, specifically as follows:
[0019] The high-frequency service loop thread is created through a dynamic link library interface, and the preset loop frequency of the high-frequency service loop thread is 1kHz to 5kHz.
[0020] The configuration files for the surgical instruments for the left and right hands are loaded respectively, and the biomechanical parameters corresponding to the instrument types are defined. The biomechanical parameters include the elastic coefficient, damping system and viscosity coefficient.
[0021] Initialize the surgical instrument communication protocol and establish the independent control channel for the left hand and the independent control channel for the right hand.
[0022] Further, in step S2, information from the force feedback device, including encoder data, joint angles, and the end-effector pose, is collected in real time, specifically as follows:
[0023] The device status update interface is called repeatedly at the preset loop frequency of the high-frequency service loop thread to obtain the joint angles of the six degrees of freedom of the force feedback device and the three-dimensional coordinates of the surgical instrument end pose.
[0024] The encoder data includes a first encoder data stream and a second encoder data stream. The first encoder data stream is read to extract channel values E1, E2, and E3. Channel value E1 is mapped to the original signal value of the clamping angle state signal, channel value E2 is mapped to the suction force state signal of the suction device, and channel value E3 is the original signal value of the instrument changing control signal. The second encoder data stream is read synchronously to analyze the different signals of different surgical instruments fed back by the force feedback device.
[0025] Further, in step S3, the data stream of the encoder data is parsed to extract the clamping angle status signal of the surgical instrument, the suction force status signal of the suction device, and the instrument replacement control signal, specifically:
[0026] Surgical instruments for the left and right hands are processed independently through the independent control channels for the left and right hands, respectively, to avoid cross-interference of operating parameter data.
[0027] Multi-source signal real-time analysis is performed to extract the clamping angle status signal of the surgical instrument from the data stream of the encoder data. The digital signal of the multi-turn absolute encoder is analyzed through the synchronous serial interface SSI. The jaw opening and closing angle and its rate of change are calculated in real time. The input linear signal of the suction state signal of the suction device is decoded. The suction intensity is obtained through the linear signal. The control command in the bus protocol, which serves as the control signal for changing the instrument, is analyzed. The instrument change request is identified and the type identifier of the target instrument is obtained.
[0028] The tissue mechanical parameters are dynamically adjusted. Based on the difference between the jaw opening angle and the preset critical angle, the elastic coefficient of the biomechanical model is dynamically adjusted. When the actual angle is close to the critical angle, the elastic coefficient increases non-linearly with the increase of the angle difference. The damping coefficient is matched, and the preset damping parameter library is loaded according to the instrument type identification. If the device is replaced with a suction device, the viscous resistance is corrected in real time according to the trend of the suction intensity of the suction device. When the suction intensity drops rapidly, the viscous resistance characteristics of the tissue model are enhanced by a preset ratio to adjust the viscosity coefficient.
[0029] Further, in step S4, the biomechanical model is dynamically adjusted according to the operating parameters, and the interaction force between the neural tissue and the surgical instruments is dynamically calculated based on the biomechanical model to generate a six-degree-of-freedom force feedback command, specifically:
[0030] Based on the operating parameters, the tissue mechanical properties of the biomechanical model are simulated by adjusting the elastic coefficient, the damping coefficient, and the viscosity coefficient. The six degrees of freedom force includes three-dimensional force calculation in the linear direction and three-dimensional torque calculation in the rotational direction.
[0031] The formula for calculating the three-dimensional force is as follows:
[0032]
[0033]
[0034]
[0035] in, , and Let x be the vector of a three-dimensional force in a linear direction along the x, y, and z directions. , and Let x be the elastic coefficient in the x, y, and z directions. , and The displacement deviations are in the x, y, and z directions. , and Let be the damping coefficients in the x, y, and z directions. , and The velocity is measured in the x, y, and z directions.
[0036] The formula for calculating the three-dimensional torque is as follows:
[0037]
[0038]
[0039]
[0040] in, , and Let be the vector of the three-dimensional torque in the rotational direction in the x, y, and z directions. , and Let be the viscosity coefficients in the x, y, and z directions. , and Let x be the rotational stiffness in the x, y, and z directions. , and The rotation angle deviations are in the x, y, and z directions. , and Let x be the angular velocity in the x, y, and z directions.
[0041] Further, in step S5, the six-degree-of-freedom force feedback command is sent to the force feedback device, and the instrument model state in the three-dimensional surgical scene is updated synchronously, specifically as follows:
[0042] The six-degree-of-freedom force feedback command is transmitted at a preset frequency. Send to the force feedback device;
[0043] The positional data of the surgical instrument end effector is obtained through the homogeneous matrix interface, which drives the model changes in the 3D surgical scene and ensures that the visual-force feedback synchronization error is within the preset range.
[0044] At the same time, it enhances the sensitivity of force feedback when surgical instruments come into contact with high-risk areas.
[0045] Furthermore, in step S6, the operating status of the force feedback device is monitored, and the feedback output is turned off and resources are released in case of abnormality or termination of operation, specifically as follows:
[0046] The force feedback device output signal, including clamping angle and suction force status signal, is detected in real time. When the value of the output signal exceeds a preset threshold, an emergency stop protocol is triggered to disable the force feedback output.
[0047] Before releasing device resources, close the service loop thread and record the operation log, including the force curve and abnormal event codes.
[0048] Verify the device's safe shutdown status through the status monitoring interface.
[0049] A force feedback command output system for neurosurgical simulation, used to execute the force feedback command output method described above, comprises:
[0050] The device initialization and channel configuration module is used to initialize the force feedback device, create a high-frequency service loop thread, and configure the independent control channels for the left and right hands of the surgical instruments, respectively.
[0051] A multi-source data acquisition module is used to acquire information from the force feedback device in real time, including encoder data, joint angles, and the position of the surgical instrument end effector.
[0052] The operation parameter parsing and conversion module is used to parse the data stream of the encoder data, extract the clamping angle status signal of the surgical instrument, the suction force status signal of the suction device and the instrument replacement control signal, and convert the original hardware signals into operation parameters used by the biomechanical model.
[0053] The biomechanical dynamic feedback module is used to dynamically adjust the biomechanical model according to the operating parameters, and dynamically calculate the interaction force between the nerve tissue and the surgical instruments based on the biomechanical model to generate a six-degree-of-freedom force feedback command.
[0054] The feedback instruction synchronization execution module is used to send the six-degree-of-freedom force feedback instruction to the force feedback device and synchronously update the instrument model status in the three-dimensional surgical scene;
[0055] The status monitoring and resource management module is used to monitor the operating status of the force feedback device, and to shut down the feedback output and release resources when there is an abnormality or the operation is terminated.
[0056] A computer device includes a memory and one or more processors, the memory storing computer code that, when executed by the one or more processors, causes the one or more processors to perform the method described above.
[0057] A computer-readable storage medium storing computer code that, when executed, performs the method described above.
[0058] Compared with the prior art, the present invention has at least one of the following beneficial effects:
[0059] (1) Solve the problem of high tactile feedback delay: By creating a high-frequency service loop thread (1kHz~5kHz) and using a 1kHz force feedback command sending frequency, the tactile delay is reduced to <1ms, which meets the precision requirements of neurosurgery for sub-millisecond real-time feedback and significantly improves the realism and safety of the operation.
[0060] (2) Support for multi-instrument collaborative operation: Based on the independent control channels for the left and right hands and the separate channel parsing encoder data stream, independent control of different mechanical properties such as suction negative pressure and electrocoagulation knife resistance is realized, supporting two-hand collaborative operation (such as clamping-cutting synchronous training) and avoiding false feedback caused by parameter cross-interference.
[0061] (3) Realize six-degree-of-freedom force feedback: Simultaneously calculate three-dimensional force (Fx / Fy / Fz) and three-dimensional torque (Tx / Ty / Tz) through viscoelastic model, fully simulate the mechanical characteristics of linear propulsion and rotation operation of the instrument (such as brain tissue elasticity and electrocoagulation knife viscous resistance), improve the realism of operation feel by more than 40%, and effectively reduce the risk of misoperation.
[0062] (4) Integrated safety protection mechanism: By real-time monitoring of clamping angle, suction force status signal and abnormal event code, an emergency stop protocol is triggered and feedback output is forcibly shut down, protecting hardware safety and avoiding training accidents when the equipment is overloaded or communication is abnormal. Attached Figure Description
[0063] Figure 1 This is an overall flowchart of the force feedback command output method in the neurosurgical simulation of the present invention;
[0064] Figure 2 This is an overall structural diagram of the force feedback command output system in the neurosurgical simulation of the present invention. Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0066] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0067] First Embodiment
[0068] like Figure 1 As shown, this embodiment provides a method for outputting force feedback commands in neurosurgical simulation, characterized by the following steps:
[0069] S1: Initialize the force feedback device, create a high-frequency service loop thread, and configure the independent control channels for the left and right hands of the surgical instruments respectively.
[0070] In this embodiment, step S1 specifically includes:
[0071] The high-frequency service loop thread is created through the dynamic link library interface, and the loop frequency of the high-frequency service loop thread is preset to 1kHz to 5kHz; the configuration files of the left and right hand surgical instruments are loaded respectively, and the biomechanical parameters corresponding to the instrument types are defined. The biomechanical parameters include elastic coefficient, damping system and viscosity coefficient; the surgical instrument communication protocol is initialized, and the independent control channel for the left hand and the independent control channel for the right hand are established respectively.
[0072] For example, in neurosurgical simulation systems, the initialization process of force feedback devices directly determines the surgeon's operational experience and training effectiveness in virtual surgery. Taking brain tumor resection surgery as an example, the surgeon needs to operate the suction device and bipolar electrocautery forceps with both hands. During system initialization, the system first calls the underlying interface provided by the hardware manufacturer (such as Geomagic Touch's OpenHaptics SDK) through a dynamic link library to create a high-frequency service thread with a frequency of 5kHz. This thread continuously schedules device status updates and command transmissions at a period of 0.2ms, compressing the latency of traditional force feedback systems from more than 10ms to less than 0.5ms. This allows the surgeon to perceive the mechanical interaction between the instruments and tissues in real time when dissecting tumors around the brainstem, avoiding the "operational lag" caused by delays, and significantly reducing the risk of accidental injury, especially in high-precision scenarios (such as separating optic nerve adhesions). Subsequently, the system loads the configuration files for the left and right hand instruments respectively: the elastic coefficient of the left-hand aspirator is set to 0.2 kPa to simulate the softness of brain tissue, the viscosity coefficient is 0.1 to correspond to the slight resistance of cerebrospinal fluid, and the damping coefficient is configured to 0.8 Ns / m to suppress vibration during negative pressure adsorption; the right-hand electrocoagulation forceps are loaded with tumor cutting parameters, the elastic coefficient is increased to 5.0 kPa to simulate a hard feel, the viscosity coefficient is 0.6 based on the power-impedance model to dynamically calculate the nonlinear resistance of carbonized tissue, and a dual-channel control is established through an independent communication protocol—the left-hand channel is dedicated to transmitting the negative pressure intensity and three-dimensional position data of the aspirator, and the right-hand channel handles the rotational torque and power level feedback of the electrocoagulation forceps. When the electrocoagulation forceps contact the simulated blood vessel, the viscosity coefficient increases exponentially with the preset power level parameter. Once the kinetic model detects that the virtual clamping force exceeds the safety threshold of 5 N (such as accidentally clamping an important blood vessel), the system immediately reduces the viscosity coefficient to zero and triggers a tactile warning, while maintaining the preset negative pressure parameter of the aspirator channel to ensure the continuity of bloodletting removal. This multi-channel, high-frequency response initialization design, through the coupling of preset parameters and dynamic mechanical models, enables independent adaptation of the mechanical properties of the two-handed instruments, avoiding dependence on external sensors. At the same time, it ensures operational safety through virtual parameter adjustment and abnormal simulation mechanisms. By setting different force feedback parameters for different anatomical structures of brain tissue and different deformation visual effects of different tissues, it cultivates doctors' habits of fine operation in virtual training and improves their operational ability in real surgery.
[0073] S2: Real-time acquisition of information from the force feedback device, including encoder data, joint angles, and the position of the surgical instrument end effector.
[0074] In this embodiment, step S2 specifically includes:
[0075] The device status update interface is called repeatedly at the preset loop frequency of the high-frequency service loop thread to obtain the joint angles of the six degrees of freedom of the force feedback device and the three-dimensional coordinates of the surgical instrument end pose.
[0076] The encoder data includes a first encoder data stream and a second encoder data stream. The first encoder data stream is read to extract channel values E1, E2, and E3. Channel value E1 is mapped to the original signal value of the clamping angle state signal, channel value E2 is mapped to the original signal value of the suction force state signal of the suction device, and channel value E3 is the original signal value of the instrument change control signal. The second encoder data stream is read synchronously to analyze the different signals of different surgical instruments fed back by the force feedback device.
[0077] In neurosurgical simulation systems, the scheduling of high-frequency service loop threads and encoder data parsing are the core technologies supporting real-time tactile feedback. The system cyclically calls the device status update interface at a fixed frequency of 5kHz, acquiring the six-degree-of-freedom joint angles and instrument end-effector pose information of the force feedback device in real time through underlying hardware drivers. After inverse kinematics calculations, the joint angle data is precisely converted into the instrument end-effector's coordinates (X / Y / Z) and posture (pitch, yaw, roll) in three-dimensional space, and mapped to the virtual surgical scene via a homogeneous matrix. This ensures that the instrument model's position in visual space is completely consistent with the actual operation, with spatial errors strictly controlled within 0.1 mm. This mechanism allows surgeons to perceive the contact state between the instrument tip and tissue in real time through touch when simulating the removal of small tumors in the brainstem, avoiding misoperations caused by pose deviations.
[0078] The encoder data is divided into a first encoder data stream and a second encoder data stream. In the first data stream parsing, channel value E1 converts the original signal into a clamping angle state signal of 0-120° through linear mapping (e.g., ADC value 2048 corresponds to 60°), and generates elastic feedback force based on the angle change rate. When the angle change rate is detected to be >15° / ms, a tissue tear warning is triggered. Channel value E2 is parsed into a suction force state signal of the aspirator using a piecewise nonlinear function. The low suction range of 0-10kPa is linearly mapped, and the high suction range of 10-50kPa increases exponentially. The adsorption deformation range is calculated by combining the fluid dynamics model (25kPa corresponds to an adsorption radius of 3.2mm). Channel value E3 serves as a control signal for changing instruments. When the signal value exceeds the 2.5V threshold, an instrument switching command is triggered. The coding rule is 0.5-1.0V corresponds to bipolar electrocoagulation forceps, 1.0-2.0V corresponds to the aspirator, and 2.0-3.3V corresponds to microscissors. The second data stream analyzes differentiated signals based on the type of activated device: bipolar electrocoagulation forceps extract 0-5Ω impedance characteristic parameters (increased to 3.2Ω in coagulation mode), aspirator analyzes the frequency-resonance relationship of 40kHz corresponding to 80μm amplitude (compensating for ±5μm error), and microscissors decode 0-3.3V corresponding to 200-800N / m shear stiffness coefficient. When the E3 channel triggers device switching, the system reloads the second signal analysis rules within 2ms (e.g., switching to microscissors and enabling the shear force mapping table), while maintaining the baseline parameters of the unactivated device (e.g., maintaining a base impedance of 0.5Ω after the electrocoagulation forceps are closed). The two data streams are synchronized in less than 20μs time through hardware interrupts. The E1 channel is filtered by a 5ms window moving average to eliminate ±0.3° angle jitter, and the E2 channel is fitted with a cubic polynomial to compensate for nonlinear errors (residual <0.5kPa). When the E3 signal is invalid or the second signal is out of tolerance (e.g., a sudden change in microsurgical shear force >50%), the current parameters are immediately locked and a tactile alarm (3 pulse vibrations per second) is triggered or the safety parameter set is returned. This design allows doctors to perceive the precise mapping of forceps clamping angle-elasticity feedback and suction force-deformation during two-handed operation, and to automatically obtain the corresponding mechanical characteristics when switching instruments, providing real-time dynamic tactile safety assurance for delicate operations such as brain tumor resection.
[0079] S3: Analyze the data stream of the encoder data, extract the clamping angle status signal of the surgical instrument, the suction force status signal of the suction device, and the instrument replacement control signal, and convert the original hardware signals into operating parameters used by the biomechanical model.
[0080] In this embodiment, step S3 specifically includes:
[0081] Surgical instruments for the left and right hands are processed independently through the independent control channels for the left and right hands, respectively, to avoid cross-interference of operating parameter data.
[0082] Multi-source signal real-time analysis is performed to extract the clamping angle status signal of the surgical instrument from the data stream of the encoder data. The digital signal of the multi-turn absolute encoder is analyzed through the synchronous serial interface SSI. The jaw opening and closing angle and its rate of change are calculated in real time. The input linear signal of the suction state signal of the suction device is decoded. The suction intensity is obtained through the linear signal. The control command in the bus protocol, which serves as the control signal for changing the instrument, is analyzed. The instrument change request is identified and the type identifier of the target instrument is obtained.
[0083] The tissue mechanical parameters are dynamically adjusted. Based on the difference between the jaw opening angle and the preset critical angle, the elastic coefficient of the biomechanical model is dynamically adjusted. When the actual angle is close to the critical angle, the elastic coefficient increases non-linearly with the increase of the angle difference. The damping coefficient is matched, and the preset damping parameter library is loaded according to the instrument type identification. If the device is replaced with a suction device, the viscous resistance is corrected in real time according to the trend of the suction intensity of the suction device. When the suction intensity drops rapidly, the viscous resistance characteristics of the tissue model are enhanced by a preset ratio to adjust the viscosity coefficient.
[0084] S4: Dynamically adjust the biomechanical model according to the operating parameters, and dynamically calculate the interaction force between the nerve tissue and the surgical instruments based on the biomechanical model to generate a six-degree-of-freedom force feedback command.
[0085] In this embodiment, step S4 specifically includes:
[0086] Based on the operating parameters, the tissue mechanical properties of the biomechanical model are simulated by adjusting the elastic coefficient, damping coefficient, and viscosity coefficient. The six degrees of freedom force includes three-dimensional force calculation in the linear direction and three-dimensional torque calculation in the rotational direction.
[0087] The formula for calculating the three-dimensional force is as follows:
[0088]
[0089]
[0090]
[0091] in, , and Let x be the vector of a three-dimensional force in a linear direction along the x, y, and z directions. , and Let x be the elastic coefficient in the x, y, and z directions. , and The displacement deviations are in the x, y, and z directions. , and Let be the damping coefficients in the x, y, and z directions. , and The velocity is measured in the x, y, and z directions.
[0092] The formula for calculating the three-dimensional torque is as follows:
[0093]
[0094]
[0095]
[0096] in, , and Let be the vector of the three-dimensional torque in the rotational direction in the x, y, and z directions. , and Let be the viscosity coefficients in the x, y, and z directions. , and Let x be the rotational stiffness in the x, y, and z directions. , and The rotation angle deviations are in the x, y, and z directions. , and Let x be the angular velocity in the x, y, and z directions.
[0097] S5: Send the six-degree-of-freedom force feedback command to the force feedback device and simultaneously update the instrument model status in the three-dimensional surgical scene.
[0098] In this embodiment, step S5 specifically includes:
[0099] The six-degree-of-freedom force feedback command is transmitted at a preset frequency. The data is sent to the force feedback device; the positional data of the surgical instrument end effector is obtained through the homogeneous matrix interface, driving the model changes in the three-dimensional surgical scene to ensure that the visual-force feedback synchronization error is within a preset range; at the same time, the force feedback sensitivity is enhanced when the surgical instrument contacts a high-risk area.
[0100] In the neurosurgical simulation system, step S5 achieves real-time coordination between high-precision force feedback and the visual scene through three key technical steps:
[0101] (1) Preset frequency command transmission: The system sends six-degree-of-freedom force feedback commands (three-dimensional force + three-dimensional torque) to the force feedback device at a fixed frequency of 1kHz to ensure that the tactile delay is less than 1ms. For example, when a doctor cuts a tumor with an electrocautery knife, the system updates the cutting resistance command every 1ms, so that the doctor's hand perception is completely synchronized with the virtual instrument's movement, avoiding the "operation lag" or "feedback delay" caused by traditional low-frequency control (such as 100Hz).
[0102] (2) Homogeneous Matrix Synchronization Drive: The force feedback device acquires the position (X / Y / Z coordinates) and attitude (rotation matrix) of the instrument tip in real time through a 16-dimensional homogeneous matrix interface, driving the update of the virtual model in the three-dimensional surgical scene. The visual-force feedback synchronization error is controlled within 0.2ms, ensuring that the movement trajectory of the surgical instrument seen by the doctor is strictly consistent with the tactile feedback from the hand. For example, when peeling off the 0.1mm thick meninges around the brainstem, the displacement error of the instrument tip in the visual scene does not exceed 0.05mm, and the tactile resistance changes precisely with the displacement, achieving a "hand-eye consistency" operation experience.
[0103] (3) Enhanced sensitivity in high-risk areas: When the instrument comes into contact with pre-set high-risk areas such as the brainstem and optic nerve, the system dynamically enhances the sensitivity of force feedback (elasticity coefficient is increased by 1.2-1.5 times). For example, when the tip of the forceps approaches the brainstem, the resistance to advancement suddenly increases from 0.5N in normal brain tissue to 0.8N, creating a significant "resistance sensation," which alerts the doctor to stop the operation without relying on visual warnings. This tactile enhancement mechanism increases the doctor's error tolerance in complex anatomical areas by 60% and significantly reduces the risk of accidental injury to simulated tissues during training.
[0104] S6: Monitor the operating status of the force feedback device, and shut down the feedback output and release resources when there is an abnormality or the operation is terminated.
[0105] In this embodiment, step S6 specifically includes:
[0106] The system monitors the output signals of the force feedback device in real time, including clamping angle and suction force status signals. When the value of the output signal exceeds a preset threshold, an emergency stop protocol is triggered to disable the force feedback output. Before releasing device resources, the service loop thread is closed and an operation log, including abnormal event codes, is recorded. The system also verifies the safe shutdown status of the device through a status monitoring interface.
[0107] Second Embodiment
[0108] like Figure 2 As shown, this embodiment provides a force feedback command output system for neurosurgical simulation, used to execute the force feedback command output method in neurosurgical simulation as described in the first embodiment, characterized in that it includes:
[0109] The device initialization and channel configuration module 1 is used to initialize the force feedback device, create a high-frequency service loop thread, and configure the independent control channels for the left and right hands of the surgical instruments, respectively.
[0110] Multi-source data acquisition module 2 is used to acquire information from the force feedback device in real time, including encoder data, joint angles, and the position of the surgical instrument end effector.
[0111] The operation parameter parsing and conversion module 3 is used to parse the data stream of the encoder data, extract the clamping angle status signal of the surgical instrument, the suction force status signal of the suction device and the instrument replacement control signal, and convert the original hardware signals into operation parameters used by the biomechanical model.
[0112] The biomechanical dynamic feedback module 4 is used to dynamically adjust the biomechanical model according to the operating parameters, and dynamically calculate the interaction force between the nerve tissue and the surgical instruments based on the biomechanical model to generate a six-degree-of-freedom force feedback command.
[0113] Feedback instruction synchronization execution module 5 is used to send the six-degree-of-freedom force feedback instruction to the force feedback device and synchronously update the instrument model status in the three-dimensional surgical scene;
[0114] The status monitoring and resource management module 6 is used to monitor the operating status of the force feedback device, and to shut down the feedback output and release resources when there is an abnormality or the operation is terminated.
[0115] A computer-readable storage medium stores computer code that, when executed, performs the methods described above. Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. This program can be stored in a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0116] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.
[0117] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0118] It should be noted that the above embodiments can be freely combined as needed. The above description is only a preferred embodiment of the present invention. It should be pointed out that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for outputting force feedback instructions in a neurosurgical simulation, characterized by, The method comprises the following steps: S1: initializing the force feedback device, creating a high-frequency service cycle thread, and respectively configuring a left-hand independent control channel and a right-hand independent control channel of left-hand and right-hand surgical instruments; S2: collecting information of the force feedback device in real time, including encoder data, joint angle, and end position of the surgical instrument; S3: analyzing the data stream of the encoder data, extracting the clamping angle state signal, the aspirator suction state signal, and the instrument replacement control signal of the surgical instrument, and converting the original hardware signal into an operating parameter used by a biomechanical model; S4: dynamically adjusting the biomechanical model according to the operating parameter, and dynamically calculating the interaction force between the neural tissue and the surgical instrument based on the biomechanical model to generate a six-degree-of-freedom force feedback instruction; S5: sending the six-degree-of-freedom force feedback instruction to the force feedback device, and synchronously updating the instrument model state in the three-dimensional surgical scene; S6: monitoring the running state of the force feedback device, and closing the feedback output and releasing resources when an exception or operation termination occurs.
2. The neurosurgery simulation force feedback command output method according to claim 1, characterized by, In step S1, the force feedback device is initialized, a high-frequency service cycle thread is created, and a left-hand independent control channel and a right-hand independent control channel of left-hand and right-hand surgical instruments are respectively configured, specifically: The high-frequency service cycle thread is created through a dynamic link library interface, and the cycle frequency of the high-frequency service cycle thread is preset to be 1 kHz to 5 kHz; Configuration files of left-hand and right-hand surgical instruments are respectively loaded, and biomechanical parameters corresponding to the instrument types are defined, wherein the biomechanical parameters include an elastic coefficient, a damping system, and a viscous coefficient; The surgical instrument communication protocol is initialized, and the left-hand independent control channel and the right-hand independent control channel are respectively established.
3. The neurosurgery simulation force feedback command output method according to claim 1, wherein In step S2, information of the force feedback device is collected in real time, including encoder data, joint angle, and end position of the surgical instrument, specifically: The device state update interface is called in a cycle with a preset cycle frequency of the high-frequency service cycle thread, the six-degree-of-freedom joint angle of the force feedback device, and three-dimensional coordinates of the end position of the surgical instrument are obtained; The encoder data includes a first encoder data stream and a second encoder data stream, the first encoder data stream is read to extract channel values E1, E2, and E3, the channel value E1 is mapped to the original signal value of the clamping angle state signal, the channel value E2 is mapped to the original signal value of the aspirator suction state signal, and the channel value E3 is the original signal value of the instrument replacement control signal, the second encoder data stream is synchronously read, and different signals of different surgical instruments fed back by the force feedback device are analyzed.
4. The neurosurgery simulation force feedback command output method according to claim 3, characterized by, In step S3, the data stream of the encoder data is analyzed, and the clamping angle state signal, the aspirator suction state signal, and the instrument replacement control signal of the surgical instrument are extracted, specifically: The left-hand and right-hand surgical instruments are respectively independently processed through the left-hand independent control channel and the right-hand independent control channel to avoid cross interference of operating parameter data; The multi-source signal is analyzed in real time, the clamping angle state signal of the surgical instrument is extracted from the data stream of the encoder data, the digital signal of the multi-turn absolute value encoder is analyzed through a synchronous serial interface (SSI), the opening and closing angle of the forceps and its change rate are calculated in real time, the incoming linear signal of the suction force state signal is decoded, the suction strength is obtained through the linear signal, the control instruction as the replacement instrument control signal in the bus protocol is analyzed, the replacement instrument request is identified and the type identification of the target instrument is obtained; The dynamic adjustment of the tissue mechanical parameters is performed, the elastic coefficient of the biomechanical model is dynamically adjusted according to the difference between the opening and closing angle of the forceps and the preset critical angle, when the actual angle approaches the critical angle, the elastic coefficient increases nonlinearly with the increase of the angle difference, the damping coefficient is matched, the preset damping parameter library is loaded according to the instrument type identification, if the suction device is replaced, the viscous resistance of the tissue model is enhanced according to the suction strength change trend of the suction device, and when the suction strength rapidly decreases, the viscous resistance characteristic of the tissue model is enhanced by a preset proportion, so as to adjust the viscous coefficient.
5. The neurosurgery simulation force feedback command output method according to claim 4, characterized by, In step S4, the biomechanical model is dynamically adjusted according to the operation parameters, and the interaction force between the neural tissue and the surgical instrument is dynamically calculated based on the biomechanical model to generate a six-degree-of-freedom force feedback instruction, specifically: The elastic coefficient, the damping coefficient and the viscous coefficient are adjusted according to the operation parameters to simulate the tissue mechanical characteristics of the biomechanical model, and the six-degree-of-freedom force includes three-dimensional force calculation in linear direction and three-dimensional torque calculation in rotation direction; The formula of the three-dimensional force calculation is as follows: wherein, , , are vectors of three-dimensional forces in linear directions in x, y, z directions, , , are elastic coefficients in x, y, z directions, , , are displacement deviations in x, y, z directions, , , are damping coefficients in x, y, z directions, , , are motion velocities in x, y, z directions; The formula of the three-dimensional torque calculation is as follows: wherein, , and are vectors of three-dimensional torques in the direction of rotation in the x, y, z directions, , and are viscous coefficients in the x, y, z directions, , and are rotational stiffnesses in the x, y, z directions, , and are rotational angle deviations in the x, y, z directions, , and are angular velocities in the x, y, z directions.
6. The neurosurgery simulation force feedback command output method according to claim 1, wherein, In step S5, the six-degree-of-freedom force feedback instruction is sent to the force feedback device, and the instrument model state in the three-dimensional surgical scene is updated synchronously, specifically: The six-degree-of-freedom force feedback command is transmitted at a preset frequency. Send to the force feedback device; The end position data of the surgical instrument is obtained through a homogeneous matrix interface to drive the model change in the three-dimensional surgical scene, so as to ensure that the visual-force feedback synchronization error is within a preset range; Meanwhile, when the surgical instrument contacts a high-risk area, the force feedback sensitivity is enhanced.
7. The neurosurgery simulation force feedback command output method according to claim 1, wherein, In step S6, the running state of the force feedback device is monitored, the feedback output is closed and the resources are released when an exception occurs or the operation is terminated, specifically: The output signal of the force feedback device including the clamping angle and the suction force state signal is detected in real time, when the value of the output signal exceeds a preset threshold, an emergency stop protocol is triggered to disable the force feedback output; Before releasing the device resources, a service cycle thread is closed and an operation log including an exception event code is recorded; The safety closing state of the device is verified through a state monitoring interface.
8. A neurosurgery simulation haptic instruction output system for executing the neurosurgery simulation haptic instruction output method according to any one of claims 1 to 7, characterized by, It includes: A device initialization and channel configuration module for initializing the force feedback device, creating a high-frequency service cycle thread and configuring a left-hand independent control channel and a right-hand independent control channel of the left-hand and right-hand surgical instruments respectively; A multi-source data acquisition module for acquiring information including encoder data, joint angle and end position of the surgical instrument of the force feedback device in real time; An operation parameter analysis and conversion module is configured to analyze a data stream of the encoder data, extract a clamping angle state signal of a surgical instrument, an aspirator suction force state signal, and an instrument replacement control signal, and convert original hardware signals into operation parameters used by a biomechanical model. A biomechanical dynamic feedback module is configured to dynamically adjust the biomechanical model according to the operation parameters, dynamically calculate an interaction force between a neural tissue and the surgical instrument based on the biomechanical model, and generate a six-degree-of-freedom force feedback instruction. A feedback instruction synchronous execution module is configured to send the six-degree-of-freedom force feedback instruction to the force feedback device and synchronously update a state of an instrument model in a three-dimensional surgical scene. A state monitoring and resource management module is configured to monitor a running state of the force feedback device, and close feedback output and release resources when an exception or operation termination occurs. 9.A computer device, comprising a memory and one or more processors, wherein the memory stores computer code, and the computer code, when executed by the one or more processors, causes the one or more processors to perform the method according to any one of claims 1 to 7. 10.A computer readable storage medium, wherein the computer readable storage medium stores computer code, and the computer code, when executed, causes the method according to any one of claims 1 to 7 to be performed.