• No results found

Platform development of body area network for gait symmetry analysis using IMU and UWB technology

N/A
N/A
Protected

Academic year: 2021

Share "Platform development of body area network for gait symmetry analysis using IMU and UWB technology"

Copied!
50
0
0

Loading.... (view fulltext now)

Full text

(1)

aster˚

as, Sweden

Thesis for the Degree of Master of Science in Engineering - Robotics

30.0 credits

PLATFORM DEVELOPMENT OF

BODY AREA NETWORK FOR GAIT

SYMMETRY ANALYSIS USING IMU

AND UWB TECHNOLOGY

Anders Persson

apn12011@student.mdh.se

Examiner: Mikael Ekstr¨

om

alardalen University, V¨

aster˚

as, Sweden

Supervisor: Martin Ekstr¨

om

alardalen University, V¨

aster˚

as, Sweden

(2)

Abstract

Having a device with the capability of measure motions from gait produced by a human being, could be of most importance in medicine and sports. Physicians or researchers could measure and analyse key features of a person’s gait for the purpose of rehabilitation or science, regarding neurological disabilities. Also in sports, professionals and hobbyists could use such a device for improving their technique or prevent injuries when performing. In this master thesis, I present the research of what technology is capable of today, regarding gait analysis devices. The research that was done has then help the development of a suggested standalone hardware sensor node for a Body Area Network, that can support research in gait analysis. Furthermore, several algorithms like for instance UWB Real-Time Location and Dead Reckoning IMU/AHRS algorithms, have been implemented and tested for the purpose of measuring motions and be able to run on the sensor node device. The work in this thesis shows that a IMU sensor have great potentials for generating high rate motion data while performing on a small mobile device. The UWB technology on the other hand, indicates a disappointment in performance regarding the intended application but can still be useful for wireless communication between sensor nodes. The report also points out the importance of using a high performance micro controller for achieving high accuracy in measurements.

(3)

contributed with during my work with this thesis. Also to Henrik Falk for helping me out with all the measurements that were conducted throughout the thesis. And to Lennie Carl´en Eriksson

(4)

Abbreviations

ADC Analog To Digital Converter

AHRS Attitude and Heading Reference System AOA Angle Of Arrival

API Application Programming Interface BAN Body Area Network

CAD Computer-Aided Design CCW Counter Clock-Wise CW Clock-Wise

DMA Direct Memory Access EMG Electromyogram

GPS Global Positioning System I2C Inter-Integrated Circuit

IEC International Electrotechnical Commission IMU Inertial Measurement Unit

JTAG Joint Test Action Group LED Light Emitting Diod MCU Micro Controller Unit

MEMS Microelectromechanical systems PCB Printed Circuit Board

RTL Real Time Location

RTLS Real-Time Location System RTOS Real Time Operating System SPI Serial Pheripheral Interface TDOA Time Difference Of Arrival TOF Time OF Flight

UART Universal Asynchronous Receiver Transmiter USB Universal Serial Bus

UWB Ultra Wide Band WP Work Package

(5)

Table of Contents

1 Hypothesis 6

2 Introduction 7

2.1 Problem Formulation . . . 7

2.2 Report content and structure . . . 8

3 Background 9 3.1 Body Area Network . . . 9

3.2 Vision . . . 9

3.3 Inertial Measurement Unit . . . 9

3.4 Ultra Wide-Band . . . 10

3.5 Global Positioning System . . . 10

3.6 Research in motion tracking . . . 10

3.7 Dead reckoning IMU/AHRS sensor fusion algorithm . . . 11

3.8 Commercial approach for motion tracking . . . 12

4 Aim 13 5 Method 13 5.1 Expected Outcomes . . . 14 5.2 Time plan . . . 14 5.3 Testing . . . 14 6 Implementation 16 6.1 Estimating the lowest sampling rate of the sensors vs accuracy . . . 16

6.2 UWB - DecaWave DW1000, DWM1000 and TREK1000 Evaluation kit . . . 17

6.3 IMU - MPU9250 . . . 18

6.4 First hardware iteration . . . 18

6.5 Second hardware iteration - Development of a customised hardware sensor node . . 19

6.5.1 Hardware architecture . . . 19

6.5.2 MCU - STM32F746VG . . . 20

6.5.3 Other components . . . 20

6.5.4 PCB and system design . . . 20

6.6 Software . . . 22

6.6.1 IMU data transmission algorithm . . . 22

6.6.2 Distance and IMU data transmission algorithm . . . 22

6.6.3 Multilateration algorithm for UWB RTL . . . 24

6.6.4 Dead rekconing IMU/AHRS sensor fusion algorithm used for tracking gait motion of the foot . . . 26

7 Results 27 7.1 Arduino Mkrzero - Testing sensor inputs . . . 27

7.2 Arduino Mkrzero - Testing sensor input and data transmission . . . 27

7.3 Arduino Due - Testing sensor inputs . . . 28

7.4 IMU data and distance algorithm with the Arduino Mkrzero sensor node . . . 28

7.5 Hardware testing of the Customised sensor node with the Arm Cortex-m7 . . . 28

7.6 Position measurement with UWB using the Trek1000 development kit . . . 29

7.7 Testing the Dead rekconing IMU/AHRS sensor fusion algorithm . . . 34

7.7.1 Corridor test . . . 34

7.7.2 The staircase test . . . 37

7.7.3 Testing 90 degree turns while walking . . . 40

7.7.4 Treadmill test . . . 42

(6)

9 Discussion and future work 45

(7)

1

Hypothesis

The hypothesis of this proposal is stated as followed,

”By using IMU’s for measuring acceleration and rotation, important features of gait can be measured that is important for e.g. stroke rehabilitations gesture recog-nition and sport achievements. Furthermore, complementing such a system with a UWB transceiver can improve accuracy of position and help forwarding the data to other systems”

(8)

2

Introduction

To be able to measure the motion of a human body when it performs some various activity could be of most importance in fields like medicine and sports. In medicine physicians or researcher could measure important parameters in gait for rehabilitation that without a measurement device only could be estimated by an observer making a qualified assessment [1]. While in sports a performer together with a trainer could analyse her/his performance while practising and easily discover areas of improvement in her/his technique. As the technology progresses with faster and more energy efficient micro controllers, more accurate sensors and a continuously decreasing form factor of components, the technology today is more mature then ever for measuring body movements with an body area network.

One parameter in medicine that physicians and researchers are interested in when analysing gait, is symmetry. Asymmetry in body coordination is a common problem that can be caused by several different reasons. One disease that often causes such a disability is stroke. When an individual encounter a stroke often symptoms of asymmetry in body coordination occur in the gait due to that regions in the brain are damaged, which also are the most common neurological disability in Sweden [2]. This can be a huge handicap for an individual and this often prevents them from living a normal life. Several studies show that symmetry in gait can be improved by relearning the lost coordination ability, if a proper rehabilitation method is used. An efficient measurement device which tracks the movement of the body could therefore be of use when rehabilitating stroke patients [3,4,5].

Other cases, recognition of gestures from an individual can be important when for instance controlling some sort of robotic arm or simply just to communicate. A individual who has lost his ability to speak can use gestures to communicate while a device senses these gestures and translates it into e.g. audio. Letting a device be able to interpret gestures could also help people who is suffering from disabilities by controlling for instance a robotic device which performs a desired task that would otherwise be impossible for the individual. Gestures is basically motions that is performed in a specific way and determined to have some meaning of expression. Therefore, having a smart device that can measure these motions at several points in a coordinated way and send the data for further analyse, would be of most importance when digitising the gesture [6,7,1].

2.1

Problem Formulation

