Next Article in Journal
Capacity Performance for Full-Duplex Multihop Wireless Networks Using Channel Interference Balancing Allocation Scheme
Next Article in Special Issue
Prediction of Type and Recurrence of Atrial Fibrillation after Catheter Ablation via Left Atrial Electroanatomical Voltage Mapping Registration and Multilayer Perceptron Classification: A Retrospective Study
Previous Article in Journal
Front-End Design for SiPM-Based Monolithic Neutron Double Scatter Imagers
Previous Article in Special Issue
Shock Response Spectrum Analysis of Fatigued Runners
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Development of an IoT Electrostimulator with Closed-Loop Control

by
Túlio Fernandes De Almeida
,
Luiz Henrique Bertucci Borges
and
André Felipe Oliveira de Azevedo Dantas
*
Graduate Program in Neuroengineering, Edmond and Lily Safra International Institute of Neuroscience, Santos Dumont Institute, Av. Alberto Santos Dumont, 1560, Zona Rural, Macaiba 59280-000, RN, Brazil
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Submission received: 30 March 2022 / Revised: 2 May 2022 / Accepted: 4 May 2022 / Published: 7 May 2022
(This article belongs to the Special Issue Impact of Sensors in Biomechanics, Health Disease and Rehabilitation)

Abstract

:
The most used approach in the motor rehabilitation of spinal cord injury is functional electrical stimulation. However, current devices do not provide real-time feedback, work in the closed-loop, and became remotely operable. In this scenario, this paper presents the development of an open access 4-channel IoT electrostimulator device with an inertial sensor. The electrostimulator circuit was designed with four modules: Boost Converter, H-bridge, Inertial Measurement Unit, and Processing Module. The firmware was implemented in the processing module to manage the modules to perform closed-loop stimulation (using PID controller). To perform the proof of concept of the device, a closed loop test was performed to control the ankle joint, performing the movements of dorsiflexion, plantar flexion, inversion, and eversion. The designed hardware allowed one to freely change the boost converter voltage and modulate the signal with 200 μ s of pulse duration and 50 Hz of period in a safe and stable way. Furthermore, the controller was able to move the ankle joint in all desired directions following the reference values and respecting the imposed constraints. In general, the developed hardware was able to safely control a closed-loop joint.

1. Introduction

Spinal cord injury (SCI) is the most disabling condition for humans, usually caused by traumatic accidents (e.g., traffic accidents, falls) or violence [1,2]. SCI led to severe impairment in the sensory, motor, and autonomous systems below the injury level, and secondary complications such as chronic pain and bladder and bowel dysfunction, along with increased susceptibility to respiratory and heart problems [1,3]. In this sense, the financial burden for the health system is immense, affecting the patient, insure companies, hospitals, and government [3,4].
To reduce the financial impact and improve the quality of life of people with SCI, the development of new rehabilitation techniques and medical devices is essential. The most used approach in the motor rehabilitation of SCI is functional electrical stimulation (FES) [5,6,7], which uses electrical current to cause a muscle to contract and promote functional improvement by increasing muscle strength and range of movement [8]. However, commercial FES equipment has not been adapted to the current Internet of Things (IoT) scenario [5,7]. The currently available devices do not have access to databases, integrated control systems, and real-time feedback [9], there are only a few devices developed or adapted in laboratories that are not open access [10].
The most complex FES applications in rehabilitation are assisted cycling and walking. Based on the actual devices, the execution of these cyclic movements is performed based on time or by devices attached to FES equipment [6,11,12]. To increase the effectiveness of the therapy with FES, it should provide real-time feedback and work in the closed-loop. In addition, it is necessary to democratize access to this type of equipment, to promote the emergence of new techniques and rehabilitation protocols [9]. The system presented here aims to meet these conditions, providing an open IoT electrostimulator device.
This study aimed to (1) develop a low-cost IoT electrostimulator, (2) present a closed-loop functionality using inertial sensors, and (3) perform a proof-of-concept of the proposed electrostimulator by a closed-loop experiment to control the ankle joint.

2. Materials and Methods

In this section, there are material description, components, concepts, and techniques to develop a 4-channel IoT electrostimulator device. This project was approved by the ethics committee of Santos Dumont Institute under the protocol 53127921.2.0000.0129 approved in 23 December 2021. The functional diagram of the system is depicted in Figure 1.
As shown in Figure 1, the setup is composed of a 4-channel Fes (processing module, BC, H-bridge, and IMU), a notebook to configure the FES and send the setpoint values and the controller, and the controlled system (muscle and joint angle). In this scheme, the notebook is responsible to start via Wi-Fi the FES and receive all generated data. After the stimulation module is started, it cyclically reads the sensors data, calculates the joint angles, compares them with the reference (error) sent from notebook, calculates the control actions and uses them to contract the muscles in the direction the error is minimized. In the following subsections, the building information of the hardware and firmware are detailed as well as the tests setup.

2.1. Hardware Design

