Dual-purpose multi-channel rehabilitation electrical stimulator and waveform generation method
The rehabilitation electrostimulation device that integrates electrostimulation therapy and electrotactile feedback functions solves the problem of the single function of existing equipment, realizes flexible switching and multi-channel adaptation, improves the versatility and ease of operation of the equipment, and enhances the rehabilitation effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN UNIV OF TECH
- Filing Date
- 2025-12-19
- Publication Date
- 2026-04-21
AI Technical Summary
Existing rehabilitation electrostimulation devices have limited functionality and cannot support both electrostimulation therapy and electrotactile feedback on the same hardware platform. This results in limited applicability and cumbersome operation procedures, making it impossible to provide a continuous and personalized rehabilitation experience.
A dual-purpose multi-channel rehabilitation electrostimulator was designed, integrating electrostimulation therapy and electrotactile feedback functions. Through components such as a control module, polarity conversion module, constant current drive circuit, channel selection module, electrotactile electrodes, and electrostimulation electrodes, flexible switching of functions and multi-channel adaptation are realized.
It integrates electrical stimulation therapy with electrotactile feedback, improving the versatility and ease of operation of the equipment, adapting to the diverse needs of different rehabilitation stages, and enhancing human-computer interaction and rehabilitation efficiency.
Smart Images

