• No results found

Optimization of the Ni-Ti pressure sensors

N/A
N/A
Protected

Academic year: 2022

Share "Optimization of the Ni-Ti pressure sensors"

Copied!
74
0
0

Loading.... (view fulltext now)

Full text

(1)

Optimization of the Ni-Ti pressure sensors

Master thesis

Study programme: N2612 – Electrical Engineering and Informatics Study branch: 3906T001 – Mechatronics

Author: Bc. et Bc. Martin Hunˇek, M.Eng.

Assessor: Prof. Dr.-Ing. Frank Worlitz Supervisor: Ing. Martin Kysela

(2)

Optimalizace NiTi tlakov´ ych senzor˚ u

Diplomov´ a pr´ ace

Studijn´ı program: N2612 – Electrical Engineering and Informatics Studijn´ı obor: 3906T001 – Mechatronics

Autor pr´ace: Bc. et Bc. Martin Hunˇek, M.Eng.

Odborn´y dohled: Prof. Dr.-Ing. Frank Worlitz Vedouc´ı pr´ace: Ing. Martin Kysela

(3)
(4)
(5)
(6)

Abstract

Aim of this thesis is to assist in research held on Technical Univer- sity of Liberec for VW group. Main task is to develop a software for shape optimization Ni-Ti pressure sensors, this should cover both types of constructions used in this research (flat area and single string sensor). The other aim is to assist to other members of the research team with comparison Ni-Ti sensors with other types of force and pressure sensors used nowadays. Last but not least tem- perature and other time variable parameters compensation of the sensors.

Keywords: NiTi, strain gauges, pressure sensors, optimization, soft- ware development, measurement

Abstrakt

C´ılem pr´ace je asistovat ve v´yzkumu prov´adˇen´em na Technick´e uni- verzitˇe v Liberci pro koncern VW. Hlavn´ım ´ukolem je vyvinout soft- ware pro optimalizaci n´avrhu NiTi senzor˚u. Tento software mus´ı b´yt schopen poskytnout tyto optimalizace u obou uvaˇzovan´ych kon- strukc´ı (ploˇsn´y a dr´atov´y senzor). Dalˇs´ım c´ılem je shrnout dalˇs´ı moˇznosti mˇeˇren´ı sil a tlak˚u a jejich porovn´an´ı. Posledn´ım c´ılem pr´ace je navrhnout teplotn´ı kompenzaci a pˇr´ıpadnou kompenzaci dalˇs´ıch poruch.

Kl´ıˇcov´a slova: NiTi, tenzometry, senzory tlaku, optimalizace, v´yvoj softwaru, mˇeˇren´ı

(7)

Acknowledgements

I would like to express my gratitude to thesis assessor Prof. Dr.- Ing. Frank Worlitz, for making thesis topic possible to be held on Hochschule Zittau/G¨orlitz, especially for all the paperwork needed as well as useful inputs to the thesis.

My gratitude also belongs to thesis supervisor Ing. Martin Kysela, for providing a access to laboratories, measuring equipment as well as useful inputs, advices and for providing guidance.

I would also like to thank head of research team Ing. Stanislav Petrik, CSc., for dealing with VW on my behalf, research team members doc. Ing. Pavel Rydlo, Ph.D. and Ing. Jaroslav Hanuˇs, Ph.D., for their inputs, consultations and for their overall care.

The last but not least, I would like to thank members of Department of Material Engineering, Faculty of Textile Engineering, Technical University of Liberec, which allowed me to measure on the tearing machine and whom assist me with setting up measurement. And also my thanks belongs to prof. Louda and Dr. Kejzlar from De- partment of Nanostructure Preparation and Analysis, Institute for Nanomaterials, Advanced Technologies and Innovation, Technical University of Liberec, for their chemical analysis of wire, which they kindly provided for this thesis.

(8)

Contents

List of abbreviations . . . 13

1 Introduction 14 2 Theoretical background 15 2.1 Possibilities of electrical stress measurement . . . 15

2.1.1 Considered use cases . . . 15

2.1.2 Usability of sensors types . . . 15

2.1.3 Recapitulation . . . 17

2.2 Measurements of stress by resistive stain gauges . . . 18

2.3 NiTi specifics . . . 19

2.3.1 Structure states . . . 19

2.3.2 Superelasticity . . . 20

2.3.3 Superplasticity . . . 20

2.3.4 Shape memory . . . 20

2.3.5 Non–linearities caused by temperature changes . . . 20

2.4 Thermal compensation . . . 21

3 Measurements 25 3.1 Carbon foil resistive strain gauge . . . 26

3.2 NiTi wire . . . 27

3.2.1 Cyclic loading . . . 27

3.2.2 Tearing . . . 28

3.3 NiTi flat area sensor . . . 31

3.4 Chemical analysis by EDS method . . . 33

4 Software 36 4.1 Mathematical algorithms and models . . . 36

4.1.1 Geometrical and mechanical simplification . . . 36

4.1.2 Classical model . . . 37

4.1.3 Model based upon measured data . . . 38

4.2 MATLAB script . . . 41

4.3 Software development . . . 43

4.3.1 Tasks . . . 43

4.3.2 Idea . . . 43

4.3.3 GUI design . . . 45

(9)

4.3.4 Classes . . . 47

4.3.5 Implementation . . . 49

4.3.6 Requirements and dependencies . . . 51

4.3.7 Adding a new wire by user . . . 52

4.3.8 Adding a new wire by programmer . . . 53

4.3.9 Future development possibilities . . . 53

4.3.10 Validation . . . 54

5 Current state of art 55 6 Conclusion 56 Appendix 59 A Contents of included Compact disc 59 B Source code 60 B.1 Project file . . . 60

B.2 Main function . . . 60

B.3 DPMain class . . . 61

B.3.1 Header . . . 61

B.3.2 Implementation . . . 61

B.4 Wire class . . . 65

B.4.1 Header . . . 65

B.4.2 Implementation . . . 65

B.5 m wire class . . . 67

B.5.1 Header . . . 67

B.5.2 Implementation . . . 68

B.6 p wire class . . . 69

B.6.1 Header . . . 69

B.6.2 Implementation . . . 69

B.7 CoefGetter class . . . 70

B.7.1 Header . . . 70

B.7.2 Implementation . . . 70

C Measured data 72 C.1 Resistivity dependence on temperature . . . 72

(10)

List of Figures

2.1 Resistive foil strain gauge (by Record Tech) . . . 16

2.2 Capacitive sensor principle (according to [4]) . . . 17

2.3 Inductive sensor principle (by [5]) . . . 17

2.4 Quarter–bridge strain gauge circuit (by [6] under DSL) . . . 18

2.5 NiTi phases (left to right Austenite, Martensite twinned and de- twinned) by [7] . . . 19

2.6 Resistivity dependence on temperature of single string NiTi sensor . . 21

2.7 Resistivity dependence on temperature of area NiTi sensor . . . 22

2.8 Quarter–bridge thermal compensated circuit (by [6] under DSL) . . . 23

2.9 Half–bridge strain gauge circuit (by [6] under DSL) . . . 24

3.1 Prototype of single string NiTi sensor . . . 25

3.2 Prototype of flat area NiTi sensor . . . 25

3.3 σ–ε graph of carbon sensor . . . 26

3.4 R–ε graph of carbon foil sensor . . . 27

3.5 σ–ε graph of NiTi wire for cyclic loading . . . 28