The electrostimulator circuit was designed with four modules: boost converter (BC), H-bridge, inertial measurement unit (IMU), and processing module, as shown in Figure 2.
The processing module (Figure 2), uses a microcontroller (ESP32-DevKitC [13]) to (1) communicate based on the Message Queuing Telemetry Transport (MQTT) protocol; (2) manage the stimulation signals using pulse width modulation (PWM) signals (used to amplify boost voltage and modulate the signal controlling the H-bridge); and (3) extract data from the IMU. The communication between the processing module and the IMU is based on the Inter-Integrated Circuit ( I 2 C ) protocol [14] with an acquisition frequency of 100 KHz, allowing the use of any IMU. Here, the GY-80 (10 degrees of freedom—accelerometer, gyroscope, magnetometer and barometer) sensor was used due to previous experience in other projects. The H-bridge [15,16] and BC [15] are essential part of the device, and the circuits are presented in Figure 3.
Due to the need to consider multiple stimulation channels, user safety and generation of stimulation signals, the Processing Module have to manage the amplification and modulation circuits to operate up to 4 stimulation channels. These amount of channel can stimulate 4 muscles and perform functional movements using the IMU as reference.
IMU module was developed based on the work of [17], they developed the Joint Angle Measurement Acquisition (JAMA) device. JAMA is an open-source hardware capable of extracting and sending IMU data via Wi-Fi, and it was applied in the assessment of human movement. In this work, the objective was to use the human movement to create an closed-loop electrostimulator, using the IMU data to calculate control actions and produce functional movements (e.g., gait, pedaling). For this, it was performed some adaptations to integrate JAMA firmware with the electrostimulator routines.

2.2. Structure of the Control System

The ankle was the chosen joint since it has a fundamental role in maintaining stability during posture (regulatory) and helps the gait movement (setpoint tracking) [18]. To generate movement for a joint in each direction, two muscles (an agonist and antagonist pair) must be stimulated [19].
Control mechanisms that help maintain the body’s balance have been investigated. In a first simple control approach, two muscles shall be actuated as shown in Figure 4.
Figure 4 shows the scheme for controlling one angle in joint movement. As seen, to control the desired angle, an error signal must be generated from set point and output angle (calculated using accelerometer and gyroscope data fused with complementary filter [17]). After that, the controller calculates the control action (PID with Conditional Integration [20]). In sequence, the control action is directed to the right muscle (Muscle Selector) as a duty cycle for the boost, causing the stimulation amplitude necessary to correct the error. In the case when more than one angle have to be controlled, the angles in joint movement can be considered not coupled. In other words, the control design can be performed independently for each joint angle.
For its simple modeling and tuning effort [19], the chosen controller is the PID. According to [21] there are three reasons that make the PID so important: (a) track record of success; (b) wide availability; (c) simplicity of application. PID is based on three control actions (Proportional, Integral and Derived). By combining proportional, integral and derivative actions in a single controller, the PID formulation can be schematized as shown in the Equation (1) [22,23]:
u ( t ) = K p e ( t ) + K i 0 t e ( t ) d t + K d d e ( t ) d t
being that:
  • u ( t ) corresponds to the control action (duty cycle) calculated on time t;
  • K p is the proportional gain;
  • K i is the integral gain;
  • K d is the derivative time;
  • e ( t ) is the difference between the desired angle and the joint angle;
  • 0 t e ( t ) d t is the integral of the error;
  • d e ( t ) d t is the derivative of the error.
Tuning is required for PID to be used, for ankle joint control, this tune needs to consider maintaining stability in regulatory and track gait movement. Additionally, the PID needs to ensure both stability and avoid pain for the experiment participant. This is an issue because, the more aggressive the controller is, the greater the discomfort for the subject.

2.3. Firmware Design

After the hardware and controller definition, its necessary to develop a firmware to integrate the device modules and implement the PID controller. There were developed two routines in C++ to control the device in Open-Loop and Closed-loop Stimulation modes and are described below:
  • Open-Loop Stimulation: it is a routine developed to activate electrostimulator channels (individually or together) to perform stimulation similar to conventional devices. In this routine, the user can determine the stimulation parameters: boost duty cycle (stimulus amplitude), pulse duration, and frequency.
  • Closed-Loop Stimulation: this routine will use an IMU as sensor to control the joint angle using the electrical stimulation. For this, the user must determine the IMU parameters: acquisition frequency (Hz) and data acquisition time (seconds). In addition to determining the sensor configurations, it is necessary to define the parameters ( K p , K i , K d and output limits) of the 2 implemented PID (proportional-integral-derivative) controllers and the stimulation parameters (the same presented in Open-Loop Stimulation).
One of the most used closed-loop controllers in healthy applications is the Proportional-Integral-Derivative (PID), due to the simplicity and efficiency [24,25,26]. Here, the PID controllers were implemented in the Processing Module using C++. They use the following parameters: error ( K p ), the integral of the error ( K i ), and the derivative of the error ( K d ) to calculate the stimulus voltage of 2 channels. Each channel is responsible for producing movement in one direction by stimulating muscle responsible for the desired movement (e.g., tibialis anterior for dorsiflexion). Furthermore, each PID is responsible for one degree of freedom, controlling the agonist and antagonist of the movement (e.g, on channel on the tibialis anterior for dorsiflexion, and the other channel on the gastrocnemius for the plantar flexion). Moreover, the C++ implemented PID saturate the control action. When this happens, the routine also stops integrating to avoid the windup phenomenon.
The implemented PID are configured so that the positive control signal stimulates the agonist muscle to increase the angle value and the negative control signal the antagonist muscle to decrease the joint angle. In this sense, the user must determine the PID parameters according to the placement of the electrodes. This was performed using an interactive Python script developed to control the ankle joint.
In addition to the firmware, it is necessary to develop a script to choose, configure and run the routines. For this, it were developed a script in Python using MQTT protocol to find the device with the ID of each channel/IMU and establish the Wi-Fi communication. Stimulation routines and the application script are available on GitHub (https://github.com/luizbertucciborges/fes4channels, accessed on 25 March 2022).

2.4. Structural Hardware Test

This section presents the design of tests to evaluate the performance and applicability of the electrostimulator. To evaluate the functioning of the BC and H-bridge modules, an oscilloscope was used to measure the PWM signals at the input of the boost circuit and the signal sent to the H-Bridge. Also, the ability of the BC to amplify the stimulation signal, and the H-Bridge to modulate it was also evaluated.
The test consisted of simulating a resistive load, changing the duty cycle from 0 to 5 and simultaneously sending a 50 Hz Hz modulation signal to the H-Bridge. Periodic and alternating stimulation was performed on the H-Bridge, alternating the stimulation every 200 μ s with a 19.6 ms pause at each cycle. The logic of the test was to evaluate if the electrostimulator was able to maintain the frequency of the modulated signal of 50 Hz while increasing and decreasing the voltage in the BC module.

2.5. Closed-Loop Test

Closed-loop routine test was performed using the four stimulation channels to control the ankle joint as a proof of concept. Ankle joint was chosen because it is able to move in 3 directions (plantar flexion/dorsiflexion, eversion/inversion and adduction/abduction) and it is possible to passively replicate these movements using electrical stimulation. The electrodes were placed over the muscles: tibialis anterior (dorsiflexion), gastrocnemius (plantar flexion), peroneus longus and brevis (eversion), and flexor hallucis longus (inversion).
The test was performed on a healthy subject (woman, 1.55 m, 55 kg, Body Mass Index 22.9), and using the following stimulation parameters: frequency of 50 Hz, pulse duration of 200 μ s , and amplitude (duty cycle) of 5% (0–100%). The stimulation parameters used and the location of the motor points were determined based on standard protocols [12], aiming at safety, decreasing the participant’s discomfort and stimulation efficiency. Discomfort/pain was measured using the Numeric Pain Rating Scale throughout the experiment, the participant was instructed on the functioning of the scale and whenever she feel it changed she should report [27]. The scale ranges from 0 to 10, with 0 being no pain/discomfort and 10 being the worst possible pain experience. It was previously established that pain/discomfort greater than or equal to 6 would stop the experiment, or at any time at the request of the participant.
Before performing the data acquisition, the electrodes were positioned and removed to ensure their correct fit. In addition, other simpler tests were performed at earlier times (e.g., knee flexion and extension) to assess the system. Thus, the electrodes and the JAMA were positioned according with Figure 5.
PID tuning were performed using the step response [28], because the system (human body) is non-linear and the step response is bounded (which means we can use magnitudes that imply neither discomfort nor pain for the subject). The step response occurs with the tuning of the parameters ( K p , K i , K d ) in order to start with less aggressive and end with more aggressive parameters, until a functional tuning was found [29,30]. This means that the PID controllers work “independently”, when a change in the setpoint of one PID does not influence the regulatory of the other. Therefore, the variation of the setpoint of one controller (responsible for eversion and inversion) does not change the orientation of the other (responsible for dorsiflexion and plantar flexion). Moreover, the electrostimulator parameters used were frequency of 50 Hz, pulse duration of 200 μ s , and amplitude of 5% (0–100%). The control and stimulation parameters have been adjusted remotely and wireless.
This experiment was performed with the individual sitting with the lower limbs hanging. After tuning the controllers, the right foot was passively positioned in a neutral position using the electrostimulator, and then the movements of inversion, eversion, dorsiflexion, and plantar flexion of the ankle joint were performed sequentially.

3. Results

This section is intended to present the hardware, structural hardware test, and the closed-loop test.

3.1. Hardware

The hardware was built as designed, with 4 channels, max voltage of ± 100 V m a x (9 W of power supply), inertial sensor feedback and 2.4 Ghz Wi-Fi communication. Moreover, the user can easily configure the channels of the application (add or remove) because the system is modular. The used power supply is a commercial one, so it matches the standardized recommendations. In addition, if the therapy requires more current, it is possible to change the power supply. Figure 6 shows the built circuit.
As seen in Figure 6, the processing module is the central part of the circuit. It allows the easy connection of 4 boosts and 4 H-Bridges using the properly connectors (in the figure, only 2 channels are shown due to the dimensions of the photo).

3.2. Structural Hardware Test

Figure 7A present the results of the structural hardware test in columns. First column shows the PWM input to BC module; the second and third columns shows the response to the PWM signal by BC and H-Bridge respectively. According with the oscilloscope readings, the electrostimulator is stable to variations in the PWM signal, managing to maintain the frequency of 50 Hz throughout the test. To ensure this, the test was performed for five minutes three times without changing the results. Figure 7B shows the output of the H-Bridge, being able to maintain the 200 μ s pulse duration and the 20 ms period. The figure shows some views of the signal using different time resolutions. The left image highlights the pulse duration in positive and negative phases, the center image shows the reading signal period with two oscilloscope channels and the right image shows the stimulation signal read at the electrode output.

3.3. Closed-Loop Stimulation

The experiment described above worked successfully, using that electrode configuration and the device it was possible to control the ankle joint performing the movements of dorsiflexion, plantar flexion, inversion and eversion. The results of the experiment are shown in Figure 8.
As described in Section 2, before tuning the controller it is necessary to place the electrodes and verify the acceptable PWM/Voltage level. This procedure is specific for each application, as it is related to the individual’s characteristics (e.g., body mass and stimulus tolerance). After that, the controller must be tuned, using the step response with a gradual increase in aggressiveness, and the parameters obtained from step response are shown in the Table 1. Note that the objective of this experiment was the functional outcome, the possibility to control the ankle joint, not to perform the best tuning of the controller.
Figure 8A,C present the protocol described in the methodology, starting with the positioning of the foot in a neutral position (0 degrees in the first seconds), performing the inversion and eversion (Figure 8C), and ending with dorsiflexion and plantar flexion (Figure 8A). The JAMA signal is expected to track the reference signal (orange line) but not overlap at all times. Due to the type of tuning performed, the purpose of the test was to certify that the controller can produce the desired movements in a comfortable and safe way, so the tuning was done very slowly to avoid aggressive responses from the controller. In addition, the experiment was performed with a healthy individual, who even without moving, there are reflex responses and a certain level of basic muscle tone, and for the duration of the experiment may have tired and made minor adjustments. It is important to point out that throughout the experiment, the individual’s discomfort/pain remained between 0–2 on the Numeric Pain Rating Scale, which indicates a small discomfort that is expected.
The controller was able to execute the proposed movements, achieving the desired range of motion, 20° of dorsiflexion and plantar flexion, 20° of inversion and 5° of eversion (small negative deflections in Figure 8C). Since eversion was voluntarily difficult to perform in this condition, we opted for a smaller range of motion and performed for a shorter time to avoid producing pain in the participant. In addition, the positioning of the JAMA did not present good angular variation for eversion, which may have reduced the visualization of the angle obtained.
Figure 8B,D shows the PWM signals used to produce electrical stimulus. The PWM signals achieved the expected pattern. Because of the motor threshold (deadzone) and use of two controllers at the same time it was expected the regulatory control actions to have high variations, oscillating when the reference is 0. Additionally, when the ankle angles in both directions were forced to outside the physical range (determined beforehand), the controller saturated the control actions to the limits shown in Table 1. Because of that, sometimes, the controller do not reach the reference showing the controllers safety.

4. Discussion

4.1. Hardware

This paper presented a 4-channel open access IoT electrostimulator. Unlike other works [7,12,31,32] that introduce applications or some part of hardware [33,34], here the hardware of an IoT electrostimulator was presented and made available along with the firmware and how to build it.
The device presented here showed promising results as the controller performed well in a complex task respecting the imposed constraints. Usually the electrostimulator rely only on the H-bridge [33,34]. However, to increase the safety of the device (circuit and subject integrity), protection diodes capable of preventing reverse current or voltage were implemented. This is important because the electrostimulator has four channels and modulating signals simultaneously at different time intervals associated with different boost output voltage values, can cause negative voltages from one channel to another. In this sense, the diodes (D9, D4, D5 and D6) shown in Figure 3 are intended to prevent this situation, making the device safer.
A limitation of the electrostimulator in the actual version is the absence of an graphic interface that facilitates the manipulation of parameters and the creation of routines, which would expand the contexts of applicability (e.g., clinical research). Currently, the electrostimulator can be easily integrated into research laboratories. In addition, as the electrostimulator is open access, the community can develop a more robust system with more resources (modules, features, scripts and others).
An important factor to consider in open access devices is cost [17]. In this sense, the electrostimulator proposed in this work is low cost and its components are basic and accessible. The most expensive devices are the microcontroller (ESP32 costs 10 dollars) and the IMU (GY-80 costs 25 dollars, but another sensor can easily be adapted). The complete description of the components and how to build the circuit is available on GitHub (https://github.com/luizbertucciborges/fes4channels, accessed on 25 March 2022).

4.2. Proof of Concept

As seen in Table 1, the controller used is a PI, with the derivative term equal to zero. That happened because in the PID implementation there is no derivative filter and because the noise and some nonlinearities, the additions of this term increases the control signal variation which leads to participant discomfort and pain. On the other hand, the pure P controller was also tested, but because of the sensibility to participant’s positioning, the regulatory and tracking problem control loses performance. This loss of performance is directly associated with the disturbance rejection and the time constant of the systems [35].
The controllers with the sowed parameters presented good performance together with the electrostimulator, the controllers were designed in regulatory and tracking mode and were able to control the ankle joint (a multivariate system) respecting the output constraints. Constraints in this type of application are essential, as human joints have an articular system (bones, tendons, ligaments and capsule) to prevent injuries. In case of excessive movement in healthy individuals, the body’s response is pain and the withdrawal reflex [36]. In this sense, Figure 8 makes it possible to observe the good performance of the controllers.
Considering that PID controllers had to deal with saturation (limits of ankle joint angles), dead zone (muscle motor threshold) and hysteresis (in BC capacitor charges faster than discharges), non-linear muscle behavior, noise of JAMA measurement and perturbations (subject’s reactions to stimulation), they presented a good result, being able to maintain the setpoint and tracking the reference signal. In other words, the dead zone may lead to the chattering [37] seen in regulatory, some sensibility to subject position on the chair may cause some variation in mean magnitude of the control signal and the boost hysteresis may lead to a greater time constant when decreasing the voltage.
The non-linear behavior of the muscle [38] together with the characteristic of recruitment by electrical stimulation [30], are obstacles to the external control of the movement. Due to these factors and the simplicity of the PID, the result found is good and in case of a better tuning using auxiliary algorithms it can improve it [25].
In addition to simplicity, PID controllers are the most used [26]. More advanced control methods (e.g., model predictive control and deep learning based) tend to present better results, but they are more difficult to tune, computationally expensive and, in the case of human articulation, need a model otherwise they can neither predict the system behavior nor respect the constraints [7,23,39,40]. Thus, aiming to develop an open access electrostimulator system associated with closed-loop control, the PID controller was chosen. However, in the future, stimulation routines will be implemented for specific situations (e.g., cycling) with more advanced controllers.

4.3. Limitations and Perspectives

This study focused on the development of an IoT electrostimulator in its proof of concept of closed-loop operation in a healthy individual. For device validation, tests in other populations (e.g., people with spinal cord injury or stroke) must be performed, along with a functional use protocol (e.g., cycling and gait).
The test of the device made in closed-loop for ankle joint control, was carried out to proof the concept of the implemented control system. The experiment did not aim to achieve the best tuning of the controllers, but only the execution of the desired movements without producing pain or discomfort to the subject. In this way, other controller algorithms will be implemented in future to evaluate which one obtains the best performance with the electrostimulator.
Although the electrostimulator has worked stably and safely, and the controller has met expectations, it is possible to optimize the presented device (circuit and communication) to increase its robustness. Another important factor is the implementation of a GUI (graphical user interface), to facilitate its use in applications outside the laboratory and the development of more complex stimulation routines.

5. Conclusions

This article proposed an IoT electrostimulator together with a proof of concept of its closed-loop operation using PID controllers. The controllers were able to move the ankle joint in the proposed movements without generating pain or discomfort for the subject. In general, the developed hardware was able to safely control a closed-loop joint. In future work, we plan to implement other control algorithms and develop more tests in different situations.

Author Contributions

Conceptualization, T.F.D.A. and A.F.O.d.A.D.; Formal analysis, T.F.D.A. and L.H.B.B.; Investigation, T.F.D.A. and L.H.B.B.; Methodology, T.F.D.A., L.H.B.B. and A.F.O.d.A.D.; Supervision, A.F.O.d.A.D.; Writing, review and editing, T.F.D.A. and A.F.O.d.A.D. All authors have read and agreed to the published version of the manuscript.

Funding

This study was financed in part by the Coordenação de Aperfeiçoamento de Pessoal de Nível Superior—Brasil (CAPES)—Finance Code 001, Conselho Nacional de Desenvolvimento Científico e Tecnológico (CNPq), Ministério da Educação (MEC), and Instituto Santos Dumont (ISD).

Institutional Review Board Statement

The study was conducted according to the guidelines of the Declaration of Helsinki, and approved by the Institutional Review Board (or Ethics Committee) of Santos Dumont Institute (protocol code C.A.A.E: 53127921.2.0000.0129 approved in 23 December 2021).

Informed Consent Statement

Informed consent was obtained from the subject involved in the study. Written informed consent has been obtained from the subject to publish this paper.

Data Availability Statement

All codes and the tutorial on how to build the device are available on GitHub (https://github.com/luizbertucciborges/fes4channels, accessed on 25 March 2022). In addition, the device used to measure the joint angle (JAMA) is available on GitHub (https://github.com/tuliofalmeida/jama, accessed on 25 March 2022).

Acknowledgments

The authors warmly thank the participant for having accepted to take part in this protocol. The authors would also like to thank Domingos Almeida, Boaz Almeida, Maria Eduarda for the discussions and contributions at different stages of the project.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. McDonald, J.W.; Sadowsky, C. Spinal-cord injury. Lancet 2002, 359, 417–425. [Google Scholar] [CrossRef]
  2. World Health Organization; International Spinal Cord Society. International Perspectives on Spinal Cord Injury; World Health Organization: Geneva, Switzerland, 2013. [Google Scholar]
  3. McDaid, D.; Park, A.L.; Gall, A.; Purcell, M.; Bacon, M. Understanding and modelling the economic impact of spinal cord injuries in the United Kingdom. Spinal Cord 2019, 57, 778–788. [Google Scholar] [CrossRef] [Green Version]
  4. Merritt, C.H.; Taylor, M.A.; Yelton, C.J.; Ray, S.K. Economic impact of traumatic spinal cord injuries in the United States. Neuroimmunol. Neuroinflamm. 2019, 6, 9. [Google Scholar] [CrossRef] [Green Version]
  5. Ho, C.H.; Triolo, R.J.; Elias, A.L.; Kilgore, K.L.; DiMarco, A.F.; Bogie, K.; Vette, A.H.; Audu, M.L.; Kobetic, R.; Chang, S.R.; et al. Functional electrical stimulation and spinal cord injury. Phys. Med. Rehabil. Clin. 2014, 25, 631–654. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  6. Sijobert, B.; Le Guillou, R.; Fattal, C.; Azevedo Coste, C. FES-Induced Cycling in Complete SCI: A Simpler Control Method Based on Inertial Sensors. Sensors 2019, 19, 4268. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  7. Selfslagh, A.; Shokur, S.; Campos, D.S.; Donati, A.R.; Almeida, S.; Yamauti, S.Y.; Coelho, D.B.; Bouri, M.; Nicolelis, M.A. Non-invasive, brain-controlled functional electrical stimulation for locomotion rehabilitation in individuals with paraplegia. Sci. Rep. 2019, 9, 6782. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  8. Doucet, B.M.; Lam, A.; Griffin, L. Neuromuscular electrical stimulation for skeletal muscle function. Yale J. Biol. Med. 2012, 85, 201. [Google Scholar] [PubMed]
  9. Rodgers, M.M.; Alon, G.; Pai, V.M.; Conroy, R.S. Wearable technologies for active living and rehabilitation: Current research challenges and future opportunities. J. Rehabil. Assist. Technol. Eng. 2019, 6, 2055668319839607. [Google Scholar] [CrossRef]
  10. Li, Z.; Guiraud, D.; Andreu, D.; Gelis, A.; Fattal, C.; Hayashibe, M. Real-time closed-loop functional electrical stimulation control of muscle activation with evoked electromyography feedback for spinal cord injured patients. Int. J. Neural Syst. 2018, 28, 1750063. [Google Scholar] [CrossRef]
  11. Zhang, Q.; Hayashibe, M.; Azevedo-Coste, C. Evoked electromyography-based closed-loop torque control in functional electrical stimulation. IEEE Trans. Biomed. Eng. 2013, 60, 2299–2307. [Google Scholar] [CrossRef] [Green Version]
  12. Bellman, M.J.; Cheng, T.H.; Downey, R.J.; Hass, C.J.; Dixon, W.E. Switched control of cadence during stationary cycling induced by functional electrical stimulation. IEEE Trans. Neural Syst. Rehabil. Eng. 2015, 24, 1373–1383. [Google Scholar] [CrossRef] [PubMed]
  13. Espressif, S. ESP32 Datasheet. In IotY Based Microcontroller; 2017; Available online: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf (accessed on 25 March 2022).
  14. Patel, J.; Soni, B. Design and implementation of I2C bus controller using Verilog. J. Inf. Knowl. Res. Electron. Commun. Eng. 2012, 2, 520–522. [Google Scholar]
  15. Hart, D.W. Power Electronics; Tata McGraw-Hill Education: Valparaiso, IN, USA, 2011. [Google Scholar]
  16. Xu, Q.; Huang, T.; He, J.; Wang, Y.; Zhou, H. A programmable multi-channel stimulator for array electrodes in transcutaneous electrical stimulation. In Proceedings of the 2011 IEEE/ICME International Conference on Complex Medical Engineering, Harbin, China, 22–25 May 2011; pp. 652–656. [Google Scholar]
  17. de Almeida, T.F.; Morya, E.; Rodrigues, A.C.; de Azevedo Dantas, A.F.O. Development of a Low-Cost Open-Source Measurement System for Joint Angle Estimation. Sensors 2021, 21, 6477. [Google Scholar] [CrossRef] [PubMed]
  18. Same, M.B.; Rouhani, H.; Masani, K.; Popovic, M.R. Closed-loop control of ankle plantarflexors and dorsiflexors using an inverted pendulum apparatus: A pilot study. J. Autom. Control 2013, 21, 31–36. [Google Scholar] [CrossRef] [Green Version]
  19. Simon, D.; Andreu, D. Real-time Simulation of Distributed Control Systems: The example of Functional Electrical Stimulation. In Proceedings of the ICINCO: International Conference on Informatics in Control, Automation and Robotics, Lisbon, Portugal, 29–31 July 2016; pp. 455–462. [Google Scholar]
  20. Astrom, K.J.; Rundqwist, L. Integrator windup and how to avoid it. In Proceedings of the 1989 American Control Conference, Pittsburgh, PA, USA, 21–23 June 1989; pp. 1693–1698. [Google Scholar]
  21. Johnson, M.A.; Moradi, M.H. PID Control; Springer: London, UK, 2005. [Google Scholar]
  22. Dantas, A.F.O.d.A. Identificação e Comparação Entre Controle Preditivo Com Modelo não Linear e PI Sintonizados Com PSO em Sistema de Separação Gravitacional de Águia-óleo. Master’s Thesis, Universidade Federal do Rio Grande do Norte, Natal, Brazil, 2012. [Google Scholar]
  23. Neto, D.L.; Dantas, A.F.; de Almeida, T.F.; de Lima, J.A.; Morya, E. Comparison of Controller’s Performance for a Knee Joint model based on Functional Electrical Stimulation Input. In Proceedings of the 2021 10th International IEEE/EMBS Conference on Neural Engineering (NER), Virtual Event, Italy, 4–6 May 2021; pp. 836–839. [Google Scholar]
  24. Alibeji, N.; Kirsch, N.; Farrokhi, S.; Sharma, N. Further results on predictor-based control of neuromuscular electrical stimulation. IEEE Trans. Neural Syst. Rehabil. Eng. 2015, 23, 1095–1105. [Google Scholar] [CrossRef]
  25. Boudville, R.; Hussain, Z.; Yahaya, S.Z.; Abd Rahman, M.F.; Ahmad, K.A.; Husin, N.I. Development and optimization of PID control for FES knee exercise in hemiplegic rehabilitation. In Proceedings of the 2018 12th International Conference on Sensing Technology (ICST), Limerick, Ireland, 4–6 December 2018; pp. 143–148. [Google Scholar]
  26. Borase, R.P.; Maghade, D.; Sondkar, S.; Pawar, S. A review of PID control, tuning methods and applications. Int. J. Dyn. Control 2021, 9, 818–827. [Google Scholar] [CrossRef]
  27. Ritter, P.L.; González, V.M.; Laurent, D.D.; Lorig, K.R. Measurement of pain using the visual numeric scale. J. Rheumatol. 2006, 33, 574–580. [Google Scholar]
  28. Ahmed, S.; Huang, B.; Shah, S.L. Novel identification method from step response. Control Eng. Pract. 2007, 15, 545–556. [Google Scholar] [CrossRef]
  29. Ferrarin, M.; Pedotti, A. The relationship between electrical stimulus and joint torque: A dynamic model. IEEE Trans. Rehabil. Eng. 2000, 8, 342–352. [Google Scholar] [CrossRef]
  30. Bergquist, A.; Clair, J.; Lagerquist, O.; Mang, C.; Okuma, Y.; Collins, D. Neuromuscular electrical stimulation: Implications of the electrically evoked sensory volley. Eur. J. Appl. Physiol. 2011, 111, 2409–2426. [Google Scholar] [CrossRef]
  31. Wang, H.P.; Bi, Z.Y.; Zhou, Y.; Zhou, Y.X.; Wang, Z.G.; Lv, X.Y. Real-time and wearable functional electrical stimulation system for volitional hand motor function control using the electromyography bridge method. Neural Regen. Res. 2017, 12, 133. [Google Scholar] [CrossRef]
  32. Andreu, D.; Sijobert, B.; Toussaint, M.; Fattal, C.; Azevedo-Coste, C.; Guiraud, D. Wireless electrical stimulators and sensors network for closed loop control in rehabilitation. Front. Neurosci. 2020, 14, 117. [Google Scholar] [CrossRef] [PubMed]
  33. Souza, D.C.D.; Gaiotto, M.D.C.; Nogueira, G.N.; Castro, M.C.F.D.; Nohama, P. Power amplifier circuits for functional electrical stimulation systems. Res. Biomed. Eng. 2017, 33, 144–155. [Google Scholar] [CrossRef] [Green Version]
  34. Sanguantrakul, J.; Wongsawat, Y. Comparison Between Integrated Circuit and Transistor Pulse Generators for Functional Electrical Stimulation. In Proceedings of the 2018 International Electrical Engineering Congress (iEECON), Krabi, Thailand, 7–9 March 2018; pp. 1–4. [Google Scholar]
  35. Han, J. From PID to active disturbance rejection control. IEEE Trans. Ind. Electron. 2009, 56, 900–906. [Google Scholar] [CrossRef]
  36. Neziri, A.Y.; Andersen, O.K.; Petersen-Felix, S.; Radanov, B.; Dickenson, A.H.; Scaramozzino, P.; Arendt-Nielsen, L.; Curatolo, M. The nociceptive withdrawal reflex: Normative values of thresholds and reflex receptive fields. Eur. J. Pain 2010, 14, 134–141. [Google Scholar] [CrossRef]
  37. Lewis, F.L.; Tim, W.K.; Wang, L.Z.; Li, Z. Deadzone compensation in motion control systems using adaptive fuzzy logic control. IEEE Trans. Control Syst. Technol. 1999, 7, 731–742. [Google Scholar] [CrossRef]
  38. Binder, M.D.; Powers, R.K.; Heckman, C. Nonlinear input-output functions of motoneurons. Physiology 2020, 35, 31–39. [Google Scholar] [CrossRef]
  39. Zhou, H.Y.; Huang, L.K.; Gao, Y.; Vasić, Ž.L.; Cifrek, M.; Du, M. Estimating the ankle angle induced by fes via the neural network-based hammerstein model. IEEE Access 2019, 7, 141277–141286. [Google Scholar] [CrossRef]
  40. Griffis, E.J.; Le, D.M.; Stubbs, K.J.; Dixon, W.E. Closed-Loop Deep Neural Network-Based FES Control for Human Limb Tracking. In Proceedings of the 2021 60th IEEE Conference on Decision and Control (CDC), Austin, TX, USA, 14–17 December 2021; pp. 360–365. [Google Scholar]
Figure 1. Functional diagram of the proposed system.
Figure 1. Functional diagram of the proposed system.
Sensors 22 03551 g001
Figure 2. Hardware Architecture - The system was designed with a 7V power supply, 4 boost modules ad H-Bridges and an IMU sensor that gives feedback via I2C or Wi-Fi.
Figure 2. Hardware Architecture - The system was designed with a 7V power supply, 4 boost modules ad H-Bridges and an IMU sensor that gives feedback via I2C or Wi-Fi.
Sensors 22 03551 g002
Figure 3. Electrostimulator circuit. The designed circuit has two parts. The first one is the boost that amplifies the 7 V input voltage accordingly to the PWM input in Q1. After the D1-C1 node, there is a connection from the boost to the H-Bridge.
Figure 3. Electrostimulator circuit. The designed circuit has two parts. The first one is the boost that amplifies the 7 V input voltage accordingly to the PWM input in Q1. After the D1-C1 node, there is a connection from the boost to the H-Bridge.
Sensors 22 03551 g003
Figure 4. PID Block Diagram.
Figure 4. PID Block Diagram.
Sensors 22 03551 g004
Figure 5. Setup test. Electrodes and IMU positing in medial, frontal, and lateral views. The figure shows electrodes of each channel positioning and indicates the direction of movements.
Figure 5. Setup test. Electrodes and IMU positing in medial, frontal, and lateral views. The figure shows electrodes of each channel positioning and indicates the direction of movements.
Sensors 22 03551 g005
Figure 6. Electrostimulation built circuit. The figure shows the 2-channel circuit of the developed electrostimulator. On the left are two H-Bridge modules, in the center the processing module, and on the right, the boost converter.
Figure 6. Electrostimulation built circuit. The figure shows the 2-channel circuit of the developed electrostimulator. On the left are two H-Bridge modules, in the center the processing module, and on the right, the boost converter.
Sensors 22 03551 g006
Figure 7. Structural Hardware Test. The figure shows the results of the structural test using an oscilloscope. (A) First column: PWM input to the Boost Control and H-Bridge. Second column: BC response to the PWM input signal. Third column: H-Brige response to the modulation signal. (B) Left: Two-channel BC response to PWM signal in 100 μ s window. Center: The 2.5 ms reading window of the Two-channel BC. Right: The stimulation signal sent to the electrode.
Figure 7. Structural Hardware Test. The figure shows the results of the structural test using an oscilloscope. (A) First column: PWM input to the Boost Control and H-Bridge. Second column: BC response to the PWM input signal. Third column: H-Brige response to the modulation signal. (B) Left: Two-channel BC response to PWM signal in 100 μ s window. Center: The 2.5 ms reading window of the Two-channel BC. Right: The stimulation signal sent to the electrode.
Sensors 22 03551 g007
Figure 8. Closed-loop ankle joint control. (A) The position of the ankle joint (in degrees) in relation to the reference in sagital plane. (B) PWM signal for stimulation of stimulation channels to produce dorsiflexion and plantar flexion movements. (C) The position of the ankle joint (in degrees) in relation to the reference in frontal plane. (D) PWM signal for stimulation of stimulation channels to produce inversion and eversion movements.
Figure 8. Closed-loop ankle joint control. (A) The position of the ankle joint (in degrees) in relation to the reference in sagital plane. (B) PWM signal for stimulation of stimulation channels to produce dorsiflexion and plantar flexion movements. (C) The position of the ankle joint (in degrees) in relation to the reference in frontal plane. (D) PWM signal for stimulation of stimulation channels to produce inversion and eversion movements.
Sensors 22 03551 g008
Table 1. PID parameters for ankle joint control.
Table 1. PID parameters for ankle joint control.
ControllerParametersValues
PID 1 K P 8.2
K I 3.8
Dorsiflexion/ K D 0
Plantar FlexionMin Limit−14
Max Limit10
PID 2 K P 8.1
K I 3.2
Inversion/ K D 0
EversionMin Limit−12
Max Limit14
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

De Almeida, T.F.; Borges, L.H.B.; Dantas, A.F.O.d.A. Development of an IoT Electrostimulator with Closed-Loop Control. Sensors 2022, 22, 3551. https://0-doi-org.brum.beds.ac.uk/10.3390/s22093551

AMA Style

De Almeida TF, Borges LHB, Dantas AFOdA. Development of an IoT Electrostimulator with Closed-Loop Control. Sensors. 2022; 22(9):3551. https://0-doi-org.brum.beds.ac.uk/10.3390/s22093551

Chicago/Turabian Style

De Almeida, Túlio Fernandes, Luiz Henrique Bertucci Borges, and André Felipe Oliveira de Azevedo Dantas. 2022. "Development of an IoT Electrostimulator with Closed-Loop Control" Sensors 22, no. 9: 3551. https://0-doi-org.brum.beds.ac.uk/10.3390/s22093551

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop