57
Department of Physics Ume˚ a Universitet January 19, 2015 A motion cueing model for mining and forestry simulator platforms based on Model Predictive Control En modell f¨or r¨ orelsesignaler till simulatorplattformar inom gruv- och skogsindustri baserad p˚ a Model Predictive Control Oryx Simulations AB Jens Walker [email protected] Master thesis 30hp Examiner: Eddie Wadbro ([email protected]) Supervisor: David Grundberg ([email protected])

A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Embed Size (px)

DESCRIPTION

A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Citation preview

Page 1: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Department of PhysicsUmea Universitet January 19, 2015

A motion cueing model for mining and

forestry simulator platforms based on

Model Predictive Control

En modell for rorelsesignaler till

simulatorplattformar inom gruv- och

skogsindustri baserad pa

Model Predictive Control

Oryx Simulations AB

Jens [email protected]

Master thesis 30hp

Examiner: Eddie Wadbro ([email protected])Supervisor: David Grundberg ([email protected])

Page 2: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control
Page 3: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

Abstract

Oryx Simulations produce simulators for mining and forestry machin-ery used for educational and promotional purposes. The simulators usemotion platforms to reflect how the vehicle moves within the simulator.This platform tilts and accelerates the driver in order to enhance the ex-perience. Previously a classical washout filter algorithm has been used tocontrol the platform which leaves something to be desired regarding howwell it reflects the vehicles movement, how easy it is to tune and how ithandles the limits of the platform.

This thesis aims to produce a model that accurately reflects angles,velocities and accelerations while in the mean time respecting the limitsof the platform. In addition to this the developed model should be easy tomodify and tune. This is achieved using so-called Model Predictive Con-trol which achieves the wanted behaviour by predicting how the platformwill move based on its current state while implementing the constraintsof the platform directly into the model. Since all of the parameters inthe model are actual physical quantities, this makes the model easier totune. A key component in this solution is the so-called tilt coordinationwhich consists of substituting a lateral/longitudinal acceleration with theacceleration of gravity by tilting the driver.

Constructing and implementing this model in Matlab we verify it byusing data extracted from the simulator environment. We see that theparameters consisting of angles, rotational velocities and linear accelera-tions are tracked very well while respecting the constraints for the plat-form, constraints that can be easily changed to fit the current simulator.We also see that the model successfully implements tilt coordination intothe behaviour of the platform. This model performs extraordinarily wellin theory, what remains is to implement this to the motion platform andfine-tune it.

i

Page 4: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

Sammanfattning

Oryx Simulations tillverkar simulatorer i huvudsak for gruv- och skogsin-dustrin vilket anvands i utbildnings- och marknadsforingssyfte. Simula-torerna anvander en rorelseplattform for att spegla hur fordonet i sim-ulatormiljon ror sig. Denna plattform lutar och accelererar foraren foratt forstarka upplevelsen. Tidigare har ett sa kallat klassiskt washout-filter anvants for att kontroller plattformen som lamnar en del i ovrigtatt onska vad galler hur val fordonets rorelser speglas, hur latt det ar attjustera samt hur det hanterar plattformens begransningar.

Detta projekt amnar producera en modell som val speglar vinklar,hastigheter och accelerationer samtidigt som den respekterar plattformensgranser. I tillagg till detta bor modellen vara enkel att modifiera ochjustera. Detta uppnas genom sa kallad Model Predictive Control somforutsager hur plattformen kommer rora sig utifran dess aktuella tillstandsamtidigt som den respekterar de tvang som finns pa plattformen direkti modellen. Da alla parametrar i modellen ar faktiska fysiska kvantiteterblir modellen markbart lattare att justera. En viktig komponent i dennalosning ar sa kallad tilt coordination vilket bestar i att substituera lat-eral/longtudinell acceleration med en komposant av tyngdaccelerationengenom att luta foraren.

Denna modell konstrueras och implementeras i Matlab och verifierasgenom att anvanda extraherat data fran den simulerade miljon. Vi kanse att parametrarna som bestar av vinklar, rotationella hastigheter ochlinjara accelerationer speglas valdigt val, samtidigt som tvangen pa plat-tformen respekteras. Dessa tvang kan enkelt modifieras for att passaden aktuella simulatorn. Vi ser aven att modellen framgangsrikt imple-menterar tilt coordination i plattformens beteende. I teorin har dennamodell valdigt bra prestanda; vad som kvarstar ar att implementera denpa en rorelseplattform och finjustera modellen.

ii

Page 5: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

Acknowledgements

Firstly I would, cliche enough, like to thank my family. Their support andencouragement has never wavered even though I have neglected them for longperiods of time during my years at the university.

Equally I want to sincerely, from the bottom of my heart, thank Emma andMaria for being never-ending sources of laughter, knowledge, support and wis-dom not only during long and late hours studying, but in my life in general.

Further I would like to express my gratitude to Krister for being so dedicatedto the students and going to great lengths to enable me and others to pursueinterests strictly not within the bounds of the programme.

Last but definitely not least, I want to thank Tony for always being a soberinfluence, even when not particularly sober himself, without whom I would nothave studied engineering physics to begin with.

iii

Page 6: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

Nomenclature

Notations

()oto Variable related to the otolith model

()scc Variable related to the semicircular canals model

()rot Variable related to the rotational model

()lin Variable related to the linear acceleration model[. . .

]m×n

Matrix with m rows and n columns

Parameters

l1, l2 Actuator lengths

xi, yi Actuator end positions, i=1,2

αi Actuator angles, i=1,2

a Fix position in x for actuator 2

β Vector containing the Euler angles

βi i:th element of β

θ Roll Euler angle, β1

φ Pitch Euler angle, β2

ψ Yaw Euler angle, β3

ω Vector containing the angular velocities

ωi i:th element of ω

θ Roll velocity, ω1

φ Pitch velocity, ω2

ψ Yaw velocity, ω3

a Vector containing the accelerations

ai i:th element of a

ax Acceleration in x-direction, a1

ay Acceleration in y-direction, a2

az Acceleration in z-direction, a3

g Acceleration of gravity

F Forces of the system

Np Prediction horizon

Nc Control horizon

yref Output reference vector

Nx Number of state parameters

Nu Number of control parameters

Ny Number of output parameters

J Cost function

iv

Page 7: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

Matrices

0m×n m-by-n matrix of zeros

Im×m m-by-m identity matrix

A State matrix of the state space model

B Input matrix of the state space model

C Output matrix of the state space model

x State vector

y Output vector

u Control vector

ξ Augmented state vector

Y Augmented output constraint vector

U Augmented control sequence constraint vector

∆U Augmented control sequence rate constraint vector

Ymax/min Maximum/minimum output constraint vector

Umax/min Maximum/minimum control sequence constraint vector

∆Umax/min Maximum/minimum control sequence rate constraint vector

b Composite constraint vector

M Composite constraint matrix

E System error matrix

Qm Output weight matrix

Sm Control sequence weight matrix

Rm Control sequence rate weight matrix

Q Composite output weight matrix

S Composite control sequence weight matrix

R Composite control sequence rate weight matrix

H Hessian matrix

f Gradient vector

Φ MPC gain matrix

κ Optimal formulation matrix

v

Page 8: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

Contents

1 Introduction 11.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3 Goal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.4 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 Theory 32.1 Motion platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2.1.1 Stewart platform - 6DOF . . . . . . . . . . . . . . . . . . 32.1.2 Car simulator platform - 2DOF . . . . . . . . . . . . . . . 32.1.3 Rotational platform - 2DOF . . . . . . . . . . . . . . . . . 3

2.2 The Oryx platform . . . . . . . . . . . . . . . . . . . . . . . . . . 32.3 Vestibular system . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.3.1 Semi-circular canals . . . . . . . . . . . . . . . . . . . . . 82.3.2 Otoliths . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2.4 Washout algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 92.4.1 Classical washout algorithm . . . . . . . . . . . . . . . . . 92.4.2 Adaptive washout algorithm . . . . . . . . . . . . . . . . 92.4.3 Optimal washout algorithm . . . . . . . . . . . . . . . . . 9

2.5 Introduction to Model Predictive Control . . . . . . . . . . . . . 102.5.1 MPC - an example . . . . . . . . . . . . . . . . . . . . . . 102.5.2 MPC mathematical concept . . . . . . . . . . . . . . . . . 11

2.6 Obtaining MPC matrices . . . . . . . . . . . . . . . . . . . . . . 122.6.1 Tilt coordination . . . . . . . . . . . . . . . . . . . . . . . 122.6.2 State, output and control vector . . . . . . . . . . . . . . 122.6.3 System matrices . . . . . . . . . . . . . . . . . . . . . . . 14

2.7 Optimal form MPC reformulation . . . . . . . . . . . . . . . . . . 17

3 Method 223.1 Analysis of current implementation . . . . . . . . . . . . . . . . . 223.2 Constructing code for evaluation . . . . . . . . . . . . . . . . . . 223.3 Calibrating the MPC model . . . . . . . . . . . . . . . . . . . . . 243.4 Extracting data from the simulator . . . . . . . . . . . . . . . . . 25

4 Experiments and results 274.1 Validating platform model . . . . . . . . . . . . . . . . . . . . . . 274.2 Validating the MPC model . . . . . . . . . . . . . . . . . . . . . 29

4.2.1 Tilt coordination evaluation . . . . . . . . . . . . . . . . . 294.2.2 Constraint handling evaluation . . . . . . . . . . . . . . . 304.2.3 Accuracy evaluation . . . . . . . . . . . . . . . . . . . . . 32

