• No results found

Wireless Piezoelectric Horse Sensor System

N/A
N/A
Protected

Academic year: 2021

Share "Wireless Piezoelectric Horse Sensor System"

Copied!
66
0
0

Loading.... (view fulltext now)

Full text

(1)

Department of Science and Technology

Institutionen för teknik och naturvetenskap

Linköping University

Linköpings universitet

LiU-ITN-TEK-A--18/013--SE

Wireless Piezoelectric Horse

Sensor System

Sandra Pantzare

Elin Wollert

(2)

LiU-ITN-TEK-A--18/013--SE

Wireless Piezoelectric Horse

Sensor System

Examensarbete utfört i Elektroteknik

vid Tekniska högskolan vid

Linköpings universitet

Sandra Pantzare

Elin Wollert

Handledare Qin-Zhong Ye

Examinator Adriana Serban

(3)

Upphovsrätt

Detta dokument hålls tillgängligt på Internet – eller dess framtida ersättare –

under en längre tid från publiceringsdatum under förutsättning att inga

extra-ordinära omständigheter uppstår.

Tillgång till dokumentet innebär tillstånd för var och en att läsa, ladda ner,

skriva ut enstaka kopior för enskilt bruk och att använda det oförändrat för

ickekommersiell forskning och för undervisning. Överföring av upphovsrätten

vid en senare tidpunkt kan inte upphäva detta tillstånd. All annan användning av

dokumentet kräver upphovsmannens medgivande. För att garantera äktheten,

säkerheten och tillgängligheten finns det lösningar av teknisk och administrativ

art.

Upphovsmannens ideella rätt innefattar rätt att bli nämnd som upphovsman i

den omfattning som god sed kräver vid användning av dokumentet på ovan

beskrivna sätt samt skydd mot att dokumentet ändras eller presenteras i sådan

form eller i sådant sammanhang som är kränkande för upphovsmannens litterära

eller konstnärliga anseende eller egenart.

För ytterligare information om Linköping University Electronic Press se

förlagets hemsida

http://www.ep.liu.se/

Copyright

The publishers will keep this document online on the Internet - or its possible

replacement - for a considerable time from the date of publication barring

exceptional circumstances.

The online availability of the document implies a permanent permission for

anyone to read, to download, to print out single copies for your own use and to

use it unchanged for any non-commercial research and educational purpose.

Subsequent transfers of copyright cannot revoke this permission. All other uses

of the document are conditional on the consent of the copyright owner. The

publisher has taken technical and administrative measures to assure authenticity,

security and accessibility.

According to intellectual property law the author has the right to be

mentioned when his/her work is accessed as described above and to be protected

against infringement.

For additional information about the Linköping University Electronic Press

and its procedures for publication and for assurance of document integrity,

please refer to its WWW home page:

http://www.ep.liu.se/

(4)

Abstract

The domestication of horses took place at least 2000 BCE. Since then, horses have been used for trans-portation, agricultural work and even for warfare. Today, horses have been bred into world athletes, used worldwide in equestrian sports. However, these explosive performance horses present characteristics that make them prone to injuries leading to lameness. According to the insurance company Agria, more than 50 % of all reported injuries on horses in Sweden each year, are related to lameness. Using more ob-jective analysing methods can lead to earlier detection and decrease the occurrence of this kind of injuries. In this Master’s degree project, a horse sensor system was proposed, designed and manufactured as a first prototype. The system consists of a force measuring device and an external reader. The force measuring sensor itself is a piezoelectric printed sensor. The force measuring device senses, acquires and transmits the raw data to the external reader. The focus of this project was on the hardware- and software devel-opment of the force measuring device and the software develdevel-opment for the external reader. To develop and verify the algorithms, as well as the entire system concept, the CC1352R1 Launchpad from Texas Instruments was used.

The first results have indicated that the developed hardware and software of the force measuring device performs as expected. Also, important conclusions were drawn for both the force measuring device and the external reader. E.g., the force measuring device should fit the required physical dimension of the hoof sole, and the algorithms of the external reader should be improved in terms of data flow and memory usage.

To conclude, the project is a challenging application making use of modern wireless sensor technology and printed electronics.

(5)
(6)

Acknowledgement

We would like to thank our supervisor Qin-Zhong Ye and examiner Adriana Serban at Linköping Uni-versity for helping us during the project. We also want to thank Lars Roepstorff at Swedish UniUni-versity of Agricultural Sciences (SLU) who showed us around the campus in Uppsala to show their systems and discuss our proposed solution.

Last but not least would we want to thank RISE Acreo for giving us the opportunity to develop and realise our idea. Especially thanks to our supervisors Jessica Åhlin and David Nilsson for all your help and support which ensured that we had had the best prerequisites for successful results. Jessica for sharing our burning interest in horses and brought up another million ideas of additional technical solutions and David for holding the group together and focused on finishing the project.

(7)
(8)

Abbreviations

AC - Alternating Current ADC – Analog Digital Converter AUX - Auxiliary

BDS - Bluetooth Developer Studio BLE - Bluetooth Low Energy CCS - Code Composer Studio CPU - Central Processing Unit DC - Direct Current

EMC - Electromagnetic Compatibility GRF - Ground Reaction Force

GUI - Graphical User Interface HWI - Hardware Interrupts I/O - Input/Output

I2C - Inter-Integrated Circuit IC - Integrated Circuit IRQ - Interrupt Request LED - Light Emitting Diode MCU - Micro Controller Unit OS - Operating System PCB - Printed Circuit Board PDUs - Advertising Packets

PEA-M - Printed Electronics Arena Manufacturing PDF - Portable Document Format

RAM - Random Access Memory ROM - Read Only Memory

RISE - Research Institutes of Sweden RF - Radio Frequency

RTC - Real Time Clock

RTOS - Real Time Operating System SC - Sensor Controller

SCS - Sensor Controller Studio SDK - Software Development Kit

SLU - Svenska Lantbruksuniversitetet (Swedish University of Agricultural Sciences) SPI - Serial Peripheral Interface

SWI - Software Interrupts TI - Texas Instruments

UUID - Universally Unique Identifier QFN - Quad Flat No leads

(9)
(10)

Contents

1 Introduction 1

1.1 Background . . . 1

1.1.1 Lameness . . . 2

1.1.2 The Master’s degree Project Idea . . . 2

1.2 Problem Definition . . . 3

1.2.1 Research Questions . . . 3

1.3 Delimitations . . . 3

1.4 Challenges . . . 4

1.4.1 Under the Hoof . . . 4

1.4.2 Signal Processing of Sensor Data . . . 4

1.4.3 Wireless Communication . . . 5

1.5 Report Structure . . . 5

2 Horses 7 2.1 The Movement Aperture of Horses . . . 7

2.2 Objective Gait Analysis . . . 8

2.3 Implementation of Horse Locomotion Surveillance . . . 9

3 Theory 11 3.1 Components and Materials . . . 11

3.1.1 Accelerometer and Gyroscope . . . 11

3.1.2 Antenna . . . 12

3.1.3 Flash Memory . . . 12

3.1.4 Energy Harvesting . . . 13

3.1.5 Printed Piezoelectric Material . . . 14

3.1.6 Microcontroller . . . 16

3.2 Bluetooth Low Energy . . . 17

3.2.1 Attributes . . . 18

3.2.2 The Attribute Protocol . . . 18

3.2.3 The Generic Attribute Profile . . . 19

3.2.4 The Generic Access Profile . . . 19

3.2.5 Advertising and Scanning . . . 20

3.2.6 Services . . . 20

3.3 Software Concepts . . . 20

3.3.1 Real-Time Operating System . . . 20

