Wearable Sensory Apparatus for Real-Time Feedback in Wearable Robotics

: We describe the Wearable Sensory Apparatus (WSA) System, which has been implemented and veriﬁed in accordance with the relevant standards. It comprises the Inertial Measurement Units (IMUs), real-time wireless data transmission over Ultrawideband (UWB), a Master Unit and several IMU dongles forming the Wireless Body Area Network (WBAN). The WSA is designed for, but is not restricted to, wearable robots. The paper focuses on the topology of the communication network, the WSA hardware, and the organization of the WSA ﬁrmware. The experimental evaluation of the WSA incorporates the conﬁrmation of the timing using the supply current WSA proﬁle, measurements related to determining the less error prone position of the master device on the backpack, measurements of the quality of the data transfer in a real environment scenario, measurements in the presence of other microwave signals, and an example of raw IMU signals during human walking. Placement of the master device on the top of the backpack was found to be less error prone, with less than 0.02% packet loss for all the IMU devices placed on different body segments. The packet loss did not change signiﬁcantly in public buildings or on the street. There was no impact of Wi-Fi bands on the WSA data transfer. The WSA hardware and ﬁrmware passed conformance testing in a certiﬁed lab. Most importantly, the WSA performed reliably in the laboratory and in clinical tests with exoskeletons and prostheses.


Introduction
The number of people with impaired mobility needing the assisting devices is rapidly increasing. Among the various orthopaedic and prosthetic solutions, wearable robotic devices can provide functional benefits in terms of therapy and daily living [1]. In addition, the robotic devices can improve the physical capabilities of healthy people by enhancing their performance and extending the time of use in industrial and military environments. These devices have made considerable progress in the past decade [2]. However, the main challenges remain low weight, actuators, human-exoskeleton interface, safety, energy efficiency, and lower cost [3].
Wearable sensory technologies have the ability to provide real-world motion-analysis information, which allows mobility limitations such as reduced walking speed/endurance and reduced physical activity to be assessed and addressed in different environments [4][5][6][7]. Relevant research has been conducted mainly in laboratory or hospital settings over the past decade [8].
Typically, integrated sensors for monitoring a user's status are attached directly to the wearable robot or near the user's interaction points. In a local assessment, the sensors worn by the user promise a more accurate assessment of the current motion state and richer feedback information. This is the so-called Whole-Body Awareness (WBA) [9,10]. In this way, the detection of the user's intended movement can be of higher quality. Within FP7-ICT-CYBERLEG we introduced WBA Control (WBAC) [9]: the control of actions sampling 100 Hz in real time. The experimental evaluation of the WSA incorporates the confirmation of the data transfer timing using the supply current profile, it was found that the best placement for the master unit is at the top of the backpack, packet loss was verified for data transmission in four scenarios from laboratory to city streets, while operational performance was experimentally confirmed in the presence of other microwave signals.
The article is organized as follows. After the introduction, the methods section describes the WSA hardware and a reasonable part of the operating principles. Next, the experimental protocols are presented to (i) determine the optimal location of the master unit on the control backpack, (ii) evaluate the communication performance in the laboratory, in a public hall and in an urban environment, and (iii) investigate the acquisition of raw signals while walking. The results are presented in the form of tables and figures for all three protocols. All the test protocols are interpreted in the Discussion section, which finally converge in a Conclusion section.

Communication Network Topology
To collect information about the movement of human-body segments while walking, five real-time IMU motion tracking units were attached to the segments of a human's lower limbs, and a master device was attached to a backpack worn by the subject. The devices were configured to communicate in a star-shaped network topology, shown in Figure 1. The structure of the network itself is very simple. The devices communicate in master-slave mode over the UWB radio channel. The device at the centre of the network, i.e., the master device, coordinates the response of the remote IMU devices by sending the triggering packet to which each IMU device responds in a timed manner. The set of devices constitutes the WSA facility for providing real-time feedback of the sensory information while walking.

WSA Units Hardware
Each unit of the WSA for tracking the movements of human segments (IMU unit) contains the following electrical modules: (a) microcontroller for data-acquisition control and system processing, (b) IMU sensors, (c) power supply, Multiple remote devices communicate with the master device based on the principle of time-slot sharing. Since they communicate on the same radio channel and only one device can transmit data at a time, precise time synchronization between all the devices is a basic requirement for reliable data transfer. Time synchronization is achieved by a synchronization packet sent by the master device, to which the timers of the local IMU devices are aligned for a particularly delayed response.