A desired application for measuring movements of the body requires sensors that can measure a position in space and movements between the positions. A Inertial Measurement Unit (IMU) can handle the task of measuring acceleration and rotation which can be used to calculate movements in between places. Unfortunately, acceleration and rotation measurements are infected by errors due to random noise which introduces a fault in motion calculations [8]. Therefore, one solution for this can be to add an additional sensor data input to the calculations, helping the IMU to position itself in space. Such a device can be a Ultra-Wide Band (UWB) transceiver module. The UWB technology uses electromagnetic waves that are at least 500 MHz wide in frequency range for positioning itself in space and also to communicate. It’s strong resistance to outer interfer-ence’s makes it an accurate and reliable technology for short distances [9][10]. The gait analysis application also requires measurements of several points simultaneously if analysis of symmetry is desired. Therefore the device should have capabilities of interacting with other similarly devices in a Body Area Network (BAN) for ensuring simultaneous gathering of data and transmission to an end interface. Developing a sensor node with these capabilities comes with several challenges. First, an appropriate micro controller has to be chosen that can handle some basic calculations for e.g. filtering and also interact with sensors and a transceiver, all at an acceptable rate. Several sensor nodes should also be able to synchronise with each other so that no drift occurs between each devices clock’s. Each device has their own resonator that generates the clock signal which are tuned to a specific frequency, within a certain precision which can cause drift between different devices [11]. Also, starting each device at different points in time will cause them to be out of sync from each other if no reference source exists that the devices can synchronise against. The sensor node should be easy to connect with other nodes and one of the nodes should be able to send the data to a computer where it can be graphically displayed. The node responsible for sending data to

(9)

the computer can be constructed a bit differently if a high-speed link is needed for communication and interfacing. The node should also be able to act as a fixed node, letting it self to be positioned in a known coordinate for triangulating other sensor nodes on the measured object.

Given the problem formulation the following research questions arises,

Q1. How often is it necessary to sample data for accurate tracking of the body motions? Q2. What type of hardware is required for this type of application regarding appropriate

interfacing, speed, energy efficiency, form factor etc?

Q3. Can the UWB device handle both communication and positioning simultaneously without affecting the performance in accuracy and data acquisition rate?

Q4. Is it possible to have better accuracy of calculating movements if UWB and IMU technologies are combined?

Q5. What algorithms or technology should be used for synchronising the sensor data?

2.2

Report content and structure

Throughout this thesis hardware for collecting data from Inertial Measurement Units (IMU) and Ultra Wide-Band (UWB) transceivers will be developed and investigated. Also, suitable algorithms will be investigated and tested for the purpose of measuring motions from a human being while walking. A well thought method will be presented on how the work flow will be structured and how to achieve results. In the end representations of the results will be stated as well as conclusions from the results. At last, discussions of the results will be given and suggested future work will be mentioned that takes this research further.

(10)

3

Background

The art of motion tracking is something that is enticing researchers and companies more than ever before. Searching about the subject through databases like IEEE Xplore1 and ACM Digi-tal Library2 generates a huge amount of hits where researchers describes how they are trying to develop algorithms, refining hardware and trying out new approaches for motion tracking. Also, when searching a regular search engine like Google3 several companies pops up that sells differ-ent solutions for motion tracking, intended for hobbyists to professionals in sports and medicine. Recording motions even dates back to 1872, when Eadweard Muybridge settled an argument of how a horses gait looked like while trotting. The disagreement where to that if a horse has its all 4 hooves off the ground while trotting. Muybridge then arranged an array of 12 cameras that he sequentially photographed the motions of the horse, while trotting. With this arrangement he was able to prove that a horse all 4 hooves where indeed of the ground at one sequence of the gait cycle [12]. The main problem when developing equipment for motion tracking that the majority of researchers are trying to improve is often accuracy. Achieving high accuracy when measuring is something that puts high demands on algorithms and hardware. Sensors are not perfect and introduces in their own way noise and errors in the measurements [13]. Therefore often different sensors with different capabilities are used together for improving the results of the measurements [14]. Simple and easy systems that are cheap is something that also are desired, especially from the commercial market. For instance, a professional athlete that is trying to improve his technique through measuring his performance should be able to move as natural as possible and not be encumbered by sensor devices, to get as good measurement’s as possible.

Throughout this section several methods by researchers and companies are described that measures motions produced by humans. Also, a state of the art overview of sensors and concepts are explained that comprises the area of this thesis.

3.1

Body Area Network

A Body Area Network (BAN) is a short-range communication network that covers the vicinity and/or inside of a human body. It has sub-standards that is defined by the IEEE802.15 standard as a Wireless Body Area Network in IEEE 802.15.6-20112 [15] and Medical Wireless Body Area Network in IEEE 802.15.4 [16]. The wireless standard of a BAN uses the Industrial Scientific Medical (ISM) bands or other frequency’s that are allowed by regulatory authorities. In the network, nodes that consists of computational devices that can be integrated with sensors, actuators or gateways, communicates with each other.

3.2

Vision

Using cameras for tracking motion is a common and proven method. The camera requires line of sight with the object measured and the calculations are often demanding when it comes to processing power. Features that are easy to extract such as colours or corners in the image is used to identify objects which are to be tracked. A lot of software libraries are written for this purpose while one of the most famous is OpenCV4. OpenCV uses the Lucas-Kanade or the Horn-Schunk method for motion tracking [17].

3.3

Inertial Measurement Unit

An Inertial Measurement Unit is a device that uses a combination of sensors for measuring acceler-ation and angular velocity. It normally consists of a gyroscope, accelerometer and sometimes also a magnetometer. IMUs can be constructed in many different ways but the focus in this thesis will be on the Micro-Electro-Mechanical Systems (MEMS) because of its small size and low price.

A gyroscope measures the angular speed around an axis and the general gyroscope often has 3 orthogonal axis. Gyroscopes suffers from several measurement errors which grows linear in time

1http://ieeexplore.ieee.org/Xplore/home.jsp 2https://dl.acm.org/

3https://www.google.com 4https://opencv.org/

(11)

due to the integration that is necessary for getting the angular position. It has an ”Constant Bias” that is the average output from the sensor when no rotation occurs, which interferes with the signal. White noise also affects the signal and the surrounding temperature makes the noise vary. All these disturbances can cause the gyroscope to drift and normally an additional sensor input from an accelerometer or a magnetometer which can identify the magnetic north, is used to reduce the error. The manufacturer usually state’s how the gyroscope is affected by these disturbances so a correction can be made [8].

The accelerometer measures the acceleration in one direction and normally they are arranged in sensing the forces in 3 orthogonal axis. It has the same type of errors when measuring such as Constant Bias, White Noise, Temperature effects but the errors affects the output values more drastically compared to the gyroscope. When calculating the position from accelerometer output the value must be integrated two times with respect to time which causes the errors to growth exponentially. Except from compensating for the errors by the manufacturers error parameters, adding a positioning system such as an GPS or an UWB system or even repeatedly resetting the accelerometer at an appropriate time could help reducing the errors [8].

3.4

Ultra Wide-Band

The Ultra Wide-Band (UWB) radio is a technology which uses a wide frequency range with low power density and are capable of transmitting/receiving data or calculate the distance between two transceivers. The radio communicates with pulses and together with the low power density it is less detectable to other radio devices, that uses a narrow-band channel with a higher transmission power. In Sweden the UWB radio is defined to have a minimum bandwidth of 500 MHz, a maximum power density of -41.3 dBm/MHz and are allowed at the frequency’s 3.1 - 4.8 GHz, 6.0 - 8.5 GHz and 8.5 - 9.0 GHz [18,19]. It is also standardised in the IEEE 802.15.4a standard where communication parameters are determined such as 16 channels and 2 pulse repetition frequency’s [16]. One of the strong features with the UWB technology is that it is capable of calculating the shortest path of the radio signal between two transceivers, which makes it resistant to multi-path fading [20]. Furthermore, by knowing the shortest path of the radio signal it is also possible to calculate Time Of Flight (TOF), Time Difference Of Arrival (TDOA) and Angle Of Arrival (AOA) for ranging and localisation. This makes the UWB efficient for Real Time Location (RTL) systems where GPS signals can’t be reached. As a standalone technology, UWB systems usually have an accuracy of ±10cm. [21].

