CN113332597A - Functional electrical stimulation instrument capable of adaptively adjusting output intensity and control method thereof - Google Patents

Functional electrical stimulation instrument capable of adaptively adjusting output intensity and control method thereof Download PDF

Info

Publication number
CN113332597A
CN113332597A CN202110556392.XA CN202110556392A CN113332597A CN 113332597 A CN113332597 A CN 113332597A CN 202110556392 A CN202110556392 A CN 202110556392A CN 113332597 A CN113332597 A CN 113332597A
Authority
CN
China
Prior art keywords
timer
output
pulse
mode
instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110556392.XA
Other languages
Chinese (zh)
Other versions
CN113332597B (en
Inventor
李玉榕
陈楷
陈建国
郑楠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fuzhou University
Original Assignee
Fuzhou University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuzhou University filed Critical Fuzhou University
Priority to CN202110556392.XA priority Critical patent/CN113332597B/en
Publication of CN113332597A publication Critical patent/CN113332597A/en
Application granted granted Critical
Publication of CN113332597B publication Critical patent/CN113332597B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61NELECTROTHERAPY; MAGNETOTHERAPY; RADIATION THERAPY; ULTRASOUND THERAPY
    • A61N1/00Electrotherapy; Circuits therefor
    • A61N1/18Applying electric currents by contact electrodes
    • A61N1/32Applying electric currents by contact electrodes alternating or intermittent currents
    • A61N1/36Applying electric currents by contact electrodes alternating or intermittent currents for stimulation
    • A61N1/36014External stimulators, e.g. with patch electrodes
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61NELECTROTHERAPY; MAGNETOTHERAPY; RADIATION THERAPY; ULTRASOUND THERAPY
    • A61N1/00Electrotherapy; Circuits therefor
    • A61N1/18Applying electric currents by contact electrodes
    • A61N1/32Applying electric currents by contact electrodes alternating or intermittent currents
    • A61N1/36Applying electric currents by contact electrodes alternating or intermittent currents for stimulation
    • A61N1/36014External stimulators, e.g. with patch electrodes
    • A61N1/3603Control systems
    • A61N1/36031Control systems using physiological parameters for adjustment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Health & Medical Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biophysics (AREA)
  • General Health & Medical Sciences (AREA)
  • Theoretical Computer Science (AREA)
  • Biomedical Technology (AREA)
  • Physics & Mathematics (AREA)
  • Molecular Biology (AREA)
  • Evolutionary Computation (AREA)
  • Public Health (AREA)
  • Veterinary Medicine (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Radiology & Medical Imaging (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Animal Behavior & Ethology (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Physiology (AREA)
  • Electrotherapy Devices (AREA)

Abstract

The invention provides a functional electrical stimulation instrument capable of adaptively adjusting output intensity and a control method thereof, which are characterized by comprising the following steps: the processor is respectively connected with the processors: the device comprises a Bluetooth communication module, an angular velocity acquisition module, a power supply module, a boosting module and a pulse output module; the power module is connected with the pulse output module through the boosting module. The device adopts the lithium cell power supply, and is small, light in weight is convenient for dress. The Bluetooth device is communicated with the smart phone through Bluetooth, so that the smart phone is used as an upper computer, the device is controlled by instructions and data transmission between the smart phone and the device is carried out on the smart phone, and the Bluetooth device is convenient to use. A mathematical model of a shank angular velocity signal and an electromyographic signal is established offline by adopting a BP neural network with a simple network structure, real-time prediction of the electromyographic signal of the tibialis anterior muscle in the walking process is realized on the device, output intensity modulation is carried out according to the predicted electromyographic signal, and electrical stimulation output intensity meeting the requirements of natural gait can be provided.

Description

Functional electrical stimulation instrument capable of adaptively adjusting output intensity and control method thereof
Technical Field
The invention belongs to the technical field of medical instruments, and particularly relates to a functional electrical stimulation instrument capable of adaptively adjusting output intensity and a control method thereof.
Background
Among the currently published or publicly used techniques, there are mainly the following three methods for adjusting the output intensity when Functional Electrical Stimulation (FES) is applied to a user: 1. the electrical stimulation outputs an all or no stimulation envelope, i.e., the output stimulation intensity toggles between a maximum intensity and zero. This change of the steeply increasing and steeply decreasing type may result in the user's toe rising too fast during walking, causing the center of gravity to be unstable, further increasing the risk of falling. 2. The electrical stimulation outputs a trapezoidal stimulation envelope curve, namely after stimulation is started, the stimulation intensity is gradually increased from zero to a stable value, constant stimulation is maintained for a certain time, and finally the stimulation intensity is gradually reduced to zero. Trapezoidal stimulus envelopes also have the disadvantage of having a large number of redundant stimuli and stimulus dead zones. The redundant stimulation means that the stimulation quantity provided by the electrical stimulation is larger than the energy required by the tibialis anterior in the natural gait maintaining process, which can cause the stimulation received by the tibialis anterior to be excessive and easily cause muscle fatigue; the stimulation blind area is that when the stimulation quantity is still required to be provided to maintain natural gait, no electric stimulation is output to provide energy for tibialis anterior muscles, so that the gravity center is still unstable, and the risk of falling is increased. 3. The electrical stimulation outputs a natural stimulation envelope line, and the stimulation intensity is modulated and output according to Electromyography (EMG) of tibialis anterior muscles when a healthy person normally walks, so that the lower limbs of a user can accord with natural gait when walking. However, the stimulation envelope modulated by this method is fixed, that is, the output intensity for the same time is constant in one gait cycle, and cannot be adjusted according to the real-time gait information of different users.
For the natural stimulation envelope, in order to make the FES have self-adaptive characteristics when being output under the natural envelope, the FES output needs to be modulated according to real-time gait information during walking. The characteristic quantities of the gait information include plantar pressure, three-dimensional angular velocity and three-dimensional acceleration of the thigh and the calf, activation states of the corresponding muscles, and the like. The characteristic quantity of gait information can represent different stages of a gait cycle, and the prior technical means is that the electromyographic signal is predicted by utilizing an angular velocity signal based on a long-short-term memory (LSTM) artificial neural network to realize the self-adaptive adjustment of the electrical stimulation intensity, but the LSTM neural network is taken as a cyclic neural network, so that the calculation amount is large, the network structure is complex, and the real-time implementation on wearable equipment is difficult.
For wearable FES devices on the market and in clinic at present, most of the wearable FES devices adopt a trapezoidal envelope, and part of the wearable FES devices adopt plantar pressure as a stimulation start and stop signal, the plantar pressure needs to be measured by a pressure-sensing resistor (FSR), and the pressure sensor is taken as an external sensor and is integrated into a processor with certain difficulty. Even a pressure sensor having a bluetooth transmission function may be integrated with the insole, resulting in a limitation in use.
In summary, the current studies on foot drop FES mainly have the following disadvantages: (1) the output mode cannot be adaptively adjusted according to the real-time gait information of the user during walking. (2) For gait information prediction of lower limb movement, multiple sensors are typically used to collect relevant data. This makes the established model more complex, the calculated amount is larger, the response is slow, and the robustness is relatively poor. (3) The modeling method needs a large amount of data support, high operation speed is needed for network operation, and the method is only suitable for off-line analysis and is difficult to realize on wearable equipment in real time.
Disclosure of Invention
In view of the above, in order to make up for the blank and deficiency of the prior art, the present invention is directed to a functional electrical stimulation apparatus capable of adaptively adjusting output intensity and a control method thereof,
the functional electrical stimulation instrument designed by the invention refers to a wearable electrical stimulation output device, the matched device is a smart phone (the model of the smart phone is not limited, the smart phone can be used as an upper computer of the wearable electrical stimulation output device with Bluetooth or other equivalent wireless connection functions and executes corresponding control instructions, or can be replaced by other equivalent devices such as a tablet personal computer and the like in an equivalent way), and the electrical stimulation output device is powered by a lithium battery, has small volume and light weight and is convenient to wear. The two communicate through the bluetooth, and the smart mobile phone carries out instruction control and data transmission, convenient to use through tall and erect APP of ann. The functional electrical stimulation instrument capable of adaptively adjusting the output intensity is designed according to the proposed adaptive control algorithm, a BP neural network with a simple network structure is adopted to establish a mathematical model of a shank angular velocity signal and an electromyographic signal in an off-line manner, so that the real-time prediction of the electromyographic signal of the tibialis anterior muscle in the walking process is realized, and then the output intensity modulation is carried out according to the predicted electromyographic signal, so that the electrical stimulation output intensity meeting the natural gait requirement can be provided. The walking process of a person has certain regularity and periodicity, the activity rule of the walking process of the person is mainly embodied in a sagittal plane, the change rule of the angular velocity of the ankle joint and the shank of the human body has consistency, and the upper part of the shank is selected as the acquisition position of the angular velocity signal and the wearing position of the device in consideration of the comfort and the attractiveness of the wearing of the device. The invention utilizes the shank angular velocity signal to carry out output intensity modulation, effectively solves the problem that the output mode can not carry out self-adaptive adjustment according to real-time gait information during walking, can avoid redundant stimulation and stimulation blind areas caused by trapezoidal envelope lines used by wearable FES equipment on the market and in clinic, and can also avoid the problem that a model is complicated because a plurality of sensors are used for carrying out data acquisition. Meanwhile, the invention utilizes the BP neural network to establish the electromyographic signal prediction model, can simplify the model, reduce the calculated amount and the calculated time, and can be realized on the wearable device in real time.
The invention specifically adopts the following technical scheme:
a functional electrical stimulation apparatus capable of adaptively adjusting output intensity, comprising: the processor is respectively connected with the processors: the device comprises a Bluetooth communication module, an angular velocity acquisition module, a power supply module, a boosting module and a pulse output module; the power supply module is connected with the pulse output module through the boosting module; the Bluetooth communication module is connected with the smart phone, and the smart phone is used as an upper computer to perform instruction control on the device; the device receives a control instruction of the smart phone and then adjusts stimulation parameters and outputs bipolar constant current pulses in real time through the processor.
Further, the processor is an STM32 microprocessor.
Furthermore, the power module comprises a lithium battery, and a USB charging circuit and a voltage conversion circuit which are connected with the lithium battery.
Further, the boost module comprises a primary boost circuit connected with the lithium battery, a secondary boost circuit connected with the primary boost circuit, a DAC (digital-to-analog converter) connected with the primary boost circuit, and a digital potentiometer connected with the secondary boost circuit, wherein the DAC and the digital potentiometer are also respectively connected to the processor.
Furthermore, the pulse output module comprises an H-bridge circuit connected with the secondary booster circuit and a constant current output circuit connected with the H-bridge circuit, and the H-bridge circuit and the constant current output circuit are also respectively connected to the processor.
Further, the processor receives data sent by the smart phone through a serial port interrupt service subprogram, the STM32 receives data of a character received by the register to generate a serial port interrupt, and the data is read into an STM32, wherein the serial port interrupt comprises an amplitude regulation instruction, a pulse width regulation instruction, a mode selection instruction, a starting instruction and a stopping instruction; and calculating a boosting parameter or an H-bridge control parameter according to data received by the serial port interrupt, and setting corresponding timer interrupt, wherein the boosting parameter comprises a primary boosting parameter and a secondary boosting parameter, and the H-bridge control parameter comprises time corresponding to output high and low levels.
Further, the control flow comprises the following specific steps:
step S1: after the processor is electrified and initialized, judging whether a mark Start generated after a serial port receives a Start output instruction through a Bluetooth module is 1, if the Start is not equal to 1, outputting no pulse, and executing the subsequent steps until the mark Start is equal to 1;
step S2: executing pulse parameter initialization operation and outputting initial pulses;
step S3: judging whether a mark Receive generated after a serial port receives a control instruction sent by the smart phone through a Bluetooth module is 1, if the Receive is not equal to 1, continuously outputting an initial pulse, and executing subsequent steps until the mark Receive is 1;
step S4: setting a mark Receive generated after the serial port receives a group of control instructions to be 0, and executing corresponding steps by the processor according to the instructions; the smart phone sends a control instruction through the APP, and the instruction comprises amplitude adjustment, pulse width adjustment, mode selection, starting and stopping output.
Further, the output intensity of the device is adjusted in real time according to the shank angular velocity signal during walking through an adaptive control algorithm; the self-adaptive control algorithm calculates and outputs an electromyographic signal E by acquiring an angular velocity signal in real time and utilizing a BP neural network modeltAnd will electromyographic signals EtScaled to electrical stimulation output intensity Ft
Further, the output intensity is adjusted according to the electromyographic signals in a gait cycle in the walking process of the healthy person, so that the change rule of the output intensity in the output time is consistent with the change rule of the electromyographic signals in the gait cycle; and the output stopping time is inserted between the output times, and the output intensity is adjusted by changing the pulse width.
Further, the amplitude adjusting instruction comprises an amplitude increasing instruction and an amplitude decreasing instruction, after the processor receives the amplitude adjusting instruction, the amplitude is calculated, the primary boosting parameter and the secondary boosting parameter are calculated according to the amplitude, and a DAC converter and a register of a digital potentiometer of the boosting unit are configured through an I2C interface of the STM32 processor;
the pulse width adjusting instruction comprises increasing pulse width and decreasing pulse width, when the processor receives the pulse width adjusting instruction, the pulse width is calculated, and control parameters of the H-bridge circuit, namely timing time of high and low levels, are calculated according to the pulse width.
Further, the mode selection includes 3 operation modes: a parameter setting mode, a myoelectricity modulation mode and a self-adaptive mode; after the processor receives a mode selection instruction, executing subsequent steps according to the corresponding instruction, wherein the initial mode state flag is that a Model is 0 and represents a parameter setting mode; the initial parameter setting flag bit ParSet is 1, which indicates that parameter setting is possible.
Compared with the prior art, the invention and the optimal scheme thereof adopt the lithium battery for power supply, have small volume and light weight and are convenient to wear. Meanwhile, communication with the smart phone is achieved through the Bluetooth, so that the smart phone can be used as an upper computer, parameter setting and instruction control can be carried out on the device on the smart phone, and the device is convenient to use.
The self-adaptive mode of the device utilizes a BP neural network to establish an electromyographic signal prediction model which can be realized in wearable equipment, the electromyographic signal is predicted in real time based on the angular velocity of the lower leg, the output intensity is modulated through the predicted electromyographic signal, redundant stimulation and stimulation blind areas are avoided, and the electrical stimulation output intensity meeting the requirements of natural gait can be provided.
The use mode of the device is as follows: the user connects the electrode plate with the device through a special lead, fixes the device below the knee through a binding band, and attaches the anode and the cathode of the electrode plate to the upper end and the lower end of the tibialis anterior muscle;
turning on a power supply of the device, and carrying out Bluetooth pairing on the smart phone and the device; a user registers on an APP of the smart phone and logs in to enter a control interface; the user starts output to set parameters; closing the output after the user parameter setting is finished; a user selects a mode; closing the output after the user opens the output and finishes using; the user uses the automatic saving of data backstage, withdraws from android APP, and the bandage and electrode slice are taken off to the closing device power.
Drawings
The invention is described in further detail below with reference to the following figures and detailed description:
fig. 1 is a schematic structural diagram of a wearable electrical stimulation output device according to an embodiment of the invention;
FIG. 2 is a schematic diagram of the operating circuit of STM32 according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an operating circuit of HC05 according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the MPU6050 working circuit according to the embodiment of the present invention;
FIG. 5 is a schematic diagram of a USB charging circuit according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a lithium battery voltage detection circuit according to an embodiment of the present invention;
FIG. 7 is a circuit diagram illustrating a circuit switching operation according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a primary boost circuit according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of a DAC conversion circuit according to an embodiment of the present invention;
FIG. 10 is a schematic diagram of a secondary boost circuit according to an embodiment of the present invention;
FIG. 11 is a schematic diagram of an H-bridge operating circuit according to an embodiment of the present invention;
FIG. 12 is a schematic diagram of an operating circuit for generating 12V voltage according to an embodiment of the present invention;
FIG. 13 is a schematic diagram of a constant current output circuit according to an embodiment of the present invention;
FIG. 14 is a schematic diagram of an H-bridge output voltage sampling circuit according to an embodiment of the present invention;
FIG. 15 is a flowchart illustrating a main procedure according to an embodiment of the present invention;
FIG. 16 is a schematic diagram of a BP neural network topology according to an embodiment of the present invention;
FIG. 17 is a schematic flow chart of amplitude adjustment according to an embodiment of the present invention;
FIG. 18 is a schematic diagram of a pulse width modulation and pulse generation process according to an embodiment of the present invention;
FIG. 19 is a flow chart illustrating an exemplary embodiment of a power-on output;
FIG. 20 is a schematic flow chart of the timer generating 1s pulses according to the embodiment of the present invention;
FIG. 21 is a schematic diagram of an interrupt service flow of a myoelectricity modulation mode timer according to an embodiment of the present invention;
FIG. 22 is a schematic diagram of a software implementation flow of the adaptive electromyography modulation algorithm according to the embodiment of the present invention.
Detailed Description
In order to make the features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail as follows:
the present embodiment aims to provide a functional electrical stimulation apparatus capable of adaptively adjusting stimulation intensity and a control method thereof, wherein the wearable electrical stimulation output device communicates with a smart phone through bluetooth. The smart phone performs instruction control and data transmission through the android APP. The functional electrical stimulation apparatus has three working modes: a parameter setting mode, a myoelectricity modulation mode and an adaptive mode. The parameter setting mode may set a parameter of the output pulse. The myoelectricity modulation mode modulates output intensity according to the myoelectricity signal in a gait cycle in the walking process of a healthy person, and the change rule of the output intensity is consistent with the change rule of the myoelectricity signal in the gait cycle. The self-adaptive mode can adjust the output intensity of electrical stimulation according to real-time shank angular velocity signals during walking, and redundant stimulation and stimulation blind areas are avoided.
Wearable electrical stimulation output device
Wearable electrical stimulation output device includes STM32 microprocessor, is used for realizing the bluetooth communication module of STM32 and smart mobile phone communication and is used for realizing the angular velocity collection module of angular velocity collection, is used for the power module, the module and the pulse output module of stepping up for the power supply of whole device, and each module of device is connected as shown in fig. 1.
The power module comprises a lithium battery, a USB charging circuit and a voltage conversion circuit, wherein the USB charging circuit and the voltage conversion circuit are connected with the lithium battery. The boost module comprises a primary boost circuit connected with the lithium battery, a secondary boost circuit connected with the primary boost circuit, a DAC (digital-to-analog converter) connected with the primary boost circuit, and a digital potentiometer connected with the secondary boost circuit, wherein the DAC and the digital potentiometer are also respectively connected to the processor.
The pulse output module comprises an H-bridge circuit connected with the secondary booster circuit and a constant current output circuit connected with the H-bridge circuit, and the H-bridge circuit and the constant current output circuit are respectively connected to the processor.
The wearable electrical stimulation output device capable of adaptively adjusting the output intensity is designed based on an STM32 processor (STM 32F407VET6 and other chips with the same function are selected), and the instructions such as amplitude adjustment, pulse width adjustment, mode selection (including a parameter setting mode, a muscle point modulation mode and a gait adaptive mode), starting and stopping output and the like sent by a smart phone are received through a Bluetooth communication module, so that the output intensity is adaptively adjusted according to real-time gait information. The specific hardware comprises an STM32 processor, a Bluetooth communication module, a power module, a boosting module, a pulse output module and an angular velocity acquisition module. This device adopts 4.2V chargeable lithium cell as the power, charges through the USB line to the lithium cell, and the lithium cell is through voltage conversion circuit as STM 32's driving voltage, and the lithium cell is as the input voltage of boost module simultaneously, and the output voltage of boost module is as constant current output module's operating voltage.
The STM32 processor selects STM32F407VET6, and the working circuit is shown in FIG. 2. The CPU is a 32-bit processor, the working frequency of the CPU is 72MHz, the peripherals are rich, and the timer, the ADC, the I2C, the GPIO and the USART function modules which are required by the constant current output device are met. The I2C peripheral module is used for configuring registers of the DAC converter and the digital potentiometer; 8 common I/O ports are used for controlling the pulse output module; the ADC module is used for collecting the voltage of the battery and the voltage of the pulse output circuit.
The Bluetooth communication module adopts an ATK-HC05 master-slave integrated Bluetooth serial port module, has small volume and high stability, and can be used for realizing mutual data transmission with an upper computer. This device adopts smart mobile phone APP as host computer. The HC05 and the STM32 are provided with USART interfaces to realize communication, and the communication baud rate is 115200 kb/s. The working circuit is shown in fig. 3, and the LED represents an indicator light and is connected to the IO port. The indicator light 2s flashes slowly once to show that the HC05 enters the AT mode, and parameter settings including baud rate, name, password, master-slave role, and the like can be performed on the HC 05. The indicator lights flash, indicating that HC05 initialization is complete, entering a pairable state. The indicator light 1s flashes twice to indicate that the pairing state has been entered. KEY is connected to IO port, and HC05 enters AT mode when high. RX and TX are respectively connected with TX and RX of an STM32 USART interface to realize mutual transmission of data.
The angular velocity acquisition module selects an MPU6050 as a sensor for acquiring angular velocity signals, and the operating circuit of the angular velocity acquisition module is shown in fig. 4. The MPU6050 sensor performs data transmission with the STM32 through an IIC interface, and performs DA conversion on the read angular velocity number to acquire a real value. The MPU6050 sensor contains 3 gyroscopes, the range selection is determined by the gyroscope configuration register, the register address is 0X1B, two bits of FS _ SEL [1:0] (namely bit3 and bit4) are used for setting the full range of the gyroscopes.
The power module comprises a battery, a USB charging circuit and a voltage conversion circuit, wherein the battery is a 4.2V rechargeable lithium battery, the battery is charged through a USB line, the battery charging circuit adopts an MP2615 high-efficiency charger chip, the voltage conversion circuit converts the battery voltage into the voltage for the STM32 to work, and the USB charging circuit is shown in figure 5. In the present device, the green light D5 and the red light D6 represent an active power input indicator light and a charging indicator light, respectively, and the red light and the green light are always on when the USB cable inputs a voltage of 5V. The charging circuit only needs to charge 1 section of 4.2V lithium battery, therefore, the 4 th pin of the MP2615 is connected with the VCC pin through the 0R resistor and is set to charge 1 section of battery. The 5 th pin is suspended and is set to charge the 4.2V battery. As shown in FIG. 6, in order to prevent the voltage of the lithium battery from exceeding the allowable voltage range of the ADC module, the lithium battery needs to be connected in series with 2 resistors of 100K for voltage division, and the divided voltage is input into the ADC module of STM32 for detecting the electric quantity of the battery. When the green light D6 goes out, it shows that battery voltage is too low, STM32 can not work normally, need to charge the lithium cell. The 3.3V voltage conversion working circuit is shown in fig. 7, a lithium battery is connected with a switch in series and then connected with an XC6206 chip, and when the switch is closed, a 4.2V voltage is converted into a 3V3 voltage through the XC6206 chip to serve as a driving voltage of an STM 32.
The boosting module is a two-stage boosting circuit comprising a primary boosting circuit and a secondary boosting circuit, and the primary boosting circuit and the secondary boosting circuit boost the power supply voltage to the required voltage in a parallel connection mode. The lithium battery is used as the input voltage of the primary booster circuit, and the voltage boosted by the primary booster circuit is used as the input voltage of the secondary booster circuit. The primary boost uses a FP6296XR chip, the operating circuit of which is shown in FIG. 8. In the device, the input voltage of the primary booster circuit is 4.2V, the output voltage is up to 12V, the 5 th pin of the primary booster chip is used as a voltage feedback pin, the feedback voltage VFB is 1.2V, and the primary booster circuit is externally connected with a linear addition circuit. By controlling the voltage of the input end CH1_ ADJ2 of the addition circuit, the voltage is controlledAnd (4) producing an output voltage. Increasing the voltage of CH1_ ADJ2 may decrease the output voltage V of the primary boost circuitO(ii) a Otherwise, the output voltage V of the primary booster circuit is increasedO. The voltage of CH1_ ADJ2 is determined by the voltage output by the I2C interface control DAC converter of STM32, and the DAC conversion operation circuit is as shown in fig. 9. The output voltage is used as the input voltage of the secondary booster circuit, the secondary booster circuit adopts a Boost booster circuit, and the working circuit of the secondary booster circuit is shown in fig. 10. In the device, a high-performance PWM controller BIT3260 is adopted to control the switch of an MOS tube, the voltage of an OCP pin of the device is 0.5V, a digital potentiometer MCP4018-502 is externally connected, the digital potentiometer is connected with a 100K resistor R22 in series, and the output voltage is calculated to be
Figure RE-GDA0003126258700000081
(assume the resistance of the digital potentiometer is Rx). And a register of the digital potentiometer is configured through an I2C interface of the STM32, the resistance value of the digital potentiometer is changed, and the control of the output voltage of the secondary boosting is realized.
The pulse output module consists of an H-bridge circuit and a constant current output circuit, and the H-bridge working circuit is shown in figure 11. The I/O port of STM32 controls the alternate conduction of H bridge, and the frequency and pulse width of output bipolar pulse are controlled according to the calculated frequency and pulse width. The lower tube of the H-bridge adopts a MOS tube, the driving voltage of the MOS tube is set to be 12V, and a working circuit generating 12V voltage is shown in figure 12. The device adopts an FP6291 boosting integrated chip, the feedback voltage of a 5 pin is 0.6V, and the output voltage of the device is ensured to be 12V by externally connecting divider resistors R54 and R57, so that the driving voltage is provided for an MOS (metal oxide semiconductor) tube. Constant current output circuit as shown in fig. 13, R26 resistance is used for small current output and load resistance measurement. If the R26 resistor is connected into a circuit, the resistor and a load form a series circuit, and the magnitude of the load resistor can be measured through the voltage of two output ends of the H bridge and the voltage of the R26 resistor. The CH1_ SW2 switch determines whether to turn on the bypass R26, and the CH1_ SW1 determines whether to open the channel. As shown in fig. 14, in order to prevent the voltage from exceeding the allowable voltage range of the ADC module, the operating circuit for sampling the voltages at the two output ends of the H-bridge is divided by resistors and then input to the ADC module. The constant current output is actually a constant current output circuit controlled by voltage, the voltage corresponding to the current required for output is calculated, and the registers corresponding to the DAC converter and the digital potentiometer are configured through an I2C interface, so that the output voltage of the secondary booster circuit is stable. Detecting the current flowing through the load, and when the load current is smaller than a set value, reducing the resistance value of the digital potentiometer, and increasing the output voltage of the booster circuit so as to increase the load current; when the load current is larger than a set value, the resistance value of the digital potentiometer is increased, the output voltage of the booster circuit is reduced, the load current is reduced, and constant current output is finally achieved.
Second, software control method of processor
And the processor STM32 of the electrical stimulation output device receives the data sent by the smart phone through the serial port interrupt service subprogram. The STM32 receives data of a character from a register, generates a serial port interrupt, and reads the data into the STM32, wherein the data comprises instructions of amplitude adjustment (increasing and decreasing amplitude), pulse width adjustment (increasing and decreasing pulse width), mode selection (parameter setting mode, myoelectricity modulation mode and self-adaptive mode), starting and stopping output and the like. And calculating a boosting parameter or an H-bridge control parameter according to data received by the serial port interrupt, and setting corresponding timer interrupt, wherein the boosting parameter comprises a primary boosting parameter and a secondary boosting parameter, and the H-bridge control parameter comprises time corresponding to output high and low levels.
The control flow of the main program of the electrical stimulation output device is shown in figure 15,
the method comprises the following specific steps:
the method comprises the steps that after the processor is powered on and initialized, whether a mark Start generated after a serial port receives a Start output instruction through a Bluetooth module is 1 or not is judged, if the Start is not equal to 1, no pulse is output, and the follow-up step is not executed until the mark Start is equal to 1.
And secondly, executing pulse parameter initialization operation and outputting initial pulses.
And thirdly, judging whether a mark Receive generated after the serial port receives a group of data (control instructions) sent by the smart phone through the Bluetooth module is 1, if Receive is not equal to 1, continuously outputting an initial pulse, and executing the subsequent steps until the mark Receive is 1.
And fourthly, setting a mark Receive generated after the serial port receives a group of control instructions to be 0, and executing corresponding steps by the processor according to the instructions. The smart phone sends a control instruction through the APP, and the instruction comprises amplitude adjustment, pulse width adjustment, mode selection, starting and stopping output.
1. Self-adaptive mode electrical stimulation output intensity control method
The self-adaptive mode of the invention can adjust the output intensity of the device in real time according to the shank angular velocity signal during walking and is realized by a self-adaptive control algorithm.
The algorithm calculates and outputs an electromyographic signal E by acquiring an angular velocity signal in real time and utilizing a BP neural network modeltAnd will electromyographic signals EtScaled to electrical stimulation output intensity Ft
The BP neural network is schematically illustrated in fig. 16, and the network comprises three parts, namely an input layer, a hidden layer and an output layer.
The calculation process of the BP neural network is as follows:
activation function:
Figure RE-GDA0003126258700000101
hidden layer:
Figure RE-GDA0003126258700000102
Figure RE-GDA0003126258700000103
an output layer:
Figure RE-GDA0003126258700000104
Figure RE-GDA0003126258700000105
updating the weight threshold value:
Figure RE-GDA0003126258700000106
wherein the connection weight between the ith neuron of the input layer and the jth neuron of the hidden layer is WijThe connection weight between the jth neuron of the hidden layer and the neuron of the output layer is WjThe threshold value of the jth neuron of the hidden layer is thetajThe threshold value of neuron of output layer is theta, SjFor the jth neuron in the hidden layer, receives the input from the input layer, δjFor the jth neuron back-propagation error of the hidden layer, delta is the back-propagation error of the output layer, etη is the learning rate for the expected error.
Electromyographic signal EtScaled to electrical stimulation output intensity FtThe calculation formula of (2) is as follows:
Ft=(sat-thr)·Et+thr
where thr and sat are the threshold and tolerance values set by the user, respectively. The invention adjusts the output intensity by changing the pulse width.
Before use, the BP neural network is trained off line, because gait data have periodicity and time sequence, in order to accurately predict the electromyographic signals by using the collected angular velocity signals, input signals in a model of the BP neural network are angular velocity signals A from time t, time t-1, time t-2 to time t-N +1t, At-1,At-2…At-N+1(N is a positive integer), and the output signal is an electromyographic signal E corresponding to different angular velocities at the time tt
The specific method for off-line training of the BP neural network model comprises the following steps: a healthy tester can walk on a flat ground in a normal straight line according to metronome signals which are respectively set to be 60 steps/min and 70 steps/min till 110 steps/min, and meanwhile, calf angular velocity signals and tibialis anterior muscle electromyographic signals are collected. The collected electromyographic signals are subjected to full-wave rectification, low-pass filtering (6-order Butterworth low-pass filtering, cut-off frequency 4Hz), resampling (100Hz) and normalization processing. The collected angular velocity signals are low-pass filtered (6 order butterworth low-pass filtering, cut-off frequency 4Hz), resampled (100Hz) and normalized. The sampling frequencies of the two groups of data are consistent, and then the model of the calf angular velocity signal and the tibialis anterior myoelectric signal is built by utilizing the BP neural network. Angular velocity signals of continuous N moments (including the current moment) are used as input of the neural network, and tibialis anterior muscle electromyography signals of the current moment are used as output.
The value taking method of the number N of the input layers and the number M of the neurons of the hidden layers of the BP neural network comprises the steps of respectively taking different values, testing the network performance by utilizing the root-mean-square error and the regression coefficient, and determining the values of N and M after comprehensively considering the complexity of the network, the root-mean-square error and the size of the regression coefficient.
2. Electromyographic modulation mode electrical stimulation output intensity control method
The electromyographic modulation mode of the invention adjusts the output intensity according to the electromyographic signals in a gait cycle in the walking process of a healthy person, and the change rule of the output intensity in 1s is consistent with the change rule of the electromyographic signals in a gait cycle. In the electromyographic modulation mode, the output lasts for 1s, then stops for 2s, and outputs for 1s again, thereby circulating.
Electromyographic signal EtScaled to electrical stimulation output intensity FtThe calculation formula of (2) is as follows:
Ft=(sat-thr)·Et+thr
where thr and sat are the threshold and tolerance values set by the user, respectively. The invention adjusts the output intensity by changing the pulse width.
3. Control instruction
(1) Amplitude adjustment instruction
The amplitude adjusting instruction comprises an amplitude increasing instruction and an amplitude decreasing instruction, after the amplitude adjusting instruction is received by the processor, the amplitude is calculated, the primary boosting parameter and the secondary boosting parameter are calculated according to the amplitude, and a DAC (digital-to-analog converter) of the boosting unit and a register of a digital potentiometer are configured through an I2C interface of the STM32 processor. The amplitude adjustment flow is shown in fig. 17.
The method comprises the following specific steps:
calculating a load resistance value Resistor; judging whether the Resistor is between 900 and 4000; if yes, continuing to execute the subsequent steps, and if not, not configuring the boosting parameters; when the Resistor is between 900 and 4000, judging whether the amplitude value Tar is Amp, or not, and if the amplitude value is less than or equal to 12V, setting the flag EaState for starting the secondary boosting to be 0, and indicating that the secondary boosting is not carried out. Meanwhile, the parameter of the input end CH1_ ADJ2 of the adding circuit in the primary booster circuit is calculated, so that the output voltage of the primary booster circuit is controlled. And if the amplitude is larger than 12V, setting EaState to be 1, and indicating that secondary boosting is performed. The parameter of the input end CH1_ ADJ2 of the adding circuit in the primary booster circuit is set to 0, and the parameter of a digital potentiometer in the secondary booster circuit is calculated, so that the output voltage of the secondary booster circuit is controlled.
(2) Pulse width modulation command
The pulse width adjusting instruction comprises increasing pulse width and decreasing pulse width, when the processor receives the pulse width adjusting instruction, the pulse width is calculated, and control parameters of the H-bridge circuit, namely timing time of high and low levels, are calculated according to the pulse width. The pulse width modulation and pulse generation flow is shown in fig. 18.
The method comprises the following specific steps:
after the timer interrupt is generated, the timer is closed; setting the timing time and the pulse state mark of a timer according to the current pulse state mark, wherein the initial state mark is CH _ INIT; when the state flag is CH _ INIT, the processor calculates the duration of HIGH and low levels according to the received regulating instruction, the timer sets the duration of HIGH level, the state flag is changed into CLTP _ HIGH, the timer is started, and a forward pulse is output; after the timer interrupt is generated, the timer is closed; when the state flag is CLTP _ HIGH, the timer sets low level delay time and outputs low level, then the timer sets HIGH level duration, the state flag is changed into CLTN _ HIGH, the timer is started, and negative pulse is output; after the timer interrupt is generated, the timer is closed; when the state flag is CLTN _ HIGH, the timer sets the duration of LOW level, the state flag changes to HOLD _ LOW, the timer is started, and the LOW level is output; timingAfter the interrupt of the timer is generated, closing the timer; when the state flag is HOLD _ LOW, the processor calculates the duration of HIGH and LOW levels according to the received regulating instruction, the timer sets the duration of HIGH level, the state flag is changed into CLTP _ HIGH, the timer is started, and a forward pulse is output; and then repeating the period, and simultaneously judging whether the current count value of the timer is less than T when the state flag is CLTP _ HIGH or CLTN _ HIGH, wherein T is less than and close to the set value of the timer. When the current count value of the timer is less than T, the load current is sampled through the AD module, and the load current I is converted into the load current IfAnd setting the current IrComparing to obtain a current deviation value delta I, wherein delta I is If-Ir. Finely adjusting the digital potentiometer according to the deviation value delta I, and when the delta I is larger than 0, increasing the resistance value of the digital potentiometer and reducing the output voltage of the booster circuit so as to reduce the load current; when the delta I is less than 0, the resistance value of the digital potentiometer is reduced, the output voltage of the booster circuit is increased, and therefore the load current is increased; and then returning to continue executing the current step until the current count value of the timer is greater than T, and exiting the timer interrupt service. To ensure the cycle integrity of the output pulse, the duration of the high and LOW levels may be changed only when the status flag bit is HOLD _ LOW; the low-level delay time is a dead time reserved due to the fact that the positive and negative pulses cannot jump, and is different from the low-level duration time.
(3) Mode selection
The device comprises 3 working modes: a parameter setting mode, a myoelectricity modulation mode and an adaptive mode. And after the processor receives the mode selection instruction, executing subsequent steps according to the corresponding instruction, wherein the initial mode state flag is that the Model is 0, and the initial mode state flag represents the parameter setting mode. The initial parameter setting flag bit ParSet is 1, which indicates that parameter setting is possible.
The method comprises the following specific steps:
receiving a parameter setting mode instruction
The mode state flag bit Model is set to 0, and the parameter setting flag bit ParSet is 1, which indicates that the setting of parameters, including the adjustment of the output amplitude and the pulse width, can be performed. The parameter setting mode is repeated by outputting a pulse of 1s, stopping for 2s, outputting a pulse of 1s again, stopping for 2 s. The pulse width and amplitude of the output pulse are current set values.
Receiving an electromyographic modulation mode instruction
The mode state flag bit Model is set to be 1, and the current mode is a myoelectricity modulation mode; and calculating the pulse width values in one output period according to the stored threshold value and tolerance value information, wherein the number of the pulse width values is f, the pulse width values are stored as an array PW [ f ], and f is the pulse output frequency. The myoelectric modulation mode is repeated by outputting a pulse of 1s, stopping for 2s, outputting a pulse of 1s again, stopping for 2 s. The amplitude of the output pulse is a set value, and the pulse width is changed for f times in 1s according to the array PW [ f ].
Receiving an adaptive mode instruction
The mode status flag Model is set to 2, indicating that the current mode is the adaptive mode. The output mode of the self-adaptive mode is full-range output, and the acquired angular speed is converted into pulse width according to a self-adaptive electromyography modulation algorithm, so that pulses with the pulse width changing along with the change of the angular speed are output.
(4) Open output instruction
When the processor receives the start output instruction, the processor enables different timer interrupts to control the start of different output modes through parameters, and the flow is shown in fig. 19.
The method comprises the following specific steps:
judging whether the mode state flag bit Model is equal to 0 or not;
if the Model is equal to 0, the current mode is the parameter setting mode; enabling the timer 1, and closing the timer 2 with the timing time of 2 s; determining the number of times Timer _ R of Timer overflow interruption according to the pulse frequency, wherein the numerical value of the number of times Timer _ R is equal to 3 times of the pulse frequency so as to realize the pulse duration of 1 s; when the time Timer _ C of the Timer overflow interruption is not less than the time Timer _ R, clearing the time Timer _ C, closing the Timer 1 and enabling the Timer 2; timer 2 times 2s and the interrupt service enables timer 1. The 1s pulse generation flow is shown in fig. 21. If the Model is not equal to 0, setting Parset to 0, and indicating that parameter setting is forbidden; the parameter setting mode timer 1 interrupt service flow is shown in fig. 20.
Judging whether the mode state flag bit Model is equal to 1 or not;
if the Model is 1, the current mode is the myoelectricity modulation mode; setting Parset to 0, which indicates that parameter setting is forbidden; enabling the timer 1, and closing the timer 2 with the timing time of 2 s; determining the number of times of pulse width change in 1s according to the pulse frequency, changing the pulse width after outputting a pulse of a complete period, and calculating a specific value through a threshold value and a tolerance value; when the time Timer _ C of the Timer overflow interruption is not less than the time Timer _ R, clearing the time Timer _ C, closing the Timer 1 and starting the Timer 2; timer 2 times 2s and the interrupt service enables timer 1. And when the time of Timer overflow interruption, namely Timer _ C, is less than Timer _ R, the H-bridge control parameter is recalculated every three times of interruption. The electromyogram modulation mode timer 1 interrupt service flow is shown in fig. 21.
If the Model is not equal to 1, the current mode is the self-adaptive mode; setting Parset to 0, which indicates that parameter setting is forbidden; enabling a timer 3 and a timer 1, wherein the timing time of the timer 1 is 2s, and the timing time of the timer 3 is 10 ms; the timer 3 interrupts service to collect angular velocity signals and converts the angular velocity into control parameters (pulse width) for controlling an H bridge through a self-adaptive electromyography modulation algorithm; and after a complete pulse is output, recalculating the H-bridge control parameter according to the angular velocity signal to realize the self-adaptive adjustment of the output intensity.
The adaptive control algorithm is implemented in the interrupt service of the timer 3, and the flow is shown in fig. 22, and the specific steps are as follows: after the timer interrupt is generated, the timer is closed; array gyro [ N ]]Storing angular velocity signals at the current moment and the previous N moments, calculating an output value of the hidden layer by using a weight threshold of the hidden layer, calculating an output value by using a weight threshold of the output layer to obtain an electromyographic signal predicted value EMG, and calculating the EMG according to a formula FtCalculating an H-bridge control parameter (high level duration, i.e. pulse width) by (sat-thr) · EMG + thr; a timer is started.
(5) Close output command
And when the processor receives an output closing instruction, all the timers are closed, the boosting is closed, and the H bridge is blocked to stop the output of the pulse. If the ParSet is 0, the ParSet is set to 1 when an instruction to close the output is received.
Three, android APP
The device realizes data transmission with the smart phone and instruction control of the smart phone to the device through Bluetooth, and the specific steps of the operation flow are as follows:
installing an android APP by a user;
after a user wears the device and turns on a power switch, Bluetooth pairing is carried out;
the user inputs 'user name and password' to register and log in;
a user clicks an 'output on' button on a screen, the button adopts a toggle button (ToggleButton), and becomes an 'output off' button after clicking;
the user sets the parameters to increase and decrease the amplitude and pulse width. The user determines the threshold value and the tolerance value by increasing and decreasing the pulse width;
the user clicks the "close output" button;
a user clicks a button selection mode of a parameter setting mode, a myoelectricity modulation mode and an adaptive mode;
the user clicks the "open output" button;
after the user finishes using, clicking a button for closing the output;
and (4) the user quits from the android APP, and the user parameter setting value and the angular speed data thereof are automatically stored in the background.
The present invention is not limited to the best mode, and any other functional electrical stimulation apparatus capable of adaptively adjusting the output intensity and the control method thereof can be obtained according to the teaching of the present invention.

Claims (10)

1. A functional electrical stimulation apparatus capable of adaptively adjusting output intensity, comprising: the processor is respectively connected with the processors: the device comprises a Bluetooth communication module, an angular velocity acquisition module, a power supply module, a boosting module and a pulse output module; the power supply module is connected with the pulse output module through the boosting module; the Bluetooth communication module is connected with the smart phone, and the smart phone is used as an upper computer to perform instruction control on the device; the device receives a control instruction of the smart phone and then adjusts stimulation parameters and outputs bipolar constant current pulses in real time through the processor.
2. The functionally electrical stimulation apparatus capable of adaptively adjusting output intensity of claim 1, wherein: the processor is an STM32 microprocessor; the power module comprises a lithium battery, a USB charging circuit and a voltage conversion circuit, wherein the USB charging circuit and the voltage conversion circuit are connected with the lithium battery.
3. The functionally electrical stimulation apparatus capable of adaptively adjusting output intensity of claim 2, wherein: the boost module includes the primary boost circuit who is connected with the lithium cell, the secondary boost circuit who is connected with primary boost circuit, the DAC converter who is connected with primary boost circuit, the digital potentiometer who is connected with secondary boost circuit, DAC converter and digital potentiometer still are connected to the treater respectively.
4. The functionally electrical stimulation apparatus capable of adaptively adjusting output intensity of claim 3, wherein: the pulse output module comprises an H-bridge circuit connected with the secondary booster circuit and a constant current output circuit connected with the H-bridge circuit, and the H-bridge circuit and the constant current output circuit are respectively connected to the processor.
5. The method of claim 4, wherein the method comprises: the processor receives data sent by the smart phone through a serial port interrupt service subprogram, the STM32 receives data of a character received by the register, generates a serial port interrupt, and reads the data into the STM32, wherein the data comprises an amplitude regulation instruction, a pulse width regulation instruction, a mode selection instruction, a starting instruction and a stopping instruction; and calculating a boosting parameter or an H-bridge control parameter according to data received by the serial port interrupt, and setting corresponding timer interrupt, wherein the boosting parameter comprises a primary boosting parameter and a secondary boosting parameter, and the H-bridge control parameter comprises time corresponding to output high and low levels.
6. The method of claim 5, wherein the method comprises:
the control flow comprises the following specific steps:
step S1: after the processor is electrified and initialized, judging whether a mark Start generated after a serial port receives a Start output instruction through a Bluetooth module is 1, if the Start is not equal to 1, outputting no pulse, and executing the subsequent steps until the mark Start is equal to 1;
step S2: executing pulse parameter initialization operation and outputting initial pulses;
step S3: judging whether a mark Receive generated after a serial port receives a control instruction sent by the smart phone through a Bluetooth module is 1, if the Receive is not equal to 1, continuously outputting an initial pulse, and executing subsequent steps until the mark Receive is 1;
step S4: setting a mark Receive generated after the serial port receives a group of control instructions to be 0, and executing corresponding steps by the processor according to the instructions; the smart phone sends a control instruction through the APP, and the instruction comprises amplitude adjustment, pulse width adjustment, mode selection, starting and stopping output.
7. The method of claim 4, wherein the method comprises: adjusting the output intensity of the device in real time according to the shank angular velocity signal during walking through an adaptive control algorithm; the self-adaptive control algorithm calculates and outputs an electromyographic signal E by acquiring an angular velocity signal in real time and utilizing a BP neural network modeltAnd will electromyographic signals EtScaled to electrical stimulation output intensity Ft
8. The method of claim 4, wherein the method comprises: adjusting the output intensity according to the electromyographic signals in a gait cycle in the walking process of the healthy person, so that the change rule of the output intensity in the output time is consistent with the change rule of the electromyographic signals in the gait cycle; the output stopping time is inserted between the output times, and the output intensity is adjusted by changing the pulse width.
9. The method of claim 5, wherein the method comprises:
the amplitude adjusting instruction comprises an amplitude increasing instruction and an amplitude decreasing instruction, after the processor receives the amplitude adjusting instruction, the current amplitude is calculated, the primary boosting parameter and the secondary boosting parameter are calculated according to the amplitude, and a DAC (digital-to-analog converter) of the boosting unit and a register of a digital potentiometer are configured through an I2C interface of the STM32 processor; the amplitude adjusting process comprises the following specific steps:
calculating a load resistance value Resistor; judging whether the Resistor is between 900 and 4000; if yes, continuing to execute the subsequent steps, and if not, not configuring the boosting parameters; when the Resistor is between 900 and 4000, judging whether the amplitude value Tar is Amp and Resistor is larger than 12V, if the amplitude value is smaller than or equal to 12V, setting a flag EaState for starting secondary boosting to be 0, and indicating that secondary boosting is not carried out; meanwhile, the parameter size of an input end CH1_ ADJ2 of an addition circuit in the primary booster circuit is calculated, so that the output voltage of the primary booster circuit is controlled; if the amplitude is larger than 12V, setting EaState to 1, and indicating that secondary boosting is performed; setting the parameter of the input end CH1_ ADJ2 of the adding circuit in the primary booster circuit to 0, and simultaneously calculating the parameter of a digital potentiometer in the secondary booster circuit so as to control the output voltage of the secondary booster circuit;
the pulse width adjusting instruction comprises increasing pulse width and decreasing pulse width, when the processor receives the pulse width adjusting instruction, the pulse width is calculated, and control parameters of the H-bridge circuit, namely timing time of high and low levels, are calculated according to the pulse width; the pulse width regulation and pulse generation process comprises the following specific steps:
after the timer interrupt is generated, the timer is closed; setting the timing time and the pulse state mark of a timer according to the current pulse state mark, wherein the initial state mark is CH _ INIT; when the state flag is CH _ INIT, the processor calculates the high and low according to the received regulating instructionThe method comprises the steps of level duration, setting HIGH level duration by a timer, starting the timer when a state flag is changed into CLTP _ HIGH, and outputting a forward pulse; after the timer interrupt is generated, the timer is closed; when the state flag is CLTP _ HIGH, the timer sets low level delay time and outputs low level, then the timer sets HIGH level duration, the state flag is changed into CLTN _ HIGH, the timer is started, and negative pulse is output; after the timer interrupt is generated, the timer is closed; when the state flag is CLTN _ HIGH, the timer sets the duration of LOW level, the state flag changes to HOLD _ LOW, the timer is started, and the LOW level is output; after the timer interrupt is generated, the timer is closed; when the state flag is HOLD _ LOW, the processor calculates the duration of HIGH and LOW levels according to the received regulating instruction, the timer sets the duration of HIGH level, the state flag is changed into CLTP _ HIGH, the timer is started, and a forward pulse is output; then repeating the cycle, and meanwhile, when the state flag is CLTP _ HIGH or CLTN _ HIGH, judging whether the current count value of the timer is smaller than T, and the T is smaller than and close to the set value of the timer; when the current count value of the timer is less than T, the load current is sampled through the AD module, and the load current I is converted into the load current IfAnd setting the current IrComparing to obtain a current deviation value delta I, wherein delta I is If-Ir(ii) a Finely adjusting the digital potentiometer according to the deviation value delta I, and when the delta I is larger than 0, increasing the resistance value of the digital potentiometer and reducing the output voltage of the booster circuit so as to reduce the load current; when the delta I is less than 0, the resistance value of the digital potentiometer is reduced, the output voltage of the booster circuit is increased, and therefore the load current is increased; then returning to continue executing the current step until the current count value of the timer is greater than T, and quitting the timer interrupt service; to ensure the cycle integrity of the output pulse, the duration of the high and LOW levels may be changed only when the status flag bit is HOLD _ LOW; the low-level delay time is a dead time reserved due to the fact that the positive and negative pulses cannot jump, and is different from the low-level duration time.
10. The method of claim 5, wherein the method comprises: the mode selection comprises 3 working modes: a parameter setting mode, a myoelectricity modulation mode and a self-adaptive mode; after the processor receives a mode selection instruction, executing subsequent steps according to the corresponding instruction, wherein the initial mode state flag is that a Model is 0 and represents a parameter setting mode; an initial parameter setting flag bit partet is 1, which indicates that parameter setting can be performed;
the method comprises the following specific steps:
receiving a parameter setting mode instruction:
setting a mode state flag bit Model to be 0, setting a parameter setting flag bit ParSet to be 1, and indicating that parameter setting can be performed, wherein the parameter setting includes adjustment of output amplitude and pulse width; the output mode of the parameter setting mode is to output 1s of pulse, stop 2s, output 1s of pulse again, stop 2s, repeat this; the pulse width and amplitude of the output pulse are current set values;
receiving an electromyography modulation mode instruction:
the mode state flag bit Model is set to be 1, and the current mode is a myoelectricity modulation mode; meanwhile, calculating the pulse width value in an output period according to the stored threshold value and tolerance value information, wherein the number of the pulse width values is f, and storing the pulse width values as an array PW [ f ], wherein f is the pulse output frequency; outputting the electromyographic modulation mode in a mode of outputting 1s of pulses, stopping for 2s, outputting 1s of pulses again, stopping for 2s, and repeating the steps; the amplitude of the output pulse is a set value, and the pulse width is changed for f times in 1s according to the array PW [ f ].
Receiving an adaptive mode instruction:
setting a mode state flag position Model to be 2, and indicating that the current mode is the self-adaptive mode; the output mode of the self-adaptive mode is full-range output, and the acquired angular speed is converted into pulse width according to a self-adaptive electromyography modulation algorithm, so that pulses with the pulse width changing along with the change of the angular speed are output;
when the processor receives an output starting instruction, different timers are enabled to interrupt through parameters to control the starting of different output modes, and the specific steps are as follows:
judging whether the mode state flag bit Model is equal to 0:
if the Model is equal to 0, the current mode is the parameter setting mode; enabling the timer 1, and closing the timer 2 with the timing time of 2 s; determining the number of times Timer _ R of Timer overflow interruption according to the pulse frequency, wherein the numerical value of the number of times Timer _ R is equal to 3 times of the pulse frequency so as to realize the pulse duration of 1 s; when the time Timer _ C of the Timer overflow interruption is not less than the time Timer _ R, clearing the time Timer _ C, closing the Timer 1 and enabling the Timer 2; the timer 2 times for 2s, and the interrupt service is the enabling timer 1; if the Model is not equal to 0, setting Parset to 0, and indicating that parameter setting is forbidden;
judging whether the mode state flag bit Model is equal to 1 or not;
if the Model is 1, the current mode is the myoelectricity modulation mode; setting Parset to 0, which indicates that parameter setting is forbidden; enabling the timer 1, and closing the timer 2 with the timing time of 2 s; the interrupt service of the timer 1 is the interrupt service of controlling H-bridge parameters in a pulse width adjusting instruction to generate bipolar rectangular pulses, the number of times of pulse width change in 1s is determined according to pulse frequency, the pulse width is changed after a pulse of a complete period is output, and a specific value is obtained by calculating a threshold value and a tolerance value; when the time Timer _ C of the Timer overflow interruption is not less than the time Timer _ R, clearing the time Timer _ C, closing the Timer 1 and starting the Timer 2; the timer 2 times for 2s, and the interrupt service is the enabling timer 1; when the time of Timer overflow interruption, Timer _ C, is less than Timer _ R, the H-bridge control parameter is recalculated every three times of interruption;
if the Model is not equal to 1, the current mode is the self-adaptive mode; setting Parset to 0, which indicates that parameter setting is forbidden; enabling timer 3 and timer 1; the timer 3 interrupts service to acquire an angular velocity signal and converts the angular velocity into a control parameter for controlling the H bridge through a self-adaptive control algorithm; the timer 1 interrupt service is an interrupt service for controlling H-bridge parameters in the pulse width adjusting instruction to generate bipolar rectangular pulses; after a pulse of a complete period is output, recalculating H-bridge control parameters according to the angular velocity signal to realize the self-adaptive adjustment of output intensity;
the self-adaptive control algorithm is realized in the interrupt service of the timer 3, and the specific steps are as follows: after the timer interrupt is generated, the timer is closed; array gyro [ N ]]Storing angular velocity signals of the current moment and the previous N moments, and calculating the output value of the hidden layer by using the weight threshold value of the hidden layerCalculating an output value by using a weight threshold value of the output layer to obtain an EMG (electromyographic signal) predicted value EMG (electromyographic signal), and calculating the EMG predicted value EMG according to a formula FtCalculating an H-bridge control parameter (i.e. high level duration, namely pulse width) by (sat-thr) EMG + thr; starting a timer;
and when the processor receives an output closing instruction, all the timers are closed, the boosting is closed, and the H bridge is blocked to stop the output of the pulse. If the ParSet is 0, the ParSet is set to 1 when an instruction to close the output is received.
CN202110556392.XA 2021-05-21 2021-05-21 Functional electric stimulation instrument capable of adaptively adjusting output intensity and control method thereof Active CN113332597B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110556392.XA CN113332597B (en) 2021-05-21 2021-05-21 Functional electric stimulation instrument capable of adaptively adjusting output intensity and control method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110556392.XA CN113332597B (en) 2021-05-21 2021-05-21 Functional electric stimulation instrument capable of adaptively adjusting output intensity and control method thereof

Publications (2)

Publication Number Publication Date
CN113332597A true CN113332597A (en) 2021-09-03
CN113332597B CN113332597B (en) 2023-08-15

Family

ID=77470549

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110556392.XA Active CN113332597B (en) 2021-05-21 2021-05-21 Functional electric stimulation instrument capable of adaptively adjusting output intensity and control method thereof

Country Status (1)

Country Link
CN (1) CN113332597B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114652961A (en) * 2022-04-01 2022-06-24 山东海天智能工程有限公司 Adjustable electrical stimulation walking aid instrument
CN115227971A (en) * 2022-07-28 2022-10-25 喻鹏铭 Autonomic nerve electric stimulator
CN117205442A (en) * 2023-09-18 2023-12-12 易集康健康科技(杭州)有限公司 Control method and system of radio frequency pulse transmitting module

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107596560A (en) * 2017-10-18 2018-01-19 福州大学 A kind of control method of the foot drop walking assisting instrument based on angular velocity signal
CN109011142A (en) * 2018-06-19 2018-12-18 重庆邮电大学 A kind of portable electric stimulation instrument based on 1/f wave theory
CN109276806A (en) * 2018-11-09 2019-01-29 福州大学 The wearable constant current output device and control method that stimulus intensity can adjust in real time
CN209378308U (en) * 2018-11-09 2019-09-13 福州大学 The wearable constant current output device that stimulus intensity can adjust in real time
US20190336019A1 (en) * 2018-05-04 2019-11-07 Cadwell Laboratories, Inc. Apparatus and Method for Polyphasic Multi-Output Constant-Current and Constant-Voltage Neurophysiological Stimulation

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107596560A (en) * 2017-10-18 2018-01-19 福州大学 A kind of control method of the foot drop walking assisting instrument based on angular velocity signal
US20190336019A1 (en) * 2018-05-04 2019-11-07 Cadwell Laboratories, Inc. Apparatus and Method for Polyphasic Multi-Output Constant-Current and Constant-Voltage Neurophysiological Stimulation
CN109011142A (en) * 2018-06-19 2018-12-18 重庆邮电大学 A kind of portable electric stimulation instrument based on 1/f wave theory
CN109276806A (en) * 2018-11-09 2019-01-29 福州大学 The wearable constant current output device and control method that stimulus intensity can adjust in real time
CN209378308U (en) * 2018-11-09 2019-09-13 福州大学 The wearable constant current output device that stimulus intensity can adjust in real time

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
丁建华等: "可实时调整刺激参数的功能性电刺激仪的研制", 福州大学学报(自然科学版), vol. 47, no. 6, pages 759 - 764 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114652961A (en) * 2022-04-01 2022-06-24 山东海天智能工程有限公司 Adjustable electrical stimulation walking aid instrument
CN115227971A (en) * 2022-07-28 2022-10-25 喻鹏铭 Autonomic nerve electric stimulator
CN115227971B (en) * 2022-07-28 2023-11-24 喻鹏铭 Autonomic nerve electric stimulator
CN117205442A (en) * 2023-09-18 2023-12-12 易集康健康科技(杭州)有限公司 Control method and system of radio frequency pulse transmitting module
CN117205442B (en) * 2023-09-18 2024-04-23 易集康健康科技(杭州)有限公司 Control method and system of radio frequency pulse transmitting module

Also Published As

Publication number Publication date
CN113332597B (en) 2023-08-15

Similar Documents

Publication Publication Date Title
CN113332597B (en) Functional electric stimulation instrument capable of adaptively adjusting output intensity and control method thereof
CN215309710U (en) Functional electrical stimulation instrument capable of adaptively adjusting output intensity
CN102119877B (en) Method for creating expert knowledge base for automatically training lower artificial limbs
CN109276806B (en) Wearable constant-current output device with real-time adjustable stimulation intensity and control method
CN108392302A (en) A kind of ankle foot distortion rectification device and its control method
US20140128939A1 (en) Functional electrical stimulation (fes) method and system to improve walking and other locomotion functions
CN209378308U (en) The wearable constant current output device that stimulus intensity can adjust in real time
WO2021047100A1 (en) Adaptive electrical stimulation training system
US20150127119A1 (en) Impedance Parameter Power Control for Lower Limb Assistive Device
JP2023504364A (en) Method and apparatus for providing resistance to users of wearable devices
Selinger et al. Myoelectric control for adaptable biomechanical energy harvesting
KR20210069557A (en) Method and apparatus for providing resistance to a user of a wearable device
Chen et al. Promise of using surface EMG signals to volitionally control ankle joint position for powered transtibial prostheses
WO2021185371A1 (en) Implantable diaphragm pacemaker
CN111544769A (en) Low-power consumption neuromuscular stimulator
CN108309308B (en) A kind of apparatus and system for teaching cardiovascular disease athletic rehabilitation
CN209574702U (en) A kind of lower limb exoskeleton formula gait analysis system
CN106621041A (en) Configuration system for electronic prescription of vagus nerve stimulator
CN115779266A (en) Rehabilitation treatment evaluation system combining functional electrical stimulation device with CPM (continuous phase modulation) rehabilitation device
CN213552679U (en) Ankle orthosis with functional electrical stimulation device
CN110946683B (en) Electric stimulation driving method and system for artificial finger tip pressure and joint angle feedback
CN106492347A (en) A kind of vagus nerve stimulator electronic prescription configuration system of quickly-chargeable
CN114618082A (en) Apparatus for electrical stimulation and electric field therapy and circuit thereof
CN106730337A (en) A kind of vagus nerve stimulator electronic prescription configuration system of quickly-chargeable
CN209187918U (en) A kind of plug-and-play feature electro photoluminescence is electrically excited device system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant