• No results found

State estimation of motorcycle fork: A Kalman filter, accelerometer and pressure sensor approach

N/A
N/A
Protected

Academic year: 2021

Share "State estimation of motorcycle fork: A Kalman filter, accelerometer and pressure sensor approach"

Copied!
56
0
0

Loading.... (view fulltext now)

Full text

(1)

 

Degree project in

Computer Science

Second cycle

Stockholm, Sweden 2013

Niclas Berglind

(2)

State estimation of motorcycle fork

A Kalman filter, accelerometer and pressure sensor approach

NICLAS BERGLIND

Master’s Thesis at NADA Supervisor: Patric Jensfelt Examiner: Stefan Carlsson

(3)
(4)

Abstract

A concept for estimation of the states of a motorcycle front fork, stroke and stroke speed, have been developed utilizing a Kalman filter, pressure sensor and accelerometers. The concept development involved sensor and suspension system modeling, Kalman filter setup and tuning, sensor mounting and sensor bracket fabrication, and data recording in a dynamometer and on the road. The result shows a stroke estimation error of about ±s mm when one absolute reference position is known. Difficulties arise when the temperature affect the pressure and makes the stroke estimate drift. Two solutions are proposed, one involving estimation of temperatures and compensating the drifting stroke esti-mate. The other solution is based on a calibration algorithm that can calibrate the system when the motorcycle is on the road. Such a cali-bration algorithm is proven to work according to a patent [1] and would also benefit from calibrating other sources of errors such as for example changing oil level.

Two additional solutions are also investigated, namely using only accelerometers for stroke speed estimation or using accelerometers and a binary sensor that sends a pulse as the stroke reaches a certain value. Using accelerometers require double integration of the accelerometer measurements in order to obtain a value of the stroke. The integration will sum the offset in the accelerometer measurement (there will always be a small offset in a sensor) which will then will drift if no complemen-tary sensor is used to compensate for drift. Due to that the estimation result is only useful for less than a second.

(5)

Tillståndsestimering av motorcykelframgaffel

Ett koncept för estimering av en motorcykelframgaffels tillstånd, slag och slaghastighet, har utvecklats med hjälp av ett kalmanfilter, trycksensor och accelerometrar. Konceptutvecklingen innefattade mo-dellering av sensor och stötdämparsystem, installation och parameterin-ställning av Kalmanfilter, sensormontering och tillverkning av sensor-fästen, och datainspelning i dynamometer och påvägen.Resultat visar ett estimerings fel i slag på ca ±s mm när en absolut referensposition är känd. Svårigheter uppkommer dåtemperaturen påverkar trycket och gör att slagestimeringen driver. Tvålösningar föreslås, en innefattar estime-ring av temperaturer och kompenseestime-ring för drivande slagestimeestime-ring. Den andra lösningen använder en kalibreringsalgoritm som kan kalibrera sy-stemet medan motorcykeln körs på vägen. Det är bevisat att en sådan kalibreringsalgoritm fungerar av ett patent [1] som också har fördelen att kalibrera andra felkällor som till exempel ändrad oljenivå.

Två alternativa lösningar har också utretts, nämnligen att använda endast accelerometrar till slaghastighetsestimering eller att använda ac-celerometrar och en binärsensor som skickar en puls när ett visst ställe i slaget nås. För att använda accelerometrar krävs en dubbel integration av accelerometermätvärden för att erhålla ett värde i slag. Integrationen kommer summera accelerometerns mätvärdesoffset (det finns alltid en liten offset i en sensor) som medför att estimeringen driver om inte en kompletterande sensor används för att kompensera drift. På grund av detta är estimeringsresultatet endast användbart i minde än en sekund.

(6)

Contents

1 Introduction 1

1.1 Problem statement . . . 1

1.2 Related work . . . 2

1.2.1 Accelerometer and linear potentiometer . . . 2

1.2.2 Accelerometer to position . . . 2

1.3 Concepts . . . 2

1.3.1 Displacement measurement . . . 3

1.3.2 Inertial measurement integration only . . . 3

1.3.3 Inertial measurement integration & binary sensor . . . 4

1.3.4 Inertial measurement integration & stroke measurement . . . 4

1.4 Contributions of the thesis . . . 4

1.5 Outline . . . 5

2 Theory 7 2.1 Motorcycle fork construction . . . 7

2.2 Quarter car model . . . 7

2.3 Sensors . . . 8

2.3.1 Accelerometer . . . 9

2.3.2 Linear potentiometer . . . 10

2.3.3 Pressure sensor . . . 11

2.4 State estimation with Kalman filter . . . 11

2.5 Pressure to displacement relation . . . 12

2.6 Temperature effects . . . 13

2.6.1 Oil temperature . . . 13

2.6.2 Air temperature . . . 13

3 Modeling and design 15 3.1 Suspension system modeling . . . 15

3.2 Sensor representation . . . 15

3.2.1 Synthetic sensor data . . . 16

3.2.2 Recorded sensor data . . . 16

3.3 Kalman filter design . . . 17

(7)

3.4.3 Accelerometer . . . 21

3.4.4 Binary sensor . . . 21

4 Implementation 27 4.1 System model . . . 27

4.2 Recorded sensor data . . . 28

4.3 State estimation . . . 29

4.3.1 Accelerometer and displacement . . . 29

4.3.2 Accelerometer and pressure . . . 29

4.3.3 Accelerometer . . . 29

5 Results 31 5.1 Experimental setup . . . 31

5.2 Theoretical results . . . 31

5.2.1 Stroke error wrt. oil temperature . . . 31

5.2.2 Stroke error wrt. fork air temperature . . . 32

5.2.3 Binary sensor solution . . . 32

5.3 Experimental results . . . 32

5.3.1 Accelerometer dynamometer test . . . 32

5.3.2 System dynamometer test . . . 33

5.3.3 System road test . . . 34

5.4 Estimation results . . . 36

5.4.1 Estimation performance with accelerometer and pressure . . 36

5.4.2 Estimation performance with accelerometer . . . 40

6 Summary and Conclusions 43 6.1 Accelerometer evaluation . . . 43

6.2 Pressure sensor solution . . . 44

6.3 Estimation performance . . . 45

(8)

Chapter 1

Introduction

Suspension systems in a car or a motorcycle plays an important role in the vehicle’s comfort and handling performance. With traditional suspension the shock absorber can be tuned to suite one type of driving which also means compromising between comfort and handling. Many modern vehicles utilize electronic suspension systems which allow dynamic tuning of the shock absorber while the vehicle is being used. As a result, the performance can at a higher degree be optimized for both comfort and handling.

To be able to control the shock absorber’s settings in a good fashion, the state of the shock absorber needs to be known. The state is in this case the shock absorber’s stroke and stroke speed. Once the state is known the shock absorber can be automatically tuned by a control algorithm that takes the state as an input and outputs the shock absorber settings to an actuator that sets the settings on the shock absorber.

1.1

Problem statement

In order to improve performance by adding electronics and software, the state of the shock absorber needs to be known. Therefore the goal of this thesis is to develop an embedded system, including sensor solution and software, that estimates a shock absorber’s stroke and stroke speed. The following list is estimated by Öhlins and indicates roughly what is required for a control algorithm to work properly and to keep the cost below a certain level.

• The system should work with a shock absorber stroke of at most 180 mm • Position estimation error is less than s mm

• Velocity estimation error is less than x % of true value • Time delay on estimated state is less than t ms