WSA Units Hardware
Each unit of the WSA for tracking the movements of human segments (IMU unit) contains the following electrical modules: (a) microcontroller for data-acquisition control and system processing, (b) IMU sensors, (c) power supply, (d) radio module for wireless data transmission. Figure 2 shows the block diagram of a single IMU unit. The hardware design of the master and remote units IMU is electrically identical, and their operating mode is configured by a firmware setting. The 4 × 2.5-mm devices are housed in a wearable 3Dprinted plastic case that can be easily attached to clothing or human-body parts with elastic straps (see Figure 2c). The IMU size is 40 mm × 25 mm with weight of 5 g, production cost with all elements is around 75 EUR each in 100 pc. batch. Same size and weight is for 240 mAh Li-Po battery, cost in range of 6 EUR. The housing is dedicated custom design 3D printed with FDM technology. The IMU unit includes: (a) The STM32L476RG microcontroller (STMicroelectronics, Geneva, Switzerland) is a 80-MHz low-power ARM Cortex M4 processor with a 1-MB flash memory, where the 60-byte initialization data structure is stored. The service port to the chip is provided via an integrated full-speed USB-OTG 2.0 configured as a communication-class device. For the reliable operation of time-demanding tasks, two independent hardware timers are initialized. One is used for driving the precise 100-kHz sampling and communication loop and the other for timeline synchronization with the master. When operating in master mode only the loop timer is functional. To ensure a stable clock reference, an external 16-MHz ± 10 ppm crystal (Seiko Epson Corporation, Nagano, Japan) is integrated. The microcontroller communicates with the IMU sensor and the radio module via two separate SPI buses, while communication with the power-management chip goes via the I2C bus. (b) The MPU-9250 inertial sensor (Invensense, San Jose, CA, USA) is a multi-chip module consisting of two dies integrated into a single chip. One chip contains a 3-axis gyroscope and a 3-axis accelerometer. The other chip contains an AK8963 3-axis magnetometer. The gyroscope, accelerometer, and magnetometer provide 16-bit digital outputs over the SPI bus. The measurement range is user programmable from ±250 °/s to ±2000 °/s, ±2 g to ±16 g, and ±4800 µ T, respectively. In the WSA the sensors were configured to measure the angular velocity to within ±2000 °/s, the acceleration to within a scale range of ±8 g, and a magnetic field to within ±4800 µ T. A range of other The IMU unit includes: (a) The STM32L476RG microcontroller (STMicroelectronics, Geneva, Switzerland) is a 80-MHz low-power ARM Cortex M4 processor with a 1-MB flash memory, where the 60-byte initialization data structure is stored. The service port to the chip is provided via an integrated full-speed USB-OTG 2.0 configured as a communicationclass device. For the reliable operation of time-demanding tasks, two independent hardware timers are initialized. One is used for driving the precise 100-kHz sampling and communication loop and the other for timeline synchronization with the master. When operating in master mode only the loop timer is functional. To ensure a stable clock reference, an external 16-MHz ± 10 ppm crystal (Seiko Epson Corporation, Nagano, Japan) is integrated. The microcontroller communicates with the IMU sensor and the radio module via two separate SPI buses, while communication with the power-management chip goes via the I2C bus. (b) The MPU-9250 inertial sensor (Invensense, San Jose, CA, USA) is a multi-chip module consisting of two dies integrated into a single chip. One chip contains a 3-axis gyroscope and a 3-axis accelerometer. The other chip contains an AK8963 3-axis magnetometer. The gyroscope, accelerometer, and magnetometer provide 16-bit digital outputs over the SPI bus. The measurement range is user programmable from ±250 • /s to ±2000 • /s, ±2 g to ±16 g, and ±4800 µT, respectively. In the WSA the sensors were configured to measure the angular velocity to within ±2000 • /s, the acceleration to within a scale range of ±8 g, and a magnetic field to within ±4800 µT. A range of other IMU chips can be selected, as required [35]. (c) The battery is Li-Po type with a capacity of 240 mAh. It is equipped with a 10-kΩ negative-temperature-coefficient (NTC) thermistor and a protection circuit that effectively prevents overcharge, over discharge, overcurrent, and short circuit. In addition, an ADP5350 power-management unit (Analogue Devices, Norwood, MA, USA) combines a high-performance buck regulator for the Li-Po battery charging and three low-dropout regulators (LDOs). The operating parameters are programmable via the I2C bus. In the IMU unit the ADP5350 controls the charging of the battery provided by the USB type-B connector. Three LDO outputs provide 3.0-V power supply for the radio module, 3.3-V power supply for the inertial sensor, and 3.0-V power supply for the microcontroller and the rest of the circuit.  Figure 3 below shows the single structure of a UWB frame. The frame starts with the preamble, a repeating sequence of pulses used for frame detection, and the start frame delimiter (SFD), which together form the synchronization header (SHR). After the SHR, the Physical Layer Header (PHR) defines the length and the data rate of the Medium Access Control (MAC) portion of the frame. The MAC begins with the 9-byte MAC header, which contains the default frame control field, sequence number, network, source address, and destination address. The frame control field contains the frame-type-definition information, addressing fields, and other control flags. The MAC header is followed by the 22-byte MAC payload containing user-defined packet-type data, inertial sensor data, the packet counter and battery-status indicator. The MAC ends with a 2-byte footer MAC (MFR) with a packet checksum.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 6 of 21 structure of a UWB frame. The frame starts with the preamble, a repeating sequence of pulses used for frame detection, and the start frame delimiter (SFD), which together form the synchronization header (SHR). After the SHR, the Physical Layer Header (PHR) defines the length and the data rate of the Medium Access Control (MAC) portion of the frame. The MAC begins with the 9-byte MAC header, which contains the default frame control field, sequence number, network, source address, and destination address. The frame control field contains the frame-type-definition information, addressing fields, and other control flags. The MAC header is followed by the 22-byte MAC payload containing user-defined packet-type data, inertial sensor data, the packet counter and battery-status indicator. The MAC ends with a 2-byte footer MAC (MFR) with a packet checksum. According to IEEE 802.15.4-2011 the preamble can consist of 64, 1024 or 4096 symbols, the SFD can contain 8 or 64 symbols, the MAC can be up to 127 bytes long and the PHY is 19 bits long. The WSA packet frame was configured as the default data-type frame. The custom packet-type field determines whether the type of a packet is an instruction to the WSA entity or a response. The WSA was configured to operate on a radio channel with a central frequency of 4.5 GHz and a channel bandwidth of 500 MHz The data frames are transmitted at 6.8 Mbit/s with a 64-symbol preamble and non-standard SFD consist of 8 symbols. The UWB implemented according to the 802.15.4 standard is called the impulse-radio UWB (IR-UWB). The name comes from the high-speed pulses of RF. During the PHR and the data portion of the frame, the information bits are signalled by the position of the burst in a modulation scheme called burst-position modulation (BPM). Each data bit passes through a convolutional encoder to produce a polarity bit that is used to set the phase of the burst as either positive or negative. This component of the modulation is referred to as binary phase shift keying (BPSK). A symbol represents successive bursts that are decoded into two bits of information. Unlike the BPM/BPSK modulation used for PHR and MAC, SHR consists of individual pulses. The detection of SFD is a key event in the reception of a frame, as it marks the beginning of the PHY header and thus the change from preamble demodulation to BPM/BPSK demodulation of the PHR (and later the MAC). According to IEEE 802.15.4-2011 the preamble can consist of 64, 1024 or 4096 symbols, the SFD can contain 8 or 64 symbols, the MAC can be up to 127 bytes long and the PHY is 19 bits long. The WSA packet frame was configured as the default data-type frame. The custom packet-type field determines whether the type of a packet is an instruction to the WSA entity or a response. The WSA was configured to operate on a radio channel with a central frequency of 4.5 GHz and a channel bandwidth of 500 MHz The data frames are transmitted at 6.8 Mbit/s with a 64-symbol preamble and non-standard SFD consist of 8 symbols.
The UWB implemented according to the 802.15.4 standard is called the impulse-radio UWB (IR-UWB). The name comes from the high-speed pulses of RF. During the PHR and the data portion of the frame, the information bits are signalled by the position of the burst in a modulation scheme called burst-position modulation (BPM). Each data bit passes through a convolutional encoder to produce a polarity bit that is used to set the phase of the burst as either positive or negative. This component of the modulation is referred to as binary phase shift keying (BPSK). A symbol represents successive bursts that are decoded into two bits of information. Unlike the BPM/BPSK modulation used for PHR and MAC, SHR consists of individual pulses. The detection of SFD is a key event in the reception of a frame, as it marks the beginning of the PHY header and thus the change from preamble demodulation to BPM/BPSK demodulation of the PHR (and later the MAC).

I.
Operating Modes: The firmware configuration defines the device's operating mode, addresses, radio channel, and other parameters. WSA devices communicate in master-slave mode, i.e., two main modes of operation are supported. The device (Master Unit) connected to the Processing Unit operates in Master mode. The main task of the Master Unit is to control the remote devices, acquire and forward user data from the remote devices to the Processing Unit. The remote device IMU operates in slave mode and responds to the master's instructions. Its main task is to acquire the data from the built-in inertial sensor and send it to the master. II.
WSA Schedule: Figure 4 shows the main operations of the WSA setup (master and five remote IMU devices) in a single 10-ms sampling cycle (5). Before the acquisition is triggered, the remote devices are in "listening mode", while the master device switches the radio from idle to transmitting the synchronization packet (SYNC TX) (3). All the remote units receive the synchronization packet (SYNC RX) simultaneously, start the preconfigured delay timer, and acquire data from the inertial sensor (5). After the delay timer of the first remote device expires (delay 5 ms), the payload is transmitted (IMU 1 data TX). The master device receives the first packet (IMU1 data RX) and waits for the next one. The process repeats for the remaining remote devices. At the end of the 10-ms time frame, the Master sends the acquired data via a USB for processing. The delay timers are configured to transmit the data after the second half of the 10-ms time frame.

II.
WSA Schedule: Figure 4 shows the main operations of the WSA setup (master and five remote IMU devices) in a single 10-ms sampling cycle (5). Before the acquisition is triggered, the remote devices are in "listening mode", while the master device switches the radio from idle to transmitting the synchronization packet (SYNC TX) (3). All the remote units receive the synchronization packet (SYNC RX) simultaneously, start the preconfigured delay timer, and acquire data from the inertial sensor (5). After the delay timer of the first remote device expires (delay 5 ms), the payload is transmitted (IMU 1 data TX). The master device receives the first packet (IMU1 data RX) and waits for the next one. The process repeats for the remaining remote devices. At the end of the 10-ms time frame, the Master sends the acquired data via a USB for processing. The delay timers are configured to transmit the data after the second half of the 10-ms time frame.

III.
Sampling protocol-time-slot division, master side: The protocol for sampling sensors and communication between the WSA devices uses the simple principle of time-slot division. Each remote device was assigned its own time slot when responding with the sensor payload. To begin sampling, the master device sends "wake-up" packets via the USB port, whereupon the master's loop timer is started. The loop timer in the master device sends synchronization packets at intervals that are multiples of 10 ms. The synchronization interval is user configurable and was set to 30 ms. IV.
Sampling Protocol-Time-Slot Splitting, IMU side: upon successful reception of the "wake up" instruction by the remote devices, the device is woken up and

III.
Sampling protocol-time-slot division, master side: The protocol for sampling sensors and communication between the WSA devices uses the simple principle of time-slot division. Each remote device was assigned its own time slot when responding with the sensor payload. To begin sampling, the master device sends "wake-up" packets via the USB port, whereupon the master's loop timer is started. The loop timer in the master device sends synchronization packets at intervals that are multiples of 10 ms. The synchronization interval is user configurable and was set to 30 ms.

IV.
Sampling Protocol-Time-Slot Splitting, IMU side: upon successful reception of the "wake up" instruction by the remote devices, the device is woken up and placed in "listening mode" to receive further remote instructions. In "listening mode" the radio receiver is on and the unit consumes most of the battery power. If no command is received within 10 s, the unit will enter power-save mode. V.
Timer: Receipt of the synchronization packet by the remote devices synchronizes two timers and reads the data from the sensor IMU. One timer is used for loop tasks and the other is a delay timer.
The loop timer repeats the sensor sampling every 10 ms until the next synchronization packet is expected, at which point the device enters "listening mode". If communication with the master device is interrupted for any reason and the remote device does not receive a sync packet for 60 s, it will enter power-saving mode.
The delay timer has two functions. One is to ensure that the devices send the sensor payloads one after another with a delay to avoid collisions between the radio signals, since they are all on the same radio channel. Each remote device has a different delay set before transmission. The other timer is responsible for the energy efficiency of the device.
VI. Before transmission: Before transmission, the receiver is put into sleep mode by receiving the synchronization packet to reduce the power consumption. The sensor data is acquired from IMU and the user data is prepared for transmission. VII. After transmission: After transmitting three 10-ms time frames, the number of which depends on the configuration of the synchronization interval, the delay timer is reconfigured to turn on the receiver just before the next synchronization packet is expected so that the remote device can continue communicating with the master device. VIII. Instructions (USB, radio): WSA devices support interrupt-based commands via the USB port and via radio waves. The device is configured via the USB port with a user-defined command set through a graphical user interface or an advanced serial communications program. The commands include reading and writing variables to flash, waking up from power-save mode, starting and stopping the sensor data's acquisition, and various other commands for diagnostics. Some of the commands can be sent over radio waves, for example, to start and stop the sensor data's acquisition and communications. IX. Energy-efficient communication: Since the DWM1000 radio receiver consumes the most power, it is important to turn it off as soon as possible when not in use and turn it on as late as possible when reception is expected. X. Power on: The device is turned on by a switch that connects the battery and the node to the circuit. Upon power-up, the low-level hardware of the microprocessor and the user-defined registers stored in the flash are initialized. The user-defined flash register contains the pre-configured device address, timer parameters (pre-scaler and period), various radio parameters such as radio channel and output power gain, the scaling of the inertial sensor and the operating mode of the device (master or slave). XI. Power-save mode: After the initialization, the remote-control unit enters the "listening mode" in which the radio receiver is on and the unit waits for remote commands. If no command is received within 10 s, the device enters the power-saving mode. In the energy-saving mode, the device switches the radio receiver on and off alternately for 50 µs, every 3 s and 133 µs. During the times when the receiver is on, the device waits for the wake-up command. If the wake-up command is not received, the device remains in energy-saving mode. XII. Firmware details: The firmware was written in C language and supplied with the STM32 HAL drivers. The initial configuration of the microprocessor is based on STM32CubeMX version 5.0.1 and the library for STM32L4 version 1.11.0. The radio module DWM1000 uses the API driver version 4.00.06 from Decawave.