3.6 σ–ε graph of NiTi wire – tearing test . . . 29

3.7 R–ε graph of NiTi wire . . . 30

3.8 Construction built in thermal chamber for load measurements . . . . 31

3.9 Loading flat area sensor by several weights in different temperatures . 32 3.10 Reactivity of flat area sensor depending on temperature . . . 33

3.11 Used NiTi wire under the microscope (provided) . . . 34

3.12 Results of EDS chemical spectrum analysis (provided) . . . 35

4.1 Mechanical simplification . . . 36

4.2 Approximation of stress–strain relation by 12th order polynomial . . . 39

4.3 Approximation of resistivity–strain relation by 13th order polynomial 40 4.4 Output of the MATLAB script . . . 42

4.5 Dock areas (by [14], licensed under FDL) . . . 45

4.6 Screen-shot of an application . . . 46

4.7 Inheritance diagram for wire class . . . 48

4.8 New wire dialogue . . . 52

(11)

List of Tables

2.1 Possibilities of stress measurement in considered use cases . . . 18

3.1 Mechanical properties from tearing tests . . . 29

3.2 Results of EDS chemical spectrum analysis . . . 34

4.1 Coefficients of stress–strain polynomial approximation . . . 39

4.2 Coefficients of resistivity–strain polynomial approximation . . . 40

4.3 Validation results . . . 54

C.1 Resistivity dependence on temperature of single string NiTi sensor . . 72

C.2 Resistivity dependence on temperature of area NiTi sensor . . . 73

C.3 Resistivity dependence on temperature and load of area NiTi sensor . 73 C.4 Loading of flat area sensor in room temperature . . . 74

C.5 Reactivity on load in different temperatures . . . 74

(12)

Listings

4.1 Script in MATLAB . . . 41

4.2 Application dependencies on Linux-x86 64/X11, by ldd . . . 51

A.1 OpenPGP key used for signatures . . . 59

B.1 Project file . . . 60

B.2 Main function . . . 60

B.3 DPMain class header . . . 61

B.4 DPMain class source . . . 61

B.5 Wire class header . . . 65

B.6 Wire class source . . . 65

B.7 m wire class header . . . 67

B.8 m wire class source . . . 68

B.9 p wire header . . . 69

B.10 p wire source . . . 69

B.11 CoefGetter header . . . 70

B.12 CoefGetter source . . . 70

(13)

List of abbreviations

CD Compact Disc

CSV Comma separated values DoF Degree of Freedom DPI Dots Per Inch

DSL The Design Science License available from [1]

EDS Energy Dispersive Spectroscopy

FDL GNU Free Documentation License available from [2]

GUI Graphical user interface HSZG Hochschule Zittau/G¨orlitz

KF5 KDE Frameworks 5 by KDE e.V. (sometimes also abreviated as KDF) LGPL Lesser General Public License available from [3]

NiTi Nickel–Titanium

NTC Negative Temperature Coefficient OOP Object-oriented programming RAM Random access memory

RTD Resistance Temperature Detectors TUL Technical University of Liberec var. Variable

(14)

1 Introduction

Main goal of this thesis is to provide assistance to other members of research team at TUL. Aim of this research includes construction of NiTi pressure sensors for steering wheel and drivers seat. Because of used material, compensation of temperature non–

linearities might be needed.

Because of above mentioned reasons, this thesis aim is to develop software for optimisation of sensors shapes to reach given force range, to ensure that maximal allowed strain wouldn’t be crossed and to come up with a solution of compensating temperature drift of sensors resistance. The last aim of this thesis is to conduct measurements regarding temperature stability for future measurement system.

(15)

2 Theoretical background

In Theoretical background, thesis covers basics needed for developing mathematical models. This mathematical models are used in written software as a main criteria for optimisation. This section also covers material specifics as well as measurement of material parameters also needed for mathematical models.

2.1 Possibilities of electrical stress measurement

Stress measurements is possible to be done by several ways. In this section I will cover mostly used types with their bright, down sides and typical use cases.

Mostly used sensor types consist from these:

• Position sensors

• Strain gauges

– Resistive strain gauges – Piezo–resistant strain gauges – Piezo–electrical strain gauges – Capacitive strain gauges – Inductance strain gauges – Fiber optic strain gauges

2.1.1 Considered use cases

In this thesis, there are two use cases considered. The first one is the use of strain gauges on circular shape object like steering wheel (later referred as case 1). The second one is use of strain gauges on flat area (referred as case 2). Details of usage as well as reasons are classified under level of confidential.

2.1.2 Usability of sensors types

Measuring of stress by position sensors doesn’t completely comply with our use case. It is typically used for measuring torque on rotating shafts or in case of large displacement. Our use case on the other hand suppose force perpendicular

(16)

Figure 2.1: Resistive foil strain gauge (by Record Tech)

to surface with small position changes ideally approaching zero displacement. For above mentioned reasons, in this thesis I will further consider strain gauges only.

Resistive strain gauges comes in form factors of foil strain gauges as well as in form of wire. Main principle of measurement is based on that stress on wire/foil induces strain in direction of stress. This leads to elongation as well as to reduce in area perpendicular to stress direction. As a result electrical conductivity decreases, so electrical resistivity increases respectively. Bright side of resistive strain gauges is that they are capable of measuring in whole length/area of sensor, down side are low sensitivity as well as temperature dependency.

Piezo–resistant strain gauges are using Piezoresistive effect. Piezoresistive effect is change of electrical resistivity upon applying mechanical strain. In contrast of resistive strain gauges it is not based upon changing of macroscopic geometry but on microscopical changes in material structure. They are typically made of semi- conductive materials like silicon–germanium, however there are even some metals, which shows the same effect. For case of sensors made of semi-conductive materials, they are highly sensitive but they are only for measuring in single point, so they are used typically for measuring other mechanical variables like acceleration, force or in case of measuring vibrations. Metal ones also shares the higher sensitivity then resistive sensors, they are also able to measure in whole length of wire, but piezoresistive effect take place only in limited conditions (stress and temperature).

Piezo–electrical strain gauges are on the other hand using direct piezoelectric effect. It means that by applying mechanical force electrical potential is generated by crystalline non-symmetry. Bright side of this type of sensors is ability to work as actuator too (by the means of reverse piezoelectric effect) and it can measure and generate vibrations in high frequency bands (up to tens of MHz). However this type can measure only in single points, that is why it is not applicable in this case.

Capacitive strain gauges are using also geometrical changes of material, but as a difference from resistive ones, material is not conductive. Outside force deforms dielectric material between electrodes which leads to changes of capacity, principle is shown in figure 2.2 (detailed information could be found in [4]). These sensors are used also for strain measurements in single point, although it is theoretically possible to use them in measurements on whole area. However this construction would be harder to make then chosen solution.

Inductance strain gauges are based upon principle of changing coil inductance by moving of metal core. Technically it is sensor of position, but when placed on flexible element and where the coil and core are placed on opposite ends (like in

(17)

Figure 2.2: Capacitive sensor principle (according to [4])

Figure 2.3: Inductive sensor principle (by [5])

figure 2.3) it can also serve as a strain gauge [5]. Bright side is possibility of large displacement measurements, negative side is lower sensitivity as well as measuring only in single point. That is why it is not suitable for either of use cases.