(9)

• Cost of final product should potentially be less than z SEK

• Concept should have potential of being robust, both mechanically and elec-tronically.

1.2

Related work

Related research are briefly described here. It seem like most existing systems that apply on a motorcycle fork only estimates the stroke velocity and not the position, which is why section 1.3 discusses some additional concepts that can solve the estimation problem.

1.2.1 Accelerometer and linear potentiometer

In a thesis at Öhlins [2], a linear potentiometer and a accelerometer was used for estimation of both stroke and stroke speed. The accelerometer was integrated to stroke speed and integrated again to stroke to give accurate high frequency infor-mation. The drift, due to integration, in stroke speed and stroke was compensated by a linear potentiometer measuring stroke directly.

The problem with this sensor solution is that the linear potentiometer is both costly and fragile which makes it hard or even not possible to develop a product in the right price range and that is mechanically robust.

A very similar sensor solution was used in a paper aimed to develop a state observer for the full car model [3], and also this commercial system [4] uses a similar sensor solution.

1.2.2 Accelerometer to position

One way of estimating position relative to a reference is to continuously integrate acceleration twice to get the position change and keep track of the position. This concept has been evaluated in a mobile robot localization application [5], [6]. How-ever, the results are very poor. Due to a very small but unknown offset in the accelerometer readings, the integration sums the offset over time and in a short amount of time the estimate is completely misleading.

1.3

Concepts

Based on related work and own ideas some concepts have been formed and tested in theory so that one or a few concepts can be proposed for further investigation.

Throughout the majority of the studied material the far most popular estimation method is the Kalman filter. Based on that all described concept below will use the Kalman filter to make an estimate of the suspension fork state.

(10)

1.3. CONCEPTS

• Displacement measurement

• Inertial measurement integration only

• Inertial measurement integration & binary sensor • Inertial measurement integration & stroke measurement

1.3.1 Displacement measurement

Measuring only the stroke of the stroke means that a derivation is needed to receive the velocity. A derivation is problematic if there is sensor noise and a short time step is used in the derivation since the slope of a signal can locally point in the ”wrong direction” due to signal noise. By low pass filtering the signal before taking the derivative a more accurate velocity can be achieved but the low pass filter will delay the signal and the system response will be slower. Some displacement sensors are listed and discussed below.

Optical sensors: There are accurate laser distance sensors that also have very low

response time, however the price of these is expected very high, and if it is mounted inside the suspension fork, the effect of oil moving around in the field of measurement may affect the measurement value.

Sonar sensor: There are sonar sensors with accuracy better than ± s mm [7] [8]

but either the response time is about 10t ms and the estimation response requirement is maximum t ms. Or the the device is very costly. Another aspect is that the oil in the fork will move around and will affect the stroke measurement value depending on how much oil the sonar pulse has to pass.

Pressure sensor: A pressure sensor is another way to measure the stroke. Since

the pressure inside a fork can be related to the stroke of the shock absorber as long as the pressure at the state of rest remains the same. The pressure is dependent on temperature so some kind of calibration will be needed to compensate for that.

This concept requires only one sensor which is preferable, however the veloc-ity estimate can be problematic since a derivation of the stroke value is needed. Derivation with short time steps and noisy stroke signals can be unstable and will need filtering of the stroke signal before derivation is performed. This filtering can remove wanted information from the signal and also delay the signal.

1.3.2 Inertial measurement integration only

This concept builds on integrating accelerometer measurements twice. This means that if there is a small error in the measurement, the estimated quantity will drift over time. According to [6] and [5] the integrated position filtered through a Kalman

(11)

filter can be ”valid” for a short period of time, about 10 seconds. However, for these 10 seconds the position is off with way more than s mm which is the maximum error requirement for this project.

This concept has very poor performance in the long-term. With an estimation accuracy requirement of ±s mm the estimation result will be useful for much less then 10 seconds which is unacceptable in this application.

1.3.3 Inertial measurement integration & binary sensor

This concept has not been discovered in papers that have been studied, but can be a suitable solution. The concept is to integrate the position from accelerometer measurements and correct the drift using a binary sensor that sends a pulse every time the stroke is at a certain value. The binary sensor could be a switch, photo diode, inductive sensor or similar sensors. Using a binary sensor could improve the results in the previous concept (1.3.2) and make it keep a low steady state error over time. The performance is dependent on the frequency of the pulses from the binary sensor, so if the shock absorber will work in a stroke range where the binary sensor is blind, the results cannot be drift corrected and poor performance will be achieved.

This sensor configuration has potential of being very cheap. The main issue is that the binary sensor can be blind for a relatively long period of time if the stroke does not pass the binary sensor. If it will give accurate results the concept can potentially be robust.

1.3.4 Inertial measurement integration & stroke measurement

Combining concept in 1.3.2 and 1.3.3 should give a robust and accurate state esti-mation since the filter algorithm always has a low steady state error measurement to correct the integrated accelerometer measurement with. The low steady state error sensor is a sensor that measures the distance directly, a displacement sensor.

This concept can give a robust estimate of the fork state if proper sensors are being used. The concept has been implemented and tested previously and is proven to work satisfactory.

1.4

Contributions of the thesis

A concept that has the potential to solve the problem statement in section 1.1 is proposed. It turns out that there are many factors that contributes to the estimation error, for example oil temperature, oil volume and air temperature in the fork. Two versions of the original concept are proposed. The first is to switch the pressure sensor for a binary sensor that sends a pulse at a certain stroke value. The second version is based on the original concept but instead of trying to estimate the error contributing factors, they are calibrated out by a smart calibration algorithm. It is

(12)

1.5. OUTLINE

proved by [1] that such a calibration algorithm can be created. The two versions are discussed in section 6.2.

1.5

Outline

In Chapter 2 related work is described. Chapter 3 describes the theory that the design is based on, and the development of the design is explained in Chapter 4. Implementation details are found in Chapter 5 and experiments that were performed to test ideas are found in Chapter 6. Chapter 7 shows the results of the system and parts of the system that are important. Chapter 8 summarizes the whole report and conclusions and ideas about future work is written in Chapter 9.

(13)
(14)

Chapter 2

Theory

2.1

Motorcycle fork construction

There are different ways of constructing a motorcycle fork, in this section the Öhlins FGRT-201 motorcycle fork will be considered.

The fork has two springs and two dampers. Figure 2.1 shows the damping system of the fork. The springs creates a force proportional to the compression of the fork and counteracts the external compression force. The dampers are placed one in each leg and acts on compression speed and rebound speed respectively. The dampers are constructed as a cylinder filled with oil and a piston with an integrated valve and moves in the cylinder as the fork is stroked. The valve in the piston is adjustable so that the damping force can be tuned.

The fork is filled with oil to a certain level and the rest of the volume inside the fork consists of air. Compressing the fork also leads to decreasing the fork volume which leads to increased pressure inside the fork since the amount of air and oil is constant. This pressure acts as an additional spring that is progressive and will therefore not affect much in the upper part of the stroke but much when it is close to fully compressed. The air is much more compressible than the oil so by adjusting the oil level which in turn adjusts the air volume one can tune the stiffness of the air spring.

2.2

Quarter car model

The Quarter car model, seen in figure 2.2 is a widely used and relatively simple model for suspension systems. It models sprung mass, ms (motorcycle body) and unsprung mass, mu (wheel). The two masses are connected with a spring and a