3.3.2 Semaphore . . . 21

3.3.3 Interrupts . . . 21

3.4 Development Environments . . . 21

3.4.1 Altium Designer . . . 21

3.4.2 Bluetooth Developer Studio . . . 22

3.4.3 Code Composer Studio . . . 22

3.4.4 MATLAB . . . 22

(11)

4 System Design 23

4.1 System Overview . . . 23

4.2 Master Unit: Hardware . . . 24

4.3 Master Unit: Software . . . 25

4.4 Hoof Sensor System: Hardware . . . 27

4.4.1 Component Research and Selections . . . 28

4.4.2 PCB Module Design . . . 30

4.5 Hoof Sensor System: Software . . . 32

4.5.1 Sensor Integration . . . 34

4.5.2 Saving Sensor Data . . . 37

4.5.3 Sending Data . . . 37

4.5.4 Log Files . . . 38

5 Prototyping and Performance Evaluation 39 5.1 Prototype Manufacturing . . . 39 5.2 Prototype Evaluation . . . 40 5.2.1 Signal Measuring . . . 41 5.2.2 Target Connection . . . 41 5.2.3 Sensor Response . . . 41 5.2.4 Antenna Measurement . . . 43 5.2.5 Energy Tracer . . . 43

6 Discussion and Future Work 47 6.1 Future Work . . . 47

7 Conclusion 49 7.1 Summary of the Project . . . 49

7.2 Research Questions . . . 49

7.2.1 Outcome the Master’s degree Project . . . 50

(12)

List of Figures

1.1 Performance horse in trotting, Only Mad Money. Photographer: Matilda Persson. . . 1

1.2 Placement of the devices in relation to the horse and the rider. Photographer: Sandra Pantzare. . . 2

1.3 Simplified block diagram of the Horse Sensor System. . . 3

2.1 Illustrations of the most common gaits of horses and the gait stances, A Walking, B -Trotting, C - Galloping, D - GRF-vectors in blue and acceleration in red, generated during the gait stances. . . 7

2.2 Old patents with similar ideas as the one in this project, A - Devices relating to hooves (1976), B - Electronic animal hoof force detection systems (1987), C - Polymer piezoelectric sensor of animal foot pressure (1985). . . 8

2.3 Design of a dynamometric horseshoe used for research. A - Fitted to left hoof with piezo-electric sensors sandwiched in the shoe, B - Wires connected to system mounted on top of the horse. . . 9

3.1 Block diagram of MPU-6500. . . 11

3.2 Typical radiation patterns of the antenna. . . 12

3.3 Block diagram of MX25R6435F. . . 13

3.4 Block diagram of LTC3588. . . 13

3.5 Crystals: A - Before polarisation, in random order, B - After polarisation. . . 14

3.6 PyZoFlex sensors: Layer structure, (left), measured displacement-electric field hysteresis response, (right). . . 14

3.7 Voltage output when pressure applied sensor. . . 15

3.8 A - Sensor signal from PyzoFlex sensor, B - Estimated pressure applied to a PyzoFlex sensor. 15 3.9 Linear relation between voltage output and applied pressure to a sensor. . . 16

3.10 Typical differences of analog-to-digital converter (ADC) current consumption using the CPU and the sensor controller. . . 16

3.11 Block diagram of CC1352R1. . . 17

4.1 Block diagram of the proposed Horse Sensor System, with the two subsystems Master Unit and the Hoof Sensor Systems. . . 23

4.2 An overview of the CC1352R1 Launchpad. . . 24

4.3 Block diagram of connections to the Master Unit, grey boxes are excluded from the project. 24 4.4 First window in Multi Role menu shown in PuTTY terminal. . . 25

4.5 Flowchart for the Master Unit algorithm. . . 26

4.6 Shoe on a horse sole, where the shoe will be closest to the ground, and the sole will be placed between the horse hoof and the shoe. . . 27

4.7 Block diagram of the Hoof Sensor System hardware. . . 28

4.8 A - Piezoelectris sensor sheet, printed at PEA-M, B - Horse sole, C - Horse shoe. . . 29

4.9 Schematic of the PCB module. A - Energy harvesting (LTC3588), B - Header for sensors, C - Header for JTAG, D - MCU (CC1352R1), E - Chip antenna, F - Accelerometer and gyroscope (MPU6500). . . 31

4.10 Top layer of the PCB module to the left, and bottom layer to the right. A - Energy harvesting (LTC3588), B - Header for sensors, C - Header for JTAG, D - MCU (CC1352R1), E - Chip antenna, F - Accelerometer and gyroscope (MPU6500). . . 32

4.11 Flowchart for the Hoof Sensor System algorithm. . . 33

4.12 Code for initialising the ADC and scheduling the task. . . 34

(13)

4.14 Sensor responses from the sensor sheet using the SCS algorithm, where the colours corre-spond to the sensors on the sheet. . . 35 4.15 Visualised sensor response of applying mechanical stress to sensor corresponding to

out-put.adcValue[1] in SCS. . . 36 4.16 Code for initializing semaphore and starting the SC task. . . 36 4.17 Code to sample and save sensor data using the sequence number. . . 37 4.18 Code to send the data over the characteristic. The variables called Sensor1 to Sensor5

contains the sensor data. . . 38 5.1 Test card manufactured at PCB lab, campus Norrköping. . . 39 5.2 PCB of the Hoof Sensor System. A - Energy harvesting (LTC3588), B - Header for sensors,

C - Header for JTAG, D - MCU (CC1352R1), E - Chip antenna, F - Accelerometer and gyroscope (MPU6500). . . 40 5.3 Hoof Sensor System device including PCB module connected to sensor sheet, on top of a

sole. . . 40 5.4 PCB module connected to debugger on a Launchpad. . . 41 5.5 Output voltage of the piezoelectric sensor sheet, when measuring the sensor response with

an oscilloscope. . . 42 5.6 Measurement setup, when measuring the sensor response of the piezoelectric sensor sheet,

with the PCB module. . . 42 5.7 Output voltage when measuring the sensor response with the PCB module. . . 43 5.8 Vertically measured antenna radiation of PCB module, A - PCB module in free space, B

- PCB module in a rubber sole, on a metal horseshoe. . . 43 5.9 The view in CCS with the energy tracer enabled. . . 44 5.10 Results with the clean Simple Peripheral project with A - the LP with debugger, B - the

LP without debugger, C - the PCB module connected without debugger. . . 44 5.11 The results for the Hoof Sensor System algorithm on A - the LP, B - PCB module. . . 45 6.1 Anticipated dimensions of an optimised Hoof Sensor System device. . . 47

(14)

Chapter 1

Introduction

This report is a result of a Master’s degree project at RISE Acreo, Printed Electronics Arena Manufac-turing in Norrköping. Their vision is to create sustainable, long-term growth in printed electronics. In this Chapter, the background of the project, the problem definition, delimitations, challenges and report structure are introduced.

1.1

Background

One of the most popular animals around the World are horses. In the past, they were used for a multitude of purposes, e.g., transportation, agriculture, commerce, and even warfare. Today, horses are mainly used in sport and breeding. In sports, they perform towards excellence in jumping, dressage, trotting and galloping. Depending on the sport or activity they are raised and trained for, horse breeds develop different characteristics. However, most performance horses have in common that they are today extremely fast, with well-developed anatomy, see Figure 1.1.

Figure 1.1: Performance horse in trotting, Only Mad Money. Photographer: Matilda Persson. There has long been a lack of technical solutions to ease the work with horses. However, this has started to change due to the increasing interest in new technology for horses, in the academical and industrial sectors. While the percentage of women in these sectors are low, the percentage of women in equestrian sports is high, e.g., 90 % of the half million people active in the Swedish Equestrian Federation [1] are women. One of the main high-tech companies in Sweden, Saab, wants to introduce innovation and today’s technology into equestrian sports [2]. Another example is Chalmers University [3].

