# A Neuro-Prosthetic Device for Substituting Sensory Functions during Stance Phase of the Gait
## 1 Introduction
In our previous work [17], we designed and built a FES-based wearable device using an Arduino Uno board that could be used for stimulation of hindleg muscles of dogs suffering from spinal cord injury. The sensing core of this balancing device includes a single IMU attached to the pelvis of the dog to gain data about pelvis angle of rotation. Timing control for the stimulation was based solely on hip orientation. To study the healthy gait of the dog, we used VICON software (Vicon Industries, Inc, Hauppauge, NY, USA) [18] to track the gait of a healthy dog on the treadmill. Our test results showed that the pelvis of the healthy dog does not rotate much during normal walking. However, during abnormal gait, dramatic rotation of the pelvis occurs before falling. We concluded that falling occurs when the pelvis angle of rotation exceeds a critical value, which can be determined by the veterinarian for each individual dog. This critical value can be measured using an IMU attached to the hip and can be used as an indication of falling. The Arduino calculates the necessary neural stimulation command when data obtained from the IMU indicates falling and, in turn, provides the voltage or charge needed for muscle stimulation. To test this balancing device, we built a bionic test-bed to mimic stimulation responses of dog hindlimbs [19]. This robot had two legs designed based on canine anatomy, with motorized hip and hock joints. Using this test-bed, we programmed Arduino to provide stimulation and balance the robodog to prevent falling. While our previous design showed excellent results regarding balancing of the robot using our proposed balancing strategies, the simple sensing core of the device made it difficult to use the real animal unless offline data was gathered from VICON for each individual animal patient. The previous device did not have a separate sensing core for gait detection of the robot/animal, and data identifying the robot gait were gathered from robot motion control sensors, not dedicated external sensors on the device. The device was not able to independently detect gait phases and anomalous gait events or measure the joint angles of the leg of the animal in real time. In our current study, we replace the Arduino board with a more powerful Teensy 3.2 processor board [20] and add three additional external IMUs to the sensing core of the device in order to track all the gait events and gait abnormalities of the animal in real time. The Teensy 3.2 is physically smaller in comparison with Arduino UNO, which makes it more suitable for a lightweight wearable device. It also provides additional I/O pins for external components, a more powerful computing processor for performance of complex operations, and two I\({}^{2}\)C buses to allow communication with external sensor devices. Using this microcontroller, we are able to attach four IMUs simultaneously and test new balancing strategies in a more advanced bionic test-bed with three motorized hip, knee, and hock joints. Test results for this advanced sensing core of the device is reported in this paper, and the robot motion control sensors are only used as a reference to validate the accuracy of the sensing core of our system. We show that our device can recognize which limb is at the stance/swing phase and identify the active limb needed to receive stimulation based on a selected strategy. We program our microcontroller to provide several different stimulation commands, based on proposed strategies. The robotic test-bed is used to mimic the responses. Four IMUs attached on the hip, femur, tibia, and metatararsus of the patient can obtain global information about patient gait in real time. Unlike our previous study, in which we used offline data obtained from VICON on abnormal gait motion to balance the patient body, here we use real-time data from the advanced sensing core of our device to identify abnormalities in the natural gait.