Last mentioned type is fiber optic strain gauge. It works on principle that by outside force is bending multi-mode fiber on multiple places. Banding results in optical attenuation, which indicate amplitude of acting force. Bright side of this type is electromagnetic noise immunity as well as possibility of measuring forces on really long distances and combination with other optical sensors in other branch (separated by different wavelength). Weak side is a transport of measured data from moving parts as well as need for light source and receiver.

2.1.3 Recapitulation

It is clear that above mentioned list of sensors types doesn’t cover all of existing principles, however it should cover most of applicable ones. In table 2.1 there is an recapitulation of an all above mentioned with both measured as well as output variables. There is also written the usability for both considered cases. When there is written “No”, it means that sensor type is hardly usable or that using this type of sensor would be complicated, rather than impossible.

For purpose of this thesis NiTi wire has been used. NiTi combines resistive and piezo–resistant principles which can be seen later on in chapters 2.3.5 and 3.

For purpose of comparison there was measured also resistive foil sensor in terms of response on mechanical stress (results are also in chapter 3).

(18)

Table 2.1: Possibilities of stress measurement in considered use cases

Type Measured var. Output var. Case 1 Case 2

Position sensors Position Various No No

Resistive strain gauges Strain Resistivity Yes Yes Piezo–resistant strain gauges Strain Resistivity Yes Yes Piezo–electrical strain gauges Force Voltage No No

Capacitive strain gauges Strain Capacity No Yes

Inductance strain gauges Strain Inductance No No

Fiber optic strain gauges Strain Attenuation Yes Yes

2.2 Measurements of stress by resistive stain gauges

As a name suggest, measurement by resistive strain gauges is by means of electrical measurement in fact measurement of resistivity changes. There are generally two options available, the first one is measuring resistivity value of sensor. This is done either by indirect method (voltage source with current and voltage measurement on sensor) or by measuring voltage drop on sensor supplied by current source. Common thing for both methods is measuring voltage drop in known current, this however induces error due to current through voltmeter (or by voltage drop on amp–meter in indirect method for high resistivity).

Figure 2.4: Quarter–bridge strain gauge circuit (by [6] under DSL)

The second method uses Wheatstone bridge, in which case bridge is not balanced

(19)

by potentiometer like in case of unknown resistor measurement, but a voltage differ- ence is measured instead. In the figure 2.4 can be seen the easiest circuit connection for resistive strain gauges. There are also others which doesn’t share a same dis- advantages as shown one. It is mainly absence of thermal compensation (discussed later in chapter 2.4), as well as low sensitivity in comparison with half or full bridge.

However this circuit is sometimes used because of its advantage, the lowest price among bridge circuits.

2.3 NiTi specifics

NiTi does have several specifics in comparison with usual materials for strain gauges.

As mentioned above, it shows changes of resistivity based upon both microscopic and macroscopic changes in geometry. More details are written in respective sections of this chapter.

2.3.1 Structure states

Figure 2.5: NiTi phases (left to right Austenite, Martensite twinned and detwinned) by [7]

NiTi does have two structure states in usually achievable temperatures. Tran- sitions between phases are caused both by temperature and by stress. The two phases are called the Austenite phase and the Martensite phase. Austenite phase does have cubic structure, it is stable in higher temperatures, has higher crystal- lographic symmetry and shows lower resistivity. Martensite phase is on the other hand stable in lower temperatures, it can exist at several mutually rotated variants (at figure 2.5 twinned and detwinned are shown) and it shows higher resistivity. De- twinned variant is reached by releasing of external stress in low temperatures, this way material won’t have enough energy to return to austenite phase (which is in lower temperatures unstable) so instead it stays in Martensite phase with changing crystalline orientation.

(20)

2.3.2 Superelasticity

Superelasticity (also called pseudoelasticity) is ability to fully recover from large strain (about 8 to 10 %). Thing is, that from perspective of usual materials (like iron alloys), if you look to at σ–ε loading diagram of NiTi wire, you would think that the plato state of diagram is plastic deformation, however it is an ongoing martensite transformation, which is fully recoverable (in high enough temperature).

The stress amplitude before initialization of martensite transform is not constant, it is in both direction function of temperature, it can be also seen that martensite transform shows hysteresis in the terms of stress. This might be seen in the figure 3.5 in the section 3.2.

2.3.3 Superplasticity

Superplasticity (also called pseudoplasticity) is, on the other hand, capability to show plastic like behaviour in low temperatures. In which martensite detwinned structure is obtained, rather then austenite one. In this case about 5% of remain- ing strain would be recovered either by heating up above temperature needed for martensite back transform or by applying of the opposite external stress.

2.3.4 Shape memory

NiTi also shows shape memory. This is induced by heating material to 450 C for at least thirty minutes, by then all inner stresses should be released so after cooling down the material should stay in new shape [8]. It’s needed to say that the shape memory effect occurs in austenite phase and it will be maintained only in austenite phase. If the material will be cooled under the martensite transform threshold temperature, stress which keeps given shape might disappear (shape might collapse). However after heating back to austenite phase the shape will be renewed again.

It is important to say, that shape memory is not used in this thesis task and considered temperature range is not anywhere near needed one for inducing shape memory effect.

2.3.5 Non–linearities caused by temperature changes

NiTi sensors shows quite big dependency on temperature [9] which is in comparison with RTDs (resistance temperature detectors) non–linear. In case of RTDs, there could be seen linear dependency with positive coefficient, which is uniform on wide temperature range. In NiTi case there are also ranges in which sensor shows the same behaviour. This could be clearly seen for example in the figure 2.6 for a range above approximately 60 C. From this temperature resistivity with temperature slowly rises in the same way like in classical RTDs case.

Presumably the same behaviour would occur on the other side of a diagram, how- ever available thermal chamber didn’t allow reaching temperatures bellow -45C so the theory couldn’t be proofed by measurements. Very interesting part of the figure

(21)

Figure 2.6: Resistivity dependence on temperature of single string NiTi sensor 2.6 is the part of martensite transform (sometimes called R–phase). It goes from -40 C (presumably even less) up to 40C. In this range NiTi shows characteristic, which is suspected case of in NTC thermistors rather then RTD. This shows possible future of NiTi use also as thermometers both indoor as well as outdoor (for mild up to Arctic climate).

Due to lower endurance of cables insulation against heat, data measured in fig- ure 2.6 above 100 C was measured quickly, so they might be shifted down. This is mainly because temperature inside of thermal chamber didn’t have a time to stabilize, such a shift could be seen mainly in the last point at 180C.

The figure 2.7 shows the same behaviour as in case of NiTi wire itself but in this case maximum temperature was limited by sensor materials to 100 C (it includes rubber, paper and duck tape). Sensor is also pre-stressed, but the result of it is not visible in the figure. Higher absolute reactivity to temperature is given by longer wire.

2.4 Thermal compensation

As the chapter 2.3.5 showed the thermal compensation is needed in this case. In this chapter I discuss two possibilities, software approach by look up tables and Wheatstone bridges.

Look up table works on principle of finding value of variable how it would look like without influence by disturbance. To accomplish it, it requires measured influence

(22)

Figure 2.7: Resistivity dependence on temperature of area NiTi sensor of disturbance to output value (could be also mathematical function), as well as measuring a disturbance in real–time. So in case of multiple disturbances, every one of them had to be known and also as their look up tables / transfer functions.

Wheatstone bridge on the other hand offers more possibilities to compensate disturbances. Disturbance in this case doesn’t even have to be known or measurable as in previous case, it is sufficient if the disturbance influences both active as well as compensation sensor in same way (or at least in given ratio).

