The main purpose of the paper is to diagnose gait disorders using a developed miniature sensor. To this end, first, a motion sensor is developed that estimates the ankle and knee angles based on a proposed filter. Then, the correlation between the ankle and knee angles in gaiting is calculated and the rate of improvement is defined based on a threshold that is extracted using the data of several volunteers.
2.1 Angle estimation An accelerometer, a gyroscope, and a magnetometer are used to estimate the angular movements (Euler angles) [34]. However, the angular movements cannot be estimated by one of the mentioned sensors alone because there is a deviation in the output of the sensors [35]. For example, gyroscope data is valid for short periods and deviates over long periods. Also, accelerometer data is reliable in the long run [36]. A combination of accelerometer and gyroscope sensors can be used to estimate accurate roll ( ϕ) and pitch ( θ) angles. Nonetheless, the fusion of the two sensors is not enough to achieve precise angle movements in yaw ( ψ) angles [37, 38]. Thus, a magnetometer sensor is added to the two accelerometer and gyroscope sensors to improve the angle of yaw. Accordingly, Equation (1) is defined as follows to fusion accelerometer, gyroscope, and magnetometer data:q̇n,t=q̇g,t−1−λ(q̇m,t−1+q̇a,t−1).(1)
Where q̇g,t−1 is the quaternion derivative of the gyroscope data at time t - 1, q̇m,t−1 is the quaternion derivative of the magnetometer data, and q̇a,t−1 is the quaternion derivative of the accelerometer data. It is quite clear that the accelerometer and magnetometer data are added together and multiplied by λ, which is the attenuation coefficient, and finally reduced from the gyroscope data to eliminate the amount of deviation. The gyroscope sensor records three-dimensional angular velocity. In order to convert the three-dimensional angle to quaternion derivative Equation (2) is used [39]:q̇g,t=12qn,t−1⊗(wr,t−Ebg).(2)
Where wr,t is the raw data of the gyroscope, Ebg is the bias of the gyroscope, and qn,t−1 is the quaternion data in the previous period. It should be noted that the initial value of the gyroscope sensor is averaged in the range of 50 to 100 samples to eliminate the bias error, and then subtracted from the raw data. In the following, the accelerometer and magnetometer meter data is converted to quaternion derivative [40, 41]. To this purpose, first, the following equation is defined to eliminate gravitational acceleration:au,t=ar,t−ag,t.(3)
Where wr,t is the raw data of the gyroscope, Ebg is the bias of the gyroscope, and qn,t−1 is the quaternion data in the previous period. It should be noted that the initial value of the gyroscope sensor is averaged in the range of 50 to 100 samples to eliminate the bias error, and then subtracted from the raw data. In the following, the accelerometer and magnetometer data is converted to quaternion derivative. To this purpose, first, the following equation is defined to eliminate gravitational acceleration:ag,t=Mr,t−1100.(4)
Where Mr,t−1 is a rotational matrix and is defined as Equation (5) [42].Mr=q12+q22−0.5q2q3+q1q4q2q4−q1q3q2q3−q1q4q12+q32−0.5q3q4+q1q2q2q4+q1q3q3q4−q1q2q12+q42−0.5.(5)
The Earth's magnetic field can be considered as two vertical and horizontal vectors. The magnetometer sensors suffer deviations which is called hard and soft iron. First, the magnetometer data is modeled as follows:mu,t=mr,t−si,t−Hi,t.(6)
Where, mu,t is new magnetometer data, mr,t is raw magnetometer data, si,t is soft iron effect and Hi,t is hard iron effect. The soft iron effect is defined as Equation (7):si,t=Mr,t−1hx,t2+hy,t20hz,t.(7)
Where h is the compass data after removing the hard iron effect and multiplying in rotational matrix [42], as shown in Equation (8):hx,thy,thz,t=Mr,t−1mr,x,t−Hi,x,tmr,y,t−Hi,y,tmr,z,t−Hi,z,t.(8)
Now, Equation (9) is defined to convert the accelerometer and magnetometer quaternion data to their quaternion derivative, that Jm and Ja are Jacobian matrices of magnetometer and accelerometer [43, 44], and their values are as follows:q̇m,t+q̇a,t=Jmmu,t|Jm=dsi,tdq+Jaau,t|Ja=dag,tdq.(9)
Finally, the value of the new quaternion is obtained by integration of the quaternion derivative:qn,t=qn,t−1+q̇n,t▵t.(10)
Where ▵t is the data sampling rate. Then, the quaternion data is converted to Euler angles by Equation (11) to record the angular variation of the knee and ankle.ϕ=tan−1q2q3−q0q1q02+q32−0.5,θ=−sin−1(2q1q3+2q0q2),ψ=tan−1q1q2−q0q3q02+q12−0.5).(11)
After obtaining the angle values, the correlation of the two ankle and knee angles is measured by Equation (12). If the correlation is more than 0.5, it can be said that the foot does not move properly. However, if the correlation is less than 0.5, the foot angles work almost correctly in gaiting.qf=Corr(Ea,Ek).(12)
Where Ea and Ek are Euler angles of ankle and knee joints, respectively. Moreover, Euler angles consist of three angles of ϕ, θ, and ψ.
2.2 The developed systemThe proposed system, which estimates joint angles in the knee and ankle, includes two transmitters and one central node. Each of the transmitter sensors consists of an MPU-9250 [45], an NRF24L01 [46], and an Atmega8 [47], as shown in Figure 1a. These transmitters are supplied by a lightweight lithium polymer battery of 3.7 V, 380 mAh. The MPU-9250, NRF24L01, and Atmega8 have low power consumption, are low priced, and are very common in the market.
The schematic of the developed system: (a) transmitter and (b) the central node
The MPU-9250 sensor is an improved version of the MPU-9150 in a smaller chip with less power consumption [45]. This sensor includes three sensors of 3D accelerometer, 3D gyroscope, and 3D magnetometer. The variation ranges of the gyroscope can be in ±250, ±500, ±1000, and ± 2000 degrees per second. The sampling rate of the analog to digital converter can be programmed from 3.9 samples per second to 8000 samples per second [45]. There is also a low-pass filter in this area that can be adjusted in a wide range. The range for accelerometers is ± 2g, ±4g, ±8g, ±16g. The analog-to-digital converter is 16-bit for the accelerometer and gyroscope [45]. Nevertheless, the compass used in this sensor has a 13-bit analog-to-digital converter. The maximum measurable range of this compass can be between ±1200 microtesla. The MPU-9250 communicates with the processor via the I2C interface and sends all its information to a processor through this interface [45].
It may be said that any module can be used to transmit the obtained data wirelessly, but it is not true because one of the significant factors in the proposed study is being small. Another essential feature is the bit rate of data transferring to record every movement accurately. If the bit rate of data is low, the foot movements will not be simulated naturally. Another essential characteristic is the cost of this module. According to these features, an NRF24L01 module is used. The wireless module created an impressive improvement in power efficiency for a one-way and a two-way system, without adding complexity to the program [46]. As a result, power consumption is adequately low.
In the processor, factors such as small size, low power consumption, low cost, and flash memory are essential. According to the available processors in the market, an SMD microcontroller of Atmega8 with AVR series is employed. This processor has the smallest size among Atmegas and has 8 KB of flash memory, 512 bytes of EEPROM memory, 2 kilobytes of SRAM, 6 of analog-to-digital converter of 10-bit, 32 input and output ports, SPI connection, USART connection, serial two-wire connection (UART), internal and external interrupts, and three timers with operating voltage between 2.7 to 5.5 V [47]. Their frequency is from 1 to 16 MHz, and the power consumption of this processor is adequately low, which makes it suitable for this purpose.
The mentioned microcontroller processes the data in both the transmitter and the receiver. The transmitters include a microcontroller of Atmega8, an MPU-9250, and an NRF24L01 shown in Figure 2a–c. The data of MPU-9250 is read by the microcontroller via the I2C protocol and then is transmitted to the NRF24L01 through the SPI protocol. Initial registers are defined in the transmitter in Atmega8 to read data from the MPU-9250 and send it to the NRF24L01. For this purpose, these registers are defined based on data sheets in [45, 46]. Accordingly, the first address of the register is sent by Atmega8 on the I2C bus to read the data of MPU-9250, and then the value of the address is put back on the bus by the processor of MPU-9250, and finally, Atmega8 receives the data. In order to send the data to NRF24L01, some registers are defined in Atmega8 and after receiving the data MPU-9150 by Atmega8, it is sent to NRF24L01.
The prototype of the developed transmitter: (a) top layer and battery, (b) bottom layer, and (c) all of the components in a developed box. The prototype of the central node: (d) top layer and (e) bottom layer
The central node consists of an Atmega8, an NRF24L01, and a TTL to USB converter (Figures 1b and 2c,d), and the data is briefly taken by NRF24L01 using the Atmega8 and then sent to the serial port of a personal computer. Indeed, the initial registers should be defined in Atmega8 of the central node for receiving the data and correct communication with NRF24L01. These registers include specifying the transmitter and receiver address, specifying the address of each byte of transmitted information, determining the transmitter and receiver operating frequency, operating bandwidth, and bit rate of data, and acknowledgment [46], [48]. These registers are also defined in the transmitter for communication between Atmega8 and NRF24L01. After sending a few bytes of data by the transmitter, the data is received by the microcontroller (Atmega8) using NRF24L01 via the SPI bus. Then, the microcontroller sends it to the USB port of a personal computer through the UART protocol to display and perform complex mathematical operations that cannot be written in the microcontroller. The data is sent at a rate of 115,200 bits per second to the computer serial port. The bit rate is maximum for sending data through the serial port and helps to accurate monitoring of movements. According to the transmitted data of the accelerometer, gyroscope, and magnetometer, the sample rate is 50 Hz.
Comments (0)