Results of the Experimental Validation
This section contains five topics validating the operation of WSA in real environment conditions. To provide a clear insight into the communication traffic between the IMU units and the master unit, and to demonstrate aspects of power consumption, the diagram of power consumption from the battery supply for the IMU units is provided first. Another issue that has arisen during the development is the reliability of the communications between each IMU unit and the master unit. The positioning of the IMU units is fixed according to the measurement requirements, while multiple placements are possible for the master unit. The communication error rate results for a range of master-unit placements are also shown. Third, data transmission errors can occur when you move from the pristine lab environment to the RF-crowded environment where a number of Wi-Fi, Bluetooth, and other protocols occupy the same or nearby radio spectrum and also interfere. For this reason, we tested our WSA system in the RF-crowded environment; the results can be found below. The WSA was tested for packet loss in the lab, while user running on a treadmill, in a public hall, and on the street. The exemplary measurement results for the IMU accelerometers, gyroscopes and magnetometers are presented at the end of the results section.

Assessment of WSA Current Profile
The WSA system is composed of one master unit, plus one to seven remotely placed IMU devices. In our case two of these IMU units are slightly different in a way that the insole signals are also being sampled and forwarded as a data payload via the UWB to the master unit. The master unit, as well as each IMU unit receive a supply voltage from independent LiPo batteries. To obtain very long discharge times for the batteries, the chips on the IMU unit are only supplied with the voltage for the minimum possible times and shut off for long periods in between. Three of the chips are the most energy demanding: the DWM radio module, the 9D sensory chip and the microprocessor itself. As described above in the description of the firmware, as well as more in detail in a sequence, five operational modes are interchanged in operation: power-save mode, waking-up phase, listening for remote instructions, synchronization interval and 10 ms of sampling frame.
These modes can be represented in a transparent way by measuring and verifying the current consumption of the IMU units versus time. In general, the Hall principle current probe allows for the non-contact measurement of supply currents. For the graphs shown in Figure 5, all five supply lines from five independent IMU batteries are bundled and passed through the Hall probe and then to each IMU unit. This gives a reading that is the sum of all five IMU supply currents. Independent supply currents can be estimated in this way when all the other currents are absent or constant at a given time. This measurement was made using the AM503A current-probe amplifier and the A6302 current probe from Textronix. The output of the probe amplifier is calibrated to 50 mA/div when the scale of the oscilloscope is set to 10 mV/div. To display the current of five devices simultaneously, the scale of the four-channel Keysight MSO-X 3014a oscilloscope was set to 50 mV/div (i.e., 250 mA/div). The top curve, starting on the left, first shows the current level, which is zero, even if it does not perfectly match one of the horizontal lines. Figure 5 shows two oscilloscope traces: the top one at a horizontal time division of 1 s/div, and the second one at a horizontal time division of 5 ms/div. Thus, the first trace shows a rough time scale, while the second one provides a precise insight into the timing. the scale of the oscilloscope is set to 10 mV/div. To display the current of five devices simultaneously, the scale of the four-channel Keysight MSO-X 3014a oscilloscope was set to 50 mV/div (i.e., 250 mA/div). The top curve, starting on the left, first shows the current level, which is zero, even if it does not perfectly match one of the horizontal lines. Figure  5 shows two oscilloscope traces: the top one at a horizontal time division of 1 s/div, and the second one at a horizontal time division of 5 ms/div. Thus, the first trace shows a rough time scale, while the second one provides a precise insight into the timing.  The oscilloscope traces in Figure 5 show the sum of the battery current for five remote-control devices from the energy-saving mode (1) and the wake-up phase (2), both in the upper trace, after which the radio receiver is switched on and the steady-state current consumption is the highest. From the "wake-up" phase, the devices enter the "listening" mode (3), where the devices wait for remote-control instructions via the UWB. The next phase (4) comprises a 30-ms synchronization cycle ending with the reception of a synchronization packet from the master device. After receiving the synchronization timestamp, all the remote devices turn off the radio receivers, resulting in a decrease in the power consumption. Between the 30-ms synchronization cycles, the remote devices transmit the sensor data, the power consumption is lower (operation mode 5). The IMU data transmission, which occurs every 10 ms, can be observed as five current spikes in operation mode 5.
The lower current trace gives an insight into the timing, in such a way that there is enough extra time in the 10-ms data sample frame (5) for a sixth, seventh or even more devices. Moreover, it is obvious that the 10-ms interval could be even shorter, without incurring any data-transmission costs. In this way the transmission rate can easily be increased beyond the presented example of 100-Hz sampling.