(15)

1.1.1

Lameness

There are about 300,000 horses in Sweden [1], making the country to have one of the highest horse den-sities in the World. According to the insurance company Agria, lameness responds yearly to over more than 50 % of all reported injuries [4]. This is a critical issue, which has contributed to the fact that horse injury prevention has gained more and more attention. There is, e.g., an ongoing project at Agria that aims to put an end to the horse lameness. Also, there is research investigating the riders impact on the horses, the influence of arena surfaces and the locomotion of horses, at SLU [5].

According to the experienced Professor and Veterinarian Lars Roeppstorff at SLU, it is common to get different diagnoses from different Veterinarians when horses are examined for lameness. This fact depends on the human factor and shows the need for more objective analysing methods. There are a few technical solutions for objective gait analysis available at some larger horse clinics, used to detect the movement pattern of the horse. However, the horses have, just like humans, individuate movement patterns and to set correct diagnoses, the horse should be compared with its regular movement pattern when perceived as sound.

1.1.2

The Master’s degree Project Idea

A possible method to discover and prevent injuries would be to use force sensor technology under the hooves of the horse. With necessary electronics integrated into a smart sole, sensor data could be collected and communicate wirelessly with an external reader. The force measuring devices should be placed under the hooves of the horse, and the external reader should be placed close to the measurement devices, preferably somewhere on the rider see Figure 1.2. By using this approach, it could be possible to get the individual movement pattern of a horse. Where the system also would be able to notice that first deviation in time, as a human eye could not. Furthermore, the system could be used to prevent more severe injuries and find out how, when and where the horse got injured. It would also be possible to find out the source of the pain, being a tool when diagnosing the injury and track the recovery process. The system should be able to use in cooperation with more comprehensive systems and detect differences in the locomotion of the horse over a longer time. The system would not only be valuable for the horse, but also for the horse owner, the trainer, the veterinarian, the blacksmith and the insurance company. Neither should the system only be available for a few selected horses at some clinics, but for every single horse anywhere in the world.

Figure 1.2: Placement of the devices in relation to the horse and the rider. Photographer: Sandra Pantzare.

(16)

1.2

Problem Definition

The purpose of this project is to create a prototype of the system mentioned in the previous Section, including both the force measuring device and the external reader. During the TNE085 CDIO course, Autumn 2017 at Linköping University Campus Norrköping, a prototype was developed as a concept validation of an idea of how to measure the pressure under a horse’s hooves. The prototype consisted of piezoelectric sensors that were connected to a CC2650 Launchpad from Texas Instruments, collecting sensor data. The measured pressure data was then sent to an android app over BLE 4.2.

This project is based on the same idea as in the earlier project, but the project aims to create a system prototype with own developed hardware for the force measuring device. The force measuring device will use piezoelectric sensors to measure applied forces, and the analog sensor output will be sampled in the ADC of a microcontroller. The measured data will then be transmitted to the external reader over Bluetooth. The resulting system in this project should be able to be used as a basis for further development. The idea of the system comes from the students, and the development of it is done in cooperation with RISE Acreo.

Figure 1.3: Simplified block diagram of the Horse Sensor System.

1.2.1

Research Questions

Four research questions were formulated to aid the development to achieve desired results. These questions are listed as follows:

1. What is required to find the movement pattern of a horse?

2. How can data be collected from the piezoelectric sensors to ensure the accuracy and credibility of the data?

3. Can the system handle all desirable functionalities while maintaining low power mode? 4. Is it possible to create a system that can be sustainable over a shoe-period?

1.3

Delimitations

The Master’s degree project is limited to 20 weeks work for each of the students. It is the final project for acquiring the degree of Master of Science (MSc.) in Electronic Design Engineering. These limitations will make the Master’s degree project to focus on the development of the required hardware and software system. There is no strict budget for the system development in this project, limiting the commercial perspective. Even if the complete system should be as affordable as possible in the future, this will not be prioritised in work. Instead, the development will be technical-oriented with some economic aspects considered.

(17)

• External reader

– Development of the embedded software – Configured to connect to multiple BLE devices – Send commands to the force measuring devices • Force measuring device

– Design hardware and develop embedded software – Measure forces with printed piezoelectric sensors – Sample sensor data in ADC

– Transmit data to external reader

1.4

Challenges

The same idea as the one in this project was first patented 1976 [6]. Since then, several versions of a force measuring device has been developed. However, no one has achieved satisfactory results and they are nowhere to be found on the market. These facts indicates how complex the system is and how many challenges to be addressed exist. Summarised requirements for the force measuring device and the external reader are listed in Table 1.1.

Table 1.1: Requirements of the force measuring device and the external reader

System Force measuring device External reader Size Fit under a hoof, sole height is about 4 mm To fit in a pocket Forces to measure From 0.5 to 15 kN No requirements

Lifetime 6 to 8 weeks Approximately 12 hours, chargeable Operating environment Waterproof, sustain 1500 kg, all weather Water resistant

Connectable units 1 unit 5 units

The technical challenges in this project are explained in the upcoming sections, describing the background of the set requirements in Table 1.1.

1.4.1

Under the Hoof

A full-grown horse weighs between 500 to 800 kilograms typically and is moving about 18 hours a day. When the horses are jumping, trotting or galloping, the forces in the hooves can exceed 15 kN. Most horses spend the majority of their lives outdoors, exposing the hooves to stone, mud, water, ice, snow, asphalt and sand.

Besides the factors mentioned above, the force measuring device must take up minimum space under the hoof and have a lifetime of six to eight weeks. This time period represents the average time between shoe fittings. At last, the most important criteria of the force measuring device is that it has to be utterly harmless to the horse, even if it breaks.

1.4.2

Signal Processing of Sensor Data

Apart from the challenges faced by the force measuring device under the hoof, the signal processing has to accurately extract the relevant and correct data. The system will be collecting a significant amount of data, and the signal processing must be able to find what is needed to track a movement pattern. Where, e.g., data collected from different surfaces and environments must be processed differently.

All horses have individuated movement patterns and will give different sensor responses. The signals will also be different between force measuring devices since in the practice sensors will differ slightly from each other. Besides having to find movement patterns of horses, the system must also be able to detect small changes.

(18)

1.4.3

Wireless Communication

The external reader must be able to connect to force measuring devices under the four hooves of a horse and a smartphone. The wireless communication has to support high-speed communication and have a secure connection, to make sure no data is lost.

1.5

Report Structure

This section contains a summary of the Chapters in this report. Chapter 2 - Horses

In this Chapter can the description of the locomotion of horses, its digitisation and similar solutions be found.

Chapter 3 - Theory

This Chapter includes hardware components and materials, software concepts and development environ-ments.

Chapter 4 - System Design

This Chapter describes the system design. The full system and the development of the subsystems are explained.

Chapter 5 - Prototyping and Performance Evaluation

The prototyping of the force measuring device and evaluation of the system performance is presented in this Chapter.

Chapter 6 - Discussion and Future Work

This Chapter includes a discussion of the outcome of the project and analysis of the measurement results. Chapter 7 - Conclusion

In this Chapter, the conclusions drawn from this project are presented by answering the research ques-tions.

(19)
(20)

Chapter 2

Horses

The great body mass and the explosive locomotion of horses could explain why the most common injuries of horses are related to its movement aperture. This Chapter includes descriptive information about the movement aperture, digitisation and similar solutions.

2.1

The Movement Aperture of Horses