4.3 Sources of error . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344.4 Possible expansions . . . . . . . . . . . . . . . . . . . . . . . . . . 34

4.4.1 Implementation and online calibration . . . . . . . . . . . 344.4.2 Convert to a sparse system . . . . . . . . . . . . . . . . . 344.4.3 Vehicle model . . . . . . . . . . . . . . . . . . . . . . . . . 34

vi

Page 9: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

5 Conclusions 355.1 Precision of the model . . . . . . . . . . . . . . . . . . . . . . . . 355.2 Tilt coordination . . . . . . . . . . . . . . . . . . . . . . . . . . . 355.3 Numerical feasibility . . . . . . . . . . . . . . . . . . . . . . . . . 35

A Appendix - Coefficients used 36

B Appendix - Platform measurements 38

C Appendix - Complete model output 39C.1 Circular path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39C.2 Extreme tilt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42C.3 Scoop slam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

vii

Page 10: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

1 Introduction

1.1 Background

Oryx manufactures sophisticated simulation equipment (henceforth simulators)primarily for the mining and forestry industry, which are used for training andmarketing purposes. The equipment normally consists of a computer systemand a number of displays mounted on a motion platform (after this referredto as mpf). This platform reproduces the tilt of the vehicle and inertial forcesthat occur during acceleration and rapid turning to enhance the user experience.

A completely holonomic system would have 6 degrees of freedom (DOFs). Theseare the linear movements in x- y- and z-direction called sway, surge and heaverespectively as well as rotation about these axis called roll, pitch and yaw. Inthis application there are 5 DOFs of interest. These are the 3 linear translationsand the two rotations pitch and roll. Yaw is considered to be of less importancefor most of the vehicles that Oryx simulate since the driver is rarely positioneddirectly at the yaw axis. This is important since the movement is then perceivedas an acceleration sideways rather than a rotation.

This report is the result of a master thesis project in engineering physics per-formed by Jens Walker at Umea University in collaboration with Oryx Sim-ulations AB. The project is supervised and graded by Eddie Wadbro ([email protected]) at the department for Computing Science at Umea University.Supervisor at Oryx is David Grundberg ([email protected]).

1.2 Purpose

The model that is currently implemented to control the platform uses very basictechniques, so a new, more complex model is desired in order to be able to bettertrack the movement of the simulated vehicle. Currently the model implementeddoes not reflect linear accelerations in a satisfactory manner partly because thecurrent design of the motion platform does not allow for planar motion andhence the inertial forces cannot be recreated directly. One of the concepts usedto solve this is called tilt coordination which substitutes linear acceleration foracceleration of gravity.

Another drawback with the current method is that configuration is time con-suming and possibly causes different simulators to behave differently dependingon when it was configured and who performed the configuration. It can alsoresult in different behaviours for different velocities of the simulated vehicle,since what is considered ”normal operating velocity” is likely to be tested morethoroughly. Thus, in order to save time and get a more homogeneous configura-tion for the simulators, an easily-tuned mathematical model is to be developed.

A further benefit of a well-defined and documented model for the movement ofthe mpf is that it would simplify expansion. This could include the addition offurther effects such as idling movement, i.e the vibrations caused by a runningengine or the sensation of different terrains.

1

Page 11: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

1.3 Goal

The goal of this project is to develop a mathematical model that accurately re-flects the angles, velocities and accelerations of the vehicle while simultaneouslytaking into account the limited range of the mpf. Another key aspect of themodel is that tilt coordination should be present.

The model should be optimized for numerical solving and a prototype codeshould be constructed.

1.4 Limitations

The model will be developed and investigated in theory only and not imple-mented on the platform.

A basic version of the model will be investigated. This means that the modelwill be adapted to the system with no extra functionalities added. Also anyrelevant software packages whose license permits it to be used in a commercialsetting will be used.

2

Page 12: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

2 Theory

By using concepts of physics and mathematics, we will in this section deriveeverything needed in order to find a functional model for determining how thempf will move. To do this we need a brief background of different motionplatforms, how humans detect movement and also what algorithms has beenused before. When we have a handle on these topics, we delve deeper into theunderlying theory of the model that we are to tailor to our system.

2.1 Motion platforms

A motion platform allows the user to be moved, tilted and rotated in differentways to raise the perceived level of realism in a simulator. There is a multi-tude of different platforms, but there are three configurations that are the mostcommon.

2.1.1 Stewart platform - 6DOF

A platform with 6 DOF’s, achieved by using six independent actuators. Thedrawbacks are that it is complicated to control and have a very limited range.This platform is often used for more high-level applications where extreme forcesoccur and accuracy is of the essence, e.g. fighter plane simulators.

2.1.2 Car simulator platform - 2DOF

As the name suggests, this is often used in car simulators and have two degreesof freedom. The seat can rotate about its z-axis (yaw) and is positioned on arail so that it can slide forward/backward so as to emulate acceleration of avehicle. If the yaw angle is non-zero the driver will also be accelerated to theside, which is used to emulate the feeling of changing lanes.

2.1.3 Rotational platform - 2DOF

This type of simulator is often used where the tilt of the platform is of greatimportance but the lateral forces of the simulated vehicle are small, e.g. ships,enthusiast aircraft simulators and, as in our case, mining vehicle simulators.

2.2 The Oryx platform

We now turn our focus to our specific platform, which is a rotational platformas described in section 2.1.3. The platforms at Oryx utilize a universal joint inthe rear center of the platform and two electrical stepper motors at the front,each lifting one of the front corners, see figure 1. This gives us the pitch androll directly.

3

Page 13: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

Figure 1: CAD sketch of the platform

The lifting mechanism of the platform consist of a lever arm secured to themotor axis which in turn is connected to the ball joint of an actuator. Theactuator is in turn connected to the platform through another ball joint. Thissetup can be seen in figure 2.

Figure 2: CAD sketch of the motor/actuator setup

4

Page 14: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

An hypothesis is that this system can be modelled as a double pendulum with aboundary condition. In figure 3 we can see how this model would look schemat-ically. The length l1 is the length of the lever arm from the motor axis to thecenter of the lower ball joint, while l2 is the length of the actuator from centerto center of the ball joints.

Figure 3: Schematic view of the double pendulum model

This model gives us the system of equations:

x1 = l1 sin(α1) (1)

y1 = −l1 cos(α1) (2)

x2 = a (3)

y2 = −l1 cos(α1)− l2 cos(α2)) (4)

In (3) we have applied the fact that the outer end of the actuator cannot movein the x-direction since it is secured to the platform. Hence the coordinate x2is fix at the position a which simplifies the system and allows us to numericallycompute the angle α2.

This gives us the coordinate y2 which is the displacement of the platform interms of the motor angle α1, which is a parameter we control.

Constructing a wire frame model of the platform using measurements obtainedfrom the CAD sketch, we get figure 4. This wireframe model is later used tocalculate the values of our simplified model.

5

Page 15: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

−0.8−0.6

−0.4−0.2

00.2

0.20.30.40.50.60.70.8

Y

X

Figure 4: Wire frame model of the motion platform

Assuming that we know the geometry of the platform as well as the angles forthe roll, θ, and and pitch, φ, we can find a relation between the platform anglesand the motor angle. Using the x-distance from the center of the platform tothe front upper joint, denoted xp and the distance in from the rear joint to thefront joints, denoted yp.

We can then find the motor angle for the roll using

αroll1 =1

2tan−1(

y2xp

) , (5)

where the1

2comes from the fact that the angle for the motor on the other side

of the platform moves in the other direction, i.e. has the same equation butwith a negative sign. In the same way we find the motor angle for the pitch,but instead we use the distance to the rear joint,

αpitch1 = tan−1(y2yp

) . (6)

6

Page 16: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

2.3 Vestibular system

The human vestibular system is what allows us to perceive accelerations andtherefore movements. It is positioned in the inner ear and comprised of thesemicircular canals and otoliths. A schematic image is depicted in figure 5.Slightly simplified, the semicircular canals are pipes partially filled with fluidthat, as we rotate, put pressure on a membrane which in turn send signals tothe brain telling us that we are indeed rotating. The otoliths behave in a similarfashion, but rather than canals it consists of gelatinous blobs called the utricleand saccule encapsulating hair cells that trigger when experiencing linear accel-erations.

Figure 5: Schematic image of the human vestibular system [1]

All inertial forces originally stem from an acceleration and these can be eitherfrom changing the velocity or a rapid turn at high velocity. In the latter caseit comes from the acceleration needed in order to change direction. An inertialforce is always experienced in the direction opposed to the acceleration.

Since the origin of inertial forces are planar accelerations which the mpf is notcapable of, we need to trick the user that these displacements do actually hap-pen. For low-frequency accelerations this is normally achieved by tilting theuser and exploiting the components of the gravitational acceleration parallel tothe platform and is called tilt coordination.

If the users vision is immersed in a virtual environment, the human vestibularsystem is not sophisticated enough to know the difference. After the inertialforce has been emulated in this manner the platform position need to be re-stored since otherwise the tilt would be incorrect, but also to be able to repeatanother acceleration without violating the limitations of the platform.

7

Page 17: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

This needs to be translated into a mathematical model and thankfully thissubject is well investigated and so-called transfer functions in state-space forboth the otoliths and semi-circular canals are available [3].

2.3.1 Semi-circular canals

Defining the vector β as the angles of the platform, with the following compo-nents

β =[θ φ ψ

]T, (7)

where θ is rotation around the x-axis (roll), φ is rotation around y (pitch) andψ is rotation around z (yaw). Further we define the time derivative of β