damper representing the forces from the shock absorber. The unsprung mass is connected to the ground with a spring representing the tire deflection.

The equations of motion can be derived using Newtons second law, F = ma and collecting all forces acting on the sprung and unsprung mass.

(15)

Air Oil Outer leg Inner leg Damping piston w. integrated valve

Top out Bottom out

Spring

Fork leg with Compression

damping

Fork leg with Rebound damping Fork leg with

Compression damping

Fork leg with Rebound damping Hole for residual oil Hole for residual oil Damping piston w. integrated valve

Figure 2.1. The figure shows the damping system of the Öhlins FGRT-201 front

fork. On the left the fork is fully extended (top out) and the right picture it is fully compressed (bottom out).

spring forces are proportional to the spring displacement with the spring constants

kf and kt, the damping force is proportional to the velocity with the damping

constant bf.

(

msx¨s= bf( ˙xs− ˙xu) + kf(xs− xu)

mux¨u = −bf( ˙xs− ˙xu) − kf(xs− xu) + kt(xg− xu)

(2.1)

The quarter car model will show the dynamics of the suspension system which is the section of the full motorcycle system that is interesting in this project.

2.3

Sensors

This section discusses how accelerometers, linear potentiometer and pressure sensors can be used to obtain a value of the stroke and / or stroke speed.

(16)

2.3. SENSORS ms mu kf bf kt xu xs xg

Figure 2.2. This figure shows the quarter car model.

2.3.1 Accelerometer

A one axis accelerometer measures the acceleration in the dimension along that axis. The acceleration measurements, a, can be integrated to yield a value of the stroke speed v

v =

Z

adt (2.2)

and in the same manner also a value of the stroke, x can be obtained

x =

Z

vdt (2.3)

the integration can be written in one step and then becomes

x =

Z Z

adt2 (2.4)

Accelerometers, as well as other sensors, has an offset which do not affect the acceleration measurement noticeably but if stroke is to be obtained, the double integration will integrate the offset over time and produce a stroke value with an error proportional to t2. This stroke error will have the affect of making the stroke calculation drift very fast.

A second source of error in the accelerometer measurement is the noise in the sensor which is often modeled as normal distributed. The noise will will result in a random walk drift when the sensor data is integrated.

(17)

To use the acceleration data in a computer, the analog accelerometer signal has to be sampled by the computer’s analog to digital converter at a chosen sampling rate. The acceleration data in the computer is discrete and obtaining stroke speed is now done by calculating the velocity for each sampling period and then summing those

v =Xa∆t (2.5)

and similar for obtaining stroke

x =Xv∆t (2.6)

Discrete data is often handled according to ”sample and hold” which means for each sample period the value is held constant and equal to the value sampled when the sample period started. This limits the sampled data to only represent constant acceleration in between the samples. So if the acceleration is changing the hold value will not tell the truth. However, by sampling the data with a high sampling rate the error can be kept small.

Measuring stroke speed and stroke using accelerometers also accelerations such as the gravity and centripetal acceleration has to be taken into account. These ac-celerations are examples of acac-celerations that will be captured by the accelerometer but not result in a movement along that axis. Because of this, such accelerations has to be considered and removed before calculating stroke speed and stroke.

Due to the construction of the accelerometer, it is not only affected by the ac-celeration in its measuring dimension. Both acac-celerations along other dimensions and rotation of the accelerometer affects the measurement, this is called cross sen-sitivity and can in this application be neglected due to its small influence of the measurement.

2.3.2 Linear potentiometer

This sensor measures relative linear position. The sensor is connected physically the two points of which the relative position will be measured. The sensor measure-ment quantity is position so that measuremeasure-ments with small absolute errors can be obtained.

The stroke speed, v can be calculated by derivating the position, x with respect to time, t. v = dx dt (2.7) which is approximated by v = ∆x ∆t (2.8)

The derivation of sensor measurements is more sensitive to sensor noise when ∆t is smaller because a spiky signal has very steep slopes and results in inaccurate

(18)

2.4. STATE ESTIMATION WITH KALMAN FILTER

speed values. The signal can first be low pass filtered to smooth out the spikes and also flatten the slopes so that the high frequency noise is reduced but the main characteristics of the signal is kept which has a lower frequency. This results in a smoother velocity signal but can also result in a delayed velocity signal depending on how hard the low pass filtering has to be.

2.3.3 Pressure sensor

A pressure sensor measures the pressure, and is a mechanically robust sensor since there are no moving parts and the sensor can be mounted so that it is protected from physical damage. The pressure sensor readings can be used to calculate the position if the initial pressure is known. The stroke value can be obtained through the cal-culations in section 2.5 which are based on constant temperature. The calcal-culations of the effect of temperature is written in 2.6.

2.4

State estimation with Kalman filter

One technique for state estimation and sensor fusion and probably also the most popular, is the Kalman filter or KF. A quantity that is represented in the KF is called a state. The KF uses sensor measurements, that often are noisy, a model of the system and a control signal to make an estimate of the true state [9, p. 40-42]. The KF algorithm is divided into two steps, predict and update and they are described below.

The predict step uses the control signal and a model of the system to make a prediction of the state in the next time step. The equations used for prediction are stated in equation 2.9

ˆ

xk= Axk−1+ Buk

ˆ

Σk = AΣk−1AT + Q (2.9)

where the first line describes the system in state space form and the second line describes the predicted covariance for the prediction. The covariance is the variance of each state and the relation between them and is increased by Q which represents the uncertainty in the model. ˆxk is the state vector estimate containing the current

values of the estimate of the states, ˆxk−1 contains the previous values of the states, uk is the control signal or the input to the system. A and B are matrices that

describes the system model dynamics and transforms the system input and the previous state to the current state.

The update step, stated in equation 2.10, compares the prediction to the mea-surements and depending on the noise parameters in Q and R the information from sensors and the prediction are weighted differently. Also, by incorporating the sen-sor measurements, the covariance is reduced since more information is added to the

(19)

estimation.

Kk= ˆΣkHT(H ˆΣkHT + R)−1 xk = ˆxk+ Kk(zk− H ˆxk)

Σk= (I − KkH) ˆΣk

(2.10)

Kkis the Kalman gain, H is the measurement matrix that transforms the states

to be comparable with the sensor measurement quantities, R is the measurement noise covariance, xk contains the updated state estimates, Σkcontains the updated covariance of the states and zk is the measurement vector.

The first row calculates the Kalman gain which determines how much each sensor should be trusted. The difference between the sensor readings and the prediction, the so called innovation, is multiplied by the Kalman gain and then added to the predicted state to get the updated state vector. Also the covariance of the estimate is updated using the Kalman gain and the predicted covariance.

2.5

Pressure to displacement relation

As described in 2.1 the fork will produce a steady state force based on the com-pression of the air inside the fork and the comcom-pression of the spring. The force is described by equation 2.11 [10]

F = k(∆y + y) + Ap1(

V1 V1− Ay

)1.4 (2.11)

where the spring force is

Fs = k(∆y + y) (2.12)

and the air spring force is

Fa= Ap1( V1 V1− Ay

)1.4 (2.13)

F is the fork force, y is the displacement, k(∆y + y) is the spring force (preload +

displacement), A is the cross sectional area of the inner leg, p1 is the pressure at top out, and V1 is the air volume at top out.

Pressure times area gives force

pmA = Fa⇒ pm = Fa

A (2.14)

substituting 2.14 into 2.13 yields

p = p1( V1 V1− Ay

(20)

2.6. TEMPERATURE EFFECTS

and solving for y results in

y = V1  p p1 1.4 − V1 −A (2.16)

which is a function that takes pressure into stroke. However the air pressure and oil volume are dependent on temperature which is not included in this function. Therefore it is only valid at the temperature where p1 and V1 was measured.

2.6

Temperature effects

The air pressure inside the fork is not only dependent on the displacement but also the temperature of the oil and the temperature of the air. The temperature’s effect on pressure and stroke will be explained in the following sections.

2.6.1 Oil temperature

The temperature of the oil affects the volume of the oil and hence the air volume and the air pressure. The expansion of the oil with respect to temperature is described by

V = V0β(T − T0) (2.17)

where V is the oil volume at temperature T , V0 is the oil volume at temperature T0 and β is the thermal expansion coefficient and is given as β = 0.0007 K−1.

2.6.2 Air temperature

The temperature of the air affects the air pressure according to the Ideal gas law [11, p. 46] which is stated in equation 2.18.

pV = RT (2.18)

where p is the gas pressure, V is the gas volume, R is the gas constant and T is the temperature of the gas.

(21)
(22)

Chapter 3

Modeling and design

This section will describe the development of the chosen concept and how it is designed and modeled based on the theory in chapter 2 and previous work in sec-tion 1.2.

3.1

Suspension system modeling

To be able to generate synthetic sensor outputs, such as accelerations of sprung and unsprung mass, as and au, and stroke, a suspension system model was developed.

The benefit of using a model is that we can experiment with any input signals, such as for example a step response or a frequency response. Simulating these situations makes it simpler when analyzing the estimation algorithm which later will be introduced.

The suspension system model was limited to only describe the dynamics of the front suspension of the motor cycle. The system model was chosen to make the modeling as simple as possible but still give accurate outputs.

The quarter car model described in 2.2 will be modeled and the force of gravity will be added to the unsprung mass and the sprung mass so that the right steady state position will be reached.

Adding the gravity to the quarter car model yields

(

msx¨s= bf( ˙xs− ˙xu) + kf(xs− xu) − msg

mux¨u= −bf( ˙xs− ˙xu) − kf(xs− xu) + kt(xg− xu) − mug

(3.1)

3.2

Sensor representation

The estimation algorithm will be fed with sensor data in different ways, either through a sensor model which uses the output from the quarter car model, or by using recorded sensor data. The two alternatives are explained in the following two subsections.

(23)

3.2.1 Synthetic sensor data

In order to get realistic sensor data out of the model some sensor noise has to be added to the output of the quarter car model, as it generates ”ideal” data with no disturbances. The sensor noise is assumed to be gaussian and the variance was identified from recorded sensor data. The sensors also often has some offset which was roughly approximated by a small number.

The gaussian noise with the obtained variance and the offset was then added to the ”ideal” sensor output so that a more realistic sensor signal is achieved. The sensor signal was also sampled as it would be in a electrical control unit, or ECU. The sample frequency was chosen to be 400 Hz because it was the one used in the ECU.

Using synthetic sensor data allows for simulating simplified sequences such as a step response or a frequency response, however, the quarter car model do not model reality perfectly so the estimation algorithm needs to be tested with more realistic sensor data to see if it will work in reality. Simulating estimation with synthetic data is a good starting point for tuning the estimation algorithm.

3.2.2 Recorded sensor data

As an alternative to the system model that outputs generated sensor data, recorded sensor data could be used instead and be directly fed to the estimation algorithm. The benefit of this is that real sensor output would be used compared to the sys-tem model that generates sensor output only based on the suspension model and not on external disturbance sources as for example motor vibrations, accelerations introduced by the rider, and other sources that may be hard to model or even point out. However, the downside is that the recorded sensor signals could be more complicated to analyze.

The structure of the sensor representation is shown in figure 3.1 which shows the steps for generating synthetic sensor data and read recorded sensor data. The preferred method can be chosen with a switch which sends the data to the estimation algorithm.

Read recorded data

Read road profile Quarter car model Sensor model

Estimation algorithm

Figure 3.1. Block diagram showing the structure of the sensor representation that

(24)

3.3. KALMAN FILTER DESIGN

3.3

Kalman filter design

All state estimation concepts that have been studied from the literature have been based on the Kalman filter, and also the concepts evaluated in this thesis will be based on the Kalman filter. Different sensor setups will be tested and the different variations will be described in the following sections.

Simulink will be used for simulation and there is a Kalman filter block in simulink which will be used. This block uses the state transition matrix to calculate the next state to be used in the prediction step in the KF. The state transition matrix is the matrix that multiplied by the state vector contains the value of the next state.

In order to use the KF one needs a model of the system, in this case the shock absorber. The shock absorber was modeled earlier with the quarter car model, but now a simpler model will be used to start with. The model integrates acceleration to velocity and velocity to position without taking the system dynamics into ac-count. The states in the model are chosen to be stroke, stroke speed, and stroke acceleration. The states can also be written as xs− xu, ˙xs− ˙xu and ¨xs− ¨xu and

can be described as x = x1 x2 x3 = ¨ xs− ¨xu ˙ xs− ˙xu xs− xu ≈ ¨ xprev ¨ x∆t ˙ x∆t (3.2)

The states are approximated by the constant acceleration model shown in the last step, where the acceleration is approximated by the previous estimation of the acceleration. Using the quarter car model, for example, would model a better value for the acceleration. The model is represented by the state transition matrix φ, which is stated in equation 3.3.

φ = 1 0 0 dt 1 0 dt2 2 dt 1 (3.3)

The measured states are x1 and x3 which are measured by accelerometers and displacement sensor respectively. Measuring the first and third state results in the following measurement matrix.

H = 1 0 0 0 0 1 (3.4) Where the first row corresponds to the acceleration state and the the second row corresponds to the position state.

To have the KF perform as desired it is also required to set the measurement noise (R in equation 2.10) for the sensors and the process noise (Q in equation 2.9) for the predict step. These values are tricky to get right by just looking at the sensors’ data sheet so the right value were found by running simulations and tuning the noise variables while looking at the estimation results.

(25)

3.4

Estimation design

Three different but similar sensor setups are designed and are all based on the Kalman filter described in section 3.3.

3.4.1 Accelerometer and displacement

This sensor setup uses two accelerometers and one linear potentiometer. The ac-celerometers, one on sprung mass and one on unsprung mass, measures the stroke acceleration by taking the difference of the two accelerometer signals and the linear potentiometer measures the stroke. These measured quantities matches the mea-sured states in the Kalman filter in section 3.3 and the KF design can therefore be used as it is.

3.4.2 Accelerometer and pressure sensor

This sensor setup is similar to the previous, the only change is that the linear potentiometer is switched for a pressure sensor. Though, the linear potentiometer is kept as a reference sensor but is not used in the estimation. The pressure sensor measures the air pressure inside the fork which is related to the stroke. The pressure is converted to stroke before it is fed to the KF allows for using the exact same KF design as in 4.3.1. This may not be the optimal KF design, but to input the pressure as a sensor measurement into the KF a nonlinear measurement model would be needed to convert the predicted stroke into a pressure. The KF block in simulink that is used for estimation simulation, does not support this feature so for simplicity this method was chosen.

The pressure to stroke relation is described below.

Pressure to stroke model

Since the sensor aimed to measure stroke is a pressure sensor and does not measure stroke directly, a model is used to obtain the stroke from pressure measurements. The model is based on equation 2.16. However, the stroke is not only related to pressure. In reality also temperature in the air inside the fork and temperature in the oil, as explained in 2.6, affects the pressure. The compressibility of oil is neglected.

The effect of oil temperature can be visualized by rewriting the delta volume in expression 2.17 to stroke which then results in 3.5.

∆x = ∆Voil

A =

VoilT0β(T − T0)

A (3.5)

Plotting ∆x vs ∆T = T − T0 results in figure 3.2. The figure gives an idea of the temperature accuracy needed to satisfy the requirements for the product which is a maximum estimated stroke error of ±s mm.

(26)

3.4. ESTIMATION DESIGN −4T −3T −2T −T 0 T 2T 3T 4T −5s −4s −3s −2s −s 0 s 2s 3s 4s 5s

Temperature error (degrees C)

Stroke error (mm)

Stroke error wrt. temperature error

stroke error Maximum error Safe temperature

Figure 3.2. Stroke error wrt. oil temperature error. The reference oil temperature

was 20 degrees Celcius.

The effect of air temperature is visualized by rewriting the ideal gas law 2.18 so that stroke error is described from temperature error. One can solve 2.18 for R which is constant.

pV

T = R (3.6)

Since the cross sectional area is constant, V can be written as xA and A can be moved to the right hand side.

px

T =

R

A (3.7)

The constant right hand side will remain constant for all states of the fork and hence p1x1 T1 = p2x2 T2 (3.8) 3.8 can now be written as

x2 =

p1x1T2 T1p2

(3.9) multiplying by −1 and adding x1 to both sides yields

x1− x2= ∆x = x1−

p1x1T2 T1p2

(27)

function 3.10 can now be plotted with different values of T2 and p2 in order to receive figure 3.3. −4T −3T −2T −T 0 T 2T 3T 4T −3s −2s −s 0 s 2s 3s Temperature error Stroke error

Stroke error wrt. air temperature

top out mean stroke bottom out

Figure 3.3. Stroke error wrt. air temperature error.

One can see that in the worst case the temperature has to be known within about ±0.2TC to keep the stroke error below ±s mm. Temperature relations is discussed in section 5.3.3.

Dynamic calibration

There are many variables that affect the pressure inside the fork and are hard to estimate. Not knowing these variables leads to errors in the stroke calculation based on the pressure. A calibration algorithm that can calibrate the stroke value is therefore desired.

If the system could be calibrated in a smart way while the motorcycle is on the road, all those variables could be neglected. The results in [1] shows that it is possible to do such a calibration.

The calibration algorithm in [1] uses a mean value of many pressure sensor samples which are sampled when there is no longitudinal acceleration, which is the acceleration in the motorcycle’s riding direction. This mean value would represent the pressure at the equilibrium stroke, even if the temperatures affects the pressure or oil level is changing.

To calibrate the stroke estimate from the pressure also the stroke at equilibrium has to be known. This is more tricky to find because it is changing if the rider weight change, and there is no sensor measuring it directly. Theoretically the stroke

(28)

3.4. ESTIMATION DESIGN

can be calibrated to not drift during run time, however the problem of finding the correct absolute stroke due to unknown start up temperatures is still present. Again the patent [1] shows that it is possible to calibrate the absolute level but such an algorithm have not been replicated in this thesis.

3.4.3 Accelerometer

An idea was that accelerometer information with low frequency would mostly con-tribute to drift and higher frequencies would contain the actual motion information from the accelerometers.

This concept has only one sensor signal input, the stroke acceleration which is produced by two accelerometers, sprung acceleration minus unsprung acceleration. The linear potentiometer is also kept as a reference sensor so that the estimation can be evaluated. This sensor setup requires a modification in the KF since there is only one sensor signal measuring stroke acceleration and no sensor measuring stroke. The same process model is used but since there is only one sensor signal, the measurement vector just contains stroke acceleration and hence the measurement matrix H is modified according to equation 3.11.

H =

1 0 0

(3.11)

The idea was simulated using synthetic sensor data from a step response. Three different cut off frequencies for the high pass filter to give an idea of the result of the filter, the cut off frequencies were 100f Hz, 10f Hz and f Hz.

Plotted in the figures 3.4 and 3.5 the estimated stroke velocity, velocity in-tegrated straight from accelerometers, and velocity derivated from displacement sensor are plotted. In figure 3.4 one can see that the highest cut off frequency is closest to the derivated linear potentiometer signal which is considered as a ground truth even though the derivation of the stroke measurement can be inaccurate on noisy signals. The two lower cut off frequencies results in more deviation from the truth. Inspecting figure 3.5 which is just a zoomed version of figure 3.4, reveals the opposite. Here the lowest cut off frequency gives the most accurate result.

Using this technique, one has to compromise between capturing details or keep-ing the absolute error low. Dokeep-ing the same simulation with recorded data as input makes it even harder but the results follows the same characteristics whether the synthetic or recorded sensor data is used. This can be seen in figure 3.6 and 3.7 if they are compared to figure 3.4 and 3.5.

This result indicates that this method do not allow estimation results with both good detail and a good absolute value. This method is therefore not taken into further evaluation.

3.4.4 Binary sensor

To avoid the bad results produced with high pass filtered accelerometers and to avoid using a linear potentiometer this concept was investigated. This concept is

(29)

0 t 2t 3t 4t 5t 6t 7t 8t 9t 10t −6v −5v −4v −3v −2v −v 0 v Time (s) Stroke speed (m/s)

Estimation w. high pass filtered accelerometer

v estimated, 10f Hz HPF v estimated, 010f Hz HPF v estimated, f Hz HPF v estimated, unfiltered

v derivated from displacement sensor v integrated from acc

Figure 3.4. Figure shows estimation result with an accelerometer filtered with different high pass filters.

0.39t 0.4t 0.41t 0.42t 0.43t 0.44t −1.2v −v −0.8v −0.6v −0.4v −0.2v 0 0.2v 0.4v 0.6v Time (s) Stroke speed (m/s)

Estimation w. high pass filtered accelerometer

v estimated, 100f Hz HPF v estimated, 10f Hz HPF v estimated, f Hz HPF v estimated, unfiltered

v derivated from displacement sensor v integrated from acc

Figure 3.5. Figure shows estimation result with an accelerometer filtered with different high pass filters.

based on two accelerometers that captures the high frequency motions of sprung and unsprung mass, and having a binary sensor that compensates for the accelerometer

(30)

3.4. ESTIMATION DESIGN 0 t 2t 3t 4t 5t 6t 7t 8t 9t 10t −20v −15v −10v −5v 0 5v 10v 15v 20v Time (s) Stroke speed (m/s)

Estimation w. high pass filtered accelerometer

v estimated, f Hz HPF v estimated, 10f Hz HPF v estimated, 100f Hz HPF v estimated, unfiltered

v derivated from displacement sensor v integrated from acc

Figure 3.6. Figure shows estimation result with an accelerometer filtered with different high pass filters.

0 t 2t 3t 4t 5t 6t 7t 8t 9t 10t −4v −2v 0 2v 4v 8v 10v 12v 14v −4v Time (s) Stroke speed (m/s)

Estimation w. high pass filtered accelerometer

v estimated, f Hz HPF v estimated, 10f Hz HPF v estimated, 100f Hz HPF v estimated, unfiltered

v derivated from displacement sensor v integrated from acc

Figure 3.7. Figure shows estimation result with an accelerometer filtered with different high pass filters.

drift. The binary sensor could for example be a switch that sends a pulse as the stroke reaches a certain value. According to [6, p. 732] and the results of stroke

(31)

speed estimation in section 5.4.2 the estimation result with only accelerometers is only valid for a short period of time, but if a binary sensor is used it can cancel the drift every time it is triggered.

The first second of the estimation with only accelerometers is shown in figure 3.8 which indicates that the estimation for stroke speed is only valid for roughly 0.04t seconds while no drift compensating sensor is used. This estimation is not meant to be accurate but just act as a guideline.

0 0.02t 0.04t 0.06t 0.08t 0.1t 0.12t 0.14t −0.8v −0.6v −0.4v −0.2v 0 0.2v 0.4v 0.6v

Stroke speed (v) − KF2 estimated

Time (s)

Stroke speed (m/s)

Estimated Speed True speed

Figure 3.8. Using only accelerometers results in this figure. Stroke speed estimate

is valid for about 0.04t seconds.

To be able to compensate for drift, the position needs to be known each 0.04t seconds. On a plot of stroke data, each 0.04t second is marked with an ”o”. Figure 3.9 shows the result and by simple eyeballing the number of sensors needed are roughly 50.

Having 50 binary sensing points seems at a first glance a bit impractical, but a sensing device could be designed for example as one sensor mounted in the outer leg sensing holes in the inner leg and software that counts the holes passing and keeping track of the position. This would allow one binary sensor to give many sensing points.

This sensor setup would need modifications in the KF that allows stroke mea-surements at a variable sampling frequency, in other words a KF that varies the measurement matrix H based on which measurements that are present at the KF update. These modifications are not performed in this thesis.

(32)

3.4. ESTIMATION DESIGN 0 10t 20t 30t 40t 50t 60t 70t 80t 0 20s 40s 60s 80s 100s 120s 140s 160s

Binary sensor − Stroke vs time

Time (s)

Stroke (mm)

Figure 3.9. Stroke recording from a track run with circles plotted each 0.04t seconds

(33)
(34)

Chapter 4

Implementation

This chapter will describe the different implementation steps that has been carried out during the project. Some of the implementation steps are not part of the final solution but have been necessary to do experiments and to evaluate ideas.

4.1

System model

As mentioned in section 3.1, a modified quarter car model will be used to model the system dynamics. A simulink implementation of the quarter car model by ”CTMS” [12] was found and modified according to equation 3.1. The result is shown in figure 4.1 stroke pos x_u v_u a_u x_s v_s a_s a_u 3 a_s 2 Stroke 1 To Workspace4 stroke To Workspace2 avx_s_true To Workspace avx_u_true Sum3 Sum1 Sum Spring tire k_t Spring fork k_f Spring corr x_stroke

Mass unsprung 1/m_u Mass sprung 1/m_s Integrator3 1 s Integrator2 1 s Integrator1 1 s Integrator 1 s Gravitation 9.82 Damper fork b_f Road profile 1

Figure 4.1. Simulink implementation of the modified quarter car model

The model takes a road profile input, which is the vertical position of the road, which is described as xg in figure 2.2, assigned with a time and feeds it to the

calculating blocks. The blocks outputting au, vu and xu calculates the unsprung

(35)

does the same for the sprung mass. The blocks ”Spring fork” and ”Damper fork” calculates the spring and damping force from the damper and the ”Spring tire” block calculates the spring force from the tire. The model then outputs sprung and unsprung accelerations and stroke which are the quantities that are measured by sensors in the real system. Also the acceleration, velocity and position for both sprung and unsprung mass are sent to a debug output.

The sensor model (one for each sensor) is designed to add noise and offset and sample the sensor signals to mimic the real sensor output, or rather the sensor signal when it is sampled inside the ECU. In figure 4.2 the simulink implementation of the sensor model is shown.

Sensor output 1 Sampling2

External noise Gaussian

Bias u+b Ideal sensor output

1

Figure 4.2. Simulink implementation of the sensor model

The ”Ideal sensor output” which comes form the system model goes into the system model and through the bias and gaussian block which adds offset and gaus-sian noise to the ideal sensor signal. The signal is then sampled with a sampling block. The size of the offset, the variance of the gaussian noise and the sampling frequency are shown in table 4.1 and the method of finding these parameters are described in section 3.2.1.

Sensor Offset Variance Sampling frequency

Sprung accelerometer 0.1v m/s2 18.9840a m/s2 400 Hz

Unsprung accelerometer 0.2a m/s2 2.5954a m/s2 400 Hz

Linear potentiometer 0.00001s m 0.0000001s m 400 Hz

Pressure sensor 0.00001p bar 0.0005p bar 400 Hz

These two models, quarter car model and sensor model, will represent the phys-ical system and provide the estimation algorithm with synthetic sensor outputs so that the estimation can easily be tested in a computer simulation environment.

4.2

Recorded sensor data

This is implemented as an option to the system model and makes the user decide whether to use generated sensor data or recorded sensor data. The recorded sensor data was read in matlab using the function csvread and then captured by simulink

(36)

4.3. STATE ESTIMATION

using from workspace block. The sensor data source is chosen with a switch that determines if generated or recorded sensor data should be passed to the estimation algorithm which does not know where the data comes from.

4.3

State estimation

The KF is already implemented in simulink but needs a system model and param-eters to work properly. Different versions are implemented and described in the following subsections.

4.3.1 Accelerometer and displacement

The first KF implementation uses accelerometer data and displacement data and uses the state transition matrix stated in 3.3 and the measurement matrix stated in 3.4. These matrices were copied into the kalman filter block in simulink and the covariance matrices were tuned by the following methodology. By looking at the estimation result and finding out which sensor information that needs more emphasis to result in a better estimation. The variance for the corresponding sensor were then decreased with respect to the other sensors. The process was iterated until feasible parameters were found.

4.3.2 Accelerometer and pressure

When the accelerometer and displacement setup proved good results, the displace-ment sensor was switched to a pressure sensor, but the KF was kept the same. Instead of modifying the KF, an additional model was added between the pressure sensor and the KF to translate the pressure into a stroke value.

The pressure to stroke function was based on equation 2.16 which was imple-mented with a matlab function block in simulink.

4.3.3 Accelerometer

This implementation was based on the first version in section 4.3.1 with the modifi-cation of removing one sensor input and adding a high pass filter on the accelerom-eter measurements.

(37)
(38)

Chapter 5

Results

This chapter is split into three categories of results, experimental setup, theoretical results and practical results. Results for each category can be seen in the three following sections.

5.1

Experimental setup

The experimental setup is a sensor setup shown in figure 5.3 and including the sen-sors listed in table 5.1 mounted on a hypersport motorcycle. All measured quantities are related to the front fork.

Sensor type Measured quantity

Linear potentiometer Stroke

Accelerometer Sprung acceleration

Accelerometer Unsprung acceleration

Pressure sensor Air pressure inside the fork Temperature sensor Oil temperature on left fork leg Temperature sensor Oil temperature on right fork leg Temperature sensor Temperature on outdoor air

All sensors are connected to a logger device that samples all sensors in up to 400 Hz and saves them in a flash memory. The data can then be downloaded to a computer for further analysis.

5.2

Theoretical results

Results derived from theoretical relations are shown in this section.

5.2.1 Stroke error wrt. oil temperature

While stroke is calculated from air pressure in the fork, the oil temperature affects the result as shown in figure 3.2. In order to receive a stroke value with an accuracy

(39)

better than ±s mm, the oil temperature has to be known within ±T◦C.

5.2.2 Stroke error wrt. fork air temperature

The air temperature affects the stroke error according to figure 3.3. This means that to receive a stroke value with an accuracy better than ±s mm, the air temperature has to be known within ±0.2T to ± 0.4T◦C when the fork is topped out.

5.2.3 Binary sensor solution

As described in section 3.4.4 a binary sensor solution would require about 50 binary sensing points to be able to compensate for accelerometer drift.

5.3

Experimental results

5.3.1 Accelerometer dynamometer test

An accelerometer typically has a built in low pass filter, this was discovered when the estimation result showed a greater delay when the accelerometers were weighted higher. The delay was consistent throughout the whole estimation so a experiment was performed so that the source of the delay could be found.

To test the accelerometer performance, three different accelerometers with spec-ifications shown in table 5.3.1, were mounted on the unsprung mass of a motorcycle fork which was tested in a dynamometer. The dynamometer stroked the fork ac-cording to recorded stroke data from a motorcycle ridden on a track.

Manufacturer Alias LPF cut off frequency

Kelag a1000 100000f Hz

2D a100 10000f Hz

Continental acont 11500f Hz

Accelerometer measurements were logged and plotted in figure 5.1 and it can be seen that the ”a1000” accelerometer is significantly faster than the ”a100” and ”acount”. ”a100” was the one used in the initial test setup. To determine if the data from ”a1000” also corresponded the best to the ”true” value, the stroke velocity were calculated by integrating the accelerometers. These velocities were compared to derivated position data from the linear potentiometer which is considered as the ”true” value. This comparison is plotted in figure 5.2.

It can be seen clearly that the ”a1000” is providing the lowest error while com-paring the accelerometer data to the linear potentiometer data. As a result of the experiment the ”a1000” accelerometer was chosen to work further with.

(40)

5.3. EXPERIMENTAL RESULTS 0 0.001t 0.002t 0.003t 0.004t 0.005t 0.006t 0.007t −20a 0 20a 40a 60a 80a 100a Accelerometer evaluation Time (s) Stroke acceleration (m/s 2) a1000 a100 acont

Figure 5.1. Graph showing the delay between the three different accelerometers.

0 0.004t 0.008t 0.012t 0.016t 0.02t 0.24t 0.28t 0.32t 0.36t 0.4t −0.4v −0.2v 0 0.2v 0.4v 0.6v 0.8v v 1.2v 1.4v

Stroke speed − integrated acc

Time (s)

Stroke speed (m/s)

integrated 1000Hz Acc integrated 100Hz Acc integrated cont Acc derivated Lin pot

Figure 5.2. Graph showing integrated accelerometer values compared to the derivated linear potentiometer value.

5.3.2 System dynamometer test

The purpose of this experiment was to evaluate the performance of the system so that decisions could be taken on further development and tuning. The following sensors were mounted on the motorcycle fork while performing the test:

(41)

• Pressure sensor measuring the pressure of the air inside the fork

• Temperature sensor measuring the temperature of the air inside the fork • Linear potentiometer measuring the stroke of the motorcycle fork

The fork was then mounted in the dynamometer and the fork was compressed according to recorded data from a motorcycle ridden on a track. The data was logged during the test at 400 Hz.

5.3.3 System road test

The main purpose of this test was to find out how temperatures in the fork would vary while riding in various conditions so the sensor configuration was expanded as shown in the list below. The sensors marked with ”*” are meant to be used for estimation of stroke and stroke speed. The linear potentiometer will provide a reference to be compared with the estimation. The temperature sensors are for evaluation of the relation of the fork oil and air temperatures, and the outdoor temperature.

• *Accelerometer at the unsprung mass of the fork • *Accelerometer at the sprung mass of the fork

• *Pressure sensor measuring the pressure of the air inside the fork

• Temperature sensor measuring the temperature of the air inside the fork • Temperature sensor on each inner leg aimed to measure temperature of the

damping system’s oil

• Temperature sensor measuring outdoor temperature

• Linear potentiometer measuring the stroke of the motorcycle fork

The sensor setup can be seen in figure 5.3. Only the accelerometers and the pressure sensor, marked with ”*” in the list, is meant to be used as input to the estimation algorithm. The others are only for evaluation of temperatures and ref-erence to be compared to the estimation algorithm.

The logged temperatures are analyzed in section 5.3.3

Temperature relations

An accurate stroke value can be calculated from the pressure measurement if also the temperature of the fork oil and fork temperature is known. To investigate the correlation between temperatures inside the fork and the outdoor temperature, temperature measurements were logged from a motorcycle ridden on a road. The temperatures on the fork air, fork left leg, fork right leg, outdoor air and low pass

(42)

5.3. EXPERIMENTAL RESULTS

(a) (b)

Figure 5.3. Test setup on the hypersport motorcycle, picture (a) shows the pressure

sensor mounted on the outer leg and logging device on the tank. Picture (b) shows the front fork with mounted sensors. One linear potentiometer parallel to the front fork, two accelerometers, one next to the wheel axle and one at the upper linear potentiometer bracket.

filtered outdoor air temperature is shown in figure 5.4. Intuitively, the temperatures inside the fork could have some similarities to the low pass filtered outdoor temper-ature which is why the outdoor tempertemper-ature is filtered and plotted. The fork air temperature seems to follow the outdoor temperature roughly, and the outdoor tem-perature can be obtained from an existing sensor on the motorcycle. However, the outdoor temperature is sometimes deviating more than ±0.2T◦C from the filtered outdoor temperature which makes the filtered outdoor temperature unfeasible as an estimate of the fork temperature. Also the fork oil temperature is on the limit of de-viating more than ±T◦C from the filtered outdoor temperature which is why it also needs to be estimated in a better way to achieve desired estimation performance.

The temperatures could probably be estimated using estimated stroke and stroke speed, and calculating damped energy and convert it into heat. The problem is that at system start up, one does not know the fork temperatures and they can not be estimated accurately because the temperature change from last usage to start up is unknown.

(43)

0 100t 200t 300t 400t 500t 600t 700t 800t 0 T 2T 3T 4T 5T Time (s) Temperature (deg C) Temperature log Fork air Fork left oil Fork right oil Outdoor Outdoor filtered

Figure 5.4. Temperature log from motorcycle ridden on a road.

5.4

Estimation results

In this section the results of the state estimation based on data collected from road tests will be presented and analyzed. The the accelerometer and linear potentiome-ter setup was made as a start point and to verify that the simulation was working properly before the estimation was extended to use a pressure sensor instead of a linear potentiometer. The results of the accelerometer and linear potentiometer setup will therefore not be presented.

5.4.1 Estimation performance with accelerometer and pressure

The estimation results from the KF using accelerometers and pressure sensor is shown in figure 5.5 which is a stroke estimation on data recorded from a motorcycle ridden on a road for about one hour. It can be seen that the estimation result tends to drift in the last part of the estimation where the stroke is constant. Here the motorcycle is parked and the fork is not cooled by the airspeed and the heat from the motor and radiator is heating the fork. The heating of the fork also leads to increased pressure, a pressure change that is not modeled by the "pressure to stroke" function and hence a error in the stroke estimation.

A closer look in figure 5.5 where the stroke frequency is high is shown in fig-ure 5.6. It can here be seen that the estimation error exceeds ±s mm. At higher stroke frequencies the estimation tends to overshoot more, in some cases up to 5

(44)

5.4. ESTIMATION RESULTS 0 100t 200t 300t 400t 500t 600t 700t 800t −0.02s 0 0.02s 0.04s 0.06s 0.08s 0.1s 0.12s stroke (x) − KF2p estimated Time (s) Stroke (m) Estimated True

Figure 5.5. Stroke estimation results with pressure sensor and accelerometer using

data from a motorcycle ridden on a road for one hour.

mm more than the true value. However, if the stroke is calculated from the pres-sure data, the estimation undershoots the true value. This indicates that the KF parameters could be configured in a more optimal way in order to achieve a better estimation result.

Looking closer at a location where the stroke frequency is slower shows in fig-ure 5.7 that the estimation is accurate to about ±s mm except for when the motor-cycle is stationary and the fork is not cooled by the airspeed.

Also the stroke speed is estimated which can be seen in figure 5.8. The "true" value should be considered as an indicator more than the exact truth since the "true" stroke speed is derivated from a linear potentiometer measurement that also is low pass filtered. This means that noise in the stroke measurement can result in peaks in the "true" stroke speed when the stroke measurement is derivated, peaks that are not there in reality. Also sharp edges and details in the stroke speed curve might be smoothed out. It is important that these considerations are taken into account whens the estimation result of the stroke speed is analyzed.

The goal was to keep the estimated stroke speed with an error less than x % of the true speed.

In the end of the estimation in figure 5.8 it can be seen that the stroke speed has an offset to the true value. The absolute error of the stroke speed after 700t seconds is about 0.01v mm/s which is very slow and considered ok, even though it is more than a x % error.

A closer view of figure 5.8 where the stroke speed is high is shown in figure 5.9. The estimated stroke speed does not have all details that the true value has and

(45)

520.6t 520.64t 520.68t 520.72t 520.76t 520.8t 520.84t 520.88t 520.92t 520.96t 521t 0.03s 0.04s 0.05s 0.06s 0.07s 0.08s 0.09s 0.1s Stroke (x) − KF2p estimated Time (s) Stroke (m) Estimated True

Figure 5.6. Stroke estimation results with pressure sensor and accelerometer when

stroke speed is fast.

t 2t 3t 4t 5t 0.03s 0.032s 0.034s 0.036s 0.038s 0.04s 0.042s 0.044s 0.046s 0.048 Stroke (x) − KF2p estimated Time (s) Stroke (m) Estimated True

Figure 5.7. Stroke estimation results with pressure sensor and accelerometer when

stroke speed is slow.

the peaks are sometimes overshoot and sometimes undershoot but mostly within a x % error compared to the true value.

(46)

5.4. ESTIMATION RESULTS 0 100t 200t 300t 400t 500t 600t 700t 800s −1v −0.8v −0.6v −0.4v −0.2v 0 0.2v 0.4v 0.6v 0.8v

Stroke speed (v) − KF2p estimated

Time (s)

Stroke speed (m/s)

Estimated True

Figure 5.8. Stroke speed estimation results with pressure sensor and accelerometer.

344.92t 344.96t 345t 345.04t 345.08t 345.12t 345.16t 345.2t −0.6v −0.4v −0.2v 0 0.2v 0.4v 0.6v 0.8v

Stroke speed (v) − KF2p estimated

Time (s)

Stroke speed (m/s)

Estimated True

Figure 5.9. Stroke speed estimation results with pressure sensor and accelerometer

(47)

5.4.2 Estimation performance with accelerometer

As can be seen in figure 5.10 the estimated value is drifting away from the true value very fast and the result is not useful at all. This is due to the integration of the accelerometer measurements as described in section 2.3. However, the small peak at about 0.5t seconds is present at both the estimated and the true curve. This shows that the accelerometer do capture the details but the estimation can not be used due to the drift. If an additional sensor with accurate absolute measurement is used in combination with the accelerometers the result could be improved.

Figure 5.10. Estimation results using only accelerometer as input

Using a high pass filter to filter out the low frequency motions results in a better steady state error and the drift is in some extent resisted. Instead though, the estimated value is oscillating around the true value. This can be seen in figure 5.11. Since the low frequency information is filtered out, the signal can no longer be constant or change slowly, so the result is a fast changing and oscillatory signal.

(48)

5.4. ESTIMATION RESULTS

(49)
(50)

Chapter 6

Summary and Conclusions

This thesis investigates the possibility of estimating the stroke and stroke speed of a motorcycle front fork with a pressure sensor and two accelerometers and kalman filter. A simulation environment is implemented in matlab and simulink and dif-ferent kalman filters are tested with difdif-ferent sensor inputs. The main focus is on getting accurate measurements from the pressure sensor, and it turns out that drift due to temperature change in the air and oil inside the fork has to be calibrated out to achieve a stroke estimation error smaller than ±s mm. Estimating the tem-peratures is hard due to unknown starting temperature so a more elegant way is proposed, namely a calibration method that calibrates the pressure sensor’s abso-lute value without knowing all parameters that affect the estimation error. There is one patented calibration method that, according to presented results can solve the calibration problem, which indicates that such a calibration method is possible.

Two alternative concepts are evaluated as well, namely stroke estimation with only an accelerometer and stroke estimation with accelerometer and binary sensors (a sensor that sends a pulse when the stroke reaches a certain value). Results with only accelerometer are poor, after less than one second the stroke speed estimation is useless due to integration drift. One idea was then to compensate for drift by adding binary sensors that could cancel the drift once the stroke reaches a binary sensor. By rough estimation the number of binary sensing points is 50.

Tests are done first in a computer simulation environment with generated sensor data, then the model was extended to take in recorded sensor data. Data were first recorded by mounting sensors on a motorcycle front fork and mounting the fork in a dynamometer that compressed the fork according to a pre-defined motion pattern. The fork was also mounted on a motorcycle that was taken out on the road so that data could be recorded from a real scenario.

6.1

Accelerometer evaluation

It has been shown that the accelerometer’s built in low pass filter needs a higher cut off frequency than 10000f Hz, however the new accelerometer used in the tests had

References

Related documents

This means that for each set of training data, for each vehicle, there were three set of parameter setups. With the algorithms optimized with respect to these criteria’s,

Resultatet visar också att de elever som är mer nöjda med sin lärare mer sällan har tänkt att de skulle vilja sluta spela cello, vilket än en gång visar att lärarens person

A newly developed treatment, Cognitive Therapy for Insomnia, (CT-I) targets these maintaining processes and was efficient in an open trial with adult participants (Harvey,

However, considering the interviewed Somali children’s beliefs and attitudes, knowledge of their language is good for their ethnic identity and belonging, which may correlate

Figure 16: Bias for the OR-estimators when coe fficients change linearly: un- smoothed (black), benchmark (light blue) and λ = 0.25 (red); 0.75 (green); 1 (blue).. Figure 16 shows

In this note we introduce a procedure for the estimation of a functional time series model first utilized in Elezović (2008) to model volatility in Swedish electronic limit order

We extended node descriptors for private nodes to include the addresses of their partners, so when a node wishes to send a message to a private node (through relaying) or establish

In the present study, the findings of advantage of bilinguals in performance on non-lexical reading tasks (rhyming) and disadvantage in lexical reading tasks (word