The high speed of a horse is a result of external forces between the horse’s limbs and when the hooves push against the ground to generate ground reaction forces and provide propulsion. Isaac Newton’s laws of motion describe the relationship between the ground force reaction and the resulting movement. The third law of motion states: “When one body exerts a force on a second body, the second body simulta-neously exerts a force equal in magnitude and opposite in direction on the first body [7].”

Gaits of horses are characterised by its legs moving in repeated and rhythmic patterns, with different patterns for walking, trotting and galloping. These are the three most common gaits, see figure 2.1. The movement patterns are controlled in the spinal cord by neuronal circuits called central pattern generators. Which by controlling flexions and extensions of the joints determines the stride [8]. The head, withers and pelvic all contribute to the characteristic movement patterns during locomotion. Throughout the movement of the horse, there will be different gait stances of the ground interaction, see Figure 2.1.

Figure 2.1: Illustrations of the most common gaits of horses and the gait stances, A Walking, B -Trotting, C - Galloping, D - GRF-vectors in blue and acceleration in red, generated during the gait stances [8][9].

(21)

The four gait stance phases of horses are listed as follows: 1. First impact

The first impact is when the hoof first touches the ground and is called the concussion. The change in accelerations (marked red in Figure 2.1 D) are upwards and backwards, while the first GRF-vector will consist of both vertical and horizontal components (marked blue in Figure 2.1 D).

2. Second impact

The second impact is when the hoof slides and eventually stop, resulting in a forward acceleration and an increasing vertical GRF-vector. These two stances take place during the landing phase. 3. Support

The support comes in the loading phase, where the horse takes support to push off and consists mainly of a vertical GRF-vector.

4. Rollover

From the take off the horse eventually roll over, which is the opposite of the second impact in the landing phase resulting in a mirrored acceleration and GRF-vector.

When limbs are being exposed to repetitive high pressure over a longer time period, this often leads to horses getting musculoskeletal injuries, leading to lameness [10]. Since horses are prey animals, meaning they will always keep running, this has made them experts in reallocating more weight on other limbs if one of them hurts to avoid the large vertical GRF to project the body into the suspension phase [8]. When the horse then continues to be trained with the same intensity, it will eventually lead to overloading other ligaments due to compensating the injured limb. The compensation will then cause secondary injuries and resulting in more severe injuries than necessary. From both the welfare of the horse and an economic perspective, it is of highest priority with an as early treatment as possible[10].

2.2

Objective Gait Analysis

Lameness among horses is a significant problem, and there is objective gait analysis available. However, these instruments require experienced people to handle it and the tests are generally performed in specific clinical environments. E.g., at some veterinarian clinics, there are systems available which uses high-speed cameras combined with data graphic to find movement pattern of horses. These systems compare the symmetry between the right and left sides of the horse. There are also other systems available, using inertial measurement systems and treadmills with force measuring sensors. To implement technical so-lutions in the horse industry has been up to date since before the age of computers. In Figure 2.2, there are three examples of patents within the same area as this project.

Figure 2.2: Patents with similar ideas as the one in this project, A - Devices relating to hooves (1976) [6] , B - Electronic animal hoof force detection systems (1987) [11], C - Polymer piezoelectric sensor of animal foot pressure (1985) [12].

(22)

The ideas in the patents above are still as relevant today as they were then. However, there are still few of these technical solutions that can be seen anywhere. The instruments should not affect the horse, and most preferably, the horse should not even notice there are anything attached to it. Even similar solutions today, see Figure 2.3, are more massive than what is usually mounted under the hooves. It also uses wires to communicate between the hooves and a collecting system mounted on the back of the horse.

Figure 2.3: Design of a dynamometric horseshoe used for research, A - Fitted to left hoof with piezoelectric sensors sandwiched in the shoe, B - Wires connected to system mounted on top of the horse [13].

2.3

Implementation of Horse Locomotion Surveillance

The main idea of the end product is that it should be available to anyone. No matter earlier experience, the user should be able to use this system with their horse without having it to cost a fortune. Compared to systems available to analyse the locomotion of horses today, this system should be able to track the regular movement pattern. Neither the horse, horse rider or horse trainer should notice or be disturbed by the system when it is operating.

To not disturb the user, the system should preferably be in a form similar to what the user should use otherwise. In this project, the measuring device is imagined to be in a sole. Since most performance horses use horseshoes, the sole could easily be mount between the hoof and the shoe.

Collecting the daily movement of a horse would make it possible to perform big data analysis, where the system would not only detect abnormalities in a pattern but also be used to prevent injuries.

(23)
(24)

Chapter 3

Theory

In this Chapter, details about the hardware components and materials that have been selected and used in this project are presented. Also, the software development that completes the system is described, including the chosen wireless technology, communication protocols, data processing, etc.

3.1

Components and Materials

This section includes all components and materials used in the project, e.g., the antenna, microcontroller and piezoelectric material, used for pressure sensing.

3.1.1

Accelerometer and Gyroscope

The MPU-6500 is a six-axis MotionTracking integrated circuit (IC) from InvenSense [14], combining a 3-axis accelerometer and gyroscope. Included in the IC, there are a run-time calibration firmware and digital motion processor. On-chip is also 16-bit ADCs as seen in Figure 3.1, a precision clock (with 1 % drift), an embedded temperature sensor, and programmable digital filters. The MPU-6500 supports both I2C (400 kHz) and SPI (1 MHz) serial interfaces and can burst read sensor data, before entering low power mode - to reduce power consumption. The package of the MPU-6500 has the size 3 x 3 x 0.90 mm (24-pin quad flat no-leads (QFN)), which has been achieved by integrating MEMS wafers with companion CMOS electronics through wafer-level bonding [14].

(25)

3.1.2

Antenna

The chip antenna 2450AT07A0100 from Johanson Technology [15], operates at 2.45 GHz. It has a peak gain of 1.0 dBi and an average gain of -1.5 dBi, in XZ-direction. The return loss of the antenna has a minimum of 6.5 dB and an output impedance of 50 Ω. The input power is 2 W and an operating temperature range of -40 to +125 degrees.

The antenna comes in a package dimensioned 1 x 0.5 x 0.37 mm, the recommended reference design on the PCB covers an area of 3 x 5 mm. When mounted on a PCB, the z-direction is straight upwards from the PCB, and the x-axis is towards feeding line. Typical radiation patterns of the antenna, from the datasheet, are shown in Figure 3.2.

Figure 3.2: Typical radiation patterns of the antenna [15].

3.1.3

Flash Memory

The MX25R6435F from Macronix [16] is an ultra-low power 64 M-bit serial NOR Flash memory. The device operates on a three wire SPI and provides sequential read operation on-chip, see Figure 3.3. The flash memory provides a status register to ease the user interface, where status read command can detect completion status of a program or erase operation via work in progress bit [16]. The MX25R6435F utilises Macronix’s proprietary memory cell, supporting to store memory contents over 100,000 programs and erase cycles.

(26)

Figure 3.3: The block diagram of MX25R6435F [16].

3.1.4

Energy Harvesting

The LTC3588-1 from Johanson Technology integrates a buck converter with a full-wave bridge rectifier to form an energy harvesting solution, optimised for high output impedance energy sources such as piezo-electric, solar, or magnetic transducers.

By using an under-voltage lockout mode with a wide hysteresis window, a charge accumulates on an input capacitor until the buck converter can transfer some of the stored charges to the output. The LTC3588-1 enters a sleep state with minimal quiescent current at both input and output during regulation, controlled by the buck converter. There are four selectable output voltages, 1.8 V, 2.5 V, 3.3 V and 3.6 V with up to 100 mA of continuous output current. An input protective shunt set at 20 V makes it possible for greater energy storage for a given amount of input capacitance.