ω = β =[θ φ ψ

]T(8)

which is the rotational velocity retrieved from the simulator, where x signifiesthe derivative of the general variable x w.r.t. time. As done in [8] we can thenuse a transfer function in order to obtain the perceived rotational velocity ωwhere each element is found as

ωi =T il T

ias

2

(T ias+ 1)(T iss+ 1)(T il s+ 1)ωi . (9)

That is if we look at the roll velocity θ, we substitute T il , Tis , T

ia for the values

of T xl , Txs , T

xa found in Appendix A and so on. Equation (9) can be rewritten in

its general form as

ωi =

1T iss2

s3 + ( 1T ia

+ 1T il

+ 1T is)s2 + ( 1

T il T

is

+ 1T il T

ia

+ 1T isT

ia

)s+ ( 1T iaT

il T

is)ωi , (10)

which gives the whole transfer function as s multiplied by some coefficients,which is needed for the canonical state representation introduced later.

2.3.2 Otoliths

Similarily, there exists a transfer function for the linear accelerations, which isperceived by the otoliths. If we define

f =

fxfyfz

, (11)

then the transfer function looks as follows:

fi =Ki(τ ias+ 1)

(τ il s+ 1)(τ iss+ 1)fi . (12)

As we did in (10), we can rewrite the transfer function (12) to general formaccording to

fi =

Kiτ iaτlτs

s+Kiτ iaτlτs

s2 + (1

τ il+

1

τ is)s+

1

τ il τis

fi . (13)

8

Page 18: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

2.4 Washout algorithm

The traditional approach to the problem of how to move a platform in sync witha simulator is to use a washout-algorithm, which reflects in [9] where the onlymethod listed for implementation is in fact the washout filter approach. Thisis a series of low-pass and high-pass filters that act to pick out the componentsof acceleration and translate this to how the platform should move. Withinthese filters are coefficients that regulate the cut-off and pass frequencies whichdetermine the behaviour of the algorithm. There are several different versions ofthis algorithm, what they have in common is that they all involve a fair amountof signal processing and filtering techniques. The algorithm currently used atOryx is the classical washout algorithm. For more information on this approach,feel free to read [10] by C.D. Larsen.

2.4.1 Classical washout algorithm

Classical washout uses fix coefficients which need to be tuned offline, that iswith the simulator turned off, and are always kept fixed. This is an issue sinceyou need to configure these according to a worst-case scenario thus not utilizingthe whole range of the platform. It is also a difficult process to get these rightsince they do not represent any physical quantity directly but rather representfrequencies.

2.4.2 Adaptive washout algorithm

Adaptive washout filters uses an approach where the coefficients vary with timedepending on position and velocity of the platform. This improves upon the clas-sical algorithm not only in performance, but also simplifies the tuning slightly,since this can be done online with the simulator running.

2.4.3 Optimal washout algorithm

Optimal washout uses the aforementioned transfer functions of the human innerear in order to translate the acceleration and rotation from the simulator toactual sensed movement using a cost function to minimize the error between thetwo. Again we face the problem of having to tune to the best overall performancewith the trade-off that we do not use the platform optimally. Further, theproblem appears again with the coefficients that has no physical representation,thus still making the tuning process complicated.

9

Page 19: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

2.5 Introduction to Model Predictive Control

While there is still performance gains in implementing one of the more ad-vanced washout algorithms, a lot of progress has recently been made using socalled Model Predictive Control, or MPC. This approach has been used withinthe chemical industry since the 80’s but has recently been adapted to otherareas, such as motion cueing [11]. This is a process for predicting how a systemwill move ahead of time for a certain duration, the so-called prediction horizon.This enables maximized exploitation of the platforms range since at each timestep we know how much space we can use without hitting the boundaries, sinceit also incorporates the constraints directly in the system. It takes a similarapproach to the optimal washout algorithm, in that it uses a transfer functionto model how the accelerations and rotations should be enacted on the platformas well as a cost function to minimize error.

Further it uses linear algebra to solve a matrix system in order to predict howthe simulated vehicle will move in the nearby future as opposed to signal analysisand filtering. This makes it more appropriate for this project since the degreefor which this thesis project is performed is focused more on matrix computationthan signal analysis.

2.5.1 MPC - an example

In order to understand the MPC model, we look at a real life example: the pro-duction at an assembly line. Every morning at 8.00 we have a meeting decidinghow many units we produce, say 100 each hour, for the next 4 hours until 12o’clock. Thus our reference function is 100 units per hour and our predictionhorizon Np is 4 hours. The state x is information about the line at 8 o’clock andcan for example be how large a workforce is available right now and how fastthe assembly line is moving, while we constantly have to take into considerationdifferent constraints such as how much materials we have.

The control sequence u is what we change until next meeting and can be if wedecide to hire more people, buy more materials and if we speed up or down theassembly line. Furthermore the output y in this example is how many unitswe produce which is limited by for example how much materials we have andmaximum speed of conveyor belts which is our constraints.

When we meet again at 9 o’clock, we take a look at how many units we actuallyproduced during the last hour, let us say that we produced 104 which is then ouractual output y. Here we overshot a bit, so we then agree to lower the speed ofthe assembly line, that is change our control sequence u slightly and make a newprediction from 9.00 to 13.00, thus discarding the rest of our previous prediction.

Now let us also assume that our state x indicates that we are starting to run lowon a certain type of material and only have 90 left, that is we are being limitedby one of our constraints. Since this is included directly in the model, then inour next calculation for production rate this will be taken into considerationautomatically. So, production rate will be lowered for the next hour to say 85units, so as not to break this condition which in our case means run out of bolts

10

Page 20: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

before the hour is up leaving people without tasks to perform. However, if weget a delivery by our next meeting at 10 o’clock, the MPC model compensatesfor the lowered production and will increase production rate for the nearest pre-diction to say y = 95, 106, 111 and 103 units for each of the coming four hoursrespectively.

This is the strength of the model, since it adapts to the constraints on the flyand allows us to be very close to the limits of our constraints without breakingthem and ensures a smooth behaviour even when close to the constraints.

2.5.2 MPC mathematical concept

More formalized, we use the state x of the system to predict what our futurecontrol sequence u should be in order to minimize the error between the pre-dicted output y and a reference function yref. The reference function yref canin some sense be seen as the ”correct” result and normally these parametersare set to be equal to the desired parameters, i.e to the parameters obtainedfrom the simulator. However, this can be exploited so that if we want a certainparameter to always strive towards zero, we set that parameter in the referencefunction to 0. This can be seen as a built-in washout filter and is especiallyuseful for the angles since we want them to return to their neutral position tobe able to perform more drastic manoeuvres.

We also denote Nx, Ny and Nu as the number of state, output and control se-quence parameters respectively. We then take the first control sequence u andsend to our system while discarding the rest, since new ones will be calculatedin the next time step.

This whole problem can be described as a differential equation

x = Ax+Bu ,

y = Cx + Du ,(14)

where for multiple input, multiple output (MIMO) systems, A, B, C and D arematrices containing coefficients for our specific model, in our case derived fromthe transfer functions. Here we assume a strictly proper system, which meansthat the input we send now can not affect the current state.

So in a discrete space, let k denote the current time step and u(k) and y(k)denote u and y at a time tk. Then u(k) cannot affect y(k) but only the futurestates y(k+1), y(k+2),..., y(k+Np). This means that D=0, which gives us (15)

x(k+1)− x(k) = Ax(k) + Bu(k)

y(k) = Cx(k).(15)

Since we would like to impose constraints for both y, u and the rate with whichu changes, denoted ∆u, we need to find a way to optimize for all of the vari-ables simultaneously. The constraints on the output y is enforced during ourprediction horizon Np, while for the control sequence they are applied duringwhat is called the control horizon, denoted Nc. Note that Nc ≤ Np, since wecannot control our output ahead of where we know it.

11

Page 21: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

2.6 Obtaining MPC matrices

The next step is to specify the x, y and u vectors as well as the A, B andC matrices according to our model. Our system is actually a composite offour parts, one for the semicircular canals with the subscript scc, one for theotoliths subscripted oto, one for the angles subscripted rot and one for the linearmovements subscripted lin. We start off by defining tilt coordination, then thecomposite system and will later specify what the matrices contain. Decipheringthis system is quite the rabbit hole that we dive down into, so please bear withall of the declarations and definitions of new matrices.

2.6.1 Tilt coordination

In order to infuse our model with the desired tilt coordination, we need toestablish a model for this as well. Using Newtons second law that

F = ma , (16)

we can add the contribution of gravity to our model. Since the force of gravityis strictly linear, it becomes a contribution to the otolith model. If we add thecontribution of gravitational forces to the ordinary linear forces, we get

F = m

ax − g sin(φ)ay − g cos(φ) sin(θ)az − g cos(φ) cos(θ)

(17)

We then assume that both θ and φ are small which gives us the small angle-approximation:

F = m

ax + gφay − gθaz − g

. (18)

We can now separate this into a gravity matrix G and a coordinate vector as

F = m

0 g 0 1 0 0−g 0 0 0 1 00 0 0 0 0 1

︸ ︷︷ ︸

G

θφψaxayaz

= m G

[βa

]. (19)

2.6.2 State, output and control vector

Even though these vectors are established along the way when assembling thematrices, for the sake of understanding we will state them beforehand. This willhopefully make it easier to understand why some of the matrices look like theydo. The state, output and control vectors are composed as

x =

xsccxotoxlin

Nx×1

, (20)

12

Page 22: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

y =

ysccyotoyrotylin