The figure 2.8 shows thermally compensated quarter–bridge and the figure 2.9 shows half–bridge. Both circuits shows ability to compensate thermal disturbances, both adds another strain gauge into circuit, both to the same place in circuit, but each them is good for different application.

Thermally compensated quarter–bridge has got one of the strain gauges under the influence of measured variable, same as classical quarter–bridge but the second one in only under the influence of disturbance (same as the first one). Because of both branches are influenced by the same disturbance, disturbance is subtracted so in theory (when influence is entirely same through whole time domain) it has no effect on output variable. However this circuits doesn’t increase strain gauge sensitivity.

Half–bridge does provide this property, but it only works when the second strain gauge is stressed in opposite direction as the first one. This is typically used in case of measuring bending of solid bodies, when one strain gauge is stressed by compression and the second one in tension, so the overall sensitivity doubles. But in our case it can be used only when the ratio would be required rather then pressure

(23)

Figure 2.8: Quarter–bridge thermal compensated circuit (by [6] under DSL) on individual sensor.

For the purpose of this thesis, I’ve chosen thermally compensated quarter–bridge, the reason is mainly because it provides pressure value instead of ratio. Look up table could be also used, but in case of look up table there had to be used also thermometer, that should measure ideally in the same area as the pressure sensor.

It means that it should be either one of RTDs or same NiTi unloaded sensor. It means that it can be connected in thermally compensated quarter–bridge as well, which saves one measuring channel per sensor.

(24)

Figure 2.9: Half–bridge strain gauge circuit (by [6] under DSL)

(25)

3 Measurements

To provide data for software models, several measurements has been done. The first series of measurements have been done on foil resistive strain gauges. These have been done for comparison reasons with NiTi sensors as well as they have been requested by research team. The second series have been done in the same way on NiTi wire. This is needed for validation of the Young’s modulus of NiTi wire, measured and published by Doctor ˇSittner et al. [10] from Institute of Physics, Academy of Science, Czech Republic.

Figure 3.1: Prototype of single string NiTi sensor

Figure 3.2: Prototype of flat area NiTi sensor

The third series of measurements have been done on two prototypes of NiTi strain gauges (patented by [11]). A single string attached between two screws (shown in the figure 3.1) and a flat area sensor (figure 3.2) . In this series the temperature char- acteristics have been measured. These results have been already shown in chapter 2.3.5, figures 2.6 and 2.7.

The final series shows loading characteristics of a flat area sensor prototype.

These were obtained both in room temperature (a wider range) and in thermal chamber (limited number of load points). These measurements provide the source of data for software model outputs (secondary, validation source has been provided by articles written by Doctor Heller from Czech Academy of Science).

(26)

3.1 Carbon foil resistive strain gauge

Measurements of a mechanical properties of a carbon foil resistive sensors have been done with cooperation of Faculty of Textile engineering TUL in their laboratory.

The reason is that this faculty’s laboratory is equipped with tearing machine for proposes of textile testing. This showed as convenient because it allows movement even by 0.01 mm, however connected sensor allowed maximum force to be 100 N.

Figure 3.3: σ–ε graph of carbon sensor

In the figure 3.3 it might be seen that foil shows plasticity, this is even less convenient because it also shows large time constant for its elongation. This might be observed in step after 1 % of relative elongation. In this point, tearing machine had to return 0.01 mm, which gave a foil additional time to stabilize (that caused drop in needed force).

The evidence of a plastic deformation is visible also by shift in releasing stage, which ended up in relative elongation 0.83 % after the first stretching and 1 % after the second one.

The figure 3.4, then shows resistivity dependence on relative elongation. Also from this figure, effect of plastic deformation is clearly visible. It also shows that, the resistivity rises even more after repeating the stretching, which makes use of this type of sensor even more inconvenient. However the positive thing is that R(ε) dependence can be approximated by linear function, but NiTi shows also this property and it doesn’t shows a plasticity (in limited region it shows superplasticity).

As a result of this finding, standard foil strain gauges could be found less suited for considered use case.

(27)

Figure 3.4: R–ε graph of carbon foil sensor

3.2 NiTi wire

NiTi wire was also measured at faculty of Textile Engineering, on the same equip- ment. Main aim of this measurements was to get both mechanical and electrical characteristics of a used material. This data is essential to both sensor types because they share the same material. In difference to foil sensor, additional measurements have been done. The first of them was cyclic measurement of stress when the rela- tive elongation was increased by 1 % every cycle. Speed was set to its minimal value 6 mm/s and the temperature was oscillating around 20 C (it hasn’t been possible to achieve fully controlled environment).

3.2.1 Cyclic loading

Figure 3.5 shows results of that above mentioned measurement. On the figure, all three NiTi phases can be seen. At the beginning, there is Austenite phase. During this phase the Young’s modulus is almost constant, this phase ends with peak just before plato part of a graph (R–phase).

Loading Austenite–Martensite transform (R–phase) begins with previously men- tioned peak till rise up around 7 % of relative elongation. In this phase it could be seen, that measured lines differs by previous loading. If it was previously loaded it shows lower inner stress than a wire which hasn’t been loaded to same level of a strain.

The third part of graph shows a further strain in martensite phase. It also shows above mentioned properties. It shows almost constant Young’s modulus and stress is higher when reached for the first time. The end of this measurement has been set for

(28)

Figure 3.5: σ–ε graph of NiTi wire for cyclic loading

10 % of a relative elongation because it has been proposed by another research team member that crossing 8 % would result in destructing a wire. However measurement proves that tearing occurs after much larger strain (it will be described later on).

Unloading shows at first almost uniform Young’s modulus, which is shortly after crossing of stress level of loading R–phase, starts to lower itself until stress goes bellow unloading R–phase level. At the first negative peak unloading R-phase begins.

Last part is an unloading R–phase, as the figure shows, after leaving R–phase when loading, stress level of unloading R–phase drops. It quite noticeable in case of maximum load, when R–phase almost hit zero stress. Higher loading stress would result in pseudoplastic deformation, because material wouldn’t have enough energy to recover (it would require higher temperature).

3.2.2 Tearing

The last series of measurements done on tearing machine, were the tearing tests themselves. It has been done three times, ones on previously cyclic loaded wire (from previous measurement), twice on wire which wasn’t loaded before. Result of previously loaded one could be seen on the figure 3.6. A same as in previous case, the speed was set to its minimal value 6 mm/s with room temperature oscillating around 20C.

As in previous measurement results, all of above mentioned material phases could be seen. Also in the figure 3.6, there are also two directional lines, which represents Young’s modulus in Austenite and Martensite state. As already mentioned, the Young’s modulus is an essential value for getting relation between force (or pressure) and strain. Young’s modulus has been calculated by Least Squares Method for the

(29)

Figure 3.6: σ–ε graph of NiTi wire – tearing test

first order function. This was calculated by LibreOffice Calc’s functions “SLOPE”

(returns slope of linear dependency) and “INTERCEPT” (returns absolute part) on range where data shows linear dependence. By denoting from generalized Hook’s law in equation 3.1, for case range limited linear dependence and strain given in per cents equation 3.2 might be obtained. The ∆ε[%]∆σ part equals to result from above mentioned “SLOPE” function. The “INTERCEPT” function doesn’t bring any information about Young’s modulus, it is needed only for showing Young’s modulus line in a graph.