3.5

Global Positioning System

The Global Positioning System (GPS) is a system that consists of several satellites in orbit around Earth. The satellites continuously send out information about its time and position in a synchro-nised way. A receiver can then calculate its position to each satellite it receives a signal from, by knowing the speed of light, and then by multilateration with respect to all satellites, also determine its position on earth [22].

3.6

Research in motion tracking

IMUs is probably one of the most common sensors for tracking motions today. Although these sensors suffer from drift and noise in measurements, some scientists use IMUs as a standalone choice of sensor and improves the accuracy with different mathematical algorithms. Mannon Kok et al.[23] have chosen this approach to track motion on a human body where they implement a optimisation-based algorithm for preventing drift in the measurements. The algorithm consists of bio-medical constraints where the length and starting position of the limbs measured are known in the beginning. Together with 7 IMU sensors Mannon claims that that the algorithm makes an estimation of the limb positions that are drift free. The drawback is that they could only calculate the positions in relation to the known sensors and not pin point the coordinates of the limbs in a external reference frame. Also, the calculations where not fast enough to do in real-time as to that 10 seconds of samples took about 5 minutes to analyse. Oliver Woodman and Robert Harle [24] have tackled the one sensor type problem in a different way. They have strapped a IMU on a test

(12)

persons foot and together with a detailed 3-dimensional map and a Bayesian filter they manage to pinpoint the test subject within 0.73m to an accuracy of 95%. For getting the first reference point of the persons location in the building they use the existing wifi-nodes to calculate the coordinates and transform them into the map.

Using algorithms for compensating the problems that arises when only using one type of sensor is often computational heavy and not perfect in accuracy, as seen in the work made by Mannon and Oliver. Such aspects can lay foundations to the sensor fusion approach. Combining an IMU together with an Electromyogram (EMG) sensor that can measure the nerve impulses sent to the muscles, for recognition of gestures generated by the arm, hand and fingers is something that Marcus Georgi et al.[6] have done. The EMG sensor is placed just beneath the elbow and the IMU is mounted on the wrist on the arm where they want to measure. The sensor data is then fused together and Hidden Markov Models are used as a classifier algorithm to classify different gestures. They claim that they are able to recognise 12 gestures with an accuracy of 97.8%. Also, a comparison of the different sensors used alone are done in their paper to prove that the fusion technique performs much better.

IMUs is also often paired together with magnetometers for knowing the orientation and com-pensating for the drift that occurs by the gyro within the IMU. The magnetometer can sense the earth’s magnetic field or an artificial magnetic field that is generated by coils, helping the gyro out. Furthermore, IMUs are not able to locate its self in space and therefore methods where IMUs are combined with Globa Positioning System GPS as a complement, are usual today. GPS though has its flaws with its satellite signals be hard to detect in indoor environments. Therefore, researchers have tried to fuse IMUs together with other positioning technologies that are more suitable for indoor situations, like UWB technology [25,13,8].

J.A. Corrales et al. [26] have published a paper where they uses a Kalman filter to fuse sensor data from UWB transceivers from Ubisens5 and IMUs to locate where a test subject are located near a working robot, to avoid harmful situations. They have placed 4 fixed UWB transceivers in a room and the test subject wear a suite that contains 18 IMU sensors placed near each joint of the body and one UWB tag. The UWB transceivers uses TDOA (Time Difference Of Arrival) and AOA (Angle Of Arrival) for calculating the position relative to the fixed transceivers. The authors write that they improved accuracy in positioning up to 0.14m when combining the different sensor inputs and run the data through a Kalman filter.

A lot of scientific work has been done with IMU’s regarding motion tracking but other ap-proaches is also investigated. The UWB technology which where incorporate into the previous solution can also be used on its own for localisation and motion measurements. Richa Bharadwaj et al. [27] have shown that they can measure 21 points or UWB antenna spots, of a test subjects body within 0.5 - 2.5 m with an accuracy of 90%. The subject is allowed to move within a 1.8 x 1.8 x 1.8 meter big cube where the fixed UWB transceivers are mounted in the cube corners. The fixed UWB antennas are run through a network analyser and then TOF (Time Of Flight) calculations are don on a computer. The network analysers have a scanning time of 800ms of the frequency spectrum so the subject needs to hold each measured position for at least that sampling time to make a good measurement.

Vision is also one approach that is used for tracking motions. Cameras that are rigged in a room are connected to computers which calculates the motion measured. Often markers are used that the camera can detect easily. The vision solution is less flexible due to that it requires line of sight with the object that is measured [28,29].

3.7

Dead reckoning IMU/AHRS sensor fusion algorithm

Sebastian O.H. Madgwick et. al. at X-IO Technologies6have developed a gait analysis algorithm

for analysing motion of a IMU sensor placed on a foot. The algorithm uses Dead Reckoning and Attitude and Heading Reference System (AHRS) algorithm for preventing drift in measurements. The algorithm uses the stationary periods when walking where the foot stands completely still and applies the principal of Dead Reckoning. Dead Reckoning means that by knowing something like a

5https://ubisense.net/

(13)

fixed point it is possible to calculate the next fixed point. In this case the known position is where the foot stands completely still and hits the ground. When this occurs, it is possible to reset the accelerometer data and the gyro data. The AHRS part uses the gravity constant to prevent drift in orientation. No paper has been published on their work but they mention parts of it in their paper ”Estimation of IMU and MARG orientation using a gradient descent algorithm” [30].

3.8

Commercial approach for motion tracking

Solutions existing today for human motion tracking is not perfect regarding accuracy and flexibility but sufficient enough to make a commercial product of. Several companies have developed motion tracking equipment that are intended for professional’s and hobbyists in sports. Racefox7 have

developed a sensor intended for runners and skiers. The sensor is placed on the chest and measures forces generated when moving. The sensor then calculates several parameters related to those forces which are important for respectively sport and the user can access all the data through her/his smart-phone.

Xsens8is one of the leading companies when it comes to motion tracking. They offer a variety of products to regular consumer customers, researchers, industries, drones etc. One of their products are intended for body motion tracking and can be used for gait analysis. It comes in two versions where the first is sensors that the user straps on the body. The other one consists of a suit that has embedded sensors whit in it which also has the best technical performance. They claim that with the suit they can sample data at a rate of 240 Hz from all sensors, almost in real-time with a latency of 20ms. The downfall though comes with the large suitcase that must be in a maximum range of 20 - 150 meters. Not much technical information about the technique used are reviled but they mention sensor fusion and bio-medical constraints. They also mention that their product is immune to magnetic interference which indicates that they don’t uses a magnetometer fused with an IMU like seen in work by H. Hellmers et al. [25] but probably uses the bio-medical approach like in the paper [23] by Mannon Kok et al.

7https://www.racefox.se 8http://www.xsens.com

(14)

4

Aim

The aim for this master thesis is to investigate UWB and IMU technology together with necessary hardware and algorithms for creating a wireless sensor node that can be used in a BAN for tracking body movements. The work should bring important knowledge of existing capabilities for creating a wireless sensor node which can be built upon in future work for developing a complete system, regarding booth hardware and software.

5

Method

Because of the scientific work from e.g. J.A. Corrales et al. [26] and Mannon Kok et al. [23] etc. which uses IMU’s or UWB for measuring motion and the claim from companies like DecaWave9 regarding RTL with communication using UWB and Xsens10 with their motion capturing tech-nology using IMU’s, indicates that these technologies have great potential for measuring motion [31,32,33]. The combined technology of UWB and IMU should therefore be investigated for the purpose of developing a wireless sensor node for measuring motions from a human body.