Ny×1

, (21)

u =

[usccuoto

]Nu×1

(22)

respectively. Here we can clearly see which parameter that belongs to a certainaspect of the model. Stating each element, we get

xscc =

θ00

φ00

ψ00

, xoto =

axθayφazψθφψ

, xlin =

pxvxpyvypzvz

. (23)

The elements of the output vector y that contains the processed values looks asfollows

yscc =

θφψ

, yoto =

axayaz

, yrot =

θφψ

, ylin =

pxvxpyvypzvz

. (24)

As for the control sequence vector u, we have

uscc =

θφψ

, uoto =

axayaz

. (25)

This means that for our model we can specify Nx =24, Ny =15 and Nu =6. Wecan now also explicitly state the vectors y, u and ∆u as:

y =[θ φ ψ ax ay az θ φ ψ px vx py vy pz vz

]T,

u =[θ φ ψ ax ay az

]T,

∆u =[

∆θ ∆φ ∆ψ ∆ax ∆ay ∆az]T.

(26)

13

Page 23: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

2.6.3 System matrices

We then move on to the matrices. It may not be apparent at first sight whythey look like they do, but it will hopefully become clear further down. Wedefine them as

A =

Ascc 09×9 09×609×9 Aoto 09×606×9 06×9 Alin

Nx×Nx

, (27)

B =

Bscc

Boto

Blin

Nx×Nu

(28)

and

C =

Cscc 03×6 03×903×9 Coto 03×909×9 09×6 Clin

Ny×Nx

. (29)

Now, let us decipher these matrices! We start with C, then work our waythrough B and finish with A. The reason for this is that we need to do performa few tricks to implement the tilt coordination. So, let’s start with C

Cscc =

Cxscc 01×3 01×3

01×3 Cyscc 01×3

01×3 01×3 Czscc

3×9

, (30)

where the block matrices of the scc-model are in themselves composed of ma-trices and look like

Ciscc =

[1 0 0

], (31)

where i is substituted for the coordinate of interest, that is i = x, y, z. Movingon to the otolith model, we have

Coto =

Cxoto 01×2 01×2 01×3

01×2 Cyoto 01×2 01×3

01×2 01×2 Czoto 01×3

3×9

, (32)

where each block matrix in the otolith matrix looks as

Cioto =

[1 0

]. (33)

while the matrix Clin is simply a 9×9 identity matrix

Coto = I9×9 . (34)

Now we look at the matrix B and start with the scc-part which is fairly straight-forward.

14

Page 24: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

Bscc =

Bxscc 03×1 03×1 03×(Nu−3)

03×1 Byscc 03×1 03×(Nu−3)

03×1 03×1 Bzscc 03×(Nu−3)

9×Nu

, (35)

where the right hand part of zeros is inserted since in the scc-model we wantto use the angular velocities and not the accelerations contained in the controlsequence vector u. Each block matrix in the model is defined as

Biscc =

− 1T is

00

, (36)

where again i = x, y, z. Moving on to the otolith model, we have to use somefancy footwork in order to implement the tilt coordination. We start by defining

Bioto =

[Kτ i

a

τ il τ

is

Kτ il τ

is

], (37)

which we get from the observable canonical state space form of the transferfunction as according to [5]. Since the angles are included in the state vector xand the linear accelerations in the control vector u, we need to pair the matrixG obtained in (19) with the otolith model, which is done using the matrix BG

BG =

Bxoto 02×1 02×1

02×1 Byoto 02×1

02×1 02×1 Bzoto

0 g 0 1 0 0−g 0 0 0 1 00 0 0 0 0 1

, (38)

which, after performing the multiplication becomes

BG =

02×1 gBxoto 02×1 Bx

oto 02×1 02×1−gBy

oto 02×1 02×1 02×1 Byoto 02×1

02×1 02×1 02×1 02×1 02×1 Bzoto

6×6

. (39)

However, we need to split the matrix in (39) in two, one part that belongs tothe angles and one that belongs to the accelerations.

BG

[βa

]= BG

θφψaxayaz

= Bββ +Baa , (40)

We then extract the matrices Bβ and Ba to obtain

Bβ =

02×1 gBxoto 02×1

−gByoto 02×1 02×1

02×1 02×1 02×1

6×3

, (41)

Ba =

Bxoto 02×1 02×1

02×1 Byoto 02×1

02×1 02×1 Bzoto

6×3

. (42)

15

Page 25: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

We then use Ba for B, obtaining

Boto =

02×3 Bx

oto 02×1 02×102×3 02×1 By

oto 02×102×3 02×1 02×1 Bz

oto

I3×3 03×1 03×1 03×1

9×Nu

, (43)

while we need to associate Bβ with A, since the angles are contained in thestate vector x. First we define

Blin =

0 0 0 0 0 00 0 0 1 0 00 0 0 0 0 00 0 0 0 1 00 0 0 0 0 00 0 0 0 0 1

6×Nu

, (44)

which is just to pass along the linear part of the control sequence vector. Toconstruct A we start by defining

Ascc =

Axscc 03×3 03×3

03×3 Ayscc 03×3

03×3 03×3 Azscc

9×9

, (45)

where we again find the submatrices by converting the transfer function (10)into observable canonical state space form according to [5], which gives us

Aiscc =

−( 1T ia

+ 1T il

+ 1T is) 1 0

−( 1T il T

is

+ 1T il T

ia

+ 1T isT

ia

) 0 1

−( 1T iaT

il T

is) 0 0

, (46)

where i = x, y, z allows us to obtain the submatrices. We now augment thematrix Aoto with Bβ , which gives us

Aoto =

Axoto 02×2 02×2 02×1 gBx

oto 02×102×2 Ay

oto 02×2 −gByoto 02×1 02×1

02×2 02×2 Azoto 02×1 02×1 02×1

03×2 03×2 03×2 03×1 03×1 03×1

9×9

. (47)

As before we find the submatrices by converting the transfer function in (13) tocanonical state space

Aioto =

[− 1τ il

− 1τ is

1

− 1τ il τ

is

0

], (48)

where again i = x, y, z. Finally, as for B, the linear submatrix for A just passesalong the linear part of the state vector by being defined as

Alin =

0 1 0 0 0 00 0 0 0 0 00 0 0 1 0 00 0 0 0 0 00 0 0 0 0 10 0 0 0 0 0

6×6

. (49)

16

Page 26: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

2.7 Optimal form MPC reformulation

This kind of optimization problem is commonly known as a ”quadratic program-ming”, or ”QP”-problem, which according to [6] is ”...the problem of optimizing(minimizing or maximizing) a quadratic function of several variables subject tolinear constraints on these variables.” This is a very grateful problem to solve,due to the fact that for a convex problem, if we manage to find a local extremumit is also guaranteed to be a global extremum. Thus a gradient method is aneffective way to solve this, since there is only one min/max point.

A quadratic function is exactly what we have in the term ∆UTH∆U and all ofour constraints are linearised since we use the small angle approximation on ournon-linear terms. The standard form of a problem such as this with symmetricconstraints, however, is

minx

1

2xTHx + fTx, subject to − b ≤Mx ≤ b (50)

and to get there requires quite a bit of reformulation. We start rememberingthat y(k) is the output vector at time tk and then define the following vectorscontaining the current and all the predicted variables. Starting with y

Y =

y(k+1)y(k+2)

...y(k+Np)

(Np·Ny)×1

. (51)

Expanding the reference function yref for all time steps as well then becomes:

Yref =

111...1

Np×1

⊗ yref =

yref

yref

yref...

yref

(Np·Ny)×1

, (52)

where ⊗ is the Kronecker product. This produces a vector where yref occursNp times. The Kronecker product is a very handy way of composing vectorswhere we want to stack several instances of the same element in a new vector ormatrix and this technique will be used repeatedly. On a more subtle level, thismeans that we make the assumption that the reference function is held constantthrough the prediction horizon. We continue with u as

U =

u(k)

u(k+1)u(k+2)

...u(k+Nc-1)

(Nc·Nu)×1

(53)

17

Page 27: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

and lastly we define ∆U:

∆U =

u(k)− u(k-1)u(k+1)− u(k)u(k+2)− u(k+1)

...u(k+Nc)− u(k+Nc-1)

=

∆u(k)

∆u(k+1)∆u(k+2)

...∆u(k+Nc)

(Nc·Nu)×1

. (54)

Now the next step is to express our problem in terms of ∆U, since this is thevariable we want to minimize over. In order to do this, we need to define anaugmented state as

ξ(k) =

[x(k)

u(k-1)

](Nx+Nu)×1

(55)

and with this we redefine the A, B and C matrices as

Aξ =

[A B

0NuxNxINuxNu

], (56)

Bξ =

[B

INuxNu

], (57)

Cξ =[C 0NyxNu

], (58)

which then updates our system from (15) to the following

ξ(k+1) = Aξξ(k) + Bξ∆u

yξ(k) = Cξξ(i) .(59)

According to Wang [4], Y and ∆U can be rewritten on the form

Y = Fξ(k) + Φ∆U , (60)

where

F =

CξAξ

CξA2ξ

CξA3ξ

...

CξANp

ξ

(Ny·Np)×Nx

(61)

and Φ is the Toeplitz lower-triangular block matrix defined by

Φ =

CξBξ 0Ny×Nu 0Ny×Nu · · · 0Ny×Nu

CξAξBξ CξBξ 0Ny×Nu· · · 0Ny×Nu

CξA2ξBξ CξAξBξ CξBξ · · · 0Ny×Nu

......

......

...

CξANp−1ξ Bξ CξA