Figure CN121891707A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of rehabilitation medical equipment technology, specifically relating to a dual-purpose multi-channel rehabilitation electrical stimulator and a waveform generation method. Background Technology
[0002] Functional electrotherapy (FEM), a technique that uses electrical current to stimulate nerves or muscles to achieve therapeutic effects, has significant application value in the field of rehabilitation medicine. This method utilizes controllable electrical currents to stimulate muscle tissue, inducing muscle contraction and joint movement, effectively increasing muscle involvement during rehabilitation training, maintaining muscle physiological activity, and slowing down muscle atrophy, thereby promoting overall rehabilitation efficiency. However, FEM has significant limitations in its implementation. Due to the lack of effective neural feedback pathways, the patient's subjective conscious participation is low, making it difficult to actively reconstruct neural pathways in the brain, thus affecting the depth and persistence of rehabilitation effects. Meanwhile, electro-driven neurotactile technology provides tactile feedback through an array of electrodes on the skin surface, enabling patients to perceive the movement status of the affected limb in real time, helping to construct a natural closed-loop "sensory-motor" system, significantly enhancing human-computer interaction capabilities and accelerating the recovery of neurological function.
[0003] In actual rehabilitation practice, patients at different stages of rehabilitation require differentiated training strategies, and their electrical stimulation needs change dynamically accordingly, demanding that equipment be flexible and adaptable. However, current electrical stimulation devices on the market generally suffer from limited functionality, unable to simultaneously support both electrical stimulation therapy and electrotactile feedback—two core functions—on a single hardware platform. Electrotactile feedback devices, in particular, are often highly customized designs with complex structures and poor versatility, making it difficult to meet the flexible needs of diverse rehabilitation scenarios. This results in limited applicability, cumbersome operation procedures, and an inability to provide patients with a continuous and personalized rehabilitation experience.
[0004] To address the aforementioned issues, existing technologies urgently need improvement. Summary of the Invention
[0005] The purpose of this invention is to address the shortcomings of the aforementioned background technology by providing a dual-purpose multi-channel rehabilitation electrostimulation device and waveform generation method, which has the advantages of integrating electrostimulation therapy and electrotactile feedback functions, improving the versatility and ease of operation of the device.
[0006] The technical solution adopted in this invention is: a dual-purpose multi-channel rehabilitation electrical stimulation device, comprising... The main control module is used to generate mode selection signals, gating signals, constant current signals, electrical stimulation signals, or electrotactile signals based on rehabilitation training instructions; The polarity conversion module is used to generate bipolar electrotactile waveforms based on electrotactile signals or bipolar electrical stimulation waveforms based on electrical stimulation signals. A constant current drive circuit is used to control the current output by the polarity conversion module based on a constant current signal. The channel selection module is used to control the on / off state of multiple electrode points on the electrotactile electrodes based on the bipolar electrotactile waveform and the gating signal; Electrotactile electrodes are used to output bipolar electrical stimulation waveforms; Electrical stimulation electrodes are used to distinguish bipolar electrical stimulation waveforms.
[0007] Furthermore, the polarity conversion module includes a first optical coupler, a second optical coupler, a third optical coupler, and a fourth optical coupler. The positive input terminals of the first and fourth optocouplers are connected to the high-level stimulation signal output terminal and the negative input terminal of the main control module, respectively, and are grounded through resistors. The positive input terminals of the second and third optocouplers are connected to the low-level stimulation signal output terminal and the negative input terminal of the main control module, respectively, and are grounded through resistors. The positive terminals of the first and third optocouplers are connected to a high-voltage source, and the negative terminals of the second and fourth optocouplers are connected to the current input terminal of the constant current drive circuit. The negative output terminal of the first optocoupler and the positive output terminal of the second optocoupler are both connected to the positive electrode signal selection terminal of the channel selection module; The negative output terminal of the third optocoupler and the positive output terminal of the fourth optocoupler are both connected to the negative electrode signal selection terminal of the channel selection module.
[0008] Furthermore, the constant current drive circuit includes an operational amplifier, a switching transistor, a capacitor, a first resistor, and a second resistor. The non-inverting input of the operational amplifier is connected to the constant current signal output of the main control module, one end of the capacitor, and one end of the second resistor. The output of the operational amplifier is connected to the other end of the capacitor and the control terminal of the switching transistor. The input of the switching transistor is connected to the current output of the polarity conversion module, and the output is connected to one end of the first resistor and the other end of the second resistor. The other end of the first resistor is grounded.
[0009] Furthermore, the channel selection module includes multiple multi-channel analog switch circuit chips. These chips receive bipolar stimulation waveforms generated by the polarity conversion module and selectively connect the positive and negative electrode points through gating signals to form different tactile feedback modes.
[0010] Furthermore, the electrotactile electrode includes a flexible ribbon cable with multiple channels. One end of the flexible ribbon cable is connected to the output terminal of the channel selection module, and the other end of the flexible ribbon cable is connected to multiple electrode points. The multiple electrode points are arranged in a hexagonal distribution and the positive and negative electrode points are arranged alternately to form a tactile electrode array.
[0011] Furthermore, the plurality of electrode points includes six positive electrode points and four negative electrode points, which are distributed on two partially overlapping vertices of a regular hexagon, and the diameter of the positive electrode points is larger than the diameter of the negative electrode points.
[0012] Furthermore, it also includes a display module for displaying the current mode selection, channel connectivity, and waveform stimulation parameters, the output of which is connected to the input of the main control module.
[0013] Furthermore, the main control module uses a 13-bit data packet to communicate with the host computer to obtain rehabilitation training instructions. The data packet includes four parts: packet header, data packet length, control information, and check bit. The control information includes mode selection information, frequency pulse width values of each channel of constant current reference value, and electrotactile gating value.
[0014] A waveform generation method based on the above-mentioned dual-purpose multi-channel rehabilitation electrical stimulator includes the following steps: The main control module receives data packets from the host computer and parses the data packets to obtain mode selection information, constant current reference value, frequency pulse width value of each channel and electrotactile gating value; Based on the parsed mode selection information, select either electrical stimulation waveform output or electrotactile waveform output; Based on the analyzed frequency and pulse width values, a timer interrupt mechanism is used to generate a bipolar electrical stimulation waveform with adjustable frequency and pulse width by determining the number of waveform flips and the period.
[0015] Furthermore, the step of generating a bipolar electrical stimulation waveform with adjustable frequency and pulse width by using a timer interrupt mechanism to determine the number of waveform flips and the period based on the analyzed frequency and pulse width values includes: A timer is started for both waveform frequency and pulse width; When the frequency timer interrupt is triggered, set Wave_Ctrl to 1 to start a new waveform cycle; When the pulse width timer interrupts for the first time, the waveform flips for the first time, and Toggle_Count is incremented by 1. When the pulse width timer interrupts for the second time, the waveform flips for the second time. The Toggle_Count value is set to 2, the waveform output for this cycle stops, Wave_Ctrl is set to 0, and the Toggle_Count value is set to 0. The above process is repeated continuously, outputting a bipolar electrical stimulation waveform. Among them, Wave_Ctrl is 1 to indicate that there is no complete waveform output in the current cycle, and 0 to indicate that the waveform is completely output in the current cycle. Toggle_Count records the number of times the waveform flips in the current cycle.
[0016] The beneficial effects of this invention are as follows: This invention integrates components such as a control module, a polarity conversion module, and a channel selection module to achieve flexible switching and multi-channel adaptation of electrostimulation therapy and electrotactile feedback functions. It solves the problem of the single function of existing rehabilitation electrostimulation devices and has the advantages of integrating electrostimulation therapy and electrotactile feedback functions, improving the versatility and ease of operation of the device.
[0017] The polarity conversion module of this invention uses an optocoupler for switch control, which can isolate high and low voltage environments, protect the MCU, and improve the service life of the equipment. A constant current drive circuit is connected to the end of the polarity conversion module, which keeps the output current loop current value stable and improves the system's anti-interference capability.
[0018] This invention provides a bipolar waveform output method based on timer interrupts, which can continuously output stable and controllable electrical stimulation waveforms, with the advantages of high control precision and rapid response. Based on precise timing, it fully releases CPU space to ensure system operating efficiency and scalability, and reduces the difficulty of applying electrical stimulation in more complex rehabilitation scenarios. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the hardware architecture of the electrical stimulator of the present invention.
[0020] Figure 2 This is a schematic diagram of the polarity conversion module of the present invention.
[0021] Figure 3 This is a schematic diagram of the constant current drive circuit of the present invention.
[0022] Figure 4 This is a schematic diagram of the channel electrode of the present invention.
[0023] Figure 5 This is a detailed schematic diagram of the tactile electrode array of the present invention.
[0024] Figure 6 This is a schematic diagram of the channel selection module of the present invention.
[0025] Figure 7 This is a schematic diagram of the display module of the present invention.
[0026] Figure 8 This is a schematic diagram illustrating the composition of the 13-byte data packet of the present invention. Figure 9 This is a flowchart illustrating the overall architecture of the present invention.
[0027] Figure 10 This is a flowchart of the data packet parsing process of the present invention.
[0028] Figure 11 This is a flowchart illustrating the process of assigning channel parameters in this invention.
[0029] Figure 12 This is a flowchart of the waveform generation process of the present invention.
[0030] Figure 13 This is a waveform diagram of the present invention.
[0031] Figure 14 This is a schematic diagram of the electrical stimulator of the present invention.
[0032] Figure 15 This is a schematic diagram showing the connection between the electrotactile and electrostimulation electrodes of the present invention, the H-bridge, and the MCU. Detailed Implementation
[0033] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.
[0034] It should be understood that references to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of the invention include the specific features, structures, or characteristics described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0035] This application provides a dual-purpose multi-channel rehabilitation electrical stimulation device, comprising: The control module is used to generate mode selection signals, gating signals, constant current signals, electrical stimulation signals, or electrotactile signals based on rehabilitation training instructions; The polarity conversion module is used to generate bipolar electrotactile waveforms based on electrotactile signals or bipolar electrical stimulation waveforms based on electrical stimulation signals. A constant current drive circuit is used to control the current output by the polarity conversion module based on a constant current signal. The channel selection module is used to control the on / off state of multiple electrode points on the tactile electrodes based on the bipolar electrotactile waveform and the gating signal; Tactile electrodes are used to output bipolar electrotactile waveforms. Stimulating electrodes are used to output bipolar electrical stimulation waveforms.
[0036] In practical applications, the control module can be understood as a signal generation unit. Its main function is to generate various signals based on externally input rehabilitation training instructions to coordinate the device's operating mode. Specifically, the control module can be implemented using an embedded processor or a programmable logic controller, such as a microcontroller or FPGA chip based on an ARM architecture. Its main purpose is to dynamically adjust the device's operating state.
[0037] A polarity conversion module is a circuit structure capable of converting a unipolar signal into a bipolar signal, with the aim of ensuring that the output waveform can switch between positive and negative polarities. As a preferred implementation, the polarity conversion module can be implemented using relay groups or electronic switch arrays, such as an H-bridge circuit composed of MOSFETs. This is primarily to ensure that the total charge flowing through the human body is zero or low, avoiding damage to muscle tissue.
[0038] A constant current drive circuit can be understood as a circuit structure used to maintain a stable output current. Its core function is to avoid current fluctuations caused by load changes. Specifically, a constant current drive circuit can be implemented using linear regulators or switching power supply technology, such as a constant current source design based on a three-terminal regulator, primarily to ensure the stability and safety of the stimulation current.
[0039] A channel selection module is a circuit structure that can dynamically configure the electrode connection state based on input signals. Its main function is to control the on / off state of multiple electrode points through gating signals. For example, a channel selection module can be implemented using a mechanical switch matrix or a multiplexer, primarily to achieve flexible electrode configuration to adapt to different rehabilitation training needs.
[0040] Several electrotactile electrodes and electrostimulation electrodes can be understood as physical interfaces used to output electrotactile waveforms and electrostimulation waveforms respectively, their main function being to transmit electrical signals to the human body. Specifically, both electrotactile electrodes and electrostimulation electrodes can be made of conductive rubber or metal sheets, such as flexible electrodes made of silver-plated material, primarily to achieve good contact with the human body and transmit stimulation signals. The number of electrotactile electrodes and electrostimulation electrodes can be set according to actual needs.
[0041] Overall, the hardware operation and signal transmission sequence of this invention are as follows: the MCU acts as the control core, controlling each circuit module. First, the MCU receives data from the host computer, parses it, and then sends control signals. The H-bridge circuit receives the MCU signals and adjusts the pulse width of the output waveform. The frequency-modulated signal then flows into the channel selection module or is directly output to the electrostimulation electrodes. The channel selection module receives signals from the MCU to control the on / off state of different stimulation channels and the stimulation frequency of the electrotactile electrodes. The stimulation current then flows through the human body and returns to the constant current drive module. The latter performs constant current drive processing and controls the current amplitude to a constant value based on the MCU signals. The current output to the electrostimulation electrodes also flows through the human body and returns to the constant current drive module for constant current processing.
[0042] The innovation of this application lies in the integration of modules such as a control module, polarity conversion module, constant current drive circuit, channel selection module, electrotactile electrodes, and electrostimulation electrodes, enabling the device to support both electrostimulation and electrotactile functions on a single device. This design solves the problem of limited functionality in existing devices, allowing for dynamic adjustment of the working mode based on rehabilitation training instructions, thereby meeting the diverse needs of different rehabilitation stages.
[0043] like Figure 1 The hardware architecture of this invention is shown. In addition to the modules described above, it also includes auxiliary modules: a Bluetooth communication module, a display module, and a button module. The main control module's GPIO ports are connected to a channel selection module for channel selection. The eight ports are paired and connected to an H-bridge inverter module for waveform output. The output of the H-bridge circuit is connected to a constant current drive module to stabilize the stimulation current. The main control module's DAC output provides a 0-3.3V voltage as a constant current reference value for the constant current drive module. The main control module connects to the Bluetooth communication module via USART, which then communicates with a PC to transmit stimulation information. The display module and button module are connected to the main control module via GPIO ports to achieve basic data display and circuit control.
[0044] The working principle of this application embodiment is as follows: The control module generates mode selection signals, gating signals, constant current signals, and electrostimulation or electrotactile signals based on rehabilitation training instructions (i.e., 13-bit data packets), providing basic control for the device's dual-function operation. Both electrotactile and electrostimulation signals drive the polarity conversion module to generate bipolar electrotactile or electrostimulation waveforms. The gating signal controls the electrode on / off state of the channel selection module, while the constant current signal regulates the current stability of the constant current drive circuit. Upon receiving the stimulation signal, the polarity conversion module switches the current direction through internal circuit design, thereby generating bipolar electrotactile or electrostimulation waveforms. These waveforms meet the muscle contraction requirements of electrostimulation and the skin stimulation requirements of electrotactile stimulation, ensuring the device functions normally in both functional modes.
[0045] Furthermore, the constant current drive circuit receives the constant current signal and performs constant current control on the current output by the polarity conversion module. In this way, the stability of the output current is maintained, avoiding the impact of current fluctuations on treatment efficacy or safety. When the mode selection signal is an electrotactile signal, the gating signal is valid. At this time, the channel selection module dynamically adjusts the on / off state of multiple electrode points on the electrotactile electrodes based on the bipolar electrotactile waveform and the gating signal. Specifically, the channel selection module can flexibly configure the electrode connection method according to the gating signal, thereby realizing tactile feedback in the electrotactile mode. When the mode selection signal is an electrical stimulation signal, the gating signal is invalid. At this time, the bipolar electrical stimulation waveform is directly output to the electrical stimulation electrode, thereby realizing muscle stimulation in the electrical stimulation mode.
[0046] Several electrotactile electrodes and electrostimulation electrodes output bipolar electrical stimulation waveforms. The multiple electrode design allows for simultaneous stimulation of multiple body parts, meeting the needs of complex rehabilitation training. Therefore, the device can flexibly switch between electrical stimulation and electrotactile functions at different rehabilitation stages, adapting to diverse rehabilitation scenarios. In the overall technical solution, the control module coordinates signal generation, the polarity conversion module and constant current drive circuit ensure waveform quality, the channel selection module dynamically adjusts electrode configuration, and the electrotactile electrodes and electrostimulation electrodes execute specific outputs. All modules work collaboratively to solve the problem that existing electrical stimulation devices cannot simultaneously support both electrical stimulation and electrotactile functions.
[0047] In one embodiment, such as Figure 2 As shown, this application further proposes a polarity conversion module including a first optocoupler U1, a second optocoupler U2, a third optocoupler U3, and a fourth optocoupler U4. The positive input terminals of the first and fourth optocouplers are connected to the high-level stimulation signal output terminal and the negative input terminals of the control module, respectively, and are grounded through resistors. The positive input terminals of the second and third optocouplers are connected to the low-level stimulation signal output terminal and the negative input terminals of the control module, respectively, and are grounded through resistors. The positive output terminals of the first and third optocouplers are connected to a high-voltage source, and the negative output terminals of the second and fourth optocouplers are connected to the current input terminal of the constant current drive circuit. The negative output terminal of the first optocoupler and the positive output terminal of the second optocoupler are both connected to the positive electrode signal selection terminal of the channel selection module. The negative output terminal of the third optocoupler and the positive output terminal of the fourth optocoupler are both connected to the negative electrode signal selection terminal of the channel selection module.
[0048] The first optocoupler is an opto-isolating device, which can be implemented using a high-speed optocoupler or a linear optocoupler. Its purpose is to achieve electrical isolation between the control signal and the high-voltage circuit through photoelectric conversion, avoiding signal interference and short-circuit risks. Similarly, the second, third, and fourth optocouplers are also opto-isolating devices. Their specific implementation methods can be selected according to actual needs, choosing different types of optocouplers to meet the requirements of high and low level signal separation and processing. In addition, the high-voltage source refers to a power supply module that can provide a stable high-voltage output. It can be implemented using a switching power supply or a linear regulated power supply, with the purpose of providing the necessary energy support for the output of the optocouplers.
[0049] Typically, bipolar waveforms are used for muscle electrical stimulation, containing both positive and negative currents. This bidirectional current flow ensures zero charge flowing through the body, minimizing potential harm. This invention uses four cross-connected optocouplers to reverse the current polarity. Figure 2 The cross-connection of the four optocouplers in the circuit is called an H-bridge inverter circuit. Each channel is equipped with one H-bridge inverter circuit. Ports 1 and 2 are connected to the GPIO ports of the MCU (i.e., the main control module). Ports 2 and 3 are two pairs of optocouplers. Port 4 is the high-voltage power input. Port 5 is connected to the input of the constant current drive module. Port 6 is a pair of output electrodes used to apply electrical stimulation to the patient, connected to port 13 of the channel selection module. During operation, port 1 transmits two voltage levels, one high and one low. If optocoupler 2 is turned on, optocoupler 3 is turned off. At this time, the direction of the stimulation current is Electrode1. Electrode2; If the voltage levels at both ends of 1 are flipped, then optocoupler 2 is closed and optocoupler 3 is open, and the current direction is Electrode2. Electrode1, by alternating high and low voltage levels at its two ends, can achieve the reversal of the stimulation current direction. In order to isolate the high voltage signal from 4 and protect the MCU connected to 1, optocouplers are used for switching control of 2 and 3. This design accurately transmits the bipolar stimulation waveform to the channel selection module or electrical stimulation electrode according to the switching state of the optocoupler.
[0050] In one embodiment, such as Figure 3 As shown, this application further proposes a constant current drive circuit including an operational amplifier U5, a switching transistor Q1, a capacitor C1, a first resistor R1, and a second resistor R2. The non-inverting input terminal of the operational amplifier is connected to the constant current signal output terminal of the control module, one end of the capacitor and one end of the second resistor at the inverting input terminal, the output terminal of the operational amplifier is connected to the other end of the capacitor and the control terminal of the switching transistor, the input terminal of the switching transistor is connected to the current output terminal of the polarity conversion module, and the output terminal is connected to one end of the first resistor and the other end of the second resistor. The other end of the first resistor is grounded.
[0051] Specifically, an operational amplifier refers to an electronic device with high gain characteristics. It can be implemented using a general-purpose operational amplifier or a low-noise precision operational amplifier, with the aim of providing stable signal amplification. A switching transistor can be understood as a semiconductor device used for current regulation, specifically a power switching element such as a MOSFET or IGBT, with the purpose of quickly responding to control signals to regulate the output current. In practical applications, a capacitor refers to a passive component used for phase compensation and noise suppression. It can be implemented using ceramic capacitors or multilayer ceramic capacitors, with the aim of improving system stability and anti-interference capability. The first and second resistors, as core components of the sampling and feedback network, can be implemented using precision resistors or metal film resistors, with the aim of ensuring the accuracy of current detection and the reliability of the feedback signal.
[0052] After successfully outputting a bipolar stimulation waveform, due to the nonlinearity of human body impedance and the presence of various interference factors, it is necessary to perform anti-interference processing on the output current. Therefore, this application connects a constant current drive circuit at the current convergence point of the polarity conversion module. Figure 3 Port 7 receives current from the H-bridge circuit. Port 8 connects to the MCU's DAC output, performing constant current control based on the voltage value from the MCU. Port 9 is the NE5532 operational amplifier, which has a powerful output drive capability, providing a maximum continuous output current of 38mA. Based on the virtual short and virtual open principle of operational amplifiers, the load current... I = V 3 / R 1. By controlling the input voltage of the 8-port, the magnitude of the output current can be controlled, thus achieving constant current control. C 1. R The function of 2 is to ensure the stability of the circuit when the input of the op-amp or the load changes.
[0053] Based on the above technical solution, the constant current drive circuit deeply couples the control signal, current sampling, and power regulation through a precision feedback loop, maintaining high robustness under complex waveforms and providing a safe and reliable current guarantee for rehabilitation electrical stimulation. Simultaneously, this solution is closely integrated with other modules such as the control module and polarity conversion module. Through the coordinated operation of operational amplifiers and switching transistors, it ensures that the current output accurately tracks the set value and adapts to minute current changes at multi-channel electrode points, thereby effectively solving the current stability problem caused by rapid polarity switching and multi-channel dynamic changes in bipolar stimulation waveforms.
[0054] In one embodiment, such as Figure 4 , Figure 5As shown, this application further proposes an electrotactile electrode comprising a flexible cable with multiple channels. One end of the flexible cable is connected to the output of a channel selection module, and the other end is connected to multiple electrode points. The multiple electrode points are arranged in a hexagonal pattern, with positive and negative electrode points alternating to form an electrode array. Specifically, the multiple electrode points include six positive electrode points and four negative electrode points, distributed on the vertices of two regular hexagons with partially overlapping vertices. The diameter of the positive electrode points is larger than the diameter of the negative electrode points.
[0055] Specifically, flexible ribbon cables refer to conductive circuit carriers with flexibility and bendability, which can be achieved using polyimide film as the substrate combined with copper foil etching technology. This design aims to adapt to the curved shape of human skin, ensuring stable contact between the electrodes and the skin during limb movement. Multiple electrode points refer to the conductive areas distributed at the ends of the flexible ribbon cable, which can be achieved using silver-silver chloride materials or conductive gel coatings, aiming to provide good electrical contact performance with the skin. Hexagonal distribution is an arrangement based on the principle of geometric tiling, which can be achieved using a honeycomb layout structure to maximize space utilization and reduce stimulation blind spots. Partial vertex overlap refers to the overlap of two vertices of two regular hexagons, forming a total of 10 vertices, each containing 10 electrode points.
[0056] In detail, this solution uses flexible cabling to precisely transmit the bipolar electrical stimulation waveform output from the channel selection module to each electrode point. The multi-channel nature of the flexible cabling ensures that each electrode point can independently receive the stimulation signal, avoiding signal crosstalk issues. When multiple electrode points are arranged in a hexagonal distribution, the alternating layout of positive and negative electrodes forces the current to form a stable loop between adjacent electrodes. This design effectively avoids local current concentration or short circuits. Simultaneously, this electrode array design supports dynamic selection of different electrode points by the channel selection module, enabling the device to meet diverse rehabilitation scenario requirements.
[0057] Through the above technical solution, the electrode array of the electrotactile electrode of this application is made of flexible FPC, which can be attached to the skin surface. The electrodes are arranged in a hexagonal distribution, with positive and negative electrodes arranged alternately. Compared with a rectangular grid, it can improve the space utilization rate by 15% and reduce electric field distortion. Figure 4 , Figure 5In the diagram, 10 is the FPC connector, responsible for connecting the FPC electrode plate to the main control PCB circuit board; 11 is the positive electrode point, consisting of 6 stimulation points; and 12 is the negative electrode point, consisting of 4 stimulation points. All 10 electrodes are distributed on the vertices of two overlapping regular hexagons, ensuring equal distance between each electrode. The diameter of the positive electrode point is 3mm, the diameter of the negative electrode point is 2mm, and the spacing between electrodes (i.e., the distance between the centers of adjacent electrodes) is 9mm. During operation, different positive and negative electrodes selectively connect to form different sensory feedbacks according to stimulation requirements. This scheme not only solves the problem of insufficient electrotactile feedback but also improves the accuracy and coverage uniformity of tactile feedback, providing a more complete sensory-motor interaction foundation for rehabilitation training.
[0058] In one embodiment, this application further proposes that the electrical stimulation electrodes generally employ conventional electrode pads coated with conductive gel, the area of which is typically 4-9 cm². 2 The large electrodes can effectively cover the muscle bundles that need stimulation, thus improving the motor drive effect.
[0059] In one embodiment, this application further proposes a channel selection module including multiple multi-channel analog switch circuit chips. The multiple multi-channel analog switch circuit chips receive bipolar stimulation waveforms generated by the polarity conversion module and selectively connect positive and negative electrode points through gating signals to form different tactile feedback modes.
[0060] Specifically, a multi-channel analog switch circuit chip refers to an electronic component capable of switching multiple signals. The selective connectivity of this chip ensures independent control of different electrode points, aiming to improve the flexibility and accuracy of the device in constructing haptic feedback modes. The strobe signal is an electrical signal used to control the switching state, which can be implemented using pulse width modulation (PWM) signals or digital logic signals, with the purpose of dynamically adjusting the on / off state of the electrode points.
[0061] In detail, a stimulation array also requires a corresponding channel selection module (i.e., electrode driving circuit), which determines how to switch different electrode points on and off to achieve the desired stimulation effect. This invention uses a ten-channel electrode array, i.e., ten stimulation points, evenly distributed in a hexagonal pattern, consisting of six stimulation points and four loop points. The channel selection module is responsible for controlling the on / off state of these ten stimulation points and forming corresponding stimulation patterns. This invention uses multiple multi-channel analog switch circuit chips in conjunction with an H-bridge circuit to achieve the corresponding functions. The stimulation source comes from the H-bridge circuit, and the selection of the ten channels is achieved using the analog switch circuit. The bipolar stimulation signal from the H-bridge circuit is selected by the analog switch circuit, realizing the on / off state of different electrode points on the electrode array and achieving different tactile feedback modes. Both the H-bridge circuit and the analog switch circuit are controlled by the core MCU. Figure 6 It is the channel selection module of the electro-tactile electrode array; the signal source for tactile feedback still comes from... Figure 2 Port 6 of the H-bridge circuit shown. The bipolar stimulation waveform generated by the H-bridge circuit is connected to this driving circuit, which is... Figure 4 The electrode array shown generates different electrotactile signals. In the diagram, 16 represents three CD4066 chips with four-channel analog switching circuits, capable of selecting four channels of analog signals. 13 represents the bipolar stimulation signal generated by the H-bridge circuit. ELEC1 is divided into six positive signals input to the chip for selection, corresponding to the six positive electrode points of the tactile electrode array; ELEC2 is divided into four negative electrode signals input to the chip, corresponding to the four negative electrode points of the tactile electrode array. Port PO1, indicated by 15, is the selection output for positive electrode point 1, connected to the first positive electrode point of the electrode array, indicating the direction of current inflow; PO2~PO6 follow the same pattern. Port NE1, indicated by 17, is the selection output for negative electrode point 1, connected to the first negative electrode point of the electrode array, indicating the direction of current outflow; NE2~NE4 follow the same pattern. CON1~CON10, indicated by 14, are ten selection control ports, connected to the control core MCU, receiving signals from the control core to select the ten electrode channels.
[0062] During operation, the bipolar stimulation signal generated by the H-bridge circuit flows into the drive module from the ELEC1 terminal. Then, based on the gating signal from the control core, the corresponding positive and negative electrodes are selected for connection. The signal flows through the skin via the positive electrode point PO, exits from the negative electrode point NE, and then flows back to the H-bridge circuit and grounded via ELEC2. This is how the tactile electrodes and their drive circuit work. This scheme provides a high-density independent control channel through the configuration of multiple multi-channel analog switching circuit chips, allowing each electrode point to be precisely isolated or combined. These chips receive the bipolar electrotactile waveform output from the polarity conversion module, ensuring the complete transmission of alternating positive and negative current signals, while effectively avoiding electrochemical damage to the skin by utilizing the bipolar characteristics. The introduction of the gating signal enables real-time dynamic adjustment based on control commands, making the on / off state of the electrode points programmable, thereby accurately constructing the spatial distribution and temporal sequence of the electrode points. This design not only generates differentiated tactile feedback modes such as vibration and pressure gradients, but also seamlessly integrates electrotactile feedback functions during electrostimulation therapy, significantly enhancing the patient's perception of the movement status of the affected limb.
[0063] In one embodiment, this application further proposes including a display module, primarily used to display the current mode selection, channel connectivity, and waveform stimulation parameters. Figure 7 As shown, the display module consists of a 6-segment LED display, 6 NPN transistors, and a 74HC595 shift register. The six SEG segments are used to display the stimulus information of the current channel. SEG 19 is an NPN transistor used for gating the LED display. SEG 18 is a 74HC595 shift register, mainly used to save MCU I / O ports, allowing for 8-bit signal output using three ports.
[0064] Specifically, the display module refers to a device that can visually present the operating status and parameter information of an equipment, which can be implemented using an LCD screen, LED screen, or touch screen. The main purpose of this module is to provide users with intuitive operational feedback, ensuring that users can monitor the equipment's operating status in real time. Specifically, the function of displaying the current mode selection can be implemented through a partitioned interface, such as setting up a separate mode indicator area on the screen; the function of displaying channel connectivity can be displayed through a graphical interface, such as using color to distinguish on / off states; and the function of displaying waveform stimulation parameters can be presented in a combination of numerical and waveform graphs, facilitating precise adjustments by the user.
[0065] In detail, the display module connects to the input of the control module through its output, constructing a complete interactive closed-loop system. The display module acquires real-time status information from the control module, including the current electrical stimulation or electrotactile feedback mode, the connection status of each channel electrode, and key parameters such as frequency and pulse width, presenting this information to the user intuitively. Through this technical solution, users can intuitively monitor the device's operating mode, channel connection status, and stimulation parameters, effectively avoiding operational errors or improper parameter configurations due to missing information, thereby improving the safety and effectiveness of rehabilitation training.
[0066] In one embodiment, this application further proposes that the control module uses a 13-bit data packet to communicate with the host computer via Bluetooth to obtain rehabilitation training instructions, such as... Figure 8 As shown, the data packet consists of four parts: header, packet length, control information, and checksum. The header, packet length, and checksum are all single-bit hexadecimal numbers used to record data packet information and for data packet verification. The header uses 0x01, and the packet length is 13, which is 0x0C. The checksum is usually a checksum, the sum of the first 12 bits. The control information includes mode selection information, constant current reference value, frequency and pulse width values for each channel, and electrotactile gating value. The mode selection information is a single-byte hexadecimal number indicating the current stimulation mode; 0x0A indicates electrical stimulation, or 0x0B indicates electrotactile stimulation. The constant current reference value is a single-byte hexadecimal number with a decimal value of 0-33, representing a voltage output of 0-3.3V. Each channel has two bytes representing its frequency and pulse width output, respectively. The four channels are controlled independently; if any bit in the current channel's frequency or pulse width information is 0, the channel's output is off. The signals corresponding to electrical stimulation and electrotactile functions differ slightly. For ease of data processing, aligned byte counts are typically selected, resulting in some bytes being unused. After receiving and parsing this 13-bit data packet, the MCU transmits channel and stimulation information according to relevant parameters, thereby achieving four-channel waveform output and frequency / pulse width control.
[0067] In detail, the above solution utilizes a structured Bluetooth communication mechanism to enable the device to dynamically adapt to diverse rehabilitation scenarios. The control module employs 13-bit data packets for communication. This specific length design ensures data integrity while optimizing transmission efficiency, avoiding Bluetooth transmission delays caused by excessively large data packets or insufficient data to carry necessary parameters, thus ensuring real-time acquisition of rehabilitation training instructions. A wireless connection is established with the host computer via Bluetooth, leveraging its wide compatibility to simplify the integration process of external devices, allowing patients or therapists to easily adjust training parameters via mobile terminals. Within the control information, mode selection information enables the device to seamlessly switch between electrical stimulation output and electrotactile feedback modes according to the needs of the rehabilitation stage. The constant current reference value provides an adjustable benchmark for current intensity, allowing the stimulation intensity to match changes in the patient's muscle state. The frequency pulse width values of each channel enable independent configuration of the stimulation characteristics of each channel, supporting the generation of complex waveforms to meet different neuromuscular response requirements. When the electrotactile gating value is valid, the corresponding positive and negative electrodes are connected. These features together construct an efficient and reliable command transmission framework, enabling the control module to accurately respond to the host computer's commands, laying the foundation for the coordinated operation of electrical stimulation and electrotactile functions, and ultimately realizing the device's scene adaptation capability in rehabilitation training.
[0068] The following section, using an algorithm flowchart, explains in detail the data packet parsing and waveform generation method of this invention, such as... Figure 9 As shown, after receiving a 13-bit data packet from the host computer, the MCU parses the packet to obtain the stimulation mode, constant current reference value, frequency pulse width values of each channel, and electrotactile gating value. Next, after selecting the stimulation mode, it uses a timer interrupt mechanism to generate a bipolar electrotactile or electrostimulation waveform with adjustable frequency and pulse width based on the parsed frequency pulse width value and the waveform's toggle count and period. Finally, it sends the stimulation mode and channel information back to the host computer, indicating that the MCU has received the information and responded.
[0069] The core innovation of this embodiment lies in combining data packet parsing with mode selection information and introducing a timer interrupt mechanism to dynamically adjust waveform parameters, thereby achieving flexible switching between electrical stimulation and electrotactile functions, and achieving the effect of supporting two functions on the same device to adapt to diverse rehabilitation scenarios.
[0070] Specifically, the control module receives and parses data packets from the host computer, providing the basic input for subsequent mode selection and parameter settings, ensuring the device can accurately acquire external commands. Based on the parsed mode selection information, it selects between electrical stimulation and electrotactile waveform output, directly achieving dynamic switching of function types, enabling the device to adapt to different feedback modes according to rehabilitation scenario requirements. Based on the parsed frequency and pulse width values, a timer interrupt mechanism controls the waveform flipping count and period, generating a bipolar electrical stimulation waveform with adjustable frequency and pulse width, ensuring precise and controllable waveform parameters to adapt to individualized rehabilitation needs. These three components work collaboratively: data packet parsing provides the command basis, mode selection determines the function type, and the timer interrupt mechanism generates the specific waveform, jointly constructing a complete link from command input to waveform output, enabling the device to seamlessly switch and output the required waveform, effectively supporting diverse rehabilitation scenarios.
[0071] Figure 10 This is a flowchart of the 13-bit data packet parsing process. After receiving the data packet, the MCU performs header verification, data bit length verification, and calculation. If all checks match the target data, the data transmission is error-free, and stimulation information parsing and parameter assignment can continue. If any check is inconsistent with the target data, the data packet transmission has failed, and the system must wait for the host computer to retransmit. In the diagram, variables Ect_CH and Num_CH are the channel number identifiers for electrotactile and electrostimulation, respectively; CON_Info is a binary variable storing tactile electrode gating information; and Temp0 is a binary counter variable. Bits 5 to 12 of the data packet contain the stimulation parameters for the four channels, grouped in pairs, with pulse width first and frequency second. Before assigning values to a channel, the presence of a 0 in the channel's stimulation information is checked. If a 0 exists, the channel is closed, and no parameter assignment is performed; if not, the channel is opened, and channel parameter assignment proceeds. After all four channels have been checked and assigned values, the data packet parsing is complete.
[0072] Figure 11This is a flowchart of the channel parameter assignment process. It's important to note that the waveform generation method of this invention is based on MCU timer interrupts. Each time the timer enters an interrupt, it indicates a change in the waveform. At the program level, the waveform's frequency and pulse width are represented by the timer's timing duration. Controlling the timer's timing duration controls the waveform's frequency and pulse width information. In the diagram, TIM1 and TIM2 are the frequency timer and pulse width timer, respectively. `__HAL_TIM_SET_AUTORELOAD(&TIM,DATA)` is the STM32 chip's timer auto-reload register filling function, which can reload the timer's timing duration. When assigning channel parameters, the hexadecimal frequency and pulse width information in the data packet is first converted to decimal. Then, the decimal frequency and pulse width information are filled into the corresponding timer's auto-reload register filling function to complete the channel information assignment. In the diagram, Temp1 and Temp2 are temporary variables storing decimal frequency and pulse width information, respectively.
[0073] In one embodiment, this application further proposes a waveform generation method implemented using the timer interrupt function of an MCU, such as... Figure 12 , 13 As shown, the stimulation waveform and pulse width are each controlled by a separate timer. Since only one waveform pair is output per stimulation cycle, and this waveform pair undergoes two waveform flips, a variable `Toggle_Count` is used to record the number of waveform flips within a single cycle. The initial value is 0. When the waveform flips twice, i.e., when the value of `Toggle_Count` is 2, the waveform output for that cycle stops. After the waveform output for that cycle stops, the status variable `Wave_Ctrl` is set to 0. At this point, the timer enters an interrupt again, and the waveform remains unchanged. Until the next cycle arrives, the frequency timer enters an interrupt, `Wave_Ctrl` is set to 1, and the waveform output permission for that cycle is restored. Figure 13 In the timeline, at point 20, waveform output begins, and the pulse width and frequency timers are activated. At point 21, the pulse width timer enters an interrupt for the first time, the waveform toggles for the first time, the GPIO pair toggles the output, and Toggle_Count is incremented by 1. The GPIO pair connection location referred to here in the hardware circuit is... Figure 2 The two ports indicated by 1 are directly connected to the H-bridge circuit. This GPIO pair toggles... Figure 2At point 6, the current direction between the two electrodes reverses, causing the waveform output to flip. At time 22, the pulse width timer enters an interrupt for the second time, the GPIO output flips for the second time, Toggle_Count is set to 2, Wave_Ctrl is set to 0, the GPIO output is set to 0, and waveform output for the current cycle stops. At time 23, the frequency timer enters an interrupt, a new waveform output cycle begins, Wave_Ctrl is set to 1, enabling waveform output. The next time the pulse width timer enters an interrupt, waveform output will begin, and this cycle repeats, producing a bipolar electrical stimulation waveform with controllable frequency and pulse width. Figure 12 The Channel_State variable is used to indicate whether the channel has waveform output; a value of 1 indicates that the channel has waveform output, and its value is within... Figure 10 The packet parsing steps shown are already given.
[0074] Among them, waveform frequency refers to the parameter used to control the periodic changes of the electrical stimulation waveform, which can be implemented through independently configured hardware or software timers. In practical applications, this timer can be a timer module integrated within a microcontroller. By setting different prescaler values and count values, it can adapt to the frequency requirements of different rehabilitation stages, aiming to ensure the flexibility and accuracy of frequency adjustment. Pulse width refers to the duration of the high level of the waveform within one cycle, which can also be implemented through independent hardware or software timers, such as using the duty cycle adjustment function in the PWM signal generation module, aiming to ensure the independence and accuracy of pulse width adjustment. Wave_Ctrl is a status flag variable used to indicate whether the current waveform cycle has been completely output. It can be implemented using a Boolean variable or a single-bit register, aiming to provide a synchronization reference for the waveform cycle. Toggle_Count is a variable that records the number of waveform flips. It can be implemented using an integer variable or a counter register, aiming to accurately capture the timing of waveform flips and prevent errors in the number of flips.
[0075] Specifically, the above technical solution uses two independent timers to control the waveform frequency and pulse width respectively, thus achieving decoupling between the two. The frequency timer sets Wave_Ctrl to 1 upon each interrupt trigger, marking the start of a new waveform cycle. This design ensures that the waveform cycle is strictly synchronized with the frequency setting, avoiding cycle misalignment due to interrupt delays. The pulse width timer is responsible for controlling the specific timing of waveform flips. When the first interrupt occurs, the waveform completes its first flip, and the number of flips is recorded by incrementing the Toggle_Count value. This mechanism effectively ensures the accuracy of the waveform's rising edge. By repeatedly executing the above process, the system can continuously output a stable bipolar electrical stimulation waveform. Furthermore, the state management mechanism of Wave_Ctrl and Toggle_Count provides a clear monitoring method for the waveform generation process, facilitating real-time identification and correction of potential errors. This significantly improves the reliability of the waveform output, meets the need for flexible adjustment of stimulation parameters at different rehabilitation stages, and enhances the reliability of muscle stimulation effects and tactile feedback during rehabilitation training.
[0076] Figure 14 This is a schematic diagram of the dual-purpose multi-channel rehabilitation electrical stimulator of the present invention. In the figure, 23 is the four electrical stimulation electrodes (electrode pairs a~d) of the electrical stimulator, 24 is the host computer used to send commands, 25 is the Bluetooth communication module, 26 is the MCU, 27 is the integrated circuit board containing four H-bridge circuits, electrode driving circuits and other components, 28 is an electrotactile electrode, and 29 is the power supply module. Figure 15 This diagram illustrates the connection between an electrotactile motor, four electrostimulation electrodes, four H-bridges, and an MCU. During operation, the host computer sends data packets containing rehabilitation training instructions to the MCU via Bluetooth. After parsing the data packets, the MCU, in conjunction with the H-bridge circuit and electrode drive circuit, outputs corresponding electrostimulation waveforms at the four electrostimulation electrodes, or electrotactile waveforms at the electrotactile electrodes, thereby performing rehabilitation training. Furthermore, the host computer can also receive various human body status information from other terminals, thus achieving closed-loop rehabilitation training.
[0077] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit its scope of protection. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that after reading the present invention, they can still make various changes, modifications, or equivalent substitutions to the specific implementation of the invention, but all such changes, modifications, or equivalent substitutions are within the scope of protection of the pending claims. Content not described in detail in this specification belongs to the prior art known to those skilled in the art.
Claims
1. A dual-purpose multi-channel rehabilitation electrical stimulation device, characterized in that: include The main control module is used to generate mode selection signals, gating signals, constant current signals, electrical stimulation signals, or electrotactile signals based on rehabilitation training instructions; A polarity conversion module is used to generate bipolar electrotactile waveforms based on electrotactile signals, or to generate bipolar electrical stimulation waveforms based on electrical stimulation signals. A constant current drive circuit is used to control the current output by the polarity conversion module based on a constant current signal. The channel selection module is used to control the on / off state of multiple electrode points on the electrotactile electrodes based on the bipolar electrotactile waveform and the gating signal; Electrotactile electrodes are used to output bipolar electrotactile waveforms. Electrical stimulation electrodes are used to output bipolar electrical stimulation waveforms.
2. The dual-purpose multi-channel rehabilitation electrical stimulation device according to claim 1, characterized in that: The polarity conversion module includes a first optical coupler, a second optical coupler, a third optical coupler, and a fourth optical coupler. The positive input terminals of the first and fourth optocouplers are connected to the high-level stimulation signal output terminal and the negative input terminal of the main control module, respectively, and are grounded through resistors. The positive input terminals of the second and third optocouplers are connected to the low-level stimulation signal output terminal and the negative input terminal of the main control module, respectively, and are grounded through resistors. The positive terminals of the first and third optocouplers are connected to a high-voltage source, and the negative terminals of the second and fourth optocouplers are connected to the current input terminal of the constant current drive circuit. The negative output terminal of the first optocoupler and the positive output terminal of the second optocoupler are both connected to the positive electrode signal selection terminal of the channel selection module; The negative output terminal of the third optocoupler and the positive output terminal of the fourth optocoupler are both connected to the negative electrode signal selection terminal of the channel selection module.
3. The dual-purpose multi-channel rehabilitation electrical stimulation device according to claim 1, characterized in that: The constant current drive circuit includes an operational amplifier, a switching transistor, a capacitor, a first resistor, and a second resistor. The non-inverting input of the operational amplifier is connected to the constant current signal output of the main control module, one end of the capacitor, and one end of the second resistor. The output of the operational amplifier is connected to the other end of the capacitor and the control terminal of the switching transistor. The input of the switching transistor is connected to the current output of the polarity conversion module, and the output is connected to one end of the first resistor and the other end of the second resistor. The other end of the first resistor is grounded.
4. The dual-purpose multi-channel rehabilitation electrical stimulation device according to claim 1, characterized in that: The channel selection module includes multiple multi-channel analog switch circuit chips. These chips receive bipolar stimulation waveforms generated by the polarity conversion module and selectively connect positive and negative electrode points through gating signals to form different tactile feedback modes.
5. The dual-purpose multi-channel rehabilitation electrical stimulation device according to claim 1, characterized in that: The electrotactile electrode includes a flexible ribbon cable with multiple channels. One end of the flexible ribbon cable is connected to the output terminal of the channel selection module, and the other end of the flexible ribbon cable is connected to multiple electrode points. The multiple electrode points are arranged in a hexagonal distribution and the positive and negative electrode points are arranged alternately to form a tactile electrode array.
6. The dual-purpose multi-channel rehabilitation electrical stimulation device according to claim 5, characterized in that: The plurality of electrode points includes six positive electrode points and four negative electrode points, which are distributed on two partially overlapping vertices of a regular hexagon, and the diameter of the positive electrode points is larger than the diameter of the negative electrode points.
7. The dual-purpose multi-channel rehabilitation electrical stimulation device according to claim 1, characterized in that: It also includes a display module for displaying the current mode selection, channel connectivity, and waveform stimulation parameters, the output of which is connected to the input of the main control module.
8. The dual-purpose multi-channel rehabilitation electrical stimulation device according to claim 1, characterized in that: The main control module uses a 13-bit data packet to communicate with the host computer to obtain rehabilitation training instructions. The data packet includes four parts: packet header, data packet length, control information, and check bit. The control information includes mode selection information, constant current reference value, frequency pulse width value of each channel, and electrotactile gating value.
9. A waveform generation method based on the dual-purpose multi-channel rehabilitation electrical stimulation device according to claim 1, characterized in that: The main control module receives data packets from the host computer and parses the data packets to obtain mode selection information, frequency pulse width values of each channel, and electrotactile gating values; Based on the parsed mode selection information, select either electrical stimulation waveform output or electrotactile waveform output; Based on the analyzed frequency and pulse width values, a timer interrupt mechanism is used to generate a bipolar electrical stimulation waveform with adjustable frequency and pulse width by determining the number of waveform flips and the period.
10. The waveform generation method according to claim 9, characterized in that, The process of generating a bipolar electrical stimulation waveform with adjustable frequency and pulse width by using a timer interrupt mechanism to determine the waveform flip count and period based on the analyzed frequency and pulse width values includes: A timer is started for both waveform frequency and pulse width; When the frequency timer interrupt is triggered, set Wave_Ctrl to 1 to start a new waveform cycle; When the pulse width timer interrupts for the first time, the waveform flips for the first time, and Toggle_Count is incremented by 1. When the pulse width timer interrupts for the second time, the waveform flips for the second time. The Toggle_Count value is set to 2, the waveform output for this cycle stops, Wave_Ctrl is set to 0, and the Toggle_Count value is set to 0. The above process is repeated continuously, outputting a bipolar electrical stimulation waveform. Among them, Wave_Ctrl is 1 to indicate that there is no complete waveform output in the current cycle, and 0 to indicate that the waveform is completely output in the current cycle. Toggle_Count records the number of times the waveform flips in the current cycle.