σ = E · ε (3.1)

E = ∆σ

∆ε[%] · 100 (3.2)

Table 3.1: Mechanical properties from tearing tests Loaded Not loaded Ultimate tensile strength [MPa] 1 654 1 434

Ultimate strain [%] 13.98 12.08

Austenite Young’s modulus [GPa] 36 34

Martensite Young’s modulus [GPa] 24 22

Table 3.1 shows results of the first two measurements. The first column repre- sents the wire previously loaded (test shown in the figure 3.6) by cyclic loading from

(30)

figure 3.5, the second one represents a wire which wasn’t previously loaded. Such a wire shows bit different characteristic, all phases looks same but the transient process is not so sharp and also the ultimate stress and strain are bit lower. The third one has been proven inconclusive because slight shift in a grip, which occurred in martensite phase, so it resulted in cyclic loading as well as false strain data after this point.

Figure 3.7: R–ε graph of NiTi wire

Figure 3.7 shows electrical characteristic of a NiTi wire. From above mentioned figure it is clearly visible that dependence of resistivity on strain is linear on two parts. The first part is related to Austenite phase, it has got higher slope of a linear dependence, slightly over 10 Ω per 1 % of a strain (relative change of almost 13.2 % of a resistivity per 1 % of a strain). The second linear part is related to Austenite–

Martensite transform phase as well as Martensite phase. This does have lower sensitivity on a strain, about 3.6 Ω per 1 % of a strain (respectively 4.7 % per percent of a strain in relative units).

Electrical characteristic is highly convenient, because of its linear dependence, which is constant on large range of relative elongation and reasonably steep. Differ- ences between Austenite and Martensite phases can be also partially compensated by pre–stressed secondary wire in sensor in such way that end of R–phase of sec- ondary wire would occur in same time as start of R–phase of primary wire (used for measurement). In this way resulting R–F characteristic slope differences would get lower because of differences in Young’s module (lower Young’s module means higher strain in the same stress, higher strain means higher resistivity, so it results in higher sensitivity). However, it is essential to realize that using pre–stressed wire limits usable strain range.

(31)

3.3 NiTi flat area sensor

In this chapter prototype of NiTi flat area sensor (as shown before in figure 3.2) has been measured. The first thing which was measured, was thermal stability (figure 2.7). It revealed probably the main set back. Martensite transform occurs in working range and it comes with huge changes of resistance. Resistance changes can be compensated (as stated in chapter 2.4), but the martensite transform also leads to pseudoplasticity, which in combination with certain among of inner stress leads to state in which previously elastic deformation results in superelastic one.

This in fact means that sensor would be out of operation (it would measure only the maximum load, not the actual one).

Figure 3.8: Construction built in thermal chamber for load measurements Because of above mentioned reason, I have been forced to make experiment, in which this property could be validated. The idea under this measurement originally included small robotic manipulator, which would change the load inside of thermal chamber, but later on I’ve found out that available manipulator cannot be used in such environment (low temperatures and high relative humidity). That why I had to improvise and I’ve made wooden construction inside thermal chamber, which could be seen in the figure 3.8. Construction consisted of two pulleys, one displayed side, there was 2 kg weight on the other side of a rope, there were two weights, 1 kg and 0.5 kg. This made possible to have five measurement points and allowed full control of an experiment outside of thermal chamber.

It is obvious that such a solution does have its down sides. Mainly due to passive loads in wooden construction the inner measuring points cannot be guaranteed (it means that data might be shifted inside a constrains of fully loaded and unloaded states). However the outside measuring points were not affected and the load has

(32)

Figure 3.9: Loading flat area sensor by several weights in different temperatures been validated by scales. Result of this measurement is shown in figure 3.9. From the characteristic it might be observed, that reactivity of the sensor is highest near the beginning of austenite–martensite transform. It fits the theory, because trans- form is triggered by both temperature and stress and both dependencies does have cumulative effect.

The second thing which could be observed from mentioned figure is the low reactivity in region of low temperatures. The reason for that is that in that region material doesn’t have enough energy to transform from martensite phase, when it reached it. It reaches detwinned martensite form instead which does have higher resistivity. This could be seen since -30 C. In this point the measurement was stopped and continued next day (reason for 2 data points). The second day the value of unloaded sensor was over 1 Ω lower, this means that sensor wasn’t working properly in that temperature and by comparing measured values of unloaded sensor in tables C.2 and C.3 it can be seen that threshold for 2 kg load happened near -25 C.

Even that it is clear that sensor is not able to return back to Austenite phase, it is also clear that it still has got some level of tensometrical properties left. As shown in the figure 3.10, absolute differences in resistance between unloaded and fully loaded sensor are still around 3 Ω. Please note that red points represents second try of the same loading and that two points at -30 C does have the same reason that was mentioned above. However it is important to mention that unloaded resistance is higher in this region, so relative resistance changes would be even lower. So even that sensor won’t be able to provide absolute values of acting force or pressure, it

(33)

Figure 3.10: Reactivity of flat area sensor depending on temperature

would be still able to provide limited information about changes (when temperature would be known).

Considering that, sensors would be used inside car and close to the human body, it is obvious that they won’t be used in such low temperature for long periods of time. However, measuring system should know this issue, that these sensors might be off-line or in limited use only. This comes hand to hand with need of temperature measurement to be able to compensate for reactivity changes, which had to be added to temperature compensation mentioned in chapter 2.4.

3.4 Chemical analysis by EDS method

At the beginning, it had to be said that this measurement hasn’t be done by me (as the only one), all the credit as well as my gratitude belongs to prof. Louda and Dr. Kejzlar from Department of Nanostructure Preparation and Analysis, Institute for Nanomaterials, Advanced Technologies and Innovation, Technical University of Liberec. Because I didn’t have more information about material than that it is Nickel–Titanium alloy, I’ve asked above mentioned experts to perform material ana- lysis. I’ve included their analysis so the thesis could provide complete information about wire in use.

(34)

Figure 3.11: Used NiTi wire under the microscope (provided)

Table 3.2: Results of EDS chemical spectrum analysis Element Atomic [%]

Ti 48.93 ± 0.24 Ni 51.07 ± 0.24

Total 100.00

(35)

Figure 3.12: Results of EDS chemical spectrum analysis (provided)

(36)

4 Software

In this chapter the software creation process is discussed. It describes all from mathematical model creation, though proof of concept done in MATLAB, up to creation of final software in C++ with Qt libraries. The last section of this chapter discuss possibilities of future development as well as adding another characteristics.

4.1 Mathematical algorithms and models

4.1.1 Geometrical and mechanical simplification

The first step of model creation was a simplification. Simplification happened in two steps. The first step was a mechanical substitution of wire between two solid points by two non-bendable beams connected together as well as to supports by joints. This substitution changed previously statically undetermined structure into statically determined one. It can calculated as sum of degrees of freedom (DoF), which equals to zero in statically determined case. In 2D case, every beam adds three DoF (movement along X and Y axis + rotation), every join subtracts two DoF (allows only rotation), so in sum we get zero.

Figure 4.1: Mechanical simplification

Result of above mentioned substitution is shown in the figure 4.1. This represents single field of a sensor, it also counting with wire inability to move in support points and with infinite small point, where external force take place. This can be

(37)

compensated by announcing L as active length of measuring field (distance between supports minus pin width) rather than just length of measuring field itself. Also note that gravitational force is not considered in this model.