(27)

3.1.5

Printed Piezoelectric Material

Piezoelectricity is the electric charge accumulated when mechanical stress is applied to specific solid ma-terials. An advantage with printed electronics is that it can be produced on flexible and elastic substrates, while fabricated sustainable, to a low-cost and in large volumes [18].

Piezoelectric materials are materials that can either create electrical charges when subjected to mechanical stress or can inversely generate tensions and consequently displacements when an electric field is applied [19]. After printing piezoelectric sensors, the dipole containing nano-crystallites is randomly ordered and placed in an amorphous polymer matrix [20], see Figure 3.5. The sensors must be polarised to achieve the piezoelectric effect from ferroelectric polymer since the positive and negative charges in the crystals should be separated while symmetrical distributed. When polarised, the dipoles will be aligned vertically to the electrodes, and a piezoelectric effect will be exhibited, see Figure 3.5.

Figure 3.5: Crystals: A - Before polarisation, in random order, B - After polarisation.

Piezoelectric material from PyzoFlex, used for pressure sensing devices, are printed with the functional inks [18]:

• Conductive polymer ink PEDOT:PSS (poly(3,4-ethylenedioxythiophene):poly(styrene sulfonic acid)) • Fluoropolymer sensor ink P(VDF-TrFE) (poly(vinylidene fluoride trifuor-oethylene)

• Conductive carbon paste

• Conductive silver ink (DuPont 5000)

The inks are printed on a plastic foil, see Figure 3.6, for high flexibility and excellent adhesion of the inks applied during the screen printing process [20]. Sensors need a high AC voltage of 140 MV/m at 10 Hz to be applied between the top and bottom electrodes, to achieve a permanent electrical polarisation, of the material done with a Sawyer-Tower circuit [18]. Examples of recorded hysteresis loops produced by a PyzoFlex foil can be seen in Figure 3.6. Showing the measured responses when increasing the electrical field strengths, with the maximum polarisation achieved at approximately 70 mC/m2.

Figure 3.6: PyZoFlex sensors: Layer structure [20], (left), measured displacement-electric field hysteresis response [18], (right).

(28)

By applying pressure to the material, charges generates a voltage response in the electrodes of the sensor capacitor [18]. Resulting in a measurable voltage output, giving a positive voltage output when mechanical stress is applied and a negative voltage output when mechanical stress is removed, see Figure 3.7.

Figure 3.7: Voltage output when mechanical stress is applied to a sensor [20].

A graph of measured voltage outputs from a PyzoFlex sensor can be seen in Figure 3.8 A, showing the sensor signals from five touch downs and up. In Figure 3.8 B, the estimated pressure applied is found. The estimated touch signal can be achieved by integrating a deviation curve [20], making it possible to detect static pressure levels.

Figure 3.8: A - Sensor signal from PyzoFlex sensor, B - Estimated pressure applied to a PyzoFlex sensor [20].

The generated voltage output from the PyzoFlex sensors is linear as seen in Figure 3.9. Where the magnitude of a sensor voltage output corresponds to the pressure measured in bar, shown in Figure 3.9.

(29)

Figure 3.9: Linear relation between voltage output and applied pressure to a sensor [20].

3.1.6

Microcontroller

The wireless microcontroller (MCU) CC1352R from Texas Instruments (TI) [21] works as a multiprotocol Sub-1 and 2.4 GHz. The device combines a 48 MHz Arm Cortex-M4F central processing unit (CPU) with a low power radio frequency (RF) transceiver while supporting multiple physical layers and RF stan-dards. Radio controller handles low-level RF protocol commands, stored in read-only memory (ROM) or random access memory (RAM), ensuring ultra-low power and excellent flexibility [21]. Due to the low power consumption, the device is suitable with a coin cell or energy harvesting applications.

The device can handle sensors with a programmable, autonomous ultra-low power CPU (sensor controller) with 4 Kb of static RAM for program and data. The sensor controller is located in a separate power domain, called the auxiliary (AUX) domain.

Figure 3.10: Typical differences of analog-to-digital converter (ADC) current consumption using the CPU and the sensor controller [22].

The sensor controller (SC) is designed for sampling, buffering and processing, analog and digital sensor data. With its fast wake up and 2 MHz modes, the system can reduce active power and maximise sleep time of the processor. The CC1352R device also has a complete RF system, and an on-chip DC/DC converter incorporated in a single-chip solution see Figure 3.11.

(30)

Figure 3.11: The block diagram of CC1352R1 [21].

3.2

Bluetooth Low Energy

Bluetooth low energy (BLE) is a wireless technology designed to be complementary to classic Bluetooth by the Bluetooth Special Interest Group (SIG) [23]. Both classic Bluetooth and BLE is working on the operating frequency of 2.4 GHz and uses frequency hopping to spread out the RF energy [23]. BLE is a separate technology that is not developed to increase data rates but instead focuses on the power consumption of the devices. The primary goal with BLE is to be able to use a button cell battery in the same device for months or years. It is developed to support low power consumption in a short-range wireless system and is most suitable if the connection between the devices is brief and the data rates are low. A brief connection can last up to a few hours. BLE is not backwards-compatible with classic Bluetooth, but some devices support both modes.

Just because BLE is used does not mean that the application automatically draws less energy than the same application in classic Bluetooth. The implementation in software is vital for the device to draw as little power as possible. For example, to reduce how many times a device is discovering, connecting to devices or sending data is essential. Between these activities, the device can enter sleep-mode to reduce the energy consumption. If a device is continuously sending data, it is wasting energy. If the data is stored and then sent when all data is collected it is more energy efficient and the application is suitable for BLE. Another energy waster is the memory. The larger memory required for the application, the more energy is required to power it, because memory typically requires dynamic refreshing [24]. By reducing the memory size, the energy consumption is reduced.

(31)

BLE 5, which is the newest version of BLE, is used in this project. To show the advantages of using BLE 5 instead of its predecessor, technical data for BLE versions 4 and 5 is shown in Table 3.1 to compare the performance of the versions.

Table 3.1: Technical data for BLE versions 4 and 5 [25]

Version 4 5

Frequency 2.402 - 2.481 GHz 2.402 - 2.481 GHz Range Up to 100 m Up to 400 m Range free field Around 100 m Around 1,000 m

Max data rate 1 Mbit/s 2 Mbit/s

BLE 5 has the two modes high-speed and long-range mode. The high-speed mode supports 2 Mbps data rates with shorter range, and the long range mode supports an extended communication with a reduction in data rate to approximately 125 - 500 kbps. During long range mode, the average power consumption is higher than for the high-speed mode. As seen in the table, both data rate and the range are increased in BLE 5 compared to version 4. However, the range depends on more than the specification. Both the performance of the hardware, in both transmitter and receiver, and physical obstacles limit the range [25]. If the output power from the transmitter is too low, the receiver will not be able to detect the signal, and if the sensitivity of the receiver is reduced, the signal is not distinguished from the noise. For BLE 5, the maximum output power is increased from 10 dBm to 20 dBm.

In BLE, the interacting devices can have different roles. There are two roles, client and server. The client sends requests to a server and can read and/or write attributes on the server. The server stores the attribute and makes the attribute available if the client sends a request. In this project, the measuring devices are servers, and the external reader is the client.

3.2.1

Attributes

An attribute is a labelled piece of addressable data. The attribute consists of a handle, type and value. The handle is used to address the attribute and varies from 0x0001 to 0xFFFF. To identify which kind of type the attribute is, a 128-bit number is used. This number identifier is called a universally unique identifier (UUID). The attribute value is the desired data, which can be up to 512 bytes long [24].

3.2.2

The Attribute Protocol

The attribute protocol (ATT) defines rules for accessing the data. ATT defines a protocol how standard messages can be sent between the client and the server. It is a simple protocol where the attribute client finds and accesses attributes on the attribute server. Six basic options structures the ATT [24]:

• Request

– Requests sent from the client to the server • Response

– Responses sent from the server • Command

– Commands sent from the client to the server that has no response • Indication

– Indications sent from the server to the client • Confirmation

– Confirmations sent from the client to the server in reply to an indication • Notification

(32)

3.2.3

The Generic Attribute Profile

The generic attribute profile (GATT) is built on top of ATT and defines standard ways to how services and characteristics are discovered and used [24]. GATT handles the actual data transfer procedures and formats. The services and characteristics of the device are discovered via GATT. The discovery process is as follows:

• Primary services

• Secondary and other referenced services • Characteristics

Clients can use the characteristics in different ways: read and write characteristic value or read and write characteristic descriptors. The characteristic descriptors are attributes that describe the characteristic value.

3.2.4

The Generic Access Profile

The generic access profile (GAP) defines low-level interactions with devices. GAP provides a framework that allows devices to discover each other, establish secure connections and broadcast data. It also establishes different roles for the devices. There are four roles for the devices. These roles are:

• Broadcaster

– Only sends advertising packets – Broadcasts data to an observer – Requires only transmitter • Observer

– Scans for broadcasters

– Reports detected broadcasters to application – Requires only receiver

• Peripheral

– Advertises using connectable advertising packets – Becomes slave when connected

– Requires both transmitter and receiver • Central

– Initiates connections to peripherals – Becomes master when connected – Requires both transmitter and receiver Security

GAP also controls the security of the device. There are several security levels, two security modes with three and two levels respectively. Some services require much security to protect the transferred data from eavesdroppers [24]. The default security of a link is no security.

• Security Mode 1 Level 1: No security

• Security Mode 1 Level 2: Unauthenticated paring with encryption • Security Mode 1 Level 3: Authenticated paring with encryption • Security Mode 2 Level 1: Unauthenticated paring with data signing • Security Mode 2 Level 2: Authenticated paring with data signing

(33)

3.2.5

Advertising and Scanning

If a BLE device is unconnected, it either sends advertising packets or scans to discover other devices that are transmitting advertising packets. These actions are called scanning and advertising. BLE uses 40 channels to communicate of which three channels are either advertising or scanning channels, and the rest are data channels.

Advertising

BLE uses three channels to send advertising packets (PDUs) to communicate outside a connection. These channels are called the primary advertising channels, used to find and connect to other devices or to broad-cast data. The other 37 channels are used to exchange data within a connection [26]. The advertising channel is quite busy since scan request, connection request and advertisement packets are sent on the same channel. Meaning that devices are unable to connect to each other if there is too much noise on the channel. The three primary advertising channels are channel 37, 38 and 39 which are located on the frequencies 2402 MHz, 2426 MHz and 2480 MHz respectively. The device can use one or more channels when advertising.

The three different advertising parameters are interval, types and channels. The advertising interval is the time between the start of two consecutive advertising events. This time can be minimum of 20 ms and maximum 10.24 s. The advertising types are the different PDUs. There are eight different kinds of advertising packets which are used in different ways. Four of the packets are 31 bytes long and take 10 ms to send [26] over the primary advertising channels. The others are 254 bytes long are are send over the secondary advertising channels. The advertising channels are used for sending the PDUs, one or more of the channels 37 to 39.

Scanning

The scanning process aims to discover devices that are transmitting advertising packets and can be both active and passive. Passive scanning can only receive data from the advertising device while the active scanning can request more information about the advertiser. When scanning, all channels are checked from channel 37 to 39. The order remains the same for all scans and is not configurable. For scanning, there are also three different parameters; interval, window and duration. The scan interval is the time between the start of two scan windows which can last from 10 ms to 10.24 s which matches the time interval for advertising. The scan window is the duration for scanning one channel. This window is between 10 ms to 10.24 s. The scan duration is the time during which a device stays in the scanning state and can last from 10 ms to infinity.

3.2.6

Services

A service is used to store data. The service usually represents a feature of a device, e.g., a particular sensor. The data items in a service are called characteristics. A service can have more than one characteristic, and their specific UUID [27] distinguishes the service itself and the characteristics of a service.

Characteristic

The characteristic is defined by attributes and consist of at least one declaration and value attribute. The declaration contains the UUID and handle and describes if the characteristic value can be read or written [28]. The characteristic value is the data item.

3.3

Software Concepts

Multiple software concepts were used to develop the algorithms for the measuring device and external reader in this project. These concepts are introduced and presented in this Chapter.

3.3.1

Real-Time Operating System

The time operating system (RTOS) is an operating system (OS) that is intended to be used in real-time applications that have to process data continuously. RTOS applications have faster response real-times than no-RTOS projects and typically without buffer delays. The two most common RTOS designs are

(34)

event-driven, and time-sharing, where the task switching is controlled by either priority scheduling or on a clocked interrupt respectively [29].

3.3.2

Semaphore

Semaphores are synchronisation objects that control access to files and shared memory. The semaphore can be either a binary or counting. The binary semaphore is restricted to two values, 0 and 1. The counting semaphore starts counting down from the highest value to zero. When the counting semaphore is initialised, the value can be any integer, but after the initialisation, a semaphore can only be decremented or incremented by one. If the semaphore becomes negative, the thread is blocked until another thread increments the semaphore [30].

3.3.3

Interrupts

Interrupts is a signal which lets the microcontroller know that it needs immediate attention. The hard-ware or softhard-ware can generate this signal. When the system has received an interrupt, it enters the interrupt handler. The interrupt handler deals with the interrupt, clears the interrupt flag and then returns to the main algorithm where the interrupt occurred.

There are three kinds of interrupts; hardware, software and task interrupt. The different interrupts are suitable for different applications.

Hardware Interrupts

Hardware interrupts (HWI) are asynchronous interrupts and are issued by hardware devices. Each device has a specific interrupt request (IRQ) line which makes the CPU dispatch the request to the correct hardware driver. There are limited numbers of IRQs which limits the numbers of hardware interrupts. The hardware interrupts the CPU directly which triggers the kernel process. HWI has quick response times but can block other high priority processes which makes them unsuitable to use for heavy computational processing [31].

Software Interrupts

Software interrupts (SWI) are synchronous and are issued by processes which are currently running. They are usually caused by an exceptional condition within the microcontroller or a special instruction which causes the interrupt when it is executed. There are many uses for SWI, for instance, requesting reading or writing data. SWI can have hundreds of different software interrupts. HWI is faster than SWI, but SWI is recommended since they do not block other high priority processes [31].

Task Interrupts

Task interrupts only works with RTOS applications which connect the RTOS-task with an interruption. It also requires the implementation of semaphores for timing purposes. Using task interrupts can result in slower response times than SWI but works better in more complex projects with many tasks. It is the preferred solution in most cases due to its flexibility in complexity and ability to prioritise the interrupts and processes which are time-critical [31].

3.4

Development Environments

The hardware and software development environments used in this project are presented in the following section. These environments have been chosen due to their availabilities and functionalities.

3.4.1

Altium Designer

Altium Designer provides a cohesive, user-friendly and performance enhancing platform for PCB design [32]. The unified platform supports solutions for an end to end design, including; schematic capture, design verification, component and data management, PCB layout with interactive routing and manu-facturing outputs [32].

(35)

3.4.2

Bluetooth Developer Studio

Bluetooth Developer Studio is a graphical, GATT based debugging tool. It is used to create files for services and characteristics [33] for Bluetooth applications. A TI plugin is available to create files that are compatible with CCS.

3.4.3

Code Composer Studio

The main software used to program the microcontrollers was Code Composer Studio (CCS) from TI [34]. CCS is an integrated development environment that contains tools to develop and debug embedded applications for TI’s microcontrollers and embedded processors. Both versions 7.4 and 8 have been used during the project. The SDK for the CC1352 Launchpad have to be installed to compile and debug the programs [35]. It contains the TI 15.4-Stack, support for proprietary solutions, BLE Stack and multiprotocol support. This first version of the SDK is only validated for pre-production silicon and is only used for early evaluation.

3.4.4

MATLAB

MATLAB from Mathworks [36], combines a platform for a programming language that expresses matrix and array mathematics with iterative analysis and design processes. In the platform can MATLAB apps show how algorithms work with data and automatically generate a MATLAB program. MATLAB also supports solutions to simplify analyses of data, giving the ability to scale analyses to run on clusters, GPUs and clouds [36].

3.4.5

Sensor Controller Studio

Sensor Controller Studio (SCS) is a tool used to generate a Sensor Controller Interface driver [37]. The software is used to write, test and debug code for the SC in the microcontroller. The SCS is equipped with examples that help start the development of the application. These examples can be linked to a CCS project. By linking the project, the output files from SCS are automatically saved in the right CCS project. The CCS project can then use the files from the SCS to use the SC.

(36)

Chapter 4

System Design

In this Chapter, the system design of the project is described. It contains an overview of the entire system and detailed explanations of the two subsystems; Hoof Sensor System operating as the measuring device and a Master Unit as the external reader.

4.1

System Overview

The system is a star network where there is no communication between the Hoof Sensor Systems. The individual Sensor Systems only communicate with the Master Unit. The Master Unit controls the oper-ations of the Hoof Sensor Systems. BLE 5 technology is used to employ communicate between the units, using a custom service and characteristics. The block diagram of the complete system is shown in Figure 4.1.

Figure 4.1: Block diagram of the proposed Horse Sensor System, with the two subsystems Master Unit and the Hoof Sensor Systems.

Under the hooves of a horse, there will be Hoof Sensor Systems integrated into regular horse soles, which are placed between the hoof and the shoe. In the Hoof Sensor Systems, there are integrated circuits connected to sensors that collect data about the movement of a horse.

(37)

4.2

Master Unit: Hardware

This project uses the CC1352R1 Launchpad (LP) [38] as the Master Unit hardware. This device is wearable and can manage several connections simultaneously. It also offers an overall solution for the Master Unit which is in line with the technical orientation of the project. The CC1352R1 LP is shown in Figure 4.2. Another solution is to use a smartphone as the Master Unit due to the ability to both save data locally and on a cloud. However, the number of BLE connections varies between manufacturers and models. There are also concerns about the battery and memory capacity of a smartphone.

Figure 4.2: An overview of the CC1352R1 Launchpad.

In Figure 4.3, another usage of a smartphone is illustrated. The Master Unit works as a bridge between the Hoof Sensor System and the user, by connecting to a smartphone. The idea is to be able to use the CC1352R1 LP with a smartphone app that has a user-friendly interface to visualise the collected data. This smartphone app should also provide the ability to send data to a cloud for saving and sharing of data.

(38)

4.3

Master Unit: Software

The Master Unit is the centre of the star network. It sends commands to the Hoof Sensor System to enable saving or sending data and it also receives the collected data in the Hoof Sensor Systems. The algorithm for the Master Unit is configured so that the Master Unit can operate with five BLE devices. However, the Master Unit was tested with only one Hoof Sensor System device.

Multi Role [39], a project from the TI SDK, has been used as a starting point for the development of the Master Unit algorithm. In the Multi Role project, there is a default menu that allows a user to see options to discover, connect to and use devices. The first menu options are shown in Figure 4.4 in a PuTTY [40] terminal window.

Figure 4.4: First window in Multi Role menu shown in PuTTY terminal.

The two buttons on the LP control menu, where the bracket signs display the actions for each button. The left button, "<", is used to mark the next item in the menu list, and the right button, ">", is used to select the marked item.

The primary purpose of the Master Unit is to send commands to the Hoof Sensor System. These commands trigger the Hoof Sensor System to enter one of the two modes, SAVE or SEND. The flowchart for the Master Unit algorithm is shown in Figure 4.5. This flowchart is not based on the menu options; instead, the sequence of events in the final algorithm are shown. The default processes in the Multi Role project are excluded from the flowchart and the grey boxes are not implemented in the project.

(39)

Figure 4.5: Flowchart for the Master Unit algorithm.

Custom service is used to send the sensor data between the devices. This service is called the ADC service and contains five characteristics, one for each sensor. The ADC service is created in Bluetooth Developer Studio (BDS) by following the fundamental steps in bonus task one [41]. The TI plugin is used to generate files from BDS to implement this service in CCS. The ADC service is added in the software of the Master Unit by initiating the adc_service_addservice function in MultiRole_init.

Before using the Master Unit to send commands, the devices must get connected. During this project, the devices are manually connected to the Master Unit using the menu.

Once the system is started and the desired devices are connected, it will wait for user interaction. The user can interact with the system using the two buttons on the Launchpad, see Figure 4.2. To date, the buttons only navigate through the menu, but in future applications, the system will be programmed to trigger one of the two modes by pressing one of the buttons. The algorithm continuously waits for the user interaction until it occurs.

(40)

Directly when a button is pressed, the algorithm enters the Board_keyCallback function. Here, the parameters are set to enter one of the two modes. Depending on which button is pressed, the Master Unit enters different modes, START and RECEIVE. The mode is only active for a short period and is excited as soon as the command is sent or when all data has been received.

When the left button is pressed, the user has triggered the RECEIVE mode in the Master Unit. This mode sends a command to the connected Hoof Sensor Systems and receives the data. When the right button is pressed, the user has triggered the START mode in the Master Unit which sends a command to the connected Hoof Sensor System to start saving data. When the system has sent the message, it returns to wait for another user interaction.

4.4

Hoof Sensor System: Hardware

The Hoof Sensor System is in this project assumed to be implemented in a sole, placed between a hoof and a shoe. In a sole, the system would be protected by the shoe against the ground as seen in Figure 4.6, while being waterproof when encapsulated in a sole.

Figure 4.6: Shoe on a horse sole, where the shoe will be closest to the ground, and the sole will be placed between the horse hoof and the shoe.

Functionalities

The Hoof Sensor Systems main functionalities are to measure the pressure under the hooves and send the sampled data over BLE 5 to a Master Unit. The sensor data will be collected by using the ADC in a MCU to read the voltage outputs from sensors. The MCU is programmable by attaching it to a debugger using JTAG communication, and it operates at 3.3 V. To extend the lifetime of the system, all components can operate in low power mode. Blocks showing the implemented components in the system, to meet the desired functionalities, are shown in Figure 4.7. The extra functionalities such as energy harvesting, external flash memory and accelerometer/gyroscope are included in the hardware design but are not evaluated in the project.

(41)

Figure 4.7: Block diagram of the Hoof Sensor System hardware. The workflow of the PCB design in this project was as follows:

• Component research and selections

• Create symbols and footprints for components • Draw schematic

– Design review with supervisors and manufacturer of the MCU [21]. – Adjust the schematic until its approved.

• Design PCB layout

– Design review with supervisors and manufacturer of the MCU [21]. – Adjust the layout until its approved.

• Order components

• Create manufacturing files

– Manufacture a test card at the PCB lab at Campus Norrköping – Mount components on the test card

– Test the PCB

• Order card from a commercial PCB manufacturer • Mount components on the card

• Test and measure characteristics on the PCB

4.4.1

Component Research and Selections

To choose necessary components, a survey was conducted, including finding out what components in the market were best suited to this application. The survey was accomplished by going through a large number of datasheets and Application Notes.

Accelerometer and Gyroscope

An approach to sense how the horse moves the legs in the air is to use 3-axis accelerometers and gy-roscopes. In this project, the MPU-6500 from Invensense [14] was chosen due to its small package (3 x 3 x 0.9 mm) and meeting the markets high-performance criteria. This while being able to operate at 1.8 V and consuming only 6.1 mW of power [14]. The MPU-6500 is one of the most used MEMS

(42)

MotionTracking devices in the market today. It was also found to be the most tested and cheapest IC. When implemented in the project, the MPU-6500 was set to communicate with the MCU over I2C. The IC supports both I2C and SPI, but an advantage with I2C is when the slave device can not send data fast enough that it can delay the clock so data will be sent slower.

Chip Antenna

The frequency used for BLE 5 is 2.45 GHz. Most common antennas for this frequency are PCB antennas. However, since the PCB MODULE is supposed to fit underneath the hoof, the antenna has to be as small as possible. The best option for a small antenna was to use a chip antenna, where the 2450AT07A0100 from Johanson Technology [15] was chosen. This antenna had also shown that it would be able to support the requested characteristics. E.g., range and omni directional.

Energy Harvesting and Power Supply

It is not optimal to attach large lithium-ion batteries under the hooves from security aspects. Instead, it would be preferable to use renewable energy. Since horses walk 18 of 24 hours every day, it would be possible to generate enough energy with the piezoelectric material to harvest and use as power supply. The LTC3588 from Linear Technology [17] is an energy harvesting circuit, optimised for high output impedance energy sources, such as piezoelectric material. This circuit has 3.3 V as pin-selectable, which suits the MCU perfectly.

External Storage

To extend the lifetime, it is preferable to save a larger amount of data in the Hoof Sensor Systems instead of streaming data continuously. Because of that, external storage was implemented in shape of an ultra-low power 64 Mbit flash memory [16]. The memory communicates to the MCU over SPI, and according to the datasheet [16] it reliably stores memory contents even after 100 000 erase and program cycles. Piezoelectric Sensors

Printed electronics opens up possibilities for low-cost and sustainable production of the sensors and the sensors can bee printed on any material, in any shape. The system in this project must fit into the regular size of a sole, to get the system as unnoticeable as possible for the horse. Where a preferable height of the system should be about 3 - 4 mm on the edges (about 7 mm in total, including the horseshoe). At Printed Electronics Area Manufacturing (PEA-M) in Norrköping, screen printed piezoelectric sensors were produced for this project. On the sheet, five sensors are covering an area of about 1 cm2 each.

There are two sensors placed on the back of the hoof, where the highest GRF-vector will be achieved during the loading phase. Then, there are two sensors on the sides, measuring the tilt of the hoof. The last sensor is placed at the toe of the horse, measuring the push off in the rollover phase.

The material of the sensor sheet can easily fit into a sole and since piezoelectric sensors do not need any supply voltage. To get an overview of the implementation of the sensors in the system, see Figure 4.8. The piezoelectric sensors (A) will be embedded in a sole (B) and later be implemented under the hoof by nailing the shoe (C) to the hoof, with the sole placed between the hoof and the shoe. The sole is made of flexible material and sensitive to pressure differences in the material.

(43)

MCU

The brain of the Hoof Sensor System is the MCU CC1352R1 from Texas Instruments [21]. This MCU was chosen since it is compatible with all necessary features required of the Hoof Sensor System. Where it is operating in low power mode, supports 2.4 GHz and sub-1 GHz (for future development) and comes along with useful examples in the SDK [35].

4.4.2

PCB Module Design

A PCB module was designed, manufactured and evaluated to verify the hardware concept and design of the Hoof Sensor System. This PCB module was used to test and troubleshoot all blocks shown in Figure 4.7. Extra functionalities were added to this PCB module to ease the evaluation and troubleshooting process. Examples of such functionalities are listed as follows:

• Evaluate all components and functionalities

– 0 Ω resistors to connect and disconnect extra components – Header to use the PCB module without Energy Harvesting IC • Actions for troubleshooting

– Test vias for signal measuring, including names of the signals – LEDs connected to where there should be voltage supplies

The PCB module design of Hoof Sensor System was designed in Altium Designer 17 [32]. This software was chosen since it has many advantages in printed circuit board (PCB) design compared to other similar software programs. E.g., an easy user-interface throughout drawing schematics, creating footprints and design layouts. Altium also has much documentation on its website [32], to educate the user in PCB layout design. Besides this, for students in Electronic Design Engineering at Linköping University, the software is familiar from earlier courses and available at Campus Norrköping.

Schematic

Larger components requiring a specific application circuit have been marked as A to F in Figure 4.9. The energy harvesting IC LTC3588 [17], marked A in Figure 4.9, have 2-pins in the 8-pin header (B) to connect a single piezoelectric material to the IC. In this project, the LTC3588 has been implemented with a battery back-up where a battery can be connected to Vin through a 2-pin header in series with a blocking diode. The diode prevents reverse current in the battery if the piezoelectric material charges Vin past the battery voltage, which in this application was 3 V.

To program the MCU, the 10-pin JTAG header in Figure 4.9 C was chosen. The PCB module can be connected to the XDS110 debugger on CC1352R1 LP [38], by using this header. Unused pins of the MCU were left unconnected since it was the recommendations given by the manufacturer. Between A and C in Figure 4.9, there are a filter and bypass capacitors, used to shorten AC signals to the ground. In the top of the schematic in Figure 4.9, the chip antenna [15] is marked as E. From the outputs of the MCU, there is a balun that converts unbalanced signals to balanced signals. The balun is matched to 50 Ω and then connected to a matching filter for the antenna. The accelerometer and gyroscope IC, MPU6500 [14], is marked as F in Figure 4.9. The MPU6500 was chosen to communicate with the MCU over I2C, with pull-up resistors at signals SDA and SCL.

All components in the schematic are numbered numerically from the left top to the right bottom to ease the component placement in PCB layout. To track the filtering components, belonging to the energy harvesting IC and accelerometer/gyroscope, these start with an 8 and 9 respectively.

The design review of the schematic was performed by both an experienced electronics designer at RISE Acreo and an application engineer at TI. The resulting schematic can be seen in Figure 4.9.

References

Related documents

This Section contains results from real experiments on the double tank sys- tem controlled via a wireless CTP network with outage compensation imple- mented as a part of the

Total electricity is the result of the earn money due to dump to the grid the surplus e nergy generated that is not possible to store within the battery system, less the amount

The results of the simulation are shown in Figure 22, the displacements in all directions have been represented in a fringe diagram with the deformed model.. These diagrams

For the formation of the organization of the virtual environment, groups of researchers suggest using different protocols: Adaptive Genetic Algorithm for identifying the

If a rotational displacement with varying frequency is applied to the drum (see Figure 4.1), the frequency of the mass displacement output is also changing, as shown in

To solve this problem, the upstream node will send its data to the plant actuator, which switches to the storage tank after some time delay, independent of inlet node mea-

The master thesis is limited to use a piezoelectric material made of a PVDF bicomponent fiber with a core of carbon black (CB) and high density polyethylene (HDPE).

A test chip had shown that the single ended design achieves a dynamic range of 15 bits for signal offsets up to ±1.2V [3].. The measured power consumption for one single modulator is