Determining the Less Error Prone Master Device's Location on the Backpack
The Decawave DW1000, a fully integrated single-chip UWB, features a low-power transceiver IC, which is IEEE802.15.4-2011 compliant. Data rates of up to 6.8 Mbps are supported, and the communication range can be extended up to 290 m @ 110 kbps 10% PER. The frequency bands are between 3.5 GHz and 6.5 GHz, which allows limited soft-tissue penetration. On the transmit side, the maximum transmit power range should be set so that the EIRP at the antenna is as close as possible to the maximum allowable level of −41.3 dBm/MHz to ensure that applicable regulatory standards such as FCC and ETSI can be met. On the receiver side, Automatic Gain Control (AGC) ensures optimum receiver performance by adjusting the receiver gain to the changing signal and environmental conditions. The level of the received signal is monitored so that automatic adjustments are made to ensure the optimum performance of the receiver.
Regardless of all the optimal settings of the transmitter and receiver, and even for a short communication range, the signal-strength fluctuations, reflections or electromagnetic obstacles in the vicinity can greatly increase the number of communication-packet errors. Even in line-of-sight (LOS) conditions, the multipath reflections can provide an additional usable received signal or increase the packet loss rate, on the one hand. In non-LOS (NLOS) conditions between UWB modules, where there are obstacles in the LOS path, the range is reduced mainly due to the attenuation of the received signal. All these effects can occur with UWB modules attached to the human body, which also attenuates the GHz signals.
While transferring accelerometer, gyroscope, magnetometer and insole payload data from the IMU units that are placed on various points of the body to the master unit, the placement of the master unit is of paramount importance. As an example, the master unit should not be placed inside a modern carbon-fibre housing that might be, for other reasons, a good choice for the exoskeletal controller.
To experimentally test several different placements of the master unit while searching for an less error prone placement, the subject was fitted with a set of WSA consisting of five IMU units attached to the subject's right/left hip, right/left thigh, and pelvis, as shown in Figure 6. The main unit was attached to different locations of the backpack (Table 1

Quality of the Data Transfer in a Real-Case Scenario
After the IMU units have been placed at the desired points on the body and the position of the master unit with best performances has been ensured, the data transmission error rate can still depend on several factors. Some are inherent in the internal settings of the DWM modules, and may be intentionally selected (or adjusted) by the system's de-  To begin the experiment, custom software written in Python was run on a portable aluminium-case computer located inside the backpack and connected via a USB cable to the main device located on the outside surface of the backpack. The backpack is made of 100% polyester fabric. The software captured the raw-data signals from the IMU sensors, counted the packet losses, and measured the received strength (RSSI) of the surrounding Wi-Fi signals. The sensor signals were post-processed using MATLAB software.
The Table 1 shows the numerical values of packet loss in a percentage during the 600s trials. The environment with best results proved to be a laboratory environment with no geometric obstacles and otherwise stable environmental conditions. The right thigh IMU unit achieved 0% packet loss; the other IMU units also had negligible values. The highest values for packet loss were found for the left and right shaft IMU units (4.8% and 2.0%, respectively). Most other readings were in the range from 0.005% to 0.02%, which corresponds to approximately 1 loss in 10,000 samples (or 1 in 100 s), which is acceptable. The placement of the master unit (6) proved to be less error prone, with a low packet-loss rate while the subject was walking in a public hall and on a treadmill. To begin the experiment, custom software written in Python was run on a portable aluminium-case computer located inside the backpack and connected via a USB cable to the main device located on the outside surface of the backpack. The backpack is made of 100% polyester fabric. The software captured the raw-data signals from the IMU sensors, counted the packet losses, and measured the received strength (RSSI) of the surrounding Wi-Fi signals. The sensor signals were post-processed using MATLAB software.
The Table 1 shows the numerical values of packet loss in a percentage during the 600-s trials. The environment with best results proved to be a laboratory environment with no geometric obstacles and otherwise stable environmental conditions. The right thigh IMU unit achieved 0% packet loss; the other IMU units also had negligible values. The highest values for packet loss were found for the left and right shaft IMU units (4.8% and 2.0%, respectively). Most other readings were in the range from 0.005% to 0.02%, which corresponds to approximately 1 loss in 10,000 samples (or 1 in 100 s), which is acceptable. The placement of the master unit (6) proved to be less error prone, with a low packet-loss rate while the subject was walking in a public hall and on a treadmill.

Quality of the Data Transfer in a Real-Case Scenario
After the IMU units have been placed at the desired points on the body and the position of the master unit with best performances has been ensured, the data transmission error rate can still depend on several factors. Some are inherent in the internal settings of the DWM modules, and may be intentionally selected (or adjusted) by the system's designer, such as the channel used, preamble length, data-transmission rate, pulse-repetition frequency, data rate, and packet duration. Based on these factors, the achievable communication range can be between a few m and 200 m, and the packet loss also varies.
In addition, external environmental conditions that are not under the user's control affect the achievable range as well as the packet loss. These external factors cannot be intentionally controlled. The ideal stable conditions could be in a laboratory environment where all the IMU unit and the main unit are not moving. The second testing case involves running on a treadmill in the same room. In this case the human moves the limbs having the connected IMU unit. Such movements could shadow or block the RF paths between the IMU units and the master unit, which can also affect the communication range as well as the packet loss. The third example, the environment of a public hall, brings new challenges due to the presence of other people moving around and the walls and architectural columns in the room. The fourth test environment was the example of a public street. In this scenario, a larger open space is added on one side, and moving metal objects in the form of bicycles and cars with different speeds on the other. The last case involves a number of Wi-Fi, Bluetooth and other protocols occupying and interfering with the same radio spectrum.
The packet-loss results for all four environmental conditions are shown in Table 2. The subject in this case was also equipped with a complete set of WSA consisting of five IMU units attached to the subject's right/left hip, right/left thigh, and pelvis, as shown above in Figure 6. Each of the four sessions lasted 15 min, and the sampling rate was 100 Hz for each IMU and each variable. As described above, the same laptop PC was in the backpack, the same acquisition software and data post-processing were used. The observation of the percentage packet loss in Table 2 can begin in the final raw state with the laboratory environment. The packet loss is in the same range for all five IMU units, i.e., 0.01%. Next, treadmill running is no worse for all five IMU units. The environment of a public hall brings slightly higher percentages, but remains in the same range as in the laboratory and on the treadmill. The urban street environment still provides low packet loss with four IMU units. The fifth, the pelvis IMU unit, is at 0.5% packet loss. In fact, the pelvis IMU unit is the only slightly elevated packet-loss figure.