The approach for this master thesis will be to divide the work into 2 Work Package (WP) where each concludes one phase of a complete BAN system for gait analysis. The work-flow for each WP will be iterative and build upon achievements in each package, all in a common goal for proving or disproving the stated hypothesis and answer the research questions.

WP 1 consists of developing the hardware platform for the smart node. An appropriate Micro Controller Unit (MCU) will be paired together with a IMU and a UWB transceiver module. The device should be able to run on a battery so a charging circuit will also be needed. A Universal Serial Bus (USB) port will be placed on the hardware for charging a battery and enable serial communication with the MCU. Some nodes may be of use of an Ethernet port if acting as gateway for the BAN. It should therefore be possible to add an Ethernet port to the sensor node. Beyond this a connection for a debugger device and LED’s will be mounted to facilitate the development. Writing code for testing out the hardware is also included in this WP. The work performed in WP 1 will contribute in answering research question 1 and 2. The strategy will be to iterative and gradually add and improve features regarding the hardware on a sensor node. Hardware components will be selected and wired together for testing performances and enable testing of algorithms. Focus will lie on finding the right components that are necessary for the desired features of the sensor node and determine its capabilities as a system.

WP 2 includes the software development for the sensor node. The sensor node should be able to process signal data so that no more data than necessary, occupies the network. It should also be able to communicate and synchronise with other nodes, for passing on data that are acquired simultaneously. Furthermore, it needs to be able to interact with all the hardware on the node and schedule all the tasks running on the MCU. For this a Real Time operating System (RTOS) and several Application Programming Interfaces (API) is needed to make sensors, transceivers and other accessories integrated with the MCU. Processing WP2 will contribute in answering research question 1, 3, 4 and 5. The iterative strategy of WP 2 will be to focus on algorithms working on a standalone node and then work towards expanding the system for BAN capabilities. Development or use of existing algorithms for collecting data will be implemented on the hardware in a first stage. When data is collected in a stable way, algorithms for processing the data will be investigated.

9https://www.decawave.com/ 10https://www.xsens.com/

(15)

5.1

Expected Outcomes

The expected outcome of this thesis is as followed,

• A verification or falsification to the hypothesis stated in this thesis.

• A sensor node platform that can support research within tracking motion of a human body. • The sensor node should have capabilities of interacting in a BAN.

• The sensor node should use IMU and UWB technology to be able to track motions. • Tests that focus on answering the stated research questions in this thesis.

5.2

Time plan

A time plan, which are seen in figure1, has been created which shows the approach of the master thesis work. Report writing will be done continuously throughout the thesis and the first 3-4 weeks the major part of the status and planning part will be written. Further on, a hardware development part and a software development part will be done together with iterative testing of all the parts of the system. At the end, focus will lie on the opposition, report writing and presentation of the thesis. The time plan in figure1specifies the dates and tasks that are schedule to each weak. The deadlines are marked with red and explained to the left.

5.3

Testing

Testing will be made for respective WP with a focus on answering the research questions and verify or falsify the hypothesis stated in this thesis. Each WP will be iterative developed so testing will occur repeatedly until the package have been investigated properly. The results and conclusions in this master thesis will be based on empirical measurements.

Testing of WP 1: When a ocular investigation is done of the node, measurement of resistance and voltage will be done to ensure that everything is in order. The interfacing of the hardware will then be tested through basic responses that is triggered by basic code. When a response of every component is achieved and the functionality works as intended the WP 1 can be recognised as a success. Also, research question 2 should be answered when the hardware is put together and are proven compatible with each other. It also strengthens an answer to question 1, because of the finished hardware it should be possible to test how fast data can be sampled from the sensors and thereby determine what is possible.

Testing of WP 2: This package will be tested with basic software testing and testing of algo-rithms. States in the code that occurs after defined actions, are tested to work properly. Data from the IMU and UWB are verified to be correct according to determined behaviours. The test in WP 2 strengthens the answer to research question 1 by investigating the results of data collected by the sensors together with different algorithms. Also, research question 3 could be answered because it is now possible measure rate performance of sending data and calculate distance with the IMU and UWB transceiver. Research question 4 can be investigated in testing the accuracy of each sensor and see if sensor fusion is a good alternative. WP 2 also comprises the area of synchronisation and could answer research question 5.

(16)

Figure 1: The time plane which shows the attended work-flow throughout the thesis. It visualises the different phases of the work with active time in green and deadlines in red. The Deadlines are explained in the red boxes to the left and the calendar dates are specified on the right.

(17)

6

Implementation

A number of hardware components and algorithms have been used for making scientific progress in this master thesis. An Arduino Due and a Arduino Mkrzero have been used for performance evaluation and data acquisition from a MPU-9250 sensor and a DWM1000 UWB transceiver. The Trek1000 evaluation kit have been used for investigating the positioning feature capabilities in 3-dimensional space. Components for a customised sensor node have been investigated and put together into a system.

6.1

Estimating the lowest sampling rate of the sensors vs accuracy

To get some sort of indication of how often the node must sample data for analysis of gait, a good method could be to consider the foot which is one of the fastest moving limbs during walking. By simplifying the problem and assuming that the foot only moves in 1 direction when walking, only forward and not upward, it is possible to construct a simple formula that takes walking speed and desired accuracy of measurement in cm as input and returns the needed minimum sampling rate. The concept is illustrated in figure2

Figure 2: Illustration of a human walking with the speed vectors of V w for walking speed and V f for the speed of the foot in red and the distance between the foots visualised as a yellow arrow.

First an equation for the speed of the foot as a consequence of the walking speed in km/h haw to be created as seen in equation1. When walking one foot is always still. Therefore, in our simplified problem, the speed of the foot have to be 2 times the walking speed and then by dividing the equation by 0.036 the speed will be in cm/s.

Vf[m/s] =

2Vw[km/h]

0.036 (1)

Then by dividing equation 1 by the desired accuracy in cm and considering that Nyqvist theorem of sampling rate requires that a signal have to be sampled twice as fast as the frequency of interest and then rearrange the equation, the following statement is created as seen in equation

2

Sampling rate[Hz] = 4Vw[km/h]

(18)

where Vw is the walking speed in km/h and a is the desired accuracy in cm.

As an example, a measurement of a test subject walking 3 km has been done with an GPS watch. The average speed that the subject walked with was 6.5 km/h which is quite high. If putting that into equation 3 together with a desired accuracy of 1 cm the following minimum sampling rate is given.

Sampling rate[Hz] = 4 ∗ 6.5

0.036 ∗ 1 = 722.22Hz (3) 722 Hz could be a demanding task for an MCU to achieve as demonstrated in further section in this report but if lowering the accuracy to 2 cm, it reduces the demand in performance heavily. As can be seen in equation4 the minimum sampling rate is instead 361.11Hz.

Sampling rate[Hz] = 4 ∗ 6.5

0.036 ∗ 2 = 361.11Hz (4)

6.2

UWB - DecaWave DW1000, DWM1000 and TREK1000 Evaluation

kit

DecaWave11 has developed an UWB transceiver chip called DW1000[34] which enables UWB

communication standardised in the IEEE 802.15.4a [16]. It has been embedded in the TREK1000 [35] for evaluation of its performance and in the DWM1000 [36] for an easy integration within a customised embedded system. The DW1000 supports 3 different data rates 110 kb/s, 850 kb/s and 6.8Mb/s over 6 different IEEE 802.15.4 standardised channels which can be seen in table1. The different channels are defined with a band width from 500 MHz up to 1331 MHz and have their respective centre frequencies from 3494 MHz up to 6489 MHz.

The Trek1000 evaluation kit consists of 4 units that each have a DW1000 chip, a STM32 MCU, a LCD display and a UWB antenna. DecaWave have developed software that is pre-compiled and as source code for doing Real-Time Location (RTL) demoing where the 4 units are used as 3 anchors and one tag. The anchors are units that are put in a fixed location, known to the system for calculating position of a tag in 3D space. The location data is then represented by a graphical user interface running on a PC where one of the anchors connects to and distributes the data.