Np−2ξ Bξ CξA

Np−3ξ Bξ · · · CξA

Np−Nc

ξ Bξ

. (62)

18

Page 28: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

We need to specify a couple more things in order to redefine our cost functionas a function of only ∆U, which is called the optimal formulation. We start offwith U,

U(k) = κ∆U(k) + U(k-1) , (63)

where the lower triangular matrix κ is defined as

κ =

1 0 · · · 01 1 · · · 0...

.... . .

...1 1 · · · 1

Nc×Nc

1 0 · · · 00 1 · · · 0...

.... . .

...0 0 · · · 1

Nu×Nu

, (64)

which results in a (Nu ·Nc)× (Nu ·Nc) matrix. We then specify Uk as

U(k-1) =

111...1

Nc×1

⊗ u(k-1) =

u(k-1)u(k-1)u(k-1)

...u(k-1)

(Nu·Nc)×1

. (65)

For brevity, we also rewrite the previous control vector values as

Up = U(k-1) , (66)

as well asE = Fξ − Yref , (67)

where E denotes the error of the system. This allows us to formulate our prob-lem as an optimized form minimization problem in order to find the best controlsequence u by minimizing a cost function J that obeys certain constraints. Thecost function is mentioned at the start of this section and originally specifiedas:

min,J(k) = ||Y(k)−Yref(k)||2Q + ||U(k)||2S + ||∆U(k)||2R , (68)

here the subscripts Q, S, R denote the weight matrices with which we multiplythe terms of the cost function in order to reach a satisfactory result. How largethe elements of these matrices are decide how much consideration we give theconstraints versus how hard we try to match the output to the reference func-tion. These matrices also need to be adapted to Y, U and ∆U so for Q weassemble Np matrices Qm of size Ny×Ny in a diagonal block matrix which willthen look as follows:

Q =

Qm 0Ny×Ny

0Ny×Ny· · · 0Ny×Ny

0Ny×Ny Qm 0Ny×Ny · · · 0Ny×Ny

0Ny×Ny 0Ny×Ny Qm · · · 0Ny×Ny

......

.... . .

...0Ny×Ny

0Ny×Ny0Ny×Ny

· · · Qm

(Np·Ny)×(Np·Ny)

, (69)

19

Page 29: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

where each value in Qm directly corresponds to the weight on each of the pa-rameters in y as specified in (26). In the same way we specify S and R, whereboth Sm and Rm are of size Nu×Nu and inserted Nc times on the diagonal,which gives

S =

Sm 0Nu×Nu

0Nu×Nu· · · 0Nu×Nu

0Nu×NuSm 0Nu×Nu

· · · 0Nu×Nu

0Nu×Nu0Nu×Nu

Sm · · · 0Nu×Nu

......

.... . .

...0Nu×Nu

0Nu×Nu0Nu×Nu

· · · Sm

(Nc·Nu)×(Nc·Nu)

(70)

and lastly

R =

Rm 0Nu×Nu

0Nu×Nu· · · 0Nu×Nu

0Nu×Nu Rm 0Nu×Nu · · · 0Nu×Nu

0Nu×Nu 0Nu×Nu Rm · · · 0Nu×Nu

......

.... . .

...0Nu×Nu

0Nu×Nu0Nu×Nu

· · · Rm

(Nc·Nu)×(Nc·Nu)

. (71)

This is one of the parameters of the model that can be tuned and the final valuesused for Qm,Sm and Rm can be found in Appendix A.

We are now ready to rewrite our cost function found in (68) using (51)–(67), sothat we get:

J(k) = ETQE + UTp SUp+

2 (ETQΦ + UTpSκ)︸ ︷︷ ︸

f

∆U + ∆UT (ΦTQΦ + R + κTSκ)︸ ︷︷ ︸H

∆U . (72)

So now we have found the Hessian matrix H and the gradient vector f to usein (50), so that takes care of the cost function J, but we still need to define ourconstraint matrices M and b in terms of ∆U .

In order to do this, we first need to reformulate our constraints to suit Y, Uand ∆U. Suppose that the maximum constraints for each variable in the outputvector is expressed as a vector ymax where each element is a constraint for thecorresponding variable in y

ymax =

ymax1

ymax2

ymax3...

ymaxNy

Ny×1

. (73)

20

Page 30: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

Then we define our new constraint vector

Ymax =

111...1

Np×1

⊗ ymax =

ymax

ymax

ymax

...ymax

(Ny·Np)×1

, (74)

which is the constraints stacked Np times to affect every time step of the pre-diction horizon. Similarly for U, where umax is a vector that contains themaximum allowed values of u for the control horizon. We use the Kroneckerproduct to define

Umax =

111...1

Nc×1

⊗ umax =

umax

umax

umax

...umax

(Nu·Nc)×1

. (75)

And in the same manner for ∆U, where ∆umax is specified as a vector whichcontains the maximum values of ∆u we specify

∆Umax =

111...1

Nc×1

⊗∆umax =

∆umax

∆umax

∆umax

...∆umax

(Nu·Nc)×1

. (76)

For the minimum constraints, we simply repeat (73)–(76) but replace ymax,umax and ∆ umax with ymin, umin and ∆ umin. Now we can reformulate ourproblem on the standard form, where our matrix M becomes

M =

[κΦ

](77)

while the constraint vector b is rewritten as the following

b =

[Umax −Uk

Ymax − Fξ(k)

]. (78)

Here we can note that M and b are actually system constant which means thatthey are time-independent and only need to be calculated once. This is actuallytrue for several matrices and vectors of the system which can be exploited inorder to conserve computational resources. In table 1, section 3.2 we list all ofthe matrices and classify which are constant and which are time-dependent.

With this we now have everything in order to be able to apply the MPC modelto our system!

21

Page 31: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

3 Method

In this section we start by looking at how the motion of the platform is handledtoday and establish inputs and outputs from this. We then move on to describehow we construct the code in order to solve our QP-problem, including how wego about calibrating the model. Lastly we go into a bit more detail what datawe wish to extract from the simulated environment.

3.1 Analysis of current implementation

Looking at the current source code is a necessity, mainly in order to know howto adapt the new model to the rest of the system. In addition to discoveringwhat input and output we need to adapt the MPC model to, it gives us a hintof how the platform currently handles the mapping of the degrees of freedom.

We have established the state parameters in (20) and all of them can be retrievedfrom the coordinate system representing the user inside the simulator. It givesus the position as well as the orientation of the user. Furthermore we can findboth linear and angular velocities and accelerations by tracking the change inthese values between time steps. This means that we need to know how muchtime has passed between each update, or frame. Thankfully the frame rate isfixed at 60Hz due to adaptations to the displays, which gives us the time stepas the reciprocal

dt =1

60. (79)

3.2 Constructing code for evaluation

This model, as mentioned in section 2.7 ultimately takes the shape of a QP-problem. Thankfully, there are a lot of software packages that handle thisproblem since it is a fairly common one. We will solve this problem in Matlabdue to its ease of use when it comes to matrices and plotting results.

To make the evaluation of data as simple as possible, the extracted simulatordata is imported into a Matlab script and solved in ”faux real-time”. That is,instead of reading the state continuously from the platform it is read from a filecontaining all of the values extracted from a simulation scenario.

This is done in a loop over time steps using only the current value as the stateand as such the implementation is not aware that the future values are alreadyknown. Thus we emulate the same situation that would occur in a real sce-nario and makes the Matlab script directly portable to another programminglanguage if one so desires.

The problem is reformulated according to the theory section of this report andsolved with the quadprog() routine found in the Matlab Optimization Toolbox.This routine however wants both the upper and lower constraints in a singlevector according to

M′ ≤ b′ (80)

22

Page 32: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

so we reformulate b slightly and stack the constraints, leaving us with:

b′ =

Umax −Uk

−Umax + Uk

Ymax − Fξ(k)−Ymax + Fξ(k)

, (81)

and adapt M to fit this, which gives us

M′ =

κ−κΦ−Φ

. (82)

We have already mentioned that some of the matrices are system constant ma-trices, which means that they can be calculated once outside the time loop inorder to preserve resources. Table 1 shows an overview of which matrices areconstant and which are time-dependent.

Table 1: Matrices and vectors in the system and their time dependence

System constant Time dependentYmax/Ymin YUmax/Umin U

∆Umax/∆Umin ∆UQ ξS bR EH Yref

M Uk

F fΦκ

Note that some of these matrices are products of others, but we list all of themto simplify any usage of these matrices for a potential port to another program-ming language. While for example Q, S and R are only used to construct H,one might want to adjust the values of the weight matrices after migrating themodel and thus deciding to calculate H rather than use the already assembledmatrix from the program.

Since we want the position of the platform to return to it’s neutral position inorder to utilize as much of the space as possible, we remember the output vectorfrom (26)

y =[θ φ ψ ax ay az θ φ ψ px vx py vy pz vz

]T. (83)

and we use the following reference vector

yref =[θ φ ψ ax ay az 0 0 0 0 0 0 0 0 0

]T. (84)

23

Page 33: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

In this way every time step we minimize the difference between 0 and the vari-ables θ, φ, ψ, px, vx, py, vy, pz, vz, which ensures that these parameters strive to-wards zero. This ensures that the platform is automatically return to its neutralposition and is mentioned in section 2.5.2 as a solution to the washout-problem.

We then go through the time loop, calculating the control and output vectorsusing the current augmented state ξ and store these for analysis. These areplotted and shown in section 4.2 of the results.

3.3 Calibrating the MPC model