N1(y) + N2(y) − F = 0 N2(x) − N1(x) = 0

N1sin(α) + N2sin(α) − F = 0 N2cos(α) − N1cos(α) = 0

N = N1 = N2

2 · N · sin(α) = F

(4.1)

By establishing axis system in 4.1, X axis from left to right and Y axis from bottom to the top, it is possible to denote ratio between inner force N and external force F . This denotion process could be seen in equation 4.1. As it might be seen from the end of second group, the model requires load symmetry between both end of a wire (pin had to be placed in the middle of measuring field).

N = F

2 · sin(α) (4.2)

Equation 4.2 shows result denotion as it is used later. As might be seen the sin(α) brings another non–linearities to chosen sensor construction. Moreover α brings even more problems to equation, because it depends not only on external force but also indirectly on Young’s modulus and perpendicular area, which both are not constants but rather functions. This leads to second step of simplification, which was mentioned at the beginning of this section, in used models later on.

4.1.2 Classical model

Classical model refers to method used for calculating resistance usually in the case of Resistive strain gauges (but after extending by 4.9, it can be also used in Piezo–

resistive cases). It is based upon parameters such as Young’s modulus, Poison’s number and in this case also coefficient of piezoresistivity. This (4.6 and 4.7) works well in case of materials, which does have these parameters constant, but in case of NiTi it probably wouldn’t lead to results. For example Young’s modulus has only two regions in which it can be considered constant. For more information about topic please refer to [10].

σ = N

S = E · ε (4.3)

εx = ∆l

l (4.4)

εy = εz = ∆r

r = −µεx (4.5)

(38)

R = %l

S (4.6)

δR= ∆R R = ∆l

l − ∆S S +∆%

% (4.7)

∆S

S = −2µ∆l

l (4.8)

∆%

% = ΠeE∆l

l (4.9)

Because of above mentioned limitations, the only reasonable way for calculations is to use numerical mathematical methods and reduce number of parameters as low as possible. This let me to model described bellow.

4.1.3 Model based upon measured data

At the beginning, the model was denoted from result of mechanics (equation 4.2), combined with Hook’s law (from equation 4.3) and strain definition (from equation 4.4). Also when L from the figure 4.1 is L = 2 · l, it can lead to denotion of ∆l as shown in equation 4.10. By combining all of these together we gets equation 4.11.

cos(α) = l

∆l + l

∆l = l

cos(α) − l

(4.10)

F

2 · sin(α) = N = σ · S = E · ε · S = E · S∆l

l = E · S 1

cos(α) − 1

!

(4.11) As it might be seen, this equation gives direct relation between angle α and external force F . But from by looking to equation 4.12, it might be seen that the main problem with Young’s modulus persists and it also adds another one with unknown variable α which is hardly separable from given geometrical functions.

F = 2 · E · S sin(α)

cos(α) − cos(α)

!

= 2 · E · S (tan(α) − cos(α)) (4.12) By taking denotion from equation 4.10 one step further, relation between α and ε can be found. To solve Young’s modulus problem, it is needed to go back by Hook’s law and find case specific relation between stress and strain, in which there is no α. Function, which represents such relation is marked by σ(ε) in equation 4.13.

F = 2 · sin



arccos

 1 ε + 1



· σ(ε) · S (4.13)

To get such relation between stress and strain, I’ve used linear regression by 12th order polynomial (previously used 15th order polynomial caused problems in

(39)

Figure 4.2: Approximation of stress–strain relation by 12th order polynomial implementation). Results of chosen approximation is visible in figure 4.2, this result shows coefficient of determination over 99.98 %.

Table 4.1: Coefficients of stress–strain polynomial approximation parameter coefficient parameter coefficient

εM AX [%] 12 x6 28.344 591 075 5

1 0 x7 −3.376 058 755 7

x1 73.917 385 557 7 x8 0.268 931 658 1

x2 959.619 899 566 4 x9 −0.014 254 256 1 x3 −1081.833 425 885 2 x10 0.000 485 833 7

x4 543.214 836 130 4 x11 −9.732 311 206 723 86 × 10−6 x5 −156.421 279 042 3 x12 8.826 420 601 277 11 × 10−8

Table 4.1 shows coefficients of of mentioned approximation, as might be seen, table also includes maximal strain, which had to be a integral part of every ap- proximation. This is due to linear regression’s inability of extrapolation. The value of 12 % has been determined because of safety reasons (the lowest of strain which resulted in tearing) and it will be probably lowered even more for production uses.

Coefficient of the lowest order has been forced to zero because of its physical mean- ing. At stress induced by zero strain had to be also zero.

A same thing has been also used in case of resistance–strain characteristic. Rea- sons were the same as in previous case, the variables which are not known for whole range of strain, in equation 4.9 it would be Young’s modulus as well as coefficient

(40)

Figure 4.3: Approximation of resistivity–strain relation by 13th order polynomial of piezo–resistivity Πe. This time coefficient of determination is equal almost 100 % and it might be seen that approximation curve covers almost all measured points.

Table 4.2: Coefficients of resistivity–strain polynomial approximation parameter coefficient parameter coefficient

εM AX [%] 12 x7 −0.119 512 544

1 78.652 932 585 8 x8 0.002 259 480 8

x1 2.332 579 262 4 x9 0.001 230 611

x2 24.613 313 412 x10 −0.000 183 318 5

x3 −29.664 717 687 4 x11 1.262 088 083 885 5 × 10−5 x4 16.969 001 610 6 x12 −4.484 676 089 224 1 × 10−7 x5 −5.604 255 954 6 x13 6.631 273 251 357 78 × 10−9 x6 1.109 776 807 3

Table 4.2 than shows coefficients of an approximation, but as might be seen it differs even in the lowest order coefficient, which value represents base level / the unloaded resistivity, which cannot be zero because of physics (at least not in room temperatures).

The last thing, which had to be covered by models, is shifting characteristics by pre–stressing of a wire. This was one of a things required by research team.

Reason was, that by pre–stressing of either support or measuring wire resulting sensor’s characteristics can be changed (range of measurable forces, compensation of non–linearities, etc.). Way, how to add pre–stressing into model, is simple, just

(41)

by substitution written in equation 4.14, in which parameter represents a x in table 4.1 and 4.2 respectively.

σ(ε) → σ(ε + ε0) (4.14)

When using this model please note that, even that it is based directly on mea- sured data, so it should be authentic, it is only valid in the same terms as data were acquired. This refers to a temperature which was 20 C. For other temperatures the new measurement had to be conducted, it would be insufficient to just shift resistivity base level according to temperature dependence curve from the figure 2.6. The reason is that austenite–martensite transform occurrence depends not only on stress but also on temperature.

4.2 MATLAB script

As stated before, the MATLAB script works like some kind of proof of concept and some trivial mean of gathered data visualisation. As might be seen in listing 4.1, script firstly closes all previous results (if any), then it creates variables (arrays) with length of input data.

The input data are loaded from previously created CSV file, which had to have at least three data lines (settings: delimited by semicolon, decimal separator “.”

period, column vectors – all but last depends on test file). These data lines had to be loaded into arrays called SigmaMPa, Elongation and ROhm. SigmaMPa states for material stress in MPa, Elongation had to contain strain data in per cents and ROhm needs to be resistivity in Ohms. It is essential that data with the same index are corresponding each other in time, all of variables have got a same length. Please also note that strain is only considered to be a positive number (considering thinness of a wire compression would be hardly achievable), also considering use case of this script, it doesn’t contain any data validation.