The DWM1000 module is much smaller and measures 23x13 mm with an embedded antenna in compared to one unit in the Trek1000 kit that measures about 50x50 mm without an antenna. The DWM1000 is easy integrated with any kind of MCU that have access to an SPI communication interface. DecaWave provides a source code library written in C for managing the DWM1000 and depending on which type of MCU a developer chooses to use, only modifications to the procedure of reading and writing on the SPI bus have to be done in the provided library.

Channel number Centre Frequency fc (MHz) Bandwidth (MHz) 1 3494.4 499.2 2 3993.6 499.2 3 4492.8 499.2 4 3993.6 1331.2 5 6489.6 499.2 7 6489.6 1081.6

Table 1: List of channels with there respective centre frequency and bandwidth on the DW1000 chip. The channels are standarised within the IEEE 802.15.4a standard. The DW1000 uses the channels for both communication and RTL.

(19)

6.3

IMU - MPU9250

The MPU-9250 is an IMU sensor from Inven Sense that includes a 3 axis gyroscope, 3 axis ac-celerometer and a 3-axis magnetometer [37]. The gyroscope has a sensitivity scale range of ± 250◦/sec, ± 500◦/sec, ± 1000◦/sec and ± 2000◦/sec. It also includes a low-pass filter to get rid of unwanted noise. The accelerometer can also be set to detect different ranges and the fixed range settings are, ± 2g, ± 4g, ± 8g and ± 16g. It can also be used to trigger interrupts when sensing acceleration. The embedded magnetometer is an AK8963 magnetometer from Asahi Kasei Microdevices Corporation and it has a sensitivity range of ± 4800µT . Both the Analog To Digital Converters (ADC) for the gyroscope and the accelerometer can be set to a sample rate of 1000Hz while the ADC for the magnetometer can be set to 100Hz.

6.4

First hardware iteration

Several configurations with different hardware has been tested for investigating performance and develop software. Arduino Mkrzero has been used for interfacing a UWB sensor and a IMU sensor while a Arduino Due has been interfaced with an IMU sensor. Through this approach it is possible to get some sort of directions of which type of hardware a customised sensor node should have, for instance the rate which a node can collect and forward data. It is also possible to evaluate algorithms and collect sensor data.

The Arduino Mkrzero is a MCU board which breaks out all the features supported by the SAM D21 Cortex-M0+ 32 bit ARM MCU that are mounted on the board. The board runs at a clock speed of 48 MHz. Most effort in the first iteration is made on the Arduino Mkrzero IMU UWB sensor node, seen in figure 3. The node consists of 2 customised PCB modules that are manufactured, stacked with the Arduino mkrzero. On top of the Arduino mkrzero a DWM1000 breakout module is placed. Underneath the Arduino Mkrzero the MPU-9250 customised PCB module is placed. Together they act as a hardware sensor node for collecting data and transmit it wireless over UWB transmissions. The Mkrzero sensor node will not produce any high data sampling rates but it will be sufficient for much research in this thesis.

An Arduino Due, which runs at a higher clock speed, is also connected to a MPU92-50 for investigation of speed performance. The Arduino Due is an easy to start development platform that have several input/outputs for instance I2C, SPI, UART and it runs a Atmel ATSAM3X8E MCU whit an Arm Cortex-M3 embedded in the chip at 84MHz clock frequency. The Arduino Due configuration can be seen in figure13.

Figure 3: Arduino Mkrzero UWB IMU sensor node hardware configuration used for testing perfor-mance, collecting sensor data and evaluating algorithms for motion tracking. The node measures 80x30x30 mm.

(20)

Figure 4: An overview of the Arduino Due/Mkrzero system. The Arduino is connected to the MPU-9250 IMU via the I2C bus. The Mkrzero is also connected to a UWB transceiver and Sensor data can then forwarded by the UART serial interface or the UWB transceiver with the Mkrzero, to a computer.

6.5

Second hardware iteration - Development of a customised hardware

sensor node

For achieving higher performance and better functionality a customised hardware sensor node is designed and built. The sensor node is designed according to the criteria specified in figure5and uses the MPU-9250 IMU and the DWM1000 UWB transceiver for sensor input and transmission of data. Several components have carefully been chosen for the purpose of creating a wireless sensor node that can act in a BAN and collect data of position, rotation and acceleration. The components have also been chosen with the consideration of a self depended BAN that are of no need of any external processing power and capable of running a Real-Time operating system on each node. All the components are off the shelf and can be ordered from a well-stocked retailer. The node is then designed in a PCB Computer-Aided Design (CAD) software tool and the functionality is then tested and verified.

6.5.1 Hardware architecture

An intended system design is created with the aspects of distribute the required functionality of the wireless sensor node. The design consists of the following components: a MCU, UWB transceiver, IMU, 3 Light Emitting Diode’s (LED), Charger circuit, battery, Joint Test Action Group (JTAG) connector, Ethernet transceiver, Serial Peripheral Interface (SPI) bus, 2 Inter-Integrated Circuit (I2C) busses and a USB connector. The design is seen in figure5.

The MCU will be responsible for administration and signal processing of sensor data on the node. It will also manage the connection with other nodes through the UWB transceiver and be responsible for scheduling of tasks. The UWB transceiver will handle the communication with other nodes and measure the distance between them through TOF calculations. A IMU will be responsible for measuring acceleration, rotation and the strength of the magnetic field. Also 3 LED’s will be placed on the board for debugging and mediate special notifications from the device. To make the node completely wireless the battery and charger circuit is needed. The I2C and SPI bus are used for internal communication between the MCU, UWB transceiver and IMU sensor. The node is also programmed and debugged through the JTAG connector. The USB connector allows for the device to be charged from a 5 volt source and it also allows for Universal Asynchronous Receiver Transmitter (UART) communication.

For simplifying the development, the Ethernet connector is not implemented due to that it is not needed for investigating the research questions in the thesis. The intention is though that a finished product would have Ethernet possibilities and a selected MCU should have Ethernet capabilities.

(21)

Figure 5: The intended system design of the wireless sensor node. The orange nodes represents communication I/O’s, red power, green MCU and blue other components.

6.5.2 MCU - STM32F746VG

A modern STM32F746VG12micro controller from ST Microelectronics has been chosen as a

com-putational and organising unit to manage the sensors and forward data to other nodes. It is a power full MCU running at a maximum clock speed of 216 MHz with a typical current consumption of 476 µA / MHz at 3.3 Volt. The high clock frequency will allow for faster data collection and on board filtering algorithms, making high rate measurements possible. It also features several interfaces that are of most importance for this thesis such as low power modes, 2 internal oscillators of 15 MHZ and 32 kHz, 18 timers, 16-stream Direct Memory Access (DMA) controller, JTAG interface, 168 I/O ports with interrupt capability, 4 I2C communication busses, 6 SPI communication busses, 4 USART serial communication interfaces and an Ethernet interface 10/100 Mbit. [11]

6.5.3 Other components

A Torex XC6210 [38] has been chosen for regulating the voltage level from a battery and the USB port. The regulator takes 1.5 Volt - 6 Volt and regulates it to a stable 3.3 Volt level for powering the hardware on the PCB.

As a charging circuit the MAX1811 [39] component has been implemented. The charger mon-itors the voltage level on a single cell Li-ion battery and charges the battery when needed given that power is applied through the USB port.

For enabling an easy UART communication through the USB port the USB to UART chip CP2102N [40] has been selected. This will enable communication and debugging when connecting the sensor to a computer via its USB ports.

6.5.4 PCB and system design