In order to evaluate the performance of our MPC model, we need to adapt thecoefficients of our theoretical model to the specific system. This is normallydone in two steps by performing both offline and online calibration to tune themodel. We will however only do the first and leave the online calibration untilthe model has been fully implemented.

Adapting the model to our platform means that we need to insert the constraintsfor the output, input and input difference as well as experimentally define whatis a suitable prediction and control horizon. The constraints can be found in thedocumentation for the platform and is shown below in (89)–(91). Note that theconstraints are given in degrees and degrees per second since the specificationsfor the platform follow this standard. These need to be converted to radiansand radians per second before any calculations are performed.

The offline calibration is performed by extracting data from a predefined sce-nario and changing the parameters in order to obtain the desired performance.These parameters include the weight matrices Q, S and R that control howmuch we take the constraints into consideration for U, ∆U and Y respectivelyas well as the control and prediction horizons. These need to be balanced, sinceif we constrain the output to harshly we may end up with very brusque move-ments of the motors which may damage the actuators and platform. Howeverif we weigh the output to lightly, we may end up with a situation where themovement is not tracked well enough.

Both the horizons and the weights require some experimenting where we varythe parameters and select appropriate values to get the wanted results. Withsome influence from [7] and a bit of experimenting we find values that work withour specific problem and arrive at the values listed in Appendix A

The online calibration on the other hand is based less on comparing data andmore on gut feeling. This step in the process is performed last by driving thesimulator and adjusting the weights so as to get ’the correct feel’. It is a matterof calibrating the platform to pick up on all the small subtleties that are hardto model mathematically by looking at plots of data. This type of calibrationis crucial for the final product, however is less important when designing andverifying the model. It is thus outside the scope of this project and suggestedas a future expansion.

24

Page 34: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

3.4 Extracting data from the simulator

We need the data from the simulator in order to compose our state and referencevectors and thus need to extract this somehow. Thankfully, all of this is alreadyused for calculations within the simulator and readily available to be printed toa file along with the velocities and accelerations, both linear and angular.

In section 4.2 we explore three scenarios for the simulator that are of interestand extract everything we need for the model.

� A planar, circular track

Figure 6: Vehicle moving along circular track, path marked as a red line.

� Extreme tilt of the vehicle

Figure 7: Vehicle is forcefully tilted to an extreme angle.

25

Page 35: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

� Banging the scoop into the ground

Figure 8: The scoop in the air and after it has been slammed into the ground withforce.

26

Page 36: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

4 Experiments and results

We have two results to show, one is for the platform double-pendulum modeland the other is for the actual MPC-model.

4.1 Validating platform model

As mentioned in 2.2, we model the motion platform using a constrained doublependulum. In order to verify this model we calculate the vertical displacementof the platform as a function of the motor angle both for the theoretical modelas well as for the actual platform. To find the latter, we perform a full rollmovement and measure the displacement of the lower and upper ball joints andcenter these values around the middle. These values are then plotted in figure9 together with the values of the theoretical model described in (1)–(4). Themeasured values can be found in Appendix B.

−50 −40 −30 −20 −10 0 10 20 30 40 50−0.2

−0.15

−0.1

−0.05

0

0.05

0.1

0.15Vertical displacement of platform vs motor angle

Angle of motor (deg)

Ver

tical

dis

plac

emen

t of p

latfo

rm (

m)

Measured valuesModel values

Figure 9: Modelled and measured values of displacement vs motor angle.

Analysing the plots in figure 9 we sense a strong linear relationship, which isto be expected since the angles are small. This allows us to perform a linearregression on these two functions to get the equations:

y = 0.0030958x− 0.0008779 (85)

y = 0.0030776x+ 0.0019765. (86)

Equation (85) shows the linear regression for the measured values and (86) forthe model values. We will discuss the discrepancies between the values in section4.3.

27

Page 37: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

In order to be able to implement the model directly into the motor controller,which may be of importance later on, we also want to find the relationshipbetween motor angle and platform angle. We find that the motor angle islinearly related to the pitch and roll and by performing linear regression. Wethen get the results seen in figures 10–11 below.

0 5 10 15 20 25 300

2

4

6

8

10

12Motor angle α1 (degrees) vs platform roll angle θ (degrees)

α1 (degrees)

θ(degrees)

Motor angle vs rollLinear fit: 0.37401x + 0.14334

Figure 10: Modelled values of motor angles vs roll angle.

0 5 10 15 20 25 300

2

4

6

8

10

12

14Motor angle α1 (degrees) vs platform pitch angle φ (degrees)

α1 (degrees)

φ(degrees)

Motor angle vs pitchLinear fit: 0.48254x + 0.37766

Figure 11: Modelled values of motor angles vs pitch angle.

Extracting the coefficients from this to be used in an implementation we getcroll = 0.375 and cpitch = 0.483.

28

Page 38: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

4.2 Validating the MPC model

In order to validate the MPC model we need to keep three things in mind; thatthe movement of the platform is tracked well, that the constraints are not vio-lated and that the tilt coordination is present in the resulting angles.

We plot the raw data from the simulator, denoted simdata alongside the MPC-processed data, labelled mpc as well as the old model, denoted washout. Thereare nine parameters of interest that we use to analyse the performance of ourmodel, which are θ, φ, ψ, θ, φ, ψ, ax, ay and az.

For a quantitative comparison of the methods we use the l2-norm. More pre-cisely we take the difference of the l2-norm for the raw data and the methodsrespectively and denote them

l2wo = | ||iwo||2 − ||iraw||2 | ,l2MPC = | ||iMPC ||2 − ||iraw||2 | ,

(87)

where i signifies one of the nine component. This is then shown in a table andplotted in bar graphs for each scenario. All of the output vectors y, x, u and∆u are plotted in appendix C for the three scenarios. Below we focus on themost interesting of these plots and analyse these.

4.2.1 Tilt coordination evaluation

For the tilt coordination, we first recollect the principle from section 2.3. Sus-tained accelerations in the lateral plane is represented as an angle by utilizingthe acceleration of gravity. We then compare the acceleration in x in figure12 with the roll angle θ in figure 13 and can see that the accelerations indeedinfluence the angle as one would want and expect.

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8−15

−10

−5

0

5

10Acceleration in x

time (s)

ax(m

/s2)

simdatampc

Linear accelerations for circular path

Figure 12: The linear acceleration in x-direction.

29

Page 39: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8−0.02

−0.01

0

0.01

0.02

0.03

0.04

0.05

0.06Roll

time (s)

θ(rad)

simdatampc

Angles for circular path

Figure 13: The roll angle with tilt coordination showing.

4.2.2 Constraint handling evaluation

As stated in (89) the maximum allowed pitch is 10 degree which translated toradians is about 0.175 radians and as we can see in figure 14 this is well ex-ceeded during the extreme tilt maneuver. This means that the model respectsthe constraints and limits the platform from exceeding the pre-set value, some-thing that the old washout model does not, which requires manual limiting ofthe angles in a separate step.

Looking at figure 15, the MPC model automatically adjusts the correspondingangular velocity while the washout use the same angular velocity as withoutthe limiting which could possibly create a mismatch in sensation. So not onlydoes the MPC model not require any additional work, it also incorporates thelimitations of the constraints into its behaviour for the other parameters. Herewe see confirmation that the platform indeed can utilize its full range.

30

Page 40: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

30 30.2 30.4 30.6 30.8 31 31.2 31.4 31.6 31.8 32

0.15

0.16

0.17

0.18

0.19

0.2Pitch

time (s)

φ(rad)

simdatampcwashout

Angles for extreme tilt manouver

Figure 14: Pitch angle during extreme tilt maneuver.

30 30.2 30.4 30.6 30.8 31 31.2 31.4 31.6 31.8 32−0.3

−0.25

−0.2

−0.15

−0.1

−0.05

0

0.05

0.1

0.15Pitch

time (s)

φ(rad/s)

simdatampcwashout

Angular velocities for extreme tilt manouver

Figure 15: Pitch velocity during extreme tilt maneuver.

31

Page 41: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

4.2.3 Accuracy evaluation

If the values of our model and the raw data coincide well, we know that themodel is accurate and we do so by looking at the difference in l2-norm betweenthe model output and the raw simulation data. Although looking at the differ-ence in the l2-norm is in no way a perfect measure of the performance of themodel since sometimes we do not want the output from our model to completelymatch the raw data, for example when the tilt coordination influences the angleor when a parameter is restricted by the constraints, it still gives an indicationof how well the parameters are tracked.

We look at the bar plots of these tables depicted in figures 16, 17 and 18.Looking at these bar plots, we see that overall the parameters are tracked verywell with a typical discrepancy in the l2-norm of 10−1.

1 2 3 4 5 6 7 8 910

−3

10−2

10−1

100

101

102

103

Logarithmic bar plot of the absolute difference in l2−norm

Parameter

Loga

rithm

of t

he d

iscr

epan

cy

MPC−simdatawashout−simdata

Figure 16: Bar graph of the absolute difference in l2 norm.

32

Page 42: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

1 2 3 4 5 6 7 8 910

−4

10−3

10−2

10−1

100

101

102

Logarithmic bar plot of the absolute difference in l2−norm

Parameter

Loga

rithm

of t

he d

iscr

epan

cy

MPC−simdatawashout−simdata

Figure 17: Bar graph of the absolute difference in l2 norm.

1 2 3 4 5 6 7 8 910

−5

10−4

10−3

10−2

10−1

100

101

102

Logarithmic bar plot of the absolute difference in l2−norm

Parameter

Loga

rithm

of t

he d

iscr

epan