c l o s e a l l ;

F ( length ( SigmaMPa ) ) = 0 ; a l p h a ( length ( SigmaMPa ) ) = 0 ; f o r i =1: length ( SigmaMPa )

a l p h a ( i )= acos ( 1 / ( ( E l o n g a t i o n ( i ) / 1 0 0 ) + 1 ) ) ; F ( i )=2∗ s i n ( a l p h a ( i ) ) ∗ SigmaMPa ( i ) ∗ 1 . 9 6 3 5 E− 9 ∗ 1 0 ˆ 6 ; end

subplot ( 2 , 2 , 1 ) ; p l o t ( E l o n g a t i o n , F ) ; x l a b e l ( ’ E l o n g a t i o n [ % ] ’ ) ; y l a b e l ( ’ F [ N ] ’ ) ;

subplot ( 2 , 2 , 2 ) ; p l o t ( a l p h a , F ) ;

x l a b e l ( ’ Alpha [ r a d ] ’ ) ; y l a b e l ( ’ F [ N ] ’ ) ;

subplot ( 2 , 2 , 3 ) ;

p l o t ( E l o n g a t i o n , a l p h a ) ; x l a b e l ( ’ E l o n g a t i o n [ % ] ’ ) ; y l a b e l ( ’ Alpha [ r a d ] ’ ) ;

subplot ( 2 , 2 , 4 ) ; p l o t ( F ,ROhm ) ; x l a b e l ( ’ F [ N ] ’ ) ; y l a b e l ( ’R [Ohm] ’ ) ;

Listing 4.1: Script in MATLAB

(42)

As a next step, script calculates for every stress–strain pair its corresponding angle of bending as well as force needed for such deformation. For calculations of these values, script uses equation 4.13 with separated relation for getting α, which is later used for visualisation of its relations to needed force as well as a strain.

Figure 4.4: Output of the MATLAB script

A figure 4.4 shows a result given by MATLAB script. As might be seen in plot force–strain mechanical construction slightly deforms characteristic from 3.6, austenite phase cannot be approximated by straight line any more, R–phase shows non–zero slope, only martensite phase looks about the same. This behaviour is consistent with behaviour of sin(α) function, which shows the highest slope around zero and then goes to one. This behaviour of mechanical construction is also con- firmed by the second plot (top right–hand side), which shows slower rise up at the beginning and quicker one in the end.

The third plot (bottom left) shows simple translation between strain and bending angle α. The final one shows the most important characteristic for measuring chan- nel, the resistivity–force relation. This, in variant with relative resistivity, might be used for getting the value of acting force on a single measuring field.

(43)

4.3 Software development

After creating the MATLAB script, I’ve started making final software. I’ve chosen to write it in C++ with Qt 5 framework with support some of stuff from KF5 libraries (namely KPlotting and KWidgetsAddons). I’ve chosen this combination because it can run on the most of PC platforms and architectures currently in use. It runs on GNU/Linux R, Apple OS X R and Microsoft R Windows R and x86, x86 64, ARMv6 and ARMv7 architectures. It also supports mobile platforms, such as Google Android, Apple iOS and others, but application is not designed to run on such mobile platforms so it would require some adjustments.

Anyway, C++ in combination with above mentioned frameworks and libraries has also advantage that it doesn’t require any licenses to run, unlike for exam- ple in case of MATLAB script. Used frameworks and libraries are licensed under LGPL v.2.1 (others licenses are also available) and are open source. This also pro- vide more solid base, which isn’t under full control of single company (can be forked), in comparison with for example “.NET ” framework.

4.3.1 Tasks

The research team members gave me this list of task, which had to be performed by a software:

• Display characteristics (y–x):

– Stress–Strain – Resistance–Strain – Force–Strain – Resistance–Force

• Calculate maximum pin height to not allow destructive strain

• Calculate maximal allowed force

• Calculate maximal allowed strain

4.3.2 Idea

As mentioned before in section 4.1.3, Stress–Strain and Resistance–Strain charac- teristics are defined by polynomial approximation so whole task has been reduced to generating strain values, calculating those polynomials, plotting and shifting by pre–stressing.

Force–Strain characteristic on the other hand, required usage of generated strain values as well as corresponding stress values for calculation of needed force for reach- ing given strain this uses equation 4.13 from also from section 4.1.3. This charac- teristic also requires to plot sum of forces from individual wires, because the overall

(44)

force, in difference from previous two (the first one shows inner stress in individual wires, so it is not cumulative and the second one has only one wire present), is cumulative. This means that it is the sum of forces, what really matters here.

Resistance–Force characteristic is probably the most demanding one. It requires calculation of forces sum as well as resistance, that means at least two runs trough polynomial calculation as well as calculation forces for all of wires, their sum and then plotting the resulting characteristic.

Talking about plotting, widget class had to be chosen. Qt itself contain two modules, which handles plotting. The first one, the QtCharts, it can be used to show various types of 2–D plots (line, box, bar, pie, area, etc.). The second one is the QtDataVisualization, this is used for 3–D plotting. Unfortunately both shares common disadvantage, there are distributed only in commercial version of Qt, which require buying license. That was the main reason to look elsewhere, namely in KDE Frameworks 5 (KF5) by KDE e.V.

The KDE develops desktop environment for Linux and other UN*X like operat- ing systems (with experimental support of MS–Windows). It’s current mayor version Plasma 5 is based on KF5, which is based upon Qt 5. KF5 expands functionality of Qt 5 by a broad range of functions from simple adding new widgets, trough support of archives to window manager. It is split into approximately 60 libraries, which are separated into 4 tiers (according to [12]). Tier 1 libraries depends only on Qt 5 (or external libraries), tier 2 depends on tier 1 and so on. Both libKF5Plotting and libKF5WidgetsAddons are tier 1 libraries, which doesn’t depend on anything else than Qt 5 so it doesn’t brings any unnecessary dependencies. It also comes free, with source and licensed under LGPLv2.1+, so it makes ideal candidate for usage. That is the reason why plotting is realized by KPlotWidget provided by libKF5Plotting.

As for data needed for above mentioned calculations, every wire should come with coefficients of Stress–Strain polynomial, maximal strain, its cross-section and its pre-stress. All of these parameters should be write protected from other classes and maximal strain (subtracted by pre-stress) and cross-section should be accessi- ble by respective getters. Stress points should be obtained also by getter, which had to require respective strain points as input parameter. Coefficients themselves shouldn’t be accessible outside of wire class because processing of data is inner busi- ness of a class and allowing outside methods access would be against Object-oriented programming (OOP) principles (according to [13]).

Measuring wire should also have another set of coefficients for Resistance–Strain relation, as well as respective getter for resistance data points. Supporting (pre- stressed) wire should provide possibility to change number of wires at its user inter- face. This possibility shouldn’t be available in case of measuring wire, because this would bring no benefits.

To get maximal allowed strain, program had to ask every instance of wire by respective getter method and display the lowest number available. For reason of not limiting wires by not setted type of wire, such an instance should return high enough number (in this program its hard-coded to 99). To obtain maximal force, program had to go trough similar process like in case of Force–Strain characteristic,

(45)

but in this time only with single strain point, the one provided by above mentioned method. This way it gets sum of forces, which specifies the range of measurable force from zero to value provided by this sum.