The Printed Circuit Board (PCB) design is developed in National Instruments Circuit Design Suit CAD tool. This tool allows for simulation of the designed circuit and developing of ”blue prints” for the PCB. All the connections and the design is implemented according to the given instructions from respective datasheet of all the components. Furthermore, in additional to the usual EMC design criteria special considerations must be done regarding the MCU, IMU and UWB antenna [41]. ST electronics have written an application note called ”EMC design guide for ST microcontrollers” where instructions of how to meet the best EMC performance is described for the STM32F746VG MCU and other ST micro-controllers [42]. It also describes the tests that ST performs on their components to ensure that the International Electrotechnical Commission

12http://www.st.com/content/st

com/en/products/microcontrollers/stm32 − 32 − bit − arm − cortex −

(22)

(IEC)13standard is meet. One important aspect that the application note describes regarding the

PCB design is to avoid drawing any oscillating circuits under the MCU which can interfere with the functionality of the chip. It also describes how to properly mount the decoupling capacitors on the supply circuits to the MCU and recommends an electrolyte capacitor of 10-100 µ F to be used.

The placement of the MPU-9250 on the PCB is crucial for its functionality. The x, y and z axis of the MPU-9250 coordinate system for the accelerometer, gyro and magnetometer must be placed so that it is easy to locate the direction of the coordinate system. This is important when making measurements with the sensor node to easily interpret the data from the sensor. Therefore, the x and y axis have been placed parallel with the edges of the PCB. It is also important to place the sensor on a location on the PCB where minimally magnetic field produced by the electrical system on the PCB will disrupt the sensor. The magnetic field strength sensor embedded within the MPU-9250 will have problem to make correct measurements of the magnetic field surrounding the area if the magnetic field produced by the system itself is much stronger.

Important design criteria of the PCB when choosing the location for the DWM1000 is the placement of the UWB antenna. The space under and over the antenna has to be fully cleared from any conductive material and the edges of the antenna must have at least 10mm of nonconductive space in every direction to work properly.

A company called Cogra14 manufactured the PCB’s. Cogra offers express delivery of printed

circuit boards up to 2 layers with solder mask and placed via’s, provided that their design criteria are met which are specify on the Cogra web page. When ordering the cards, the Gerber files are required which can be exported from the National Instruments Circuit Design Suit tool15.

An overview of the interaction of every component on the developed sensor node can be seen in figure6. The red lines represent voltage sources for supplying the components with power and the green lines visualises the communication in between the components. In figure7 the complete sensor node is shown with explanations of component placement and connections.

Figure 6: A system overview of the constructed sensor node. Red arrows indicate voltage levels and green arrows indicates communication. All the components and I/O’s are specified in the blocks.

13http://www.iec.ch/

14http://www.cogra.se/produkter/

(23)

Figure 7: The finished PCB sensor node that was constructed throughout the thesis. The compo-nents placement and the connections for interfacing the hardware is described in the figure with red text. This is an implementation of the system in figure6. The node measures 50x60 mm.

6.6

Software

This section describes the algorithms that are used and implemented. An IMU data transmission algorithm is explained and implemented and also combined later on with a UWB distance cal-culation algorithm. Further on, the multilateration algorithm with UWB distance calcal-culations is explained which enables RTL. At last the Dead Rekconing IMU/AHRS sensor fusion algorithm is explained which enables for gait measurements with IMU data.

6.6.1 IMU data transmission algorithm

A simple algorithm for sending IMU data from a sensor node to another sensor node is constructed. The sensor node reads the sensor data from the IMU and send it to the other node as seen in figure

8. Through this algorithm it is possible to evaluate the IMU data as a standalone sensor for tracking motion.

Figure 8: State machine describing the transmission process between a sensor node and a receiver, with IMU data. The orange arrows describes the different events that can occur between the states and the green arrows describes the messages.

6.6.2 Distance and IMU data transmission algorithm

An algorithm for calculating the distance between 2 UWB transceivers and send IMU sensor data is constructed based on the DecaWave Real-Time Location System (RTLS) algorithm [43]. The algorithm is based on a hand shaking technique between 2 transceivers which records several time stamps throughout the handshaking process and with these time stamps it is possible to calculate

(24)

the distance. In figure9the hand shake procedure is visualised in state machines. One transceiver is called anchor and is placed in a fixed position. The other one is the sensor node which are supposed to be mobile and able to collect IMU sensor data. The sensor node starts by transmitting a POLL messages to the anchor and records a time stamp of the transmission. The anchor then reads a poll message, records a time stamp and then response with an POLL ACK massage to the sensor node. When the sensor node reads the POLL ACK message it sends RANGE to the anchor and times stamps of POLL ACK received, POLL sent and a stamp of when it transmits the data to the Anchor. It also reads and sends the IMU data in this state. The anchor then receives RANGE and all the data and records a time stamp of the event. Now the anchor calculates the TOF by using eq. 5, the distance using eq. 6and then sends a RANGE REPORT to the sensor node with the distance data. The distance is calculated by knowing the speed of light and the TOF.

Figure 9: State Machine describing the hand shake procedure that enables DWM1000 transceivers to calculate the distance between them self and transmit IMU data from the sensor node to the anchor. The orange arrows describes the different events that can occur between the states and the green arrows describes the messages that are sent between the sensor node and the anchor.

Round 1 = TimePollAckReceived − TimePollSent Reply 1 = TimePollAckSent − TimePollReceived Round 2 = TimeRangeReceived − TimePollAckSent

Reply 2 = TimeRangeSent − TimePollAckReceived TOF = Round 1 ∗ Round 2 − Reply 1 ∗ Reply 2 Round 1 + Round 2 + Reply 1 + Reply 2

(5)

(25)

6.6.3 Multilateration algorithm for UWB RTL

By using 3 or more UWB anchors and letting a UWB tag to do distance calculations between itself and each UWB anchor, it is possible to calculate the tags position in space. By knowing the anchors position from a fixed origin in space and the distance to each anchor from the tag, an equation system describing the relation of the coordinate system, anchors and the tag can be set up. Given a system with a known number of anchors A and one tag T with a fixed origin, as seen in figure10

Figure 10: A system representing a number of Anchors A and a Tag T within a coordinate system with their respective coordinate. d1, d2 and dn represents the distance vectors from each anchor

to the Tag.

Then the equation system seen in equation7 can be set up, describing the system with a Tag and several Anchors.

d21= (x − x1)2+ (y − y1)2+ (z − z1)2

d22= (x − x2)2+ (y − y2)2+ (z − z2)2

. . .

d2n= (x − xn)2+ (y − yn)2+ (z − zn)2

(7)

Expanding the equation system gives the following equations seen in8

d21= x2− 2xx1+ x21+ y 2 − 2yy1+ y12+ z 2 − 2zz1+ z12 d22= x2− 2xx2+ x22+ y2− 2yy2+ y22+ z2− 2zz2+ z22 . . . d2n= x2− 2xxn+ x2n+ y 2 − 2yyn+ yn2+ z 2 − 2zzn+ z2n (8)

Then by rearranging the equation systems, the following system is given in equation9

x2+ y2+ z2− 2xx1− 2yy1− 2zz1= d21− x 2 1− y 2 1− z 2 1 x2+ y2+ z2− 2xx2− 2yy2− 2zz2= d22− x 2 2− y 2 2− z 2 2 . . . x2+ y2+ z2− 2xxn− 2yyn− 2zzn= d2n− x 2 n− y 2 n− z 2 n (9)

(26)

Equation9is then re-written in matrix form, seen in equation10 G~x = b     1 − 2x1− 2y1− 2z1 1 − 2x2− 2y2− 2z2 . . . 1 − 2xn− 2yn− 2zn         x2+ y2+ z2 x y z     =     d2 1− x21− y21− z12 d2 2− x22− y22− z22 . . . d2n− x2 n− y 2 n− z 2 n     (10)

If the system only have 3 Anchors, multiplying the equation by G−1 from the left on both sides will solve the equation as seen in equation11

G~x = b G−1G~x = G−1b