Operation Performances in the Presence of Other Microwave Signals
The fourth experiment was conducted with a person moving in a public hall. In cases where all WiFi devices and IMU devices do not use the same frequencies, as is the case here, and also meet regulatory requirements, both services should work well independently. To further verify this, Wi-Fi reception strength (RSSI) for channels in the 2.4 GHz and 5 GHz Wi-Fi bands was recorded in parallel with WSA packet losses. The possible relationship between packet loss and interference was the main concern. The packet loss shown in the top graph in Figure 7 has different colours for five observed IMUs. Glitches that jump from 0 to 1 at different times represent lost packets. The percentage is given between the two corresponding lines that have the same colour. The middle graph in Figure 7 shows the measured RSSI for channels in 2.4 GHz WiFi, the bottom diagram shows the same information for the 5 GHz WiFi band. Sampling was performed in 100 ms using the computer's standard Wi-Fi network-communication interface.

Raw Data Signals from IMU Sensors
3D accelerometer, 3D gyroscope, and 3D magnetometer chips were housed in a package called the MPU-9250, which provides a range of functions. All the sensors are analogue, each equipped with a 16-bit AD converter. In addition to sampling the raw signals from the sensors, the data in the chip can be low-pass filtered and passed to a digital motion processor located in the same chip hardware. Detailed descriptions of the options can be found in the original specifications. In our case, this option is skipped in order to fully manage the data transmitted from the IMU units placed at different points on the body to the central motion controller.
To verify the acquired data and to verify the complete software bits from sampling to the master unit drivers, the example measurement results for the IMU accelerometers, gyroscopes and magnetometers are shown in Figure 8. In this particular case, the IMU sensors were not calibrated, the subject ran on the treadmill for 600 s while samples were taken every 10 ms. The subject was equipped with a complete set of WSA with five IMU units, as shown in Figure 6. The laptop PC was in the backpack as before, and the acquisition software and data post-processing were the same as above. Similar to the above experiments, the subject was equipped with a complete set of WSA, including five IMU units, as shown in Figure 6. The session lasted 10 min, and the sampling rate was 100 Hz for each IMU and each variable. The same laptop PC with a Wi-Fi interface was in the backpack. The same software was used for the data acquisition and post-processing. Figure 7 shows the traces of packet loss measured for the IMU units attached to the pelvis, right/left thigh, and right/left lower leg. Glitches appearing on the green, purple, yellow, orange, and blue traces represent single events of a single packet loss. Most traces are at the 0 mark, which represents no packet loss. Traces with jumps to the value 1 represent single packet losses. The middle graph shows the RSSI signal levels for different 2.4-GHz Wi-Fi band channels. The channels are identified by different colours. An index for the colour coding of the channels is not provided, as this would make Figure 7 even more complex without adding relevant information. The bottom diagram shows the RSSI signal levels for different channels in the 5-GHz Wi-Fi band. For the same reason as for the 2.5-GHz band, the colour traces are not coded.

Raw Data Signals from IMU Sensors
3D accelerometer, 3D gyroscope, and 3D magnetometer chips were housed in a package called the MPU-9250, which provides a range of functions. All the sensors are analogue, each equipped with a 16-bit AD converter. In addition to sampling the raw signals from the sensors, the data in the chip can be low-pass filtered and passed to a digital motion processor located in the same chip hardware. Detailed descriptions of the options can be found in the original specifications. In our case, this option is skipped in order to fully manage the data transmitted from the IMU units placed at different points on the body to the central motion controller.
To verify the acquired data and to verify the complete software bits from sampling to the master unit drivers, the example measurement results for the IMU accelerometers, gyroscopes and magnetometers are shown in Figure 8. In this particular case, the IMU sensors were not calibrated, the subject ran on the treadmill for 600 s while samples were taken every 10 ms. The subject was equipped with a complete set of WSA with five IMU units, as shown in Figure 6. The laptop PC was in the backpack as before, and the acquisition software and data post-processing were the same as above. Left side of each graph shows the curves for the first minute of walking, and right side of each graph shows the curves for the last minute of walking. Blue, orange, and yellow curves represent the x-axis, y-axis, and z-axis signals, respectively.
The first column in Figure 8 presents the 3D gyroscope signals for the IMUs attache to the pelvis in the top diagram and to the right/left thigh and right/left lower leg in th bottom diagrams of the same first column. In the same way, the second column lists th 3D accelerometer signals. The third column contains the 3D magnetometer signals for th same IMUs. It is important to note that in each of the 15 graphs, the left side shows th traces for the first minute of walking and the right side shows the traces for the last minut of walking. The colours blue, orange, and yellow represent the x-axis, y-axis, and z-ax signals, respectively.

Discussion
This section covers all five experimental topics presented in the Results section. Th first topic is the timing of the WSA traffic, shown by measuring the WSA current profile Left side of each graph shows the curves for the first minute of walking, and right side of each graph shows the curves for the last minute of walking. Blue, orange, and yellow curves represent the x-axis, y-axis, and z-axis signals, respectively.
The first column in Figure 8 presents the 3D gyroscope signals for the IMUs attached to the pelvis in the top diagram and to the right/left thigh and right/left lower leg in the bottom diagrams of the same first column. In the same way, the second column lists the 3D accelerometer signals. The third column contains the 3D magnetometer signals for the same IMUs. It is important to note that in each of the 15 graphs, the left side shows the traces for the first minute of walking and the right side shows the traces for the last minute of walking. The colours blue, orange, and yellow represent the x-axis, y-axis, and z-axis signals, respectively.