The last parameter would have insufficient information (if provided only from wire class), it had to have also information about length of wire, which is able to deform. This value is a distance between supports subtracted by width of pin (in program called “Active field length” and in 4.1 called “L”) and should be provided in millimetres. By use of equation 4.15 the maximal height of a pin is calculated.

hM AX = tan



arccos

 1 εM AX + 1



· L

2 (4.15)

4.3.3 GUI design

In Qt there are two ways how to construct graphical user interface (GUI). The easier way is to make static design, in which every component does have its constant position in window coordinates. This is sufficient in case of small applications with static content and constant size. The other way uses dynamical layouts and dock widgets. Qt offers four layout types, horizontal, vertical, grid and form (special case of grid with two columns one for a labels and one for user controls). Layouts uses all available space and distributes it to all widgets inside of it, it also manages all their size but only inside constrains (if any). In case that it would run out of available space, it is able to expand its parent to get more (it includes main window itself).

Figure 4.5: Dock areas (by [14], licensed under FDL)

(46)

Dock widgets are parts of the main window, which could be moved around dock areas (shown in the figure 4.5), moved outside of the main window or even closed.

It provides its own coordinate system, in which other components might be placed, this also includes dynamical layouts so both can be used simultaneously. In the figure 4.5, there could be also seen the central widget. The central widget’s size is managed by its parent, which reserves all its available space for central widget.

Place occupied by toolbars and dock widgets is not considered free because these have higher priority.

Figure 4.6: Screen-shot of an application

In the picture 4.6, it might be seen the screen-shot from the final version of an application. The GUI is composed of menus, status bar, central widget and one dock widget. Under the File menu, it contains action to export all of the calculated data to single CSV file and the Quit action. Under the View menu, there is single action for opening “Data widget” in case that it was closed by a user. The last Help menu does have About action (shows information about thesis as well as an application) and About Qt action (which shows information about Qt libraries version and license).

Status bar (on the bottom) can be used to pass information in non intrusive way.

This is used in this application for giving user explanation of parameters, but it can be also used in case that someone would like to expand functionality of this application by some action, which would for example took more time, it would be good place to add some message to the user or progress bar to indicate, that the application is busy, not non-responding. But during testing, I haven’t seen any problems concerning performance issues.

As mentioned before plotting is done by KPlotWidget, because it provides the

(47)

most important information to the user, it has been set as central widget. This assures that it would use all available space to show as large plots as possible.

When window size is changed, size of plot is changed as well, when dock widget is removed from a window or closed, it uses its formal place to expand.

The last top-level widget is a data widget. It is has dock widget type, which is allowed on left hand-side, right-hand side, floating outside of window or hid- den. It has dynamic vertical layout (QVBoxLayout ), in which other components are placed. When there are multiple components in one row, there are placed in horizontal layout (QHBoxLayout ). In whole widget there isn’t single component placed statically. This ensures that it would behave correctly when change of win- dow size occurs. However current version of Qt Creator (which has been used for development) doesn’t support relative size constrains yet, this doesn’t bring prob- lems to users with usual DPI screens, however it might be limiting for those who have high DPI screens. For those users, it might be good idea to cancel or adjust size constrains in wire class and its subclasses (it has been used to save more space for combo boxes, by limiting maximum width of KColorCombo and QDoubleSpinBox ).

Last thing, which might not be so obvious from screen-shot, is that wire settings are not actually part of main class GUI design. There is only another vertical layout, on their place. All user controls concerning wire settings are stand alone widgets, which are part of wire class or its subclass. This allows hiding those data from other class members (to maintain OOP principles), as well it allows adding another pre- stressed wires dynamically from the code. It means that every time, when combobox text is changed from “Choose wire” to something else, new row is added. On the other hand, when some of the combo boxes is changed back to “Choose wire” option (and it it not the last one), it is removed.

4.3.4 Classes

As mentioned several times before, program is composed of several classes. The main application class is the DPMain class. It handles most of the tasks around user interface. It manages user inputs (outside of wire settings), it also manages instances of wire class or its subclasses and last but not least, it also handles plotting and data export. It inherits from QMainWindow, which gives it GUI as well as it makes it QObject which provides ability to use SIGNAL/SLOT system (more information in section 4.3.5).

The next class is a wire class. Its main purpose is to provide universal methods and data structures for its subclasses. Its Inheritance diagram is shown in the figure 4.7. It provides possibility to write code just ones and to use it multiple times. The class has got three private members, the coef, limit and area variables. The coef variable represents coefficients of stress–strain polynomial. The limit represents the maximal allowed stress in per cents and the area is the wire cross-section. Class also has got protected members, these are mostly pointers to user interface, which had to be accessible to subclasses and virtual methods for user interface initialization and changing of coefficients. Even that coefficients are private (not accessible to subclasses) by using virtual methods, it is possible call both methods and effectively

(48)

expand parents method functionality. Class also has got public getters so that parent of these instances (the DPMain class) can get all of necessary information out of wire class, such as stress values, colour of line, maximal strain, cross-section and selected wire. The last thing this class have, it one public slot wireChanged and signal changed. Slot wireChanged is toggled by active index change of the wire selector combobox. This is using switch/case structure to force reset on coefficients and to choose appropriate replacement to all parameters. Signal changed is emitted every time that any of wire class user controls changes its value, this force instance of DPMain to update plot accordingly.

wire QWidget

m_wire p_wire

Figure 4.7: Inheritance diagram for wire class

The m wire is the next class, it inherits from wire class (as shown in the figure 4.7). The “m” stands here for measurement, this means that it had to add the second set of polynomial coefficients for Resistance–Strain characteristic (private) as well as public method to access resistance data upon strain points. The last addition are overloading functions to virtual methods from wire class concerning coefficients set up. These had to call versions from wire class first, then they are supposed to add resistance coefficients into Rcoef variable which is accessible only locally. In this subclass it is not needed to overload initUI method, because it shares the same user interface as wire class have.

The last of a wire subclasses is the p wire. The “p” stands for pre-stressed. In the difference to m wire class, this one doesn’t add any coefficients but adds a spin box, which allows user to add the same wire in to a plot multiple times. This however require overloading initUI method, which now also had to add a spin box into the user interface. This has been also achieved by re-using code from wire class by firstly calling wire::initUI and then adding spin box into the layout. Also please note, that if you would have the “High DPI” problem, as described before both initUI methods had to be adjusted.

References

Related documents

Quality registers have become a policy tool for management healthcare and, over time, they have developed and addressed different policy aims.. In this study, we

More speci…c, we show that for thin walled cross sections, a hollow circular cross section has up to 36% better sti¤ness to weight ratio than a corresponding triangular cross

The trend in the linewidth increase is consistent with that induced by the linear chirp, indicating that the understanding of the linewidth being the direct consequence of the

In this in vitro study we will try elucidate what in the interaction between the virus and the host is responsible for the temperature effect on human Rhinovirus

Att förhöjningen är störst för parvis Gibbs sampler beror på att man på detta sätt inte får lika bra variation mellan de i tiden närliggande vektorerna som när fler termer

The other approach is based on the study of thermal emission of materials and the determination of their optical indices by fitting the curve of its emissivity as a function of

Therefore, we have chosen to perform a combined social constructivist and critical discourse analysis of the three main actors’ discourses on migration: the

2 The result shows that if we identify systems with the structure in Theorem 8.3 using a fully parametrized state space model together with the criterion 23 and # = 0 we