CN111111008A - Multi-channel electrical stimulation device and waveform output method thereof - Google Patents
Multi-channel electrical stimulation device and waveform output method thereof Download PDFInfo
- Publication number
- CN111111008A CN111111008A CN202010069674.2A CN202010069674A CN111111008A CN 111111008 A CN111111008 A CN 111111008A CN 202010069674 A CN202010069674 A CN 202010069674A CN 111111008 A CN111111008 A CN 111111008A
- Authority
- CN
- China
- Prior art keywords
- circuit
- pin
- output
- operational amplifier
- current source
- 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.)
- Pending
Links
Images
Classifications
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61N—ELECTROTHERAPY; MAGNETOTHERAPY; RADIATION THERAPY; ULTRASOUND THERAPY
- A61N1/00—Electrotherapy; Circuits therefor
- A61N1/18—Applying electric currents by contact electrodes
- A61N1/32—Applying electric currents by contact electrodes alternating or intermittent currents
- A61N1/36—Applying electric currents by contact electrodes alternating or intermittent currents for stimulation
- A61N1/36014—External stimulators, e.g. with patch electrodes
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61N—ELECTROTHERAPY; MAGNETOTHERAPY; RADIATION THERAPY; ULTRASOUND THERAPY
- A61N1/00—Electrotherapy; Circuits therefor
- A61N1/02—Details
- A61N1/025—Digital circuitry features of electrotherapy devices, e.g. memory, clocks, processors
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61N—ELECTROTHERAPY; MAGNETOTHERAPY; RADIATION THERAPY; ULTRASOUND THERAPY
- A61N1/00—Electrotherapy; Circuits therefor
- A61N1/18—Applying electric currents by contact electrodes
- A61N1/32—Applying electric currents by contact electrodes alternating or intermittent currents
- A61N1/36—Applying electric currents by contact electrodes alternating or intermittent currents for stimulation
- A61N1/36014—External stimulators, e.g. with patch electrodes
- A61N1/3603—Control systems
- A61N1/36034—Control systems specified by the stimulation parameters
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03K—PULSE TECHNIQUE
- H03K5/00—Manipulating of pulses not covered by one of the other main groups of this subclass
- H03K5/15—Arrangements in which pulses are delivered at different times at several outputs, i.e. pulse distributors
- H03K5/15013—Arrangements in which pulses are delivered at different times at several outputs, i.e. pulse distributors with more than two outputs
Landscapes
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Engineering & Computer Science (AREA)
- Biomedical Technology (AREA)
- Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
- Radiology & Medical Imaging (AREA)
- Animal Behavior & Ethology (AREA)
- Public Health (AREA)
- Veterinary Medicine (AREA)
- Heart & Thoracic Surgery (AREA)
- Biophysics (AREA)
- Physics & Mathematics (AREA)
- Nonlinear Science (AREA)
- Electrotherapy Devices (AREA)
Abstract
The invention discloses a multi-channel electrical stimulation device and a waveform output method thereof, wherein the device comprises: the power supply comprises a power supply signal interface, a power supply isolation circuit, a signal isolation circuit, a microprocessor, a boost circuit, a DAC output circuit, a constant current source circuit, a polarity switching circuit and an electrical stimulation output interface, wherein the power supply signal interface is respectively connected with the power supply isolation circuit and the signal isolation circuit, and the microprocessor is respectively connected with the signal isolation circuit, the boost circuit and the DAC output circuit; the constant current source circuit comprises a forward constant current source circuit and a reverse constant current source circuit, the forward constant current source circuit and the reverse constant current source circuit are respectively connected with the booster circuit, the DAC output circuit and the polarity switching circuit, and the polarity switching circuit is connected with the electrical stimulation output interface. In the process of switching different types of electrical stimulation waveforms, a user does not need to switch an electrical stimulation output interface, and the use is convenient.
Description
Technical Field
The invention relates to the technical field of medical equipment, in particular to a multi-channel electrical stimulation device and a waveform output method thereof.
Background
Electrotherapy is a method for treating diseases using various types of electric current and electromagnetic fields, and is one of the most commonly used methods among physical therapy methods. Mainly comprises direct current electrotherapy, direct current drug iontophoresis, low frequency pulse electrotherapy, medium frequency pulse electrotherapy, high frequency electrotherapy, and electrostatic therapy. Different types of current have different main physiological effects on the human body. Direct current is current with constant direction, can change ion distribution in vivo and adjust organism function, and is commonly used for introducing medicine ions; the low and medium frequency current stimulates the contraction of neuromuscular, reduces pain threshold, relieves adhesion, and is commonly used for neuromuscular diseases, such as injury, inflammation and the like; the high-power high-frequency electricity can promote circulation, eliminate inflammation and edema, stimulate tissue regeneration and relieve pain by the heat effect and the heat external effect of the high-frequency electricity on the human body, is commonly used for treating injury and inflammatory pain syndromes, and can be used for heating and treating cancer; the static electricity mainly acts to regulate central nervous and vegetative functions, and is commonly used for neurosis, hypertension in early stage, and climacteric syndrome.
D, direct current therapy: the direct current direction is constant, and the intensity does not change along with time. The DC voltage for physiotherapy is generally 50-80V, and the current intensity is 0.05-0.1 mA/cm 2. When direct current acts on human body, electrolyte in body fluid is electrolyzed to generate positive and negative ions, and the positive and negative ions move towards the electrodes with opposite polarities. The physicochemical changes of the tissues under the positive and negative poles of the direct current have the functions of regulating the excitability of nerves, improving the local edema or dehydration phenomenon and promoting the blood circulation and the metabolic function. And can improve the activity function of internal organs through segmental reflection. Clinically, direct current is often used for easing pain, relieving itching, softening scars, reducing swelling, promoting tissue regeneration, improving central and peripheral nerve functions and the like.
Low-frequency pulse electrotherapy: low frequency pulse current with frequency below 1kHz is adopted. The current can cause the ions and charged particles to move rapidly in the human body, thereby having obvious stimulation effect on sensory nerves and motor nerves. The low-frequency pulse current can be divided into square waves, trapezoidal waves, exponential curve waves, triangular waves, sine waves and the like due to different waveforms. The pulse period, pulse width and rising and falling wave time can be adjusted according to the clinical treatment requirement. The low-frequency pulse is sometimes modulated with a pulse wave of a lower frequency, which is called a low-frequency modulated wave.
Intermediate frequency electrotherapy: the method adopts intermediate-frequency sinusoidal current with the frequency of 1-100 kHz. The frequency is 2-5 kHz, and three common methods are constant-amplitude medium-frequency sinusoidal electrotherapy, amplitude-modulation medium-frequency sinusoidal electrotherapy and interference electrotherapy. The frequency of the modulation wave is 10-200 Hz, full wave or half wave, continuous modulation or discontinuous modulation can be adopted, and constant amplitude wave and modulation wave can be alternatively generated or the frequency of the modulation wave is alternative. The modulated medium-frequency current has the characteristics of low and medium-frequency currents, is used for relieving pain or promoting blood circulation, and has obvious effect when the low and medium-frequency currents are applied independently; when used for neuromuscular stimulation, patients can tolerate larger electric quantity due to small skin prick. The interference electricity is input to the same part of a human body in a crossed manner by utilizing two groups of constant-amplitude medium-frequency sinusoidal currents (5 +/-0.1 kHz is clinically used mostly) with the frequency difference of 0-100 Hz. An interference electric field is formed at the intersection part, and a low-frequency modulation intermediate-frequency current of 0-100 Hz is generated in the body according to the beat principle of sine electric waves. Clinically, 3 groups of constant-amplitude intermediate-frequency sinusoidal currents are input into a human body from a three-dimensional space in a crossed manner to form a three-dimensional interference electric field, and the effect of the three-dimensional interference electric field is superior to that of a common interference electric field. After improvement, 3 groups of sine currents with alternating intensity are adopted, so that the local stimulation effect is easier to be endured by patients, and the treatment effect is further improved.
However, a special circuit is required for a specific electrical stimulation waveform in the conventional electrical stimulation scheme, and the special circuit cannot be highly compatible, so that equipment requiring simultaneous treatment of multiple electrical stimulation waveforms of multiple channels needs to be connected to different electrical stimulation generation modules, when the multiple channels work simultaneously, the interfaces are complex, and application parts of electrical stimulation output can only be mutually independent and cannot be shared, so that the volume of the equipment cannot be reduced, and because the special circuit comprises multiple electrical stimulation output application parts, the application parts need to be replaced when one waveform is switched, and the user experience is greatly reduced.
Therefore, the present inventors have earnestly demanded to conceive a new technology to improve the problems thereof.
Disclosure of Invention
The invention provides a multichannel electrical stimulation device and a waveform output method thereof, which can provide hardware and software support for solving the technical problems.
The technical scheme of the invention is as follows:
a multi-channel electrical stimulation apparatus comprising: the power supply comprises a power supply signal interface, a power supply isolation circuit, a signal isolation circuit, a microprocessor, a boost circuit, a DAC output circuit, a constant current source circuit, a polarity switching circuit and an electrical stimulation output interface, wherein the power supply signal interface is respectively connected with the power supply isolation circuit and the signal isolation circuit, and the microprocessor is respectively connected with the signal isolation circuit, the boost circuit and the DAC output circuit; the constant current source circuit comprises a forward constant current source circuit and a reverse constant current source circuit, the forward constant current source circuit and the reverse constant current source circuit are respectively connected with the booster circuit, the DAC output circuit and the polarity switching circuit, and the polarity switching circuit is connected with the electrical stimulation output interface.
Preferably, the forward constant current source circuit includes, but is not limited to, an operational amplifier U2B, an operational amplifier U2C, an operational amplifier U3D, a diode D12, a resistor R42, a resistor R49, and a resistor R44, wherein the DAC output circuit is connected to the fifth pin of the operational amplifier U2B through a resistor R42, the fifth pin of the operational amplifier U2B is connected to the eighth pin of the operational amplifier U2C through a resistor R49, and the tenth pin of the operational amplifier U2C is connected to the polarity switching circuit through a diode D12; the seventh pin of the operational amplifier U2B is connected to the twelfth pin of the operational amplifier U3D, and the thirteenth pin and the fourteenth pin of the operational amplifier U3D are connected to the microprocessor through a resistor R44.
Preferably, the reverse constant current source circuit includes, but is not limited to, a high voltage operational amplifier U5B, an NMOS transistor Q4, a high voltage operational amplifier U5C, a resistor R45, and a resistor R48, wherein a seventh pin of the high voltage operational amplifier U5B is connected to a first pin of the NMOS transistor Q4 through a resistor R45, a third pin of the NMOS transistor Q4 is connected to the polarity switching circuit and a tenth pin of the high voltage operational amplifier U5C, and an eighth pin and a ninth pin of the high voltage operational amplifier U5C are connected to the microprocessor through a resistor R48.
Preferably, the device further comprises a hardware emergency stop button connected with the polarity switching circuit.
Preferably, the polarity switching circuit comprises an analog switch U6, an analog switch U8 and a pull-up resistor R7, wherein the positive terminal of the diode D12 in the forward constant current source circuit is connected with the fifth pin of the analog switch U8; the third pin of an NMOS tube Q4 in the reverse constant current source circuit is connected with the seventh pin of the analog switch U8; the fourteenth pin of the analog switch U6 and the fourteenth pin of the analog switch U8 are connected to the hardware emergency stop button, the microprocessor and the pull-up resistor R7.
Preferably, the power supply further comprises a voltage stabilizing circuit, wherein the voltage stabilizing circuit is connected with the power supply isolation circuit and the microprocessor.
A waveform output method based on the multi-channel electrical stimulation device comprises the following steps:
s1: initializing functions;
s2: receiving and analyzing protocol information to obtain characteristic information such as waveform, frequency, amplitude and the like corresponding to each channel;
s3: judging whether an emergency stop button is pressed, if so, stopping all output by hardware, stopping parameter output by software and reporting to an upper computer, and if not, entering the step S4;
s4: outputting corresponding waveforms according to the set number, channel numbers and polling;
s5: calculating the output value and polarity output of the DAC;
s6: calculating the load impedance value of each channel according to the data collected by the ADC, thereby obtaining the current load state;
s7: and reporting the current load state of the upper computer, including whether the work is abnormal or not, the load impedance, whether the lead falls off or not and whether the lead short circuit exists or not.
Preferably, the step S2 specifically includes:
s21: carrying out time-sharing processing by using a timer, carrying out 5ms polling once by using a serial port, and detecting whether protocol information exists or not;
s22: after protocol information exists, the protocol information is put into a serial port receiving two-dimensional buffer area, and the buffer area is used for storing the protocol information to prevent the protocol coverage;
s23: and analyzing after the protocol is received, and acquiring characteristic information such as waveform, frequency, amplitude and the like corresponding to each channel.
Preferably, the step S22 specifically includes:
s221: judging whether the write pointer and the read pointer are equal, if so, entering step S222, otherwise, entering step S224;
s222: judging whether a protocol is received, if so, entering the step S223, otherwise, returning to the step S21;
s223: receiving a protocol, and entering a two-dimensional write pointer into 1;
s224: one protocol is handled, the two-dimensional read pointer goes to 1.
Preferably, the step S6 specifically includes:
s61: judging whether a loop is formed, if not, waiting for the loop to be established, and if so, entering the step S62;
s62: collecting ADC data;
s63: judging whether the collection number is more than 10 times, if not, continuing to collect, and if so, entering the step S64;
s64: filtering the acquired ADC data;
s65: and calculating the load impedance value of each channel so as to obtain the current load state.
By adopting the technical scheme, the invention at least comprises the following beneficial effects:
the multichannel electrical stimulation device and the waveform output method thereof can measure and calculate the load impedance in real time and obtain the lead falling or lead disconnection state; when a plurality of electrical stimulation output waveforms are output, positive and negative pulse output can be carried out only through N +1 interfaces, and N is the number of channels required actually. The multi-channel parameters are independently adjustable, different forms, frequencies, duty ratios, amplitudes and the like can be output, and a user does not need to replace an electrical stimulation output interface in the switching process of different types of electrical stimulation waveforms; the device is additionally provided with a hardware emergency stop button, the electric stimulation is directly interrupted by hardware without being identified by an internal microprocessor, and the device is used for interrupting the electric stimulation output at the highest speed in an emergency situation and improving the safety of a user in the using process.
Drawings
FIG. 1 is a schematic structural diagram of a multi-channel electrostimulation device and a waveform output method thereof according to the present invention;
FIG. 2 is a circuit diagram of a power signal interface;
FIG. 3 is a circuit diagram of a power isolation circuit;
FIG. 4 is a circuit diagram of a signal isolation circuit;
FIG. 5 is a circuit diagram of a voltage regulator circuit;
FIG. 6 is a circuit diagram of a microprocessor;
FIG. 7 is a circuit diagram of a boost circuit;
FIG. 8 is a circuit diagram of a DAC output circuit;
FIG. 9a is a circuit diagram of a forward constant current source circuit;
FIG. 9b is a circuit diagram of a reverse constant current source circuit;
FIG. 10 is a circuit diagram of a polarity switching circuit;
FIG. 11 is a circuit diagram of an electrical stimulation output circuit;
FIG. 12 is a flow chart of a waveform output method of the multi-channel electrostimulation device according to the invention;
fig. 13 is a flowchart of the processing mechanism of step S22;
fig. 14 is a flowchart of the processing of step S6;
FIG. 15a is a waveform diagram of the DAC output with a pulse wave having an output amplitude of 1V, a frequency of 5Hz, and a duty cycle of 50%;
FIG. 15b is a corresponding waveform diagram for 4 channels of a pulse wave with an output amplitude of 1V, a frequency of 5Hz, and a duty cycle of 50%;
FIG. 16a is a waveform diagram of the DAC output with an output amplitude of 1V;
FIG. 16b is a waveform diagram of 4 channels with an output amplitude of 1V;
FIG. 17a is a waveform diagram of the DAC output with a sine wave output amplitude of 1V and frequency of 10 Hz;
FIG. 17b is a waveform diagram corresponding to 4 channels outputting a sine wave with an amplitude of 1V and a frequency of 10 Hz;
FIG. 18a is a waveform diagram of the DAC output with a triangular wave output amplitude of 1V and frequency of 10 Hz;
FIG. 18b is a diagram of the corresponding waveforms of 4 channels outputting a triangular wave with an amplitude of 1V and a frequency of 10 Hz;
FIG. 19a is a waveform diagram of the DAC output with a trapezoidal wave output amplitude of 1V, frequency of 10Hz, and top duty cycle of 60%;
FIG. 19b is a waveform diagram of 4 channels of a trapezoidal wave with an output amplitude of 1V, a frequency of 10Hz, and a top duty cycle of 60%.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
As shown in fig. 1 to 11, a multi-channel electrical stimulation apparatus according to the present embodiment includes: the power supply comprises a power supply signal interface, a power supply isolation circuit, a signal isolation circuit, a microprocessor, a boost circuit, a DAC output circuit, a constant current source circuit, a polarity switching circuit and an electrical stimulation output interface, wherein the power supply signal interface is respectively connected with the power supply isolation circuit and the signal isolation circuit, and the microprocessor is respectively connected with the power supply isolation circuit, the signal isolation circuit, the boost circuit and the DAC output circuit; the constant current source circuit comprises a forward constant current source circuit and a reverse constant current source circuit, the forward constant current source circuit and the reverse constant current source circuit are respectively connected with the booster circuit, the DAC output circuit and the polarity switching circuit, and the polarity switching circuit is connected with the electrical stimulation output interface.
Preferably, the forward constant current source circuit takes one channel as an example, and includes an operational amplifier U2B, an operational amplifier U2C, an operational amplifier U3D, a diode D12, a resistor R42, a resistor R49, and a resistor R44, wherein the DAC output circuit is connected to the fifth pin of the operational amplifier U2B through a resistor R42, the fifth pin of the operational amplifier U2B is connected to the eighth pin of the operational amplifier U2C through a resistor R49, and the tenth pin of the operational amplifier U2C is connected to the polarity switching circuit through a diode D12; the seventh pin of the operational amplifier U2B is connected to the twelfth pin of the operational amplifier U3D, and the thirteenth pin and the fourteenth pin of the operational amplifier U3D are connected to the microprocessor through a resistor R44. When the number of channels needs to be increased, the circuit components may be correspondingly increased, that is, fig. 9a may be expanded into a plurality of components according to the number of channels, and the connection modes are consistent, which is known by those skilled in the art and will not be described herein.
Preferably, the reverse constant current source circuit takes one of the channels as an example, and includes a high voltage operational amplifier U5B, an NMOS transistor Q4, a high voltage operational amplifier U5C, a resistor R45, and a resistor R48, wherein a seventh pin of the high voltage operational amplifier U5B is connected to a first pin of the NMOS transistor Q4 through a resistor R45, a third pin of the NMOS transistor Q4 is connected to the polarity switching circuit and a tenth pin of the high voltage operational amplifier U5C, and an eighth pin and a ninth pin of the high voltage operational amplifier U5C are connected to the microprocessor through a resistor R48. Similarly, when the number of channels needs to be increased, the circuit components may be correspondingly increased, that is, fig. 9b may be expanded into a plurality of components according to the number of channels, and the connection modes are consistent, and those skilled in the art should know that details are not repeated.
Preferably, the device further comprises a hardware emergency stop button connected with the polarity switching circuit. It is known that in the conventional electrical stimulation scheme, the way of interrupting the electrical stimulation is that a user triggers through a key, and after a microprocessor (microcontroller) software in the device recognizes the key triggering, the process of interrupting the electrical stimulation is started. The device is additionally provided with a hardware emergency stop button, the electric stimulation is directly interrupted by hardware without being identified by an internal microprocessor, and the device is used for interrupting the electric stimulation output at the highest speed in an emergency situation and improving the safety of a user in the using process.
Preferably, the polarity switching circuit comprises an analog switch U6, an analog switch U8 and a pull-up resistor R7, wherein the positive terminal of the diode D12 in the forward constant current source circuit is connected with the fifth pin of the analog switch U8; the third pin of an NMOS tube Q4 in the reverse constant current source circuit is connected with the seventh pin of the analog switch U8; the fourteenth pin of the analog switch U6 and the fourteenth pin of the analog switch U8 are connected to the hardware emergency stop button, the microprocessor and the pull-up resistor R7.
Preferably, the power supply further comprises a voltage stabilizing circuit, wherein the voltage stabilizing circuit is connected with the power supply isolation circuit and the microprocessor.
The present embodiment will be described in detail below with reference to the accompanying drawings.
1. A power supply signal interface:
the interface contains 7 signals:
1.1, J3_1:5V _ Vin,5V input power;
1.2, J3_2: GND _ IN, input ground;
1.3, J3_3:3.3V _ Vin,3.3V input power;
1.4, J3_4: Module _ RX, wherein a Module serial port receives signals;
1.5, J3_5: IO _ IN, module reservation signal receiving IO port;
1.6, J3_6, Module _ TX, Module serial port sending signal;
1.7, J3_7: IO _ OUT, module reservation signaling IO ports.
2. Power isolation circuit
5V _ Vin is a 5V input power supply of the module, the 5V input power supply is converted into an isolated 5V power supply through an H0505S-2WR2 isolation module, and the isolation voltage of H0505S-2WR2 is 4200VAC or 6000VDC, so that the requirement of strengthening insulation of medical appliances is met;
3. signal isolation circuit
The signals on the left side of the diagram are input signals of a module interface, the signals on the right side of the diagram are signals which are connected with an MCU (micro controller) through the ADuM2402BRWZ digital isolation chip, and the isolation voltage of the ADuM2402BRWZ is 5000V rms, so that the requirement of the medical instrument on insulation enhancement is met.
Through 5V power isolation and signal isolation, can realize this module device and other complete isolations of system for the device accords with the requirement that medical instrument strengthens insulating, uses safelyr.
4. Voltage stabilizing circuit
The 5V power supply after power supply isolation is converted into a low-noise 3.3VD power supply through an RT9013-33GB LDO (low dropout regulator) to supply power to circuits such as an MCU (microprogrammed control unit);
5. microprocessor
The Microprocessor (MCU) was selected from STM32F103RCT6 from ST corporation, which was an ARM32-bit Cortex-M3CPU, with a speed of 72MHz, a program memory capacity of 256KB, a program memory type of FLASH, and a RAM capacity of 48K.
6. Voltage booster circuit
The 5V power supply is boosted to 30V by the TPS61170DRVR piece of the boosting DCDC chip, and the boosted DCDC chip is used by a subsequent constant current source circuit. The power input of the boost DCDC is controlled by a PMOOS tube AO3407A, and the MCU controls the power supply of the boost chip by controlling the level of the pin 30V _ EN, so that the purpose of controlling the output of the 30V power supply is achieved, and when the module is idle and does not work, the 30V power supply can be closed to achieve the purpose of low power consumption. The control relationship between the output of the 30V power supply and the 30V _ EN is as follows:
30V _ EN level | Whether the 30V power supply outputs |
Logic high | Has an output of 30V |
Logic low | Close 30V output |
In addition, the TPS61170DRVR may be used to control the magnitude of the output voltage by configuring its pin 5 "CTRL" in software to configure the degree of boosting, which is useful in some cases when it is necessary to limit the magnitude of the maximum output voltage. The specific control mode is as follows: the MCU controls a pin corresponding to '30V _ CTRL' to output a PWM waveform of 10KHz, the forward Duty ratio of the PWM waveform is Duty, and then the output voltage value is as follows: VOUT is DUTY 30V, for example, 15V needs to be output, PWM of "30V _ CTRL" pin is 10KHz with 50% DUTY cycle, and PWM of "30V _ CTRL" pin is 10KHz with 100% DUTY cycle if 30V needs to be output.
7. DAC output circuit
Because the MCU only has two paths of DAC outputs, the DAC outputs need to be expanded under multiple channels, MCP4728-E/UN of microchip company is adopted, the chip adopts I2C for communication, IO ports required by communication are reduced, MCU hardware resources are saved, 4 paths of 12-bit DACs can be output by a single chip, two reference voltage modes, namely, internal 2.048V voltage and external expansion voltage, the maximum communication frequency can reach 3.4Mbps, and the typical value of the setting time of a single DAC is 6 us. The chip pins are annotated as follows:
7.1, U7_ 1: VDD, power input
7.2, U7_ 2: SCL, I2C clock pin
7.3, U7_ 3: SDA, I2C data pin
7.4、U7_4:In order to enable the pin, two modes exist, when the pin level is changed from high to low, the written data is directly updated to the register to be used as output, and when the pin is always pulled low, the written data is directly updated in real time to be used as output.
7.5、U7_5:RDY/The pin is used for detecting whether the chip is in a data writing state, and is in a low level when the chip is in a busy state, and is in a high level when the chip is in a waiting state.
7.6, U7_ 6: VOUTA, channel A output pin
7.7, U7_ 7: VOUTB, channel B output pin
7.8, U7_ 8: VOUTB, channel C output pin
7.9, U7_ 9: VOUTB, channel D output pin
7.10, U7_ 10: VSS, ground pin
8. Forward constant current source circuit
In this embodiment, 4 channels are taken as an example, so the forward constant current source is composed of 4 channels, and the circuit takes one of the channels as an example, and the forward constant current source is composed of a high-voltage operational amplifier TP2264-SR, wherein: DAC _ A4+ is DAC chip output voltage, different waveforms, frequency, duty ratio, amplitude and the like are output through DAC, any waveform can be generated, the constant current source circuit is directly controlled by the any waveform, the output of any waveform is generated by matching with a subsequent circuit, A4+ is positive constant current source output and is connected with a load through a polarity switching circuit, a triode D12 is used for preventing load current from reversely pouring into an operational amplifier, and therefore the circuit is affected, ADC _ A4+ is a lead falling ADC detection pin, the current flowing through a 12 pin of U3D can be ignored due to the fact that the impedance of the input end of the operational amplifier is extremely large, the current can be considered to be broken in calculation, and therefore the function of the main circuit of the constant current source is not affected by the bias circuit formed by U3D.
The working principle of the forward constant current source is as follows:
MCP4728-E/UN controls the voltage at DAC _ A4+ to be UDAC_A4+The voltage of the 5-pin of the U2B operational amplifier is UU2B+The voltage of the 6 pins of the U2B operational amplifier is UU2B-The voltage of the pin 7 of the U2B operational amplifier is UU2B_OUTThe voltage of the 10 pin of the U2C operational amplifier is UU2C+The voltage of the pin 9 of the U2C operational amplifier is UU2C-The voltage of the 8-pin of the U2C operational amplifier is UU2C_OUTAssume A4+ is loaded with RL。
According to the superposition principle of operational amplifier, U2B operational amplifier 5-pin voltage
UU2B+=(UU2C_OUT*R42+UDAC_A4R49)/(R42+ R49), in turn UU2C_OUT=UU2C-According to the principle of operational amplifier virtual short virtual break UU2C-=UU2C+According to the principle of partial pressure, UU2C+=(UU2B_OUT*RL)/(R46+RL) From this, it is possible to obtain:
the formula I is as follows: u shapeU2B+={[(UU2B_OUT*RL)/(R46+RL)]*R42+UDAC_A4+*R49}/(R42+R49)
According to the voltage division principle, the U2B operational amplifier 6-pin voltage UU2B-=(UU2B_OUTR41)/(R40+ R41), from which we can derive:
the formula II is as follows: u shapeU2B-=(UU2B_OUT*R41)/(R40+R41)
According to the principle of operational amplifier virtual short virtual break, UU2B+=UU2B-And according to the first formula and the second formula, bringing the circuit data in the graph into availability:
the formula III is as follows: u shapeU2B_OUT=UDAC_A4+*(R46+RL)/R46
Then the current I at the load endL=UU2B_OUT/(R46+RA4+) I.e. IL=UDAC_A4+R46, R46 is constant resistance, and therefore, it finally flows through load RLCurrent value of only with UDAC_A4+In relation to this, the current will not change with the change of the load, so as to achieve the purpose of constant current.
In the figure, U3D is a voltage follower formed by an operational amplifier, and as a bias circuit at a4+, because the input impedance of the input end of the operational amplifier is very large, the current flowing into the pin 12 of U3D can be ignored, so the bias circuit at this position does not affect the constant current source circuit. R can be reversely deduced according to a formula IIILAnd UU2B_OUTIn relation to (1), i.e.
The formula four is as follows: rL=[(UU2B_OUT*R46)/UDAC_A4+]-R46
In the formula IV, UDAC_A4+The control voltage controlled by MCP4728-E/UN is a known value, so that U is required at this timeU2B_OUTAccording to the principle of virtual short and virtual break of operational amplifier, UU2B_OUT=UU3D+=UU3D-=UU3D_OUTAnd according to the principle of voltage division, U can be obtainedU3D_OUTThe voltage values are:
the formula five is as follows: u shapeU2B_OUT=UU3D_OUT=[UADC_A4+*(R50+R44)]/R50
UADC_A4+Can be used for dredgingThe value of the ADC is detected by the MCU and is obtained by calculation, so that UADC_A4+Also known values, are obtained from formula four and formula five:
formula six: rL={[R46*UADC_A4+*(R50+R44)]/(R50*UDAC_A4+)}-R46
In the sixth formula, R46, R50, R44 and UADC_A4+、UDAC_A4+Are all known values, so the load value RLAnd can be calculated. By RLThe value can also be used to determine whether the lead is disconnected or shorted at the load electrode, so as to take further protection measures.
9. Reverse constant current source circuit
In this embodiment, 4 channels are taken as an example, so the reverse constant current source is composed of 4 channels, and in this circuit, one of the channels is taken as an example, and a reverse constant current source circuit is composed of the high-voltage operational amplifier TP2262-SR and the NMOS transistor NCE0103Y, where: DAC _ A4-is the output voltage of DAC chip, through DAC output different wave form, frequency, duty cycle, amplitude etc. can produce arbitrary waveform, and this arbitrary waveform has directly controlled constant current source circuit, cooperates with follow-up circuit to produce the output of arbitrary waveform. A4-is the reverse constant current source output, and is connected with the load through the polarity switching circuit. ADC _ A4-is an ADC detection circuit, and because the impedance of the input end of the operational amplifier is extremely large, the current flowing through the 10 pins of U5C can be ignored, and can be regarded as an open circuit during calculation, so that the function of the main circuit of the constant current source is not influenced by the bias circuit formed by U5C.
The working principle of the reverse constant current source is as follows:
MCP4728-E/UN controls the voltage at DAC _ A4-to be UDAC_A4-The voltage of the 5-pin of the operational amplifier U5B is UU5B+The voltage of the 6 pin of the operational amplifier U5B is UU5B-R52 resistance voltage is UR52。
According to the principle of virtual short and virtual disconnection of operational amplifier, the following results are obtained:
the formula I is as follows: u shapeDAC_A4-=UU5B+=UU5B-=UR52
The current flowing through R52 is therefore:
the formula II is as follows: i isR52=UR52/R52=UDAC_A4-/R52
Current I flowing through pin 2,3 of Q4Q4=IR52A4-is connected to the load via a polarity switching circuit, so that the current I flowing through the loadL=IQ4=IR52=UR52/R52=UDAC_A4-/R52, so that the current flowing through the load is only equal to the driving voltage UDAC_A4-And the control resistor R52 is connected, the current can not change along with the change of the load, thereby achieving the purpose of constant current.
In the figure, U5C is a voltage follower formed by an operational amplifier, as a bias circuit at a4-, since the input impedance of the input end of the operational amplifier is very large, the current flowing into the pin 10 of U5C can be ignored, so that the bias circuit at this position does not affect the constant current source circuit. According to the voltage division principle, the output voltage of the bias circuit is as follows:
the formula III is as follows: u shapeADC_A4-=[R51/(R48+R51)]*UQ4
UQ4Pin 3 of Q4 is at ground voltage. U shapeADC_A4-The ADC pin of the MCU is accessed, and U can be obtained through the ADC calculation software of the MCUADC_A4-Specific numerical values, so for MCU UADC_A4-Is known, so U is calculated in reverseQ4Comprises the following steps:
the formula four is as follows: u shapeQ4=UADC_A4-*(R4+R5)/R5
The load impedance can be directly calculated through the numerical value, and the specific calculation is as follows:
the formula five is as follows: rL=(U30V-UQ4)/IL=[U30V-UADC_A4-*(R51+R48)/R51]/(UDAC_A4-/R52)
In the formula of U30V30V for the booster circuit is constant 30V, UADC_A4-Is calculated by ADC of MCU, UDAC_A4-DAC voltage output for MCU control, therefore, load impedance RLCan be easily obtained by calculation. By RLThe value can also be used to determine whether the lead is disconnected or shorted at the load electrode, so as to take further protection measures.
10. Polarity switching circuit
ADG5433BRUZ-REEL7 is a 3-channel SPDT (single pole double throw) analog switch manufactured by ADI. The truth table for each switch channel of ADG5433BRUZ-REEL7 is as follows:
when SxA is on, SxA and Dx are directly conducted, when SxB is on, SxB and Dx are directly conducted, otherwise, the two are cut off, thereby forming a switch circuit.
In the schematic diagram, ELEC _ SW _ C, ELEC _ SW _ a1, ELEC _ SW _ a2, ELEC _ SW _ A3 and ELEC _ SW _ a4 are switching signals controlled by the MCU, and 30V, GND, a1+, a2+, A3+, a4+, a1-, a2-, A3-and a 4-are corresponding interfaces of a constant current source, and are respectively connected to corresponding SxA and SxB, and ELEC _ C, ELEC _ a1, ELEC _ a2, ELEC _ A3 and ELEC _ a4 respectively correspond to 5 output channels and are connected to corresponding Dx channels to form a logic output of 4 negative 1 positive or 4 positive 1 negative.
ELEC_SW_For the signal of the emergency stop button, ELEC _ SW \is normally operatedThe analog switch channel of ADG5433BRUZ-REEL7 works normally by grounding the emergency stop button, and ELEC _ SW \ u is pressed by the userSetting a high level through a pull-up resistor R7, wherein all channels of an analog switch of the ADG5433BRUZ-REEL7 are closed at the moment, so that the ELEC _ A1, the ELEC _ A2, the ELEC _ A3, the ELEC _ A4 and the ELEC _ C have no output, thereby interrupting the electrical stimulation output at the fastest speed, improving the safety of a user in the using process and achieving the purpose of tightly stopping a button by hardware; in addition, the MCU also checks ELEC _ SW _Is detected, and when the device is in normal operation, the ELEC _ SW _The level is low, ELEC _ SW _, when the user presses the stop buttonThe level goes high, recognizing that the user pressed the emergency stop button, the software can turn off the 30V power supply and report to the host for action through the communication protocol.
The polarity control logic of the polarity switching circuit is as follows:
wherein when ELEC _ SW \uWhen high, it indicates that the emergency stop button is pressed, regardless of the level of ELEC _ SW _ C, ELEC _ SW _ A1, ELEC _ SW _ A2, ELEC _ SW _ A3, and ELEC _ SW _ A4, and regardless of how ELEC _ A1, ELEC _ A2, ELEC _ A3, ELEC _ A4, and ELEC _ C are connected to the load, the load is disconnected from the control circuit.
11. Electrical stimulation output circuit
The circuit is used for connecting with an external interface, and comprises 8 signals:
11.1, J1_ 1: electrically stimulating an output port of the ELEC _ A1, wherein the port is connected with the ESD tube in parallel in a grounding mode, and the ESD interference caused by hot plugging at the port is prevented; the magnetic beads are connected in series to filter out high-frequency signal interference;
11.2, J1_ 2: electrically stimulating an output port of the ELEC _ A2, wherein the port is connected with the ESD tube in parallel in a grounding mode, and the ESD interference caused by hot plugging at the port is prevented; the magnetic beads are connected in series to filter out high-frequency signal interference;
11.3, J1_ 3: electrically stimulating an output port of the ELEC _ A3, wherein the port is connected with the ESD tube in parallel in a grounding mode, and the ESD interference caused by hot plugging at the port is prevented; the magnetic beads are connected in series to filter out high-frequency signal interference;
11.4, J1_ 4: electrically stimulating an output port of the ELEC _ A4, wherein the port is connected with the ESD tube in parallel in a grounding mode, and the ESD interference caused by hot plugging at the port is prevented; the magnetic beads are connected in series to filter out high-frequency signal interference;
11.5, J1_ 5: electrically stimulating an ELEC _ C output port, wherein the port is grounded and connected with an ESD pipe in parallel, and the ESD interference caused by hot plug at the port is prevented; the magnetic beads are connected in series to filter out high-frequency signal interference;
11.6、J1_6:ELEC_SW_signal of emergency stop button, ELEC _ SW \in normal operationThe emergency stop button is grounded with the J3_4, and the ports are grounded and connected with an ESD pipe in parallel, so that the hot plug ESD interference at the ports is prevented; the magnetic beads are connected in series to filter out high-frequency signal interference;
11.7, J1_ 7: the signal ground is connected with the magnetic beads in series to filter high-frequency signal interference;
11.8, J1_ 8: and the signal ground is connected with a shielding wire of the cable.
12. Parameter range
12.1 maximum output frequency
Since the DAC write-once time of MCP4728-E/UN is about 6us, i.e. the maximum output frequency of DAC is 166KHz, the frequency of operational amplifier and MOS transistor is much greater than 166KHz, therefore: if outputting the unidirectional waveform, the maximum output frequency is 166 KHz; if positive and negative bidirectional waveforms are output, the maximum output frequency is 83 KHz.
12.2 maximum output Voltage
The maximum output voltage of the booster circuit is 30V, so that the maximum voltage of two ends of the load is 30V; maximum voltage U across the loadL=IL*RLAccording to the type of the connected constant current source circuit, the voltage U at two ends of the load can be directly calculatedL。
12.3 load capacity at maximum current
U is formed because the maximum output voltage of the MCP4728-E/UN depends on the reference voltage set by the register, the maximum internal reference is 2.048V, and the maximum external power supply reference is 3.3VDACMAX=3.3V。
In a forward constant current source, according to the formula RL=[(UU2B_OUT*R46)/UDAC_A4+]R46, at maximum current, UDAC_A4+Is 3.3V, UU2B_OUTThe maximum value is determined by the input voltage of the operational amplifier, the operational amplifier supplies power for 30V, so that U is obtainedU2B_OUTR is calculated from 30VL MAX=[(30V*1K)/3.3V]-1K=8.09K。
From the above analysis, the load capability will vary for different output currents, i.e., depending on the DAC output of MCP4728-E/UN, as determined by the equation:
RL MAX=[(30V*1K)/UDAC_A4+]-1K
in the reverse constant current source, the constant current source is corresponding to the partial pressure load of all 1K, so the maximum current I of the loadL MAX3.3V/1K 3.3mA, because the internal resistance of the MOS tube is in milliohm level and the maximum current is only 3.3mA, the voltage drop of the MOS tube Q4 under the condition of complete conduction is very small and can be ignored, and the MOS tube under the maximum current is completely conducted under the condition of maximum load, so U is completely conductedQ4=UR52=UDAC_A4-MaxMaximum on-load capacity R at maximum current of 3.3VLMax=(30V-UQ4)/IL MAX(30V-3.3V)/3.3mA ═ 8.09K. Therefore, under the positive constant current source and the reverse constant current source, the maximum load capacity R of the maximum belt under the maximum currentLMax=(30V-UQ4)/IL MAX=(30V-3.3V)/3.3mA=8.09K。
RLMax=(30V-UQ1)/IL MAX=(30V-UDAC_A4-)/(UDAC_A4-/1K)=[(30V*1K)/UDAC_A4-]-1K
From the above analysis, the maximum belt load capacity formulas of the forward constant current source and the reverse constant current source are the same.
The device can measure and calculate load impedance in real time to obtain the lead falling or lead disconnection state; when a plurality of electrical stimulation output waveforms are electrically stimulated, positive and negative pulse output can be carried out only by N +1 interfaces, and N is the number of channels required actually. The multi-channel parameters are independently adjustable, different forms, frequencies, duty ratios, amplitudes and the like can be output, and a user does not need to replace an electrical stimulation output interface in the switching process of different types of electrical stimulation waveforms; the device is additionally provided with a hardware emergency stop button, the electric stimulation is directly interrupted by hardware without being identified by an internal microprocessor, and the device is used for interrupting the electric stimulation output at the highest speed in an emergency situation and improving the safety of a user in the using process.
Example 2
As shown in fig. 12, a waveform output method of the multi-channel electrical stimulation apparatus according to embodiment 1 includes the following steps:
s1: initializing functions;
s2: receiving and analyzing protocol information to obtain characteristic information such as waveform, frequency, amplitude and the like corresponding to each channel;
s3: judging whether an emergency stop button is pressed, if so, stopping all output by hardware, stopping parameter output by software and reporting to an upper computer, and if not, entering the step S4;
s4: outputting corresponding waveforms according to the set number, channel numbers and polling;
s5: calculating the output value and polarity output of the DAC;
s6: calculating the load impedance value of each channel according to the data collected by the ADC, thereby obtaining the current load state;
s7: and reporting the current load state of the upper computer, including whether the work is abnormal or not, the load impedance, whether the lead falls off or not and whether the lead short circuit exists or not.
Preferably, the step S2 specifically includes:
s21: carrying out time-sharing processing by using a timer, carrying out 5ms polling once by using a serial port, and detecting whether protocol information exists or not;
s22: after protocol information exists, the protocol information is put into a serial port receiving two-dimensional buffer area, and the buffer area is used for storing the protocol information to prevent the protocol coverage;
s23: and analyzing after the protocol is received, and acquiring characteristic information such as waveform, frequency, amplitude and the like corresponding to each channel.
Preferably, the step S22 specifically includes:
s221: judging whether the write pointer and the read pointer are equal, if so, entering step S222, otherwise, entering step S224;
s222: judging whether a protocol is received, if so, entering the step S223, otherwise, returning to the step S21;
s223: receiving a protocol, and entering a two-dimensional write pointer into 1;
s224: one protocol is handled, the two-dimensional read pointer goes to 1.
Preferably, the step S6 specifically includes:
s61: judging whether a loop is formed, if not, waiting for the loop to be established, and if so, entering the step S62;
s62: collecting ADC data;
s63: judging whether the collection number is more than 10 times, if not, continuing to collect, and if so, entering the step S64;
s64: filtering the acquired ADC data;
s65: and calculating the load impedance value of each channel so as to obtain the current load state.
The present embodiment will be described in detail below with reference to the accompanying drawings.
13.1 function initialization
After the modules are powered on, the modules are initialized firstly, and the initialization comprises NVIC interrupt vector table initialization, system clock initialization, tick timer initialization, serial port initialization, timer initialization, ADC initialization, power supply initialization, ADG5433 analog switch initialization, MCP4728DAC chip initialization and electrical stimulation parameter initialization.
13.2 time-sharing processing, accepting protocol information
The design software adopts a time-sharing mechanism, utilizes a timer to realize time-sharing processing of each module, a serial port processes polling once in 5ms, detects whether protocol information exists or not, and after the protocol information is processed, the protocol information is placed into a serial port receiving two-dimensional buffer area which is used for storing the protocol information to prevent the protocol coverage, and the processing mechanism of the step S22 is shown in figure 13:
the mechanism is mainly used for occasions with large data volume, and has the advantages that as long as the cache opened by the two-dimensional array is large enough, the protocol processing speed is high enough, the packet loss situation can never occur, and the serial port directly enters the main function processing after the data is received completely, so that the influence on the time sequence due to overlong interrupt processing time is prevented. And after the protocol is received, analyzing to obtain data such as waveform, frequency, amplitude and the like corresponding to each channel.
13.3 judge emergency stop button
Using ADG5433BRUZ-REEL7The pin characteristic, which can realize one level to close all the outputs, namely, the function of the emergency stop, is explained in the circuit description of ADG5433BRUZ-REEL7, when ELEC _ SW _When the level is low, the analog switch is enabled to work, and normal electrical stimulation logic output is carried out at the time, and when the emergency stop button is pressed, namely ELEC _ SW \When the pin outputs high level, all channels of the analog switch are closed, and at the moment, the 30V output is required to be closed on software, so that accidents are avoided, and double protection of hardware and software is achieved.
13.4 waveform output
The waveform output is also carried out in the form of a timer, the clock reference set by the timer is 50us, the 1KHz periodic waveform with the resolution of 200 can be output theoretically, and the relationship between the clock reference and the resolution and the minimum period is as follows:
resolution of clock reference (minimum period of waveform)
If a waveform of higher frequency or greater resolution is to be output, the clock reference needs to be adjusted. If a waveform with a lower frequency is output, software calculation is needed, the frequency of the timer entering the processing is calculated, and the relationship between the processing frequency and the setting period is as follows:
processing frequency setting period/(resolution x clock reference)
And obtaining waveforms with different frequencies according to the processing frequency.
13.5 calculating DAC output values, polarity switching
The amplitude resolution of the waveform is determined by a DAC chip, MCP4728-E/UN is a 4-channel 12-bit DAC chip, the reference voltage bit adopted by the design of the invention is 3.3V, so the theoretical voltage resolution is as follows:
voltage resolution of 3.3V/4096 of 0.000806V
The software can calculate the output voltage through the obtained digital quantity, and if the voltage is 2V, the digital quantity is set as follows:
DAC digital value/voltage resolution (2V 4096)/3.3V 2482
The number value corresponding to 2V is 2482, and the analogy is repeated, so that the corresponding setting is completed. Because the output voltage of the DAC is positive, if positive and negative bidirectional waveforms are to be realized, channel switching on hardware is needed, the channel switching is determined by an analog switch ADG5433BRUZ-REEL7, and the bidirectional pulse waveforms can be realized by performing IO port processing on software according to the explanation of the polarity switching circuit.
13.6 ADC impedance calculation
The ADC adopts the ADC in the chip to acquire signals, and needs to be noted that when the ADC is used for acquiring signals, a loop needs to be in an established state, and data acquired by the loop in an open circuit state is generally infinite impedance and has no practical significance. The ADC acquires the processing once in 10ms, and the processing flow chart of step S6 is shown in fig. 14:
the ADC of STM32F103RCT6 is 12 bits, the reference voltage is 3.3V, and the voltage resolution is:
voltage resolution of 3.3V/4096 of 0.000806V
According to the impedance calculation formula of the positive and negative constant current source circuits, the load R can be obtained in a simplified modeLThe simple formula in the design of the invention is as follows: forward direction:
RL=[{[UADC*(100K+1000K)]/100K}/(UDAC/1K)]-1K=[(UADC*11)/(UDAC/1K)]-1K
reversing: rL=[30V-(UADC*11)]/(UDAC/1K)
The power supply voltage of the constant current source operational amplifier is 30V, so that U is realizedADC11 should not be greater than 30V, when greater than 30V, the constant current source is saturated, the formula is not used, and as can be seen from the above maximum load capacity formula, the impedance calculation formula at saturation voltage is:
RL=[30V/(UDAC/1K)]-1K
according to the impedance calculation formula under the saturation voltage, the maximum impedance R under different currents can be calculatedL MAXSome typical data are listed here:
setting the current IL MAX | Maximum resistance RL MAX |
0.5mA | 59K |
1mA | 29K |
1.5mA | 19K |
2mA | 14K |
2.5mA | 11K |
3mA | 9K |
3.3mA | 8.09K |
When the lead is in a normal working state, if the impedance is detected to be close to a saturated impedance value, the lead can be considered to fall off, and the analysis shows that the lead falls off not to detect the real 'open circuit' of the lead, but the real-time impedance is calculated to ensure that the impedance is too large, the lead falls off, and if the impedance caused by poor contact is too large, the lead falls off.
14. Waveform realization method
The invention designs that the output of the waveform is realized by using DAC, each channel can be independently arranged, the linearity of the output waveform depends on the resolution of the waveform, the resolution is 200 for waveform output, the duty ratio of positive square wave and negative square wave under the resolution of 200 can be adjusted by 1%, and the accuracy is higher.
First, 4 loads of 1K Ω, ELEC _ SW _ A1, ELEC _ A2, ELEC _ A3, ELEC _ A4, and ELEC _ C were incorporated into the respective cellsThe module normally operates by grounding the emergency stop button, and the generation of each waveform is described as follows:
14.1 pulse wave
The pulse is divided into unidirectional pulse and bidirectional pulse, unidirectional pulse does not carry on the polarity switching while DAC outputs, the bidirectional pulse is that the polarity switches over in DAC output interval, take the pulse of the double pulse as the example to explain the implementation principle, enter the function to count according to the processing frequency at first, when the count value is equal to duty ratio set, make the output value 0, switch over the polarity at the same time, when the count value is 100, count again, repeat above, because the resolution designed in this invention is 200, so the unidirectional count value can reach 100, namely can realize the duty ratio 1% precision is adjustable.
The output amplitude is 1V, the frequency is 5Hz, the duty ratio is 50% of the pulse wave, the waveform of the DAC output and the corresponding waveform of 4 channels are shown in FIG. 15a and FIG. 15 b:
14.2 direct Current
The direct current waveform can be regarded as a square wave with 100% duty ratio, the implementation mode is the same as that of a pulse wave, and the current intensity value is output after the direct current waveform enters a waveform processing function according to the processing frequency.
The output amplitude is 1V, the waveform of the DAC output and the waveforms of the 4 channels are shown in fig. 16a and 16 b:
14.3 sine wave
The sine function is directly calculated through a function, the sine function in a math library is directly used for execution, the processing time is too long when the system uses the sin function, and therefore a second mode is adopted, the second mode is a point taking method, 100 characteristic points in the sine function are taken and placed in a sin function array, and when function counting is carried out, points corresponding to the corresponding array are output.
The output amplitude is 1V, the frequency is 10Hz sine wave, the DAC output waveform and 4 channels corresponding waveform as shown in FIG. 17a and FIG. 17 b:
14.4 triangular wave
The triangular wave is calculated by using a linear function, and the linear function formula is as follows:
outputting current count value + B
Wherein the current count value is data between 0 and 100, and every time the processing function is added with 1, the rising edge and the falling edge of the K value are determined by the current output intensity:
rising: K-Strength/50
And (3) descending: K-Strength/50
Due to the symmetry of the triangular wave, the B value is:
rising: b is 0
And (3) descending: intensity 2
During processing, the rising and the falling need to be distinguished, the distinguishing mode is determined by the counting value, when the counting value is 0-50, the counting value is in a rising state, when the counting value is 50-100, the counting value is in a falling state, when the counting value is 100, the counting is cleared, and the polarity is switched.
The output amplitude is 1V, the frequency is 10Hz triangle wave, the DAC output waveform and 4 channels of corresponding waveform as shown in FIG. 18a and FIG. 18 b:
14.5 trapezoidal wave
The trapezoidal wave is calculated by adopting a linear function when rising and falling, a fixed value form is adopted at the top end, the trapezoidal wave designed by the invention can realize that the top end of 10-90% duty ratio can be set, and the output function in the rising and falling processes is as follows:
outputting current count value + B
Wherein the current count value is the data between 0-100, and every time the processing function that enters once adds 1, the rising edge and the falling edge of K value, K value and the top duty cycle of setting for and set for intensity relevant:
rising: k-intensity/[ (100-top duty cycle)/2 ]
And (3) descending: k-intensity/[ (100-top duty cycle)/2 ]
Due to the symmetry of the trapezoidal wave, the B value is:
rising: b is 0
And (3) descending: intensity [ 100/((100-top duty cycle)/2) ]
Wherein (100-top duty ratio)/2, can obtain the count time that rises and falls and will process, need to divide into three sections to process while processing, rise, fall and top, rise, fall adopt from above-obtained linear function can, the top directly outputs the duty ratio value, is specifically decided by the duty ratio presumed.
The output amplitude is 1V, the frequency is 10Hz, the top duty cycle is 60% trapezoidal wave, the DAC output waveform and 4 channels of corresponding waveform as shown in FIG. 19a and FIG. 19 b:
14.6 mixing
The frequency mixing has two modes, one mode is that software inside the MCU calculates a frequency mixing function, the mode is mainly used for frequency mixing of simple waveforms, and the requirement on the calculation processing capacity of the MCU is low; the other method is that the matlab software simulation is adopted to firstly carry out function frequency mixing, then a point is taken to output a corresponding data table, and then the data table is input into the system software to be output. Two mixing schemes are explained here:
14.6.1 mixing mode one
MCU internal function computation, in some simple waveform mixing, can be implemented, such as implementing a mixed waveform of sin (pi x) and cos (pi x) functions, i.e., f (x) ═ sin (pi x) × cos (pi x) ═ 0.5 sin (2 × pi x), which can be directly derived through a simple mathematical formula, and the output time is directly called:
output 0.5 sin (2 pi software count value)
Certainly, the process of formula derivation is directly handed to the MCU for execution, and since the general MCU has limited processing capability, an artificial calculation method is used to reduce the MCU load.
14.6.2 mixing mode two
Under the mixing output of a plurality of function waveforms, because MCU throughput is limited, it is relatively complicated to directly carry out software processing moreover, can carry out function calculation earlier with the help of matlab instrument, output corresponding array, again by MCU defeated handle can, the implementation process is promptly: z (x) G (x) T (x) …, wherein F (x), G (x) and T (x) are functions required to be mixed, Z (x) is a function after mixing, waveform characteristic parameters required to be output are obtained according to the Z (x) function after mixing calculation, and the MCU controls corresponding circuits to generate corresponding output waveforms according to the parameters, so that the purpose of outputting the mixing waveforms is achieved.
For example:
F(x)=sin(pi*x)
G(x)=cos(pi*x)
T(x)=sin(2*pi*x)
P(x)=cos(2*pi*x)
Z(x)=F(x)*G(x)*T(x)*P(x)
oscillograms can be obtained by utilizing matlab simulation
The simulation waveform generated by matlab does not need to be mathematically calculated, the waveform can be observed directly through simulation, a dlmwrite function is called and output to a txt file, and then the generated array is realized by software, whether the output waveform is consistent with the simulation waveform or not can be observed, so that the software realization is simplified, and the operation burden of the MCU is reduced.
The invention can set any channel of the device to generate any waveform through a communication protocol, including the form, frequency, duty ratio, amplitude and the like of the set waveform, and can measure and calculate load impedance in real time to obtain the state of lead falling or lead disconnection, in addition, the output of the electrical stimulation has N +1 interfaces, and can output the waveforms of N channels, if the number of the channels needs to be modified, only 1 interface needs to be added or reduced, and the addition or reduction of one waveform can be realized. Meanwhile, a hardware emergency stop button is added in the device, the electric stimulation is directly interrupted by hardware without being identified by an internal microprocessor, so that the electric stimulation is interrupted at the fastest speed in an emergency, and the safety of a user in the using process is improved.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (10)
1. A multi-channel electrical stimulation apparatus, comprising: the power supply comprises a power supply signal interface, a power supply isolation circuit, a signal isolation circuit, a microprocessor, a boost circuit, a DAC output circuit, a constant current source circuit, a polarity switching circuit and an electrical stimulation output interface, wherein the power supply signal interface is respectively connected with the power supply isolation circuit and the signal isolation circuit, and the microprocessor is respectively connected with the signal isolation circuit, the boost circuit and the DAC output circuit; the constant current source circuit comprises a forward constant current source circuit and a reverse constant current source circuit, the forward constant current source circuit and the reverse constant current source circuit are respectively connected with the booster circuit, the DAC output circuit and the polarity switching circuit, and the polarity switching circuit is connected with the electrical stimulation output interface.
2. The multi-channel electrostimulation device according to claim 1, characterized in that: the forward constant current source circuit comprises but is not limited to an operational amplifier U2B, an operational amplifier U2C, an operational amplifier U3D, a diode D12, a resistor R42, a resistor R49 and a resistor R44, wherein the DAC output circuit is connected with the fifth pin of the operational amplifier U2B through a resistor R42, the fifth pin of the operational amplifier U2B is connected with the eighth pin of the operational amplifier U2C through a resistor R49, and the tenth pin of the operational amplifier U2C is connected with the polarity switching circuit through a diode D12; the seventh pin of the operational amplifier U2B is connected to the twelfth pin of the operational amplifier U3D, and the thirteenth pin and the fourteenth pin of the operational amplifier U3D are connected to the microprocessor through a resistor R44.
3. A multi-channel electro-stimulation device as claimed in claim 1 or 2 wherein: the reverse constant current source circuit comprises but is not limited to a high-voltage operational amplifier U5B, an NMOS tube Q4, a high-voltage operational amplifier U5C, a resistor R45 and a resistor R48, wherein a seventh pin of the high-voltage operational amplifier U5B is connected with a first pin of the NMOS tube Q4 through a resistor R45, a third pin of the NMOS tube Q4 is connected with the polarity switching circuit and a tenth pin of the high-voltage operational amplifier U5C, and an eighth pin and a ninth pin of the high-voltage operational amplifier U5C are connected with the microprocessor through a resistor R48.
4. A multi-channel electro-stimulation device as claimed in any one of claims 1 to 3 wherein: and the hardware emergency stop button is connected with the polarity switching circuit.
5. The multi-channel electrostimulation device according to any of the claims 1 to 4, characterized in that: the polarity switching circuit comprises an analog switch U6, an analog switch U8 and a pull-up resistor R7, wherein the positive terminal of a diode D12 in the forward constant current source circuit is connected with the fifth pin of the analog switch U8; the third pin of an NMOS tube Q4 in the reverse constant current source circuit is connected with the seventh pin of the analog switch U8; the fourteenth pin of the analog switch U6 and the fourteenth pin of the analog switch U8 are connected to the hardware emergency stop button, the microprocessor and the pull-up resistor R7.
6. A multi-channel electro-stimulation device as claimed in any one of claims 1 to 5 wherein: the power isolation circuit is connected with the microprocessor through the voltage stabilizing circuit.
7. A waveform output method based on the multi-channel electrical stimulation device as claimed in any one of claims 1 to 6, characterized by comprising the following steps:
s1: initializing functions;
s2: receiving and analyzing protocol information to obtain characteristic information such as waveform, frequency, amplitude and the like corresponding to each channel;
s3: judging whether an emergency stop button is pressed, if so, stopping all output by hardware, stopping parameter output by software and reporting to an upper computer, and if not, entering the step S4;
s4: outputting corresponding waveforms according to the set number, channel numbers and polling;
s5: calculating the output value and polarity output of the DAC;
s6: calculating the load impedance value of each channel according to the data collected by the ADC, thereby obtaining the current load state;
s7: and reporting the current load state of the upper computer, including whether the work is abnormal or not, the load impedance, whether the lead falls off or not and whether the lead short circuit exists or not.
8. The waveform output method of the multi-channel electrical stimulation apparatus as claimed in claim 7, wherein the step S2 specifically includes:
s21: carrying out time-sharing processing by using a timer, carrying out 5ms polling once by using a serial port, and detecting whether protocol information exists or not;
s22: after protocol information exists, the protocol information is put into a serial port receiving two-dimensional buffer area, and the buffer area is used for storing the protocol information to prevent the protocol coverage;
s23: and analyzing after the protocol is received, and acquiring characteristic information such as waveform, frequency, amplitude and the like corresponding to each channel.
9. The waveform output method of the multi-channel electrical stimulation apparatus as claimed in claim 8, wherein the step S22 specifically includes:
s221: judging whether the write pointer and the read pointer are equal, if so, entering step S222, otherwise, entering step S224;
s222: judging whether a protocol is received, if so, entering the step S223, otherwise, returning to the step S21;
s223: receiving a protocol, and entering a two-dimensional write pointer into 1;
s224: one protocol is handled, the two-dimensional read pointer goes to 1.
10. The waveform output method of the multi-channel electrostimulation device according to any one of claims 7 to 9, wherein the step S6 specifically includes:
s61: judging whether a loop is formed, if not, waiting for the loop to be established, and if so, entering the step S62;
s62: collecting ADC data;
s63: judging whether the collection number is more than 10 times, if not, continuing to collect, and if so, entering the step S64;
s64: filtering the acquired ADC data;
s65: and calculating the load impedance value of each channel so as to obtain the current load state.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010069674.2A CN111111008A (en) | 2020-01-21 | 2020-01-21 | Multi-channel electrical stimulation device and waveform output method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010069674.2A CN111111008A (en) | 2020-01-21 | 2020-01-21 | Multi-channel electrical stimulation device and waveform output method thereof |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111111008A true CN111111008A (en) | 2020-05-08 |
Family
ID=70492788
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010069674.2A Pending CN111111008A (en) | 2020-01-21 | 2020-01-21 | Multi-channel electrical stimulation device and waveform output method thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111111008A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112169169A (en) * | 2020-09-28 | 2021-01-05 | 广东时光颜究所美容科技有限公司 | Beauty instrument current control system and beauty instrument |
CN116549842A (en) * | 2023-07-10 | 2023-08-08 | 大悦创新(苏州)医疗科技股份有限公司 | Multichannel bidirectional constant-current electric stimulation system, method and electrotherapy equipment |
-
2020
- 2020-01-21 CN CN202010069674.2A patent/CN111111008A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112169169A (en) * | 2020-09-28 | 2021-01-05 | 广东时光颜究所美容科技有限公司 | Beauty instrument current control system and beauty instrument |
CN112169169B (en) * | 2020-09-28 | 2023-12-08 | 广东花至美容科技有限公司 | Beauty instrument current control system and beauty instrument |
CN116549842A (en) * | 2023-07-10 | 2023-08-08 | 大悦创新(苏州)医疗科技股份有限公司 | Multichannel bidirectional constant-current electric stimulation system, method and electrotherapy equipment |
CN116549842B (en) * | 2023-07-10 | 2023-09-15 | 大悦创新(苏州)医疗科技股份有限公司 | Multichannel bidirectional constant-current electric stimulation system, method and electrotherapy equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103893914B (en) | Program control multichannel electrophysiological stimulation device | |
CN103212157B (en) | Bipolar general nerve electric stimulation instrument | |
CN103300853B (en) | Diagnosis and treatment system based on surface myoelectricity | |
CN105744984B (en) | Electrial medical apparatus | |
CN109276806B (en) | Wearable constant-current output device with real-time adjustable stimulation intensity and control method | |
CN111111008A (en) | Multi-channel electrical stimulation device and waveform output method thereof | |
CN109731221A (en) | A kind of Multifunctional nerve muscular electrostimulation device | |
CN211751816U (en) | Multi-channel electrical stimulation device | |
CN102772856A (en) | Multifunctional nervous system electrical stimulator for treating words swallowing disease | |
CN107080894A (en) | A kind of portable multichannel acupoint stimulation system | |
CN101584909A (en) | Portable non-invasive neurogenic bladder therapeutic instrument | |
CN110882486A (en) | Constant current type percutaneous nerve electrical stimulation circuit | |
CN216439827U (en) | Low-frequency electronic pulse therapeutic instrument | |
CN205163912U (en) | Medium frequency electro -therapeutic appearance | |
CN111097103A (en) | Electrical stimulation device capable of generating arbitrary waveforms and waveform output method thereof | |
CN211751815U (en) | Electrical stimulation device capable of generating arbitrary waveform | |
KR102397015B1 (en) | Stimulator and method for controling stimulator | |
CN207640809U (en) | A kind of pulse generating circuit through cranial nerve physical therapy apparatus | |
CN210521551U (en) | Chaotic electric massager with rotation effect | |
CN106621034A (en) | Medium-frequency electric stimulation therapeutic instrument | |
CN201959422U (en) | Spasm muscle therapeutic apparatus | |
CN102058934A (en) | Fully computer-controlled multifunctional physiotherapy equipment | |
CN109954209A (en) | A kind of high-voltage driving circuit system for functional electrostimulation | |
CN220546470U (en) | Electrical stimulation circuit and electrical stimulation treatment equipment | |
CN105521559A (en) | Intelligent pulse sweating suppression instrument circuit |
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 |