cy

MPC−simdatawashout−simdata

Figure 18: Bar graph of the absolute difference in l2-norm.

33

Page 43: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

4.3 Sources of error

The offset could be due to a systematic error in the measurements such as aparallax error. This is always a risk when using a manual measuring device,in this case a measuring tape. It could also be due to hysteresis in the balljoints, that is that the middle of the ball joint can be moved slightly and notbe completely aligned with the motor axis vertically in its rest position. Thiswould also account for it not being centered around zero. One last possibility isthat the rest position of the lower ball joint is not completely aligned verticallywith the motor axis.

Since a difference in platform displacement of anything below 10−3m gives anegligible impact on the pitch/roll angle and is in most cases indistinguishableto the driver of the platform. Further the hysteresis of the ball joints themselvesaccount for errors larger than that of the numerical model. Thus we can neglectthe error of the mathematical model, since the error is of order 10−5m.

4.4 Possible expansions

The expansions listed below are the next steps in making the model better,faster and more accurate.

4.4.1 Implementation and online calibration

The first expansion is to port the solution to the required format and implementon the current hardware. When this has been done one can perform the onlinecalibration described earlier by tweaking weights, horizons and constraints. Inorder to speed along this process the current Matlab code exports all the ma-trices to a comma-separated .txt-file to be imported into any ported solution.

4.4.2 Convert to a sparse system

Most of the matrices are fairly large with up to 105 elements depending onthe parameter size and many of them are very sparse with only elements onthe diagonal. It would then make sense to convert this to a sparse system andpreserve both memory and possibly speed up the calculations as well.

4.4.3 Vehicle model

One further step is to implement a more complex vehicle model, that takes intoconsideration suspension, steering angle and similar parameters. This wouldenable even further customisation to the current application.

34

Page 44: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

5 Conclusions

The time has come to tie the results to the goals in section 1.3, so we look atthe goals one by one.

5.1 Precision of the model

”The goal of this project is to develop a mathematical model that accurately re-flects the angles, velocities and accelerations of the vehicle while simultaneouslytaking into account the limited range of the mpf.”

As we could see in section 4 all of the parameters that we are interested inare tracked very well, even while respecting the constraints, which we could seeclearly in figures 14–15. The l2-norm shows that the MPC model performs a lotbetter than the washout model that is currently used.

5.2 Tilt coordination

”Another key aspect of the model is that tilt coordination should be present.”

We also concluded that tilt coordination was indeed present from figure 13,so the outcome with regards to this goal can be said to be positive.

5.3 Numerical feasibility

”The model should be optimized for numerical solving and a prototype codeshould be constructed.”

Since the MPC model allows us to construct a QP-problem which is very wellsuited for numerical solving, we may conclude that the first part of this goal isfulfilled. As for the second part, the code is constructed in Matlab which allowsfor easy plotting and simplicity when handling matrices. This prototype can beported to the required programming language and at the same time be used toverify the ported solution.

35

Page 45: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

A Appendix - Coefficients used

Table 2: Vestibular system transfer function coefficients.

Coefficient i=x i=y i=z

Til 6.1 5.3 10.2

Tis 0.1 0.1 0.1

Tia 30 30 30

τ il 5.33 5.33 5.33

τ is 0.66 0.66 0.66

τ ia 13.2 13.2 13.2

Ki 0.4 0.4 0.4

Np = 15

Nc = 10(88)

Below are the weights listed together with the constraints and the vectors y, uand ∆u. These are all found in 26 to easily see which parameters carry whichweight and has which constraint. Below in the diagonal matrix (89) we see theweights Qm as well as the constraints for y

y =[θ φ ψ ax ay az θ φ ψ px vx py vy pz vz

]T,

Qm = diag([

2000 2000 300 60 30 10 60 60 20 20 20 20 20 30 15])

,

ymax = +[

500 500 400 150 150 100 10 10 10 100 10 100 10 100 10]T

,

ymin = −[

500 500 400 150 150 100 10 10 10 100 10 100 10 100 10]T(89)

and the weight matrix Sm for u are displayed below in (90) along with theconstraints

u =[θ φ ψ ax ay az

]T,

Sm = diag([

1 1 1 1 1 1])

,

umax = +[

30 30 40 10 10 10]T

,

umin = −[

30 30 40 10 10 10]T

(90)

36

Page 46: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

and the weight matrix Rm for the rate of change in control sequence ∆u as wellas the constraints are given as

∆u =[

∆θ ∆φ ∆ψ ∆ax ∆ay ∆az.]T

,

Rm = diag([

1 1 1 0.1 0.1 0.1])

,

∆umax = +[

150 150 150 100 100 100]T

,

∆umin = −[

150 150 150 100 100 100]T.

(91)

37

Page 47: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

B Appendix - Platform measurements

Below in table 3 we see the values measured for the platform during a rollmovement. Knowing the length of the lever arm allows us to find the motorangle from the position of the lower joint and the displacement of the platformfrom the position of the upper. All values are adjusted around the center, wherethe center is defined as the rest position of the platform when it is parallel tothe ground. The angles are found through:

α1 = sin−1(lower ball joint position

lever arm length

)(92)

Table 3: Measured positions of actuator joints during a full roll.

Upper ball joint Lower ball joint Resulting angle (°)

-0.124 -0.119 -39.78

-0.111 -0.111 -36.64

-0.096 -0.096 -31.07

-0.079 -0.076 -24.12

-0.058 -0.057 -17.85

-0.041 -0.039 -12.10

-0.021 -0.019 -5.86

0 0 0

0.020 0.021 6.48

0.040 0.039 12.10

0.060 0.060 18.82

0.078 0.079 25.13

0.096 0.096 31.07

0.113 0.114 37.80

0.124 0.121 40.58

38

Page 48: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

C Appendix - Complete model output

C.1 Circular path

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6−0.1

0

0.1Roll

time (s)

θ(rad)

simdatampcwashout

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6−0.03

−0.02

−0.01

0

0.01Pitch

time (s)

φ(rad)

simdatampcwashout

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6−0.5

0

0.5

1Yaw

time (s)

ψ(rad)

simdatampcwashout

Angles for for circular path

Figure 19: The angles for the circular path.

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6−1

−0.5

0

0.5Roll

time (s)

θ(rad/s)

simdatampcwashout

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6−0.5

0

0.5

1Pitch

time (s)

φ(rad/s)

simdatampcwashout

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6−1

−0.5

0

0.5Yaw

time (s)

ψ(rad/s)

simdatampcwashout

Angular velocities for circular path

Figure 20: The rotational velocities for the circular path.

39

Page 49: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6−20

−10

0

10Acceleration in x

time (s)

ax(m

/s2)

simdatampcwashout

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6−10

0

10

20

30Acceleration in y

time (s)

ay(m

/s2)

simdatampcwashout

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6−1

−0.5

0

0.5Acceleration in z

time (s)

az(m

/s2)

simdatampcwashout

Linear accelerations for circular path

Figure 21: The linear accelerations for the circular path.

Table 4: Absolute difference in l2-norm for each method.

Parameter l2wo l2MPC

θ 0.0026 0.0061

φ 0.0025 0.0011

ψ 0.0179 6.1798

θ 0.0072 0.7321

φ 0.0041 0.1540

ψ 0.0185 1.4022

ax 1.1069 49.7561

ay 1.9495 103.5735

az 0.0204 1.1961

40

Page 50: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

0 1 2−1

−0.8

−0.6

−0.4

−0.2

0

0.2

0.4Roll velocity

time (s)

θ(rad/s)

0 1 2−0.4

−0.2

0

0.2

0.4

0.6

0.8

1Pitch velocity

time (s)φ(rad/s)

0 1 2−1

−0.8

−0.6

−0.4

−0.2

0

0.2

0.4Yaw velocity

time (s)

ψ(rad/s)

0 1 2−10

−8

−6

−4

−2

0x−acceleration

time (s)

ax(m

/s2)

0 1 20

2

4

6

8

10y−acceleration

time (s)

ay(m

/s2)

0 1 2−0.1

−0.05

0

0.05

0.1

0.15

0.2

0.25z−acceleration

time (s)

az(m

/s2)

Control sequence rate values for circular path

Figure 22: Control sequence for the circular path.

0 1 2−1

−0.5

0

0.5Roll acceleration

time (s)

∆θ(rad/s2)

0 1 2−0.4

−0.2

0

0.2

0.4

0.6

0.8

1Pitch acceleration

time (s)

∆φ(rad/s2)

0 1 2−1

−0.8

−0.6

−0.4

−0.2

0

0.2

0.4Yaw acceleration

time (s)

∆ψ

(rad/s2)

0 1 2−2

−1.5

−1

−0.5

0

0.5x−acceleration rate

time (s)

∆ax(m

/s3)

0 1 2−1.5

−1

−0.5

0

0.5

1y−acceleration rate

time (s)

∆ay(m

/s3)

0 1 2−0.1

−0.05

0

0.05

0.1

0.15z−acceleration rate

time (s)

∆az(m

/s3)

Control sequence values for circular path

Figure 23: Control sequence rate for the circular path.

41

Page 51: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

C.2 Extreme tilt

30 30.2 30.4 30.6 30.8 31 31.2 31.4 31.6 31.8 32−0.1

−0.08

−0.06

−0.04Roll

time (s)

θ(rad)

simdatampcwashout

30 30.2 30.4 30.6 30.8 31 31.2 31.4 31.6 31.8 32

0.16

0.18

0.2Pitch

time (s)

φ(rad)

simdatampcwashout