Discussion
This section covers all five experimental topics presented in the Results section. The first topic is the timing of the WSA traffic, shown by measuring the WSA current profile. Practically very important is the second topic with the measurement of the optimal position of the master device on the backpack and the third topic with measurements of the quality of the data transmission in a real scenario. The fourth was to check the data transmission in the presence of other microwave signals. At the end, measurements of the raw data signals from the IMU sensors are presented.
The oscilloscope traces in Figure 5 show the sum of the battery supply current from five remote IMU units. In the top plot, the first 3.5 s represent the "power-saving mode" labelled (1), where the current is zero, as expected. Just before 4 s and almost up to 5 s in this graph, the "wake-up" phase occurs (2). This phase transitions to the "listening mode," labelled (3) in the bottom graph of Figure 5. The receivers in all the DWM modules consume a larger portion of the constant current, and the traffic between the master and each IMU unit increases the circuit activity and the current consumption. This phase of listening for remote commands ends with a current glitch at the beginning of each synchronization interval (4). The synchronization interval begins with the synchronization packet sent by the master and received by each IMU unit. When the activity of IMU unit stops, the currents drop down to the response slots assigned to each IMU unit.
The bottom graph has 5 ms/div, while the IMU unit respond synchronously every 1 ms. These five IMU responses are evident as the sample frame window (5). After completion of, in this case, three sample frames, the new synchronization packets are sent from the master unit to synchronize all the IMU units on a common time scale. The 240-mAh LiPo battery in the IMU unit can support this kind of full activity, including data transmission, for more than 6 h. In power-saving mode with RX sniffing, the battery will last for several days. Of course, the battery is fully conserved when the hardware on/off switch is used in the case of saving.
The presented current supply profiles accurately confirm the scheduled activities on the master and IMU side, synchronization and data exchange, and appropriate timing, including various interruptions, sleep phases, and the chip function. Figure 6 and Table 1 in the Results section explain how the less error prone position of the master device on the backpack was determined. The IMU remote devices communicate with the master device via radio waves, either in direct or reflected mode. Even without the human body, the propagation models for WBAN have dominant factors that can affect the UWB channel [36]. Moreover, the coupling between the wearable antenna and the human body is dominant and degrades the performance of the antenna due to the presence of the body [37]. Second, the propagation channel in WBAN is affected by the continuous movement of the human body, which is due to the time-varying scattering of electromagnetic waves.
To avoid any interruption of communication and loss of data samples, it is important to position the master device appropriately with respect to the position of the IMU unit. The optimal number of IMU units implemented, the appropriate positioning points, and the IMU positioning combinations on the human body for activity detection were extensively studied before [38]. Using the master unit in the less error prone position is crucial for the proper operation of the whole WSA set. The results in Table 1 shows the measured values for packet loss. The observation of data loss is one of the possible indicators; another possible parameter is S/N (signal to noise ratio). The highest packet loss was observed at master position 1, near the pelvis at the bottom of the backpack. Similarly, position (8) without the backpack is closer to the human body. From the experimental results and the packet loss, it can be concluded that position (8), which sits firmly on the subject's back, is too close to the human body. Consequently, the radio waves cannot reach the most distant IMUunits on the lower legs on the other side of the subject's body.
For positions (2) to (5), the greatest packet loss was observed for the IMU units located on the subject's pelvis, which is the closest remote device to the Master. The reason for such a high packet loss is thought to be the aluminium casing of the laptop computer inside the backpack that was blocking the radio communications. Unfortunately, this was impossible to avoid during the experiments. The master unit's placement (6) was found to be less error prone, with a low packet-loss ratio in both cases, for the subject walking in the public hall and on the treadmill. Placement (6) avoids the limitations of UWB-WBAN, as revealed in the literature [39].
The quality of the data transmission for the real case are shown in Table 2. The WSA, as a system consisting of several separate units, must be robust and autonomous, and must work well both in laboratory and real-world conditions such as public buildings. The results of the packet-loss measurements from our experiment in a public hall and on the treadmill are not significantly different from the results of the laboratory tests. All but one of the packet-loss measurements are less than 0.05%. Is 0.05% an acceptable limit? This number would correspond to one lost packet in 20,000 samples, which would occur once in 200 s at 100 Hz. Our decision algorithms and those of our partners could work properly with such input data [9,10,13,33,34].
The literature identifies the limitations in reliable data transmission for a patient's freedom of movement and the avoidance of interference from other bands [39]. Data transmission in the presence of other microwave signals, as shown in Figure 7, was not expected to affect the WSA data transmission over UWB. The Wi-Fi operates in the 2.5-GHz and 5-GHz bands, which is a different frequency band than the WSA system uses. For example, UWB channel number 3, with a central frequency of 4449.8 MHz and a bandwidth of 499.2 MHz, is away from Wi-Fi in both the 5-GHz band with channels above 5-GHz, and the 2.5-GHz band with channels between 2496 MHz and 2690 MHz There is no overlap. Also, Wi-Fi uses a much lower bandwidth with a channel bandwidth of 20 MHz or 40 MHz, while UWB generally uses a bandwidth of 500 MHz, with two channels having a maximum bandwidth of 900 MHz The 2.5-GHz band is very busy with different services. In addition to Wi-Fi, the same frequencies are used by Bluetooth and Zigbee, for example. For comparison, the Zigbee radio used in the first project CL operates on the saturated, i.e., overpopulated 2.5-GHz band ISM and uses only 2 MHz of bandwidth.
In our measurements no correlation was found between the packet loss and the Wi-Fi band population. The times of the lost packets do not correlate with the occurrence of the Wi-Fi signals measured in a public hall. For the record: Wi-Fi signal levels were sampled every 100 ms, as opposed to 10 ms at the IMU. The traces showing packet loss in Figure 7, as well as the data presented in Tables 1 and 2, lead to the conclusion that WSA based on UWB data transmission is robust and usable in a real-world environment.
According to the studies discussed in [39], a WBAN based on IEEE802.15.4-2011, such as the WSA presented in this paper, can be used as a communication network for personal health applications. The technology behind this standard is now mature enough to be available in the market, making it a potential solution for dedicated low-cost WBAN systems, as shown here. The low packet-loss graphs shown in Figure 7 are not surprising. The WSA set conforms to the 802.15.4-2011 or IEEE802.15.6-2012 standard for WBAN and can be further improved [40]. The current WSA currently uses unsecured communication, as the implementation of AES256 security is possible. High-speed transmission is implemented at 6.8 Mbps, with a QoS channel-noise scan supported by firmware. The data protocol as implemented in WSA has no delay issues compared to some other published approaches [41]. Susceptibility to radio interference could become a factor if the currently free frequency band becomes more crowded.
WSA complies with the relevant standards for medical or health-related applications and devices such as biomedical class 2A for the clinical trial certification process and is in accordance with Directives 93/42EEC, 2007/47EC (e.g., standards EN60601, EN301489, EN62304). The tests were carried out in a certified laboratory within the framework of the EU-funded project CL ++ H2020 in the areas of EMI, electromagnetic immunity, ESD (electrostatic discharge) and electrical safety. A user manual, technical dossier, risk analysis, software validation and usability report were produced. There are several requirements that must be met, such as safety, low transmit power, low specific absorption rate (SAR), EMC, size and weight of the device. For portable devices, energy efficiency is also an important factor, resulting in a low power consumption and a long battery life for the devices.
The raw-data output from the IMU during the walking of an intact adult subject is shown in Figure 8. The sensors for this measurement were intentionally uncalibrated. The first column shows the data from the 3D gyroscope, the second column shows the data from the 3D accelerometer sensor, and the third column shows the data from the 3D magnetometer sensor. Each of the 15 plots in Figure 8 shows traces for the first-minute step on the left-hand side, and the right-hand side of each plot shows traces for the last-minute step. These are not calculated joint angles in the left and right legs. Using similar data with gradient-descent algorithms [42], we published a successful estimate of the IMU unit orientation based on an earlier version of WSA [9,10]. By implementing modelling, IMU-based angular measurements are becoming the standard [43]. Gait analysis and a number of other clinical applications rely on these accelerometer data [44]. Among them, an indirect estimation of the ground reaction forces and moments is realistic in the cases that are not realistic with another method [45,46].
Comparing the different traces in Figure 8, one can immediately see that the shapes for the first and last minutes of the walking are almost identical. It is important to note that the traces for the last minute are not shifted, i.e., they are not affected by drift. The drift could be primarily dependent on the MPU-9250 sensors. Other possible sources of interference could be in various aspects of the design of the electronic circuit of the IMU unit. Such ghost signals could not be found in the presented diagrams.
Using the clear signals seen in Figure 8, we can visually distinguish the steps in the diagrams shown. But this user observation is only the first impression. Most importantly, this data can be used for intention-recognition algorithms as recently presented in [34]. Intention-recognition algorithms used in exoskeletons and bionic prostheses first divide the collected gait-related signals into steps, from one foot contact to the subsequent foot contact of the same leg. For each subject, the left-and right-leg data are processed independently. This is followed by a phase representation of the steps and a unification of the dimension of the sensory data for steps with different cadence. The overall architecture of the algorithm is divided into three modules: (1) a steady/transition module that identifies a step as either steady state or transition; (2) a steady-state module that classifies the locomotion task of a steady-state step, (3) a transition module that recognizes the initial and final locomotion modes of transition steps. By using the WSA presented in this work, the classification of steady-state steps achieved a mean accuracy of 98.7%, and the classification of transition steps achieved a mean accuracy of 95.6% [34]. These numbers are consistent with the state of the art in the published literature and indicate that the WSA based on the IMU sensors presented performs adequately.