~

x = G−1b

(11)

Otherwise, if the system have more than 3 Anchors, the equation will have more than 1 solution. If applying the Least Square method to the problem as seen in equation12, the closest solution to the problem will be given.

G~x = b GTG~x = GTb (GTG)−1GTG~x = (GTG)−1GTb ~ x = (GTG)−1GTb (12)

(27)

6.6.4 Dead rekconing IMU/AHRS sensor fusion algorithm used for tracking gait motion of the foot

The algorithm by Sebastian O.H. Madgwick et al. at X-IO Technologies16 is found on their GitHub page17 and constructed as follows; If feeding the algorithm with accelerometer and gyro data measured from a walking foot, the first procedure is to locate all the stationary periods when the foot hits the ground and stands completely still. This is achieved through calculating the magnitude of the accelerometer data, applying low pass and high pas filters and calculating the absolute value from all 3 axis of accelerometer data. Then a threshold determines which periods that are stationary and the periods are stored. The second phase of the algorithm is to use an AHRS method for compensation of rotational drift caused by the gyroscope. The AHRS method uses the gravity component measured by the accelerometer and removes the drift. The quaternions are then calculated from the accelerometer- and gyro-data. The third phase is then to integrate the acceleration of the translation into velocity. Here, also the integral drift between stationary periods is removed. Finally one more integration is done to calculate the position of the foot. A flow chart of the algorithm can be seen in figure11, describing the process.

Figure 11: Flow chart describing the IMU/AHRS Dead Rekconing sensor fusion algorithm. Ac-celerometer and gyro data from an IMU is feed to the algorithm where stationary periods are located, drift in orientation is compensated through an AHRS method and drift in translation is removed each time the foot steps onto the ground and becomes stationary.

16http://x-io.co.uk/gait-tracking-with-x-imu/

(28)

7

Results

Several tests are conducted for evaluating the work and answer the research questions stated in this thesis. Tests of the hardware and the algorithms are reported throughout this section.

7.1

Arduino Mkrzero - Testing sensor inputs

A speed test of polling data from a MPU-9250 IMU and transmitting it over a UART communica-tion at 1 Mega-baud is performed for testing the performance of the MCU. The system is visualised in figure13. Speed is measured by toggling a pin on the Arduino Mkrzero and reading the output on a oscilloscope, seen in figure12.

Figure 12: Measurements from the Oscilloscope while letting the Arduino Mkrzero poll data from the MPU-9250 IMU sensor and then toggle a digital output pin. One period is measured to take 4ms as seen in the figure.

The frequency was then calculated in equation13

frequency = 1 period frequency = 1

0.004s = 250Hz

(13)

The Arduino Mkrzero was able to poll data and transmit it over the UART at a speed of 250Hz which is a little to slow if considering the theorised experiment in section6.1.

7.2

Arduino Mkrzero - Testing sensor input and data transmission

A configuration with 2 Arduino Mkrzero, 2 DWM1000 and a MPU-9250 is also put together for developing algorithms, collect data for further examination and testing the maximum sampling rate. The first Arduino Mkrzero is connected to a MPU-9250 over the I2C bus which runs at 400 kHz and to a DWM1000 through the SPI bus. The Arduino can then poll data from the MPU-9250 and transmit data through the DWM1000. The other Arduino can then receive the data and forward it to a PC over a UART connection. A speed test is performed with this hardware configuration for sampling IMU data. The first Arduino polls data and sends it to the other Arduino through the UWB transceivers and the second Arduino transmits the IMU data to a PC over UART. By switching a pin on the receiver board high and low for each iteration of receiving and forwarding data, measurements of one complete cycle is measured to 15ms which corresponds to a sampling frequency of 67 Hz, calculated in equation14.

frequency = 1 period frequency = 1

0.015s = 67Hz

(29)

Figure 13: Visulaisation of the the setup with 2 Arduino Mkrzero, one IMU and 2 DWM1000 modules. The first Arduino polls data from the MPU-9250 sensor and transmits it through the DWM1000 module. The other Arduino then receives the data through its DWM1000 module and then forward the data over UART to a PC.

7.3

Arduino Due - Testing sensor inputs

A standalone test was performed to see how fast the Arduino Due could poll fresh data from all the axis x, y and z of acceleration, rotation and magnetic field strength from the MPU-9250 sensor. Code was written to commit the poll from the sensor and when finished it would toggle a digital output pin on the Arduino Due. The pin was then connected to an oscilloscope where the time of completing one cycle could be measured to 2ms:

The frequency was then calculated in equation15.

frequency = 1 period frequency = 1

0.002s = 500Hz

(15)

The Arduino Due was able to poll data at a speed of 500 Hz which is promising considering the stated example of minimum sampling rate given in section6.1.

7.4

IMU data and distance algorithm with the Arduino Mkrzero sensor

node

A test of implementing the algorithm described in figure 9 for measure the distance between 2 sensor nodes and sending IMU data to the other node was done. Unfortunately, the algorithm failed to work as intended. The distance calculating part succeeded but when adding the IMU data transmission into the algorithm, the distance calculated between the nodes was incorrect.

7.5

Hardware testing of the Customised sensor node with the Arm

Cortex-m7

Several measurements of voltages and electrical conductivity are performed on the node for verifying its basic functionality. Through this test it is possible to see that the components act as they supposed to in an electrical way i.e. every voltage level at each measured point is as expected. The voltage references can be seen in figure6. It is also possible to verify the connections between the PCB and the components. Also, verifications of all connections according to the data sheets are done. When these tests where passed a connection test with the Arm Cortex-m7 was done with a MikroProg STM3218 debugger programmer, to verify and see if the STM32F746VG MCU

responds as expected [44].

It was discovered that the re-flow oven did not manage to get the temperature high enough when heating the solder paste on the PCB and that resulted in poor connections, especially with the STM32F746VG chip. This was later on fixed with a flat soldering tip, flux and a soldering braid. Flux was applied to the feets of the component and the soldering tip was used to heat and

(30)

push the feet down on the PCB. Then a visual inspection was done to ensure that no led was shortening the feet of the component. If that where the case, a soldering braid was used to clean that up.

After these tests, parts of the basic functionality in hardware was verified. Communication between the components could unfortunately not be tested in this thesis due to that there was no time for developing the software drivers for the MCU and writing code for setting up the peripheral and both sequence on the MCU.

7.6

Position measurement with UWB using the Trek1000 development

kit

A test environment for measuring the accuracy of position and only considering 2D space x, y po-sition in space while moving and standing still using the Trek1000 development kit was conducted. The third one, z-axis, is not as reliable as x and y with 3 anchors due to that the equation given in section6.6.3gives 2 solutions in z and that the anchors are placed in parallel with the tag, making it hard to determine which solution is correct. This approach is done for increasing the accuracy in the x and y plane. First a test while carrying the UWB sensor on a test subject’s ankle while walking on a treadmill, was done. The other test was aimed for determine how great the fault in measurement was in the area where the first test was conducted.

Three anchors where placed in a room, two in the ceiling at a height of 2.4 meters and 4.6 meter in between them self. The third one was placed underneath one in the ceiling and was defined as the reference point (0, 0) in the reference frame of the coordinate system as seen in figure14. The mounting of an anchor in the ceiling can be seen in figure15.

Figure 14: A visualisation of the test area where the treadmill and accuracy test was conducted. The green dots represent the anchors with the 2 top ones mounted in the ceiling while the green in the bottom are located on the floor. The red one in the middle of the 2 ceiling anchors, located on the floor, represents the centre point on the x axis of the treadmill. All components are represented with their respective coordinates and distances between them.

Performing the walk test, the test subject walked with three different speeds, 1.8km/h, 3.6km/h and 5km/h, for 1 minute on the treadmill while recording data from the tags using the algorithm described in section6.6.3. The treadmill can be seen in figure 16and the tag that was mounted on the test subjects ankle can be seen in figure17.