30 30.2 30.4 30.6 30.8 31 31.2 31.4 31.6 31.8 32−1.5

−1

−0.5

0

0.5Yaw

time (s)

ψ(rad)

simdatampcwashout

Angles for extreme tilt manouver

Figure 24: The angles for the extreme tilt manouver.

30 30.2 30.4 30.6 30.8 31 31.2 31.4 31.6 31.8 32−0.2

0

0.2Roll

time (s)

θ(rad/s)

simdatampcwashout

30 30.2 30.4 30.6 30.8 31 31.2 31.4 31.6 31.8 32−0.4

−0.2

0

0.2

0.4Pitch

time (s)

φ(rad/s)

simdatampcwashout

30 30.2 30.4 30.6 30.8 31 31.2 31.4 31.6 31.8 32−0.1

0

0.1

0.2

0.3Yaw

time (s)

ψ(rad/s)

simdatampcwashout

Angular velocities for extreme tilt manouver

Figure 25: The rotational velocities for the extreme tilt manouver.

42

Page 52: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

30 30.2 30.4 30.6 30.8 31 31.2 31.4 31.6 31.8 32−5

0

5Acceleration in x

time (s)

ax(m

/s2)

simdatampcwashout

30 30.2 30.4 30.6 30.8 31 31.2 31.4 31.6 31.8 32−20

−10

0

10

20Acceleration in y

time (s)

ay(m

/s2)

simdatampcwashout

30 30.2 30.4 30.6 30.8 31 31.2 31.4 31.6 31.8 32−5

0

5

10Acceleration in z

time (s)

az(m

/s2)

simdatampcwashout

Linear accelerations for extreme tilt manouver

Figure 26: The linear accelerations for the extreme tilt manouver.

Table 5: Absolute difference in l2-norm for each method.

Parameter l2wo l2MPC

θ 0.0007 0.0000

φ 0.0037 0.0000

ψ 0.0001 0.1845

θ 0.0005 0.0201

φ 0.0137 0.0032

ψ 0.0009 0.0145

ax 0.4013 1.4631

ay 0.3051 26.8611

az 0.0967 7.3437

43

Page 53: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

30 31 32−0.1

−0.05

0

0.05

0.1

0.15Roll velocity

time (s)

θ(rad/s)

30 31 32−3

−2.5

−2

−1.5

−1

−0.5

0

0.5Pitch velocity

time (s)φ(rad/s)

30 31 320.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45Yaw velocity

time (s)

ψ(rad/s)

30 31 32−10

−9.8

−9.6

−9.4

−9.2

−9

−8.8x−acceleration

time (s)

ax(m

/s2)

30 31 32−2

0

2

4

6

8y−acceleration

time (s)

ay(m

/s2)

30 31 32−3.2

−3

−2.8

−2.6

−2.4

−2.2

−2

−1.8z−acceleration

time (s)

az(m

/s2)

Control sequence rate values for extreme tilt manouver

Figure 27: Control sequence during extreme tilt maneuver.

30 31 32−0.1

−0.05

0

0.05

0.1Roll acceleration

time (s)

∆θ(rad/s2)

30 31 32−0.2

−0.15

−0.1

−0.05

0

0.05

0.1

0.15Pitch acceleration

time (s)

∆φ(rad/s2)

30 31 32−0.05

0

0.05

0.1

0.15Yaw acceleration

time (s)

∆ψ

(rad/s2)

30 31 32−10

−8

−6

−4

−2

0

2x−acceleration rate

time (s)

∆ax(m

/s3)

30 31 32−4

−2

0

2

4

6y−acceleration rate

time (s)

∆ay(m

/s3)

30 31 32−2.5

−2

−1.5

−1

−0.5

0

0.5

1z−acceleration rate

time (s)

∆az(m

/s3)

Control sequence values for extreme tilt manouver

Figure 28: Control sequence rate during extreme tilt maneuver.

44

Page 54: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

C.3 Scoop slam

4.8 4.9 5 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8−4

−2

0

2x 10

−3 Roll

time (s)

θ(rad)

simdatampcwashout

4.8 4.9 5 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.80.01

0.015

0.02

0.025Pitch

time (s)

φ(rad)

simdatampcwashout

4.8 4.9 5 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8−0.01

0

0.01

0.02Yaw

time (s)

ψ(rad)

simdatampcwashout

Angles for scoop slam

Figure 29: The angles for the scoop slam.

4.8 4.9 5 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8−0.1

0

0.1Roll

time (s)

θ(rad/s)

simdatampcwashout

4.8 4.9 5 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8−0.01

0

0.01

0.02Pitch

time (s)

φ(rad/s)

simdatampcwashout

4.8 4.9 5 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8−0.01

0

0.01

0.02Yaw

time (s)

ψ(rad/s)

simdatampcwashout

Angular velocities for scoop slam

Figure 30: The rotational velocities for the scoop slam.

45

Page 55: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

4.8 4.9 5 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8−1

0

1Acceleration in x

time (s)

ax(m

/s2)

simdatampcwashout

4.8 4.9 5 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8−10

−5

0

5

10Acceleration in y

time (s)

ay(m

/s2)

simdatampcwashout

4.8 4.9 5 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8−6

−4

−2

0

2Acceleration in z

time (s)

az(m

/s2)

simdatampcwashout

Linear accelerations for scoop slam

Figure 31: The linear accelerations for the scoop slam.

Table 6: Absolute difference in l2-norm for each method.

Parameter l2wo l2MPC

θ 0.0002 0.0281

φ 0.1500 0.0052

ψ 0.0335 17.1242

θ 0.0166 0.1829

φ 1.3337 0.2205

ψ 0.1316 1.6575

ax 0.1539 14.4211

ay 0.5521 47.8782

az 0.1474 11.3545

46

Page 56: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

Jens [email protected] January 19, 2015

4 5 6−0.06

−0.04

−0.02

0

0.02

0.04

0.06

0.08Roll velocity

time (s)

θ(rad/s)

4 5 60.025

0.03

0.035

0.04

0.045

0.05

0.055Pitch velocity

time (s)φ(rad/s)

4 5 6−0.01

−0.005

0

0.005

0.01Yaw velocity

time (s)

ψ(rad/s)

4 5 6−10

−9.8

−9.6

−9.4

−9.2

−9

−8.8x−acceleration

time (s)

ax(m

/s2)

4 5 6−2

0

2

4

6y−acceleration

time (s)

ay(m

/s2)

4 5 6−3.4

−3.2

−3

−2.8

−2.6

−2.4

−2.2

−2z−acceleration

time (s)

az(m

/s2)

Control sequence rate values for scoop slam

Figure 32: Control sequence for the scoop slam.

4 5 6−0.04

−0.02

0

0.02

0.04

0.06

0.08Roll acceleration

time (s)

∆θ(rad/s2)

4 5 6−0.02

−0.01

0

0.01

0.02

0.03

0.04Pitch acceleration

time (s)

∆φ(rad/s2)

4 5 6−8

−6

−4

−2

0

2

4

6x 10

−3Yaw acceleration

time (s)

∆ψ

(rad/s2)

4 5 6−10

−8

−6

−4

−2

0

2x−acceleration rate

time (s)

∆ax(m

/s3)

4 5 6−6

−4

−2

0

2

4y−acceleration rate

time (s)

∆ay(m

/s3)

4 5 6−2.5

−2

−1.5

−1

−0.5

0

0.5

1z−acceleration rate

time (s)

∆az(m

/s3)

Control sequence values for scoop slam

Figure 33: Control sequence rate for the scoop slam.

47

Page 57: A Motion Cueing Model for Mining and Forestry Simulator Platforms Based on Model Predictive Control

References

[1] Prodyut Das Vestibular Rehabilitation Exercise 2014http://www.physiotherapy-treatment.com/Vestibular-Rehabilitation-Exercise.html

[2] Chin-I Huang, Human Visual-Vestibular Based (HVVB) Adaptive WashoutFilter Design for VR-based Motion Simulator. National Kaohhsiung FirstUniversity of Science and Technology, Taiwan, 2010

[3] Sensory Systems/Vestibular System Simulation 2014http://en.wikibooks.org/wiki/Sensory Systems/Vestibular System Simulation[06 dec 2014]

[4] Chin-I Huang, Human Visual-Vestibular Based (HVVB) Adaptive WashoutFilter Design for VR-based Motion Simulator. National Kaohhsiung FirstUniversity of Science and Technology, Taiwan, 2010

[5] Wikipedia State-space representation 2014http://en.wikipedia.org/wiki/State-space representation [20 nov 2014]

[6] Wikipedia Quadratic programming 2014http://en.wikipedia.org/wiki/Quadratic programming [29 dec 2014]

[7] Bruno Daniel Correia Augusto, Rui Jose Leal Loureiro Motion Cueing inthe Chalmers Driving Simulator: A Model Predictive Control Approach.Chalmers University of Technology, Goteborg, Sweden, 2009

[8] L.D Reid, M.A Nahon Flight Simulation Motion-base Drive Algorithms:Part 1 - Developing and Testing the Equations. UTIAS Report No.296,CN, 1985

[9] Wikipedia Motion simulator - Implementation using washout filters 2014http://en.wikipedia.org/wiki/Motion simulator#Implementation using washout filters[22 dec 2014]

[10] C.D Larsen Comparison of Three Defree of Freedom and Six Degree ofFreedom Motion Bases Utilizing Classical Washout Algorithms. Iowa StateUniversity, USA 2011

[11] Wikipedia Model predictive control 2015http://en.wikipedia.org/wiki/Model predictive control [12 jan 2015]

48