Conclusions
The WSA, consisting of a variable number of IMU units and the master unit communicating via UWB, was designed and implemented. A suitable firmware for 100-Hz real-time data transfer from each IMU to the master unit, allowing energy-efficient operation for 6 h or several days in idle mode, was developed and verified. Data loss when sending IMU sensor data from five IMU units in the test network to the master unit and then to the USB and PC was successfully measured and analysed. The conclusion is that the highest packet loss, 5% for the left lower leg IMU unit, was found at the master position near the pelvis at the bottom of the backpack. The less error prone placement for the master unit was on the top of the backpack, with less than 0.02% packet loss for all the IMU units attached to the pelvis, right/left thigh, and right/left lower leg. Most readings were in the range of 0.005% to 0.02%, which is 1 packet loss in 10,000 samples (or 1 packet in 100 s), which is acceptable. As shown in Section 2.2 ( Figure 4) and Section 3.1 ( Figure 5), synchronization at 100 Hz is strictly guaranteed.
The packet loss when using WSA while walking on a treadmill, in a public gym, in an urban street environment, and in a laboratory test is less than 0.05%, with one exception. The same version of the WSA was successfully tested in a certified laboratory as a Class-2A biomedical device according to the relevant guidelines. Subsequently, the same WSA, together with algorithms for motion phase detection, was also reliably used in clinical trials with wearable robots and prostheses as part of the CL ++ H2020 project. Some results have already been published in the literature.
As expected for the presence of Wi-Fi signals, we did not detect any occurrences of WSA data packet loss associated with the propagation of 2.5-GHz and 5-GHz Wi-Fi bands. There were rare cases of packet loss that could not be associated with Wi-Fi signals in a public space.
Overall, the WSA with IMU units and UWB has proven to be robust and highly reliable. Finally, two potential problems could arise in some cases. The currently unsecured communication might need to be updated by implementing AES256 security in the future. Second, if the currently unused or infrequently used RF bands from 3.5 GHz to 6.5 GHz gain more users, the interference problems might also require more attention.