(31)

Figure 15: This is how the fixed UWB anchors was mounted while conducting the treadmill test with a UWB tag placed on the ankle.

Figure 16: The treadmill where both UWB and IMU tests were conducted. Notice one of the fixed anchors in the background marked with a read circle.

(32)

Figure 17: A UWB tag placed on the ankle for measuring movements while walking on the tread-mill. The UWB tag was tightly fixed for avoiding any unwanted motions due to external forces.

(33)

As seen from the walking tests in figure 18, 19 and 20 the test subjects step length where measured by the Trek1000 device to be almost 3 meter while the real step length of the test subject was almost the length of the treadmill, i.e. 1 m. The treadmill was also parallel with the floor while the test data indicates that the subject walks upward a slope seen in the diagonal result.

Figure 18: Measurement of the ankle movement while walking on a treadmill at 1.8 km/h for 1 minute with an sample rate of 10 Hz. The real step length is approximately 1 m while the measured step length is up to 3 m.

Figure 19: Measurement of the ankle movement while walking on a treadmill at 3.6 km/h for 1 minute with an sample rate of 10 Hz. The real step length is approximately 1 m while the measured step length is up to 3 m.

(34)

Figure 20: Measurement of the ankle movement while walking on a treadmill at 5 km/h for 1 minute with an sample rate of 10 Hz. The real step length is approximately 1 m while the measured step length is up to 3 m.

The determination of the measurement error at different location in the test area was conducted through making measurements at 10 different fixed points and then compare those with the actual results measured by a folding rule. The error from the Trek1000 measurements are shown in figure

21. The black circles mark the position of the fixed anchors while each start of the pillars in the x, y plane indicates the position where the tag was placed for each measurement. Blue, red and green represents the error in measurement in meter for x, y and z.

Figure 21: x,y and z error measured in position in 3D space by the Decawave Trek1000 kit where the treadmill tests was conducted. Measurements were done at every meter in between the anchors at 0m above the reference plane from the ground and at 1m above the reference plane from the ground. The error is shown in the graph at each x and y position. The black circles mark the location of the anchors while every measurement point is located in the x and y plane where each fault vector starts.

(35)

All the measurements where conducted at a rate of 10 Hz which can be seen from the time stamps in the log file.

7.7

Testing the Dead rekconing IMU/AHRS sensor fusion algorithm

Several tests with the Dead rekconing IMU/AHRS sensor fusion algorithm is conducted for evalu-ating the feasibility of the algorithm and investigevalu-ating the hypothesis of this thesis. The first test is done by walking in a straight line in a corridor, the other one are done while walking up and down in a stair, another one when walking on a treadmill and the last one is done walking straight and taking 90 degree turns, forming a square. The Arduino Mkrzero sensor node with a MPU-9250 and a DWM1000 transceiver is mounted on the foot of a test subject, as seen in figure 23. The IMU data is then transmitted through the DWM1000 device and received by a DWM1000 receiver connected on a computer. The data is then collected and fed into Matlab19where the data is run

through the algorithm.

Figure 22: Placement of the IMU UWB Arduino Mkrzero sensor node. The node is tightly fixed to the top of the foot for as accurate measurements as possible. The node is powered by a USB connected powerbank.

7.7.1 Corridor test

First a simple test while walking straight in a 15 meter long corridor is performed to determine the behaviour of the algorithm. The results of the walk can be seen in figure23. Each step can be seen in the graph where it is denser between the symbols. The number of steps, 11, in the graph correlates with the number taken by the left foot of the test subject. However, the distance in the graph sums up to 10.5 m while the real distance is 15 meters.

Another corridor test is set up at a different location, seen in figure24. This time a distance of 10 meters is measured and the test subject takes 7 steps to finish the distance. Measurements are done by both the left and the right foot for comparison. The results are seen in figure25. On the left foot the distance walked where measured to 5.4m in the graph and on the right the distance was measured to 6.2 m, which is a little too short compared to the actual distance. The number of steps measured from the test was 7 which are correct.

(36)

Figure 23: A walk in a 15 m long corridor with the sensor on the left foot taking 11 steps while the Arduino Mkrzero IMU UWB sensor node collects IMU data and sends it over a UWB commu-nication link. The figure visualises the path walked which is calculated by the IMU/AHRS sensor fusion Algorithm described in section3.7and section6.6.4.

Figure 24: The corridor where a 10 meter long test where conducted. Each line on the floor represents 1 meter and the red lines represents the start and the finish. The test subject walked the distance with the sensor on the left and the right foot. The number of steps were also noticed during the test.

(37)

Figure 25: A walk with the sensor on the right foot and the left foot in the corridor seen in figure

24. The left graph represents the recorded motion from the left foot and the right graph represents the recorded motion from the right foot. Notice that the sensor drifted more to the right while carrying it on the left foot while it only drifted about 1m with the sensor on the right foot.

(38)

7.7.2 The staircase test

A test of walking up and down a staircase seen in figure26, is done. Measurements are conducted on both the left and the right foot while walking in the staircase. One step in the staircase measures 0.16 m high and 0.26 m deep while the whole staircase is 2 m high and 3 m deep and got 12 steps in total. In figure27 measurements from the left and the right foot are presented. The motion measured gives the impression of a test subject walking in a staircase. Looking at the data from figure27and28where the displacement in x, y and z is represented, the foot moves approximately 40-50 cm upwards compared to that one foot climbs 2 steps at a time and each step is 0.16 m high which results in 0.32 m of actual climb. Looking at the whole distance the foot moves 2.5 m forward and climbs about 2.5 m while the staircase is 3 meter deep (forward) and 2 m high (climb) in reality. In figure 29 a test walking down a staircase is presented. Although the algorithm performed as good as the other tests where the test subject walked upward the staircase when measuring the forward displacement, it could not capture the downward displacement. Instead, the algorithm represented the downward movement as a movement upwards 0.7 m.

Figure 26: The staircase where the test of walking in a stair was conducted. The staircase is approximately 3 meters deep and 2 meters high. Each step in the staircase is 0.27 m deep and 0.16 m high.

(39)

Figure 27: Measurements from walking upwards on the staircase seen in figure26. Measurements where conducted from the left and the right foot.

Figure 28: Walking upward the staircase seen in figure 26with the IMU on the right foot. The left graph shows the displacement in x, y and z of the IMU sensor and the right graph represents a 3D displacement.

(40)

Figure 29: Walking down the staircase seen in figure 26 with the IMU on the right foot. The algorithm performed poorly and could not capture the correct motion.

References

Related documents

46 Konkreta exempel skulle kunna vara främjandeinsatser för affärsänglar/affärsängelnätverk, skapa arenor där aktörer från utbuds- och efterfrågesidan kan mötas eller

För att uppskatta den totala effekten av reformerna måste dock hänsyn tas till såväl samt- liga priseffekter som sammansättningseffekter, till följd av ökad försäljningsandel

The increasing availability of data and attention to services has increased the understanding of the contribution of services to innovation and productivity in

Syftet eller förväntan med denna rapport är inte heller att kunna ”mäta” effekter kvantita- tivt, utan att med huvudsakligt fokus på output och resultat i eller från

Generella styrmedel kan ha varit mindre verksamma än man har trott De generella styrmedlen, till skillnad från de specifika styrmedlen, har kommit att användas i större

Parallellmarknader innebär dock inte en drivkraft för en grön omställning Ökad andel direktförsäljning räddar många lokala producenter och kan tyckas utgöra en drivkraft

Närmare 90 procent av de statliga medlen (intäkter och utgifter) för näringslivets klimatomställning går till generella styrmedel, det vill säga styrmedel som påverkar

Industrial Emissions Directive, supplemented by horizontal legislation (e.g., Framework Directives on Waste and Water, Emissions Trading System, etc) and guidance on operating