• No results found

Modelling and Control of an Electro-Hydraulic Forklift

N/A
N/A
Protected

Academic year: 2021

Share "Modelling and Control of an Electro-Hydraulic Forklift"

Copied!
100
0
0

Loading.... (view fulltext now)

Full text

(1)

Master of Science Thesis in Electrical Engineering

Department of Electrical Engineering, Linköping University, 2016

Modelling and Control of an

Electro-Hydraulic Forklift

(2)

Master of Science Thesis in Electrical Engineering

Modelling and Control of an Electro-Hydraulic Forklift

Anders Brändström and Henrik Bäckman LiTH-ISY-EX–16/4970–SE Supervisor: Du Ho

isy, Linköpings universitet

Linus Helgesson Examiner: Johan Löfberg

isy, Linköpings universitet

Division of Automatic Control Department of Electrical Engineering

Linköping University SE-581 83 Linköping, Sweden

(3)

Abstract

To meet the increasing demand on control precision in industrial forklifts, phys-ical modelling of the lifting system has been combined with parameter estima-tions from data. A number of different controllers have been evaluated in terms of their ability to achieve a load independent lifting speed. The model and con-troller performance as well as stability properties were evaluated in simulations, and the most promising controller was implemented on the real system. Espe-cially the electric motor turned out to be difficult to model, and therefore exper-imental data was used to approximate some parts of it. This, along with some friction parameters that had to be estimated caused a slight loss in model gener-ality. An observer (Extended Kalman filter) was used to estimate the unknown states, including the velocity of the forks. The simulated performance of the MPC controller was slightly better than the PID controller, except for a bigger overshoot when starting from a turned off motor. The PID controller also han-dles model errors better, because of its integral action. Due to the simplicity in relation to performance, only the PID controller was implemented on the forklift. The model turned out to perform well, but not well enough to estimate the lifting height accurately. The PID controller worked as intended and it could therefore be concluded that a more advanced control algorithm, such as an MPC controller, is not necessary for this system.

(4)
(5)

Acknowledgments

We would like to thank our examiner Johan Löfberg for doing a great job and being interested in the work we do. Also a big thanks to our supervisor Linus Helgesson and all other people at the company we have come in touch with. We have have allways felt a good support and a welcoming atmosphere towards us. A very special thanks goes out to our friends and loved ones, who have put up with us all this time, and brought us so much joy.

Linköping, June 2016 Anders Brändström och Henrik Bäckman

(6)
(7)

Contents

Notation xi 1 Introduction 1 1.1 Background . . . 1 1.2 Problem formulation . . . 1 1.3 Research questions . . . 3 1.4 Delimitations . . . 4 1.5 Outline . . . 4 2 Related Work 5 2.1 Electric motors . . . 5 2.2 Hydraulic systems . . . 7 2.3 Temperature estimation . . . 7 3 Theory 9 3.1 The extended Kalman filter . . . 9

3.1.1 Linearization . . . 9 3.1.2 Time update . . . 10 3.1.3 Measurement update . . . 10 3.1.4 Initialization . . . 10 3.2 Exact Linearization . . . 11 3.3 Stability Theory . . . 11

3.3.1 Small gain theorem . . . 11

3.3.2 Static nonlinearities . . . 12 3.3.3 Circle criterion . . . 12 3.3.4 Tustin’s Formula . . . 13 4 Method 15 4.1 Modeling . . . 16 4.2 Software . . . 16 4.3 Data gathering . . . 17 4.4 Control . . . 17 4.5 Verification . . . 18 vii

(8)

viii Contents 4.6 Implementation . . . 18 4.7 Final testing . . . 18 5 Modeling 19 5.1 Bond graph . . . 19 5.2 Model equations . . . 20 5.3 Check valve . . . 21

5.4 Mast change dynamics . . . 21

5.5 Summarized mathematical model . . . 21

5.6 Simulink model . . . 23

5.6.1 Battery . . . 24

5.6.2 Motor control unit . . . 24

5.6.3 DC motor . . . 25 5.6.4 Pump . . . 25 5.6.5 Check valve . . . 26 5.6.6 Cylinder . . . 26 5.6.7 Chains . . . 27 5.6.8 Forks . . . 27

5.6.9 Extended Kalman Filter . . . 28

5.6.10 Frequency analysis . . . 28 5.7 Model validation . . . 31 5.7.1 Data gathering . . . 31 5.7.2 Performance measure . . . 31 5.7.3 Parameter estimation . . . 32 6 Control Strategies 35 6.1 Generating the reference signal . . . 35

6.2 Model Predictive Control . . . 36

6.2.1 Quadratic programming . . . 36

6.2.2 The MPC framework . . . 37

6.2.3 Choosing the cost function . . . 38

6.2.4 Constrains in MPC . . . 39 6.2.5 Main drawbacks . . . 39 6.2.6 MPC Stability . . . 40 6.3 PID . . . 40 6.4 IMC . . . 40 6.5 Code generation . . . 46 7 Results 47 7.1 Linearized model . . . 47 7.2 Controller . . . 47 7.2.1 PID . . . 48 7.2.2 MPC . . . 49 7.3 Stability . . . 50

7.3.1 Open loop stability . . . 50

(9)

Contents ix

7.4 Model Validation . . . 54

7.5 Extended Kalman Filter . . . 56

7.5.1 Discretization . . . 56 7.5.2 Linearization . . . 56 7.5.3 Tuning parameters . . . 57 7.5.4 Performance . . . 57 7.5.5 Fault detection . . . 57 7.6 Implementation . . . 59 7.7 Conclusions . . . 62

7.7.1 Model based work . . . 62

7.7.2 The 600 rpm criteria . . . 62

7.7.3 Independent lifting velocity . . . 62

7.7.4 Stability . . . 63

7.7.5 Model generality . . . 63

7.7.6 Other benefits of having an observer . . . 64

7.7.7 Precision . . . 64

7.7.8 Control strategies . . . 64

8 Future work 67 A Calculations 71 A.1 Motor function calculation . . . 71

A.2 Field current calculation . . . 72

A.3 Equations from bond graph . . . 73

B Simulations 75 B.1 Parameter estimation and model validation . . . 75

(10)
(11)

Notation

Abbreviations

Notation Meaning

P I D Proportional, Integrative, Derivative (control)

MP C Model Predictive Control

EK F Extended Kalman Filter

P W M Pulse Width Modulation

rpm Revolutions per minute

SEDC Separately Excited Direct Current (motor)

CAN Controller Area Network

(12)
(13)

Nomenclature

Physical Constants

m0 Mass of the forks without any load 294 kg

A Area of the lifting cylinder 0.0025 m3

g Gravitational Constant 9.81 m/s2

Ubatt Voltage of the battery 24 V

1/r Displacement of the pump 6.68 × 10−7m3

Rbatt Resistance of the battery 0.0057 Ω

Ra0 Resistance of the armature at room temperature 0.0192 Ω

Design parameters

Tc Desired rise time of the IMC controlled closed loop 0.5 s

N Number of steps used by the MPC controller 20

Q1 cost function parameter used by the MPC controller 1 Q2 cost function parameter used by the MPC controller 1

Estimated parameters

τ Time constant of a lowpass filter within the model 1.2 s

D1 Friction coefficient within the pump 0.00875719 N m/ω

c1 Constant part of friction on the forks −197.56 N

c2 Friction coefficient on the forks dependent on mass 0.74 N /kg

(14)
(15)

1

Introduction

This is a thesis work concerning modeling, estimation and control of certain states of an electro-hydraulic system. In this chapter, we will explain why model-ing is interestmodel-ing from an industrial point of view.

1.1

Background

In recent years, the cost of computational power has been continuously reduced. This has resulted in a high potential for more advanced and computational ex-pensive algorithms in control systems. As a result, many model based algorithms such as model predictive control(MPC), have become more feasible in various ap-plications. This can be one of the reasons why model based methods increase in popularity for every day that passes.

The thesis work has been made on a Swedish company that has a big share in the forklift market. Like in many technical areas, the forklift industry also has an interest to work more model based than they do now. It helps developers to simulate systems and to find errors earlier in the work process. This will in the end lead to higher quality in the products, benefiting the end user, its customer and therefore the whole society.

1.2

Problem formulation

The system that is studied in this thesis is the part of a forklift responsible for the lifting action. The forklift is a so calledStacker which is a truck that you ride

(16)

2 1 Introduction

Figure 1.1:A stacker forklift.

standing up on a platform, or walk behind. It is depicted in Figure 1.1. The max-imum lifting height can be as much as 6 m, depending on the type of mast that is mounted. The hydraulic lifting system consists of a control unit, an electric mo-tor, a pump and a hydraulic cylinder which converts the energy from the pump into a lifting force, which in its turn moves the forks carrying the load. A simple sketch of the system is shown in Figure 1.2 below.

Figure 1.2:A color coded sketch of the hydraulic lifting system, with purple inputs, green sensory signals and grey unmeasured outputs.

Poor lubrication and cooling are two reasons why the hydraulic pump used in this system sometimes wear out earlier than it should. The supplier of these pumps states that in order to ensure proper lubrication and cooling, the pump must be run at 600 rpm or higher.

(17)

1.3 Research questions 3

However, for practical and economical reasons, adding a sensor to the system to measure the pump rpm is not beneficial. Therefore one may be interested in estimating the angular velocity of the pump in another way. One way to do this is to use a model based approach, where a model of the system is combined with measurements in an observer to estimate the desired states. This could for instance be the angular velocity of the pump, but also the lifting height and ve-locity.

Because of safety regulations, gates to the side of the driver has to be folded down when lifting above 1.8 m. This is to ensure that the driver has plenty of space to escape if something goes wrong, for instance if something comes falling down or the truck for some reason falls over. This is today noticed by a magnetic sensor, which tells if the forks have passed 1.8 m or not. This will force the forks to brake fast, if side gates are up, but that is not always easy and smooth. If position and velocity is estimated, the speed of the forks can be ramped down and stopped at 1.8 m with higher precision and comfort.

This thesis investigates how the 600 rpm criteria mentioned above can be ful-filled without adding a sensor that measures the rotational velocity of the pump. The thesis will also investigate the how issue of achieving a constant lift velocity independent of load on the forks can be solved. This is useful for the operator because the same control signal would then, ideally, always result in the same lifting speed.

1.3

Research questions

There are a number of questions that hopefully will be fully explored and an-swered in this thesis work. The main problems of the task are summarized in the table below.

1. How can the 600 rpm criteria be fulfilled without adding an extra sensor? 2. Is it possible to achieve similar lifting velocity independent of the load on

the forks?

3. Which control strategy is best suited for this problem? 4. Can stability be assured for the generated control algorithm?

5. Can a general model for the system be generated in a way that the model parameters require no individual tuning? I.e. the model parameters should be readable from the data sheets of the components.

6. Can regulation restrictions be met, by estimating the velocity and height of the forks with higher precision?

(18)

4 1 Introduction

1.4

Delimitations

Due to the nature of the authors’ education and interests, focus has intention-ally been shifted away from the hydraulic parts of the system. This part of the model is therefore relatively simple and has some room left for improvement, in the form of for instance energy losses, compressibility of the hydraulic fluid and changes in viscosity due to temperature changes. These factors are however small enough to be omitted in this first proof of concept that this report presents. The work has instead been directed towards the motor and the pump, to obtain an in-depth analysis of the dynamics of these parts. It was, however, soon discov-ered that the motor posed some difficulties that could not be modeled analytically, and instead had to be approximated. The motor function was initially assumed to be directly dependent on the field current, but this is not the case for large currents. Due to magnetic saturation of the iron core, the motor function is only a linear function for low currents. Instead of spending an entire semester trying to find a set of equations that describe the magnetization, some data points were gathered and a look-up table was used instead.

The plan was initially to model a double mast that uses multiple cylinders to achieve higher lifting heights, but since there was no truck with this configura-tion available, the work had to be performed on a single mast truck instead.

1.5

Outline

The purpose of this section is to give the reader an idea of the general structure of the thesis.

• The first chapter gives an introduction to the problem that is to be investi-gated, and puts it into context by explaining the background and why it is an important and relevant topic.

• Chapter 2 presents the related work that already has been done by others. • The third chapter further complements the related work with theory that is

necessary and will be used in the work.

• Chapter 4 describes the method throughout the project, while chapter 5 investigates the modeling task more deeply, together with model validation • The sixth chapter introduces the controllers that are implemented in

simu-lations, and also describes the implementation to the physical system. • The results are presented and discussed in chapter 7.

(19)

2

Related Work

This is not the first time someone tries to set up a model and control strategy for this kind of system. Similar system has been modeled, but often with other sensors or a detail that changes the outcome significantly.

2.1

Electric motors

Electric motors have been modeled to a great extent in the past, and the basic equations that describe their dynamics can be derived from Kirchoff’s voltage law, Lorentz’s forces and the laws of motion. In this project, a special type of mo-tor is used, namely a separately excited direct current (SEDC) momo-tor. The main difference compared to a regular DC motor, is that this motor uses an electromag-net with a controllable magelectromag-netic field instead of a permanent magelectromag-net. A simple sketch of how it looks can be found in Figure 2.1. The main benefit of using an SEDC motor is that the operating range can be extended, so that the motor can achieve higher speeds at low loads, and still be able to lift very heavy loads. According to [1], for an SEDC motor, the dynamics are characterized by

Lai˙a= UaRaiaUe

Ue= kifω

J ˙ω = TdDω − Tl

Td= kifia

(2.1)

where Lais the inductance of the armature, iais the current through the arma-ture, Uais the armature supply voltage, Rais the armature resistance, Ueis the

(20)

6 2 Related Work

Figure 2.1: An illustration of an SEDC motor, with the armature circuit which generates the output power and the field circuit that represents the electromagnet in the motor.

motor voltage, if is the field current, k is the motor function, ω is the rotational velocity of the motor, J is the inertia in the system, Td is the torque produced by the motor, D is the friction coefficient and Tl is the load torque. Compared to a regular, permanent magnet DC motor, the motor constant is replaced by a motor function depending linearly on the field current, which from now on will be called g1(if).

One quickly realizes that this model contains a non-linearity in (2.1), since the field current is a function of the armature current in the system that is being stud-ied in this thesis. This is a problem that has to be dealt with. A plausible solution might be a method called exact linearization, as described in [2, p.433], or an extended Kalman filter (EKF) [3, p.153]. Furthermore, it will later in the report be shown that this model of the motor is flawed, because the assumption that the motor function would be g1(if) = kif is a poor approximation of the reality. An alternative way of estimating the angular velocity of the motor would be to measure frequencies of the ripple that occurs when the brushes connect and dis-connect from the commutators, as explained in [4]. However, since the system is part of a noisy environment, with other motors and factors that are likely to cause a lot of disturbances, this method may not yield the best results for this project. Furthermore, due to limitations in the motor control unit it is not possible to sample and read the current fast enough to achieve an appropriate bandwidth to capture the high frequency ripple, and therefore this method will be excluded from further investigation at this point.

(21)

2.2 Hydraulic systems 7

2.2

Hydraulic systems

Hydraulic systems have been modeled before, not exactly this kind of systems, but similar ones. André in [5] does this, but in his case, several sensors in the system were given. This makes some of the methods used in his thesis unviable, because we do not have access to these type of sensors, but the general structure of the model will be salvaged and used as a basis for this project. By assuming no leakage, (2.2) is used to get a linear relationship between the angular velocity of the motor and the velocity.

f = ω/r

f = A ˙x (2.2)

Another similar system is used when modeling an elevator in [6], using a mathe-matical approach describing their system. The elevator is similar to our system in many ways, and the method for modeling hydraulics should therefore be ap-plicable to our system as well. So by using their method to get the equations, to our system, modeling of the hydraulics should be quite straight forward.

2.3

Temperature estimation

An approach to estimate temperature and velocity by measuring armature cur-rent is presented in [7]. In this article, a linear model for the internal resistance’s temperature dependence is presented as

Ra= Ra0(1 + αθ) (2.3)

along with a nonlinear thermal equation

H ˙θ = ia2Ra+ kirω2−k0(1 + kTω)θ (2.4)

where Ra0is the ambient resistance, α is the temperature coefficient of resistance,

θ is the deviation from ambient temperature, H is the thermal capacity of the

armature, kiris the iron loss constant, k0is the thermal power transfer coefficient

and kT is the temperature coefficient of angular velocity.

The model parameters are estimated through quite extensive experiments, some of which may not be possible to perform in this project, but if the motor supplier has values for these parameters and are willing to share this information, this could potentially be very valuable for this project. Once the model parameters are known, an extended Kalman filter is used to estimate both the temperature and the angular velocity ω.

To determine the ambient resistance may cause some trouble, because the fork-lifts are used in a wide variety of conditions, including everything from cold

(22)

8 2 Related Work

storages to very hot countries near the equator. This means that the ambient tem-perature may be anywhere in the range from −30◦C to about 50C.

It is however enough to know the ambient resistance for one temperature to be able to calculate it for any other temperature, since α is a material dependent con-stant, which for copper turns out to be approximately 0.004/

C. Also note that

this means that the resistance changes with 4% for every 10◦

C, which

consider-ing the temperature differences mentioned earlier are far from negligible. This of course strengthens the thesis that a temperature model is necessary.

(23)

3

Theory

3.1

The extended Kalman filter

The method used for estimating the desired states in this thesis is the EKF[3, p.153]. In order to apply the EKF algorithm, the model should be formulated as a discrete time state space model as

xk+1= f (xk, uk) + ek

yk = h(xk, uk) + vk

(3.1) where x is the states, y is the measured quantities and e as well as v are assumed to be zero mean Gaussian white noise with covariance Q and R respectively. The functions f and h can both be nonlinear.

The EKF algorithm can be divided into three major stages: linearization, time update and measurement update. These stages will be discussed in greater detail below.

3.1.1

Linearization

What differentiates the EKF from normal KF is that linearizations of the functions

f and h are used. The linearizations are done according to

Fk = ∂f ∂x xˆk|k,uk Hk = ∂h ∂x xˆk|k−1 (3.2) 9

(24)

10 3 Theory

which is known as the Jacobian matrices, and is basically a first order Taylor expansion around the current state estimates. These linearizations only work well close to the points of linearization, and therefore they have to be recalculated at every time sample of the algorithm, which is one of the reasons why the EKF requires quite a lot of computational power. When the linearization is done, the procedure follows the same path as for a regular Kalman filter, with the time update and measurement update in ordinary fashion.

3.1.2

Time update

In the time update phase, which may also be called the prediction phase, the next set of states are estimated as

ˆ

xk|k−1= f ( ˆxk−1|k−1, uk−1)

Pk|k−1= FkPk−1|k−1FkT + Q

(3.3) where Q is the process noise covariance, which is used as a tuning parameter for the filter, along with the measurement noise covariance R. By tuning the relation between these two, one can control which has the most impact on the estimate: the model prediction or the measurements.

3.1.3

Measurement update

In short, the measurement update phase compares new sensory inputs yk, with the predicted states and calculates a new estimate of the states and their covari-ance, with help of the innovation matrix Sk, which describes the uncertainty in the model. The Kalman gain Kk origins from the Riccati equation, but further details are omitted from this report, and the equations

Sk = HkPk|k−1HkT + R Kk = Pk|k−1HkTS1 k k = ykh( ˆxk|k−1, uk) Pk|k = (I − KkHk)Pk|k−1 ˆ xk|k = ˆxk|k−1+ Kkk (3.4)

should be interpreted as a recipe for generating corrected estimates and state covariance given the latest measurements.

3.1.4

Initialization

In order to initialize the EKF, a starting position of the system is necessary, which means that ˆx0|0and P0|0have to be determined. In this thesis, the initial

condi-tions are known, since the EKF is always initialized when the system is inactive, which means the states (and P0) are zero.

(25)

3.2 Exact Linearization 11

3.2

Exact Linearization

If the nonlinearities of your system are known, it may be possible to compen-sate for this directly in a controller by choosing an appropriate input signal, but depending on how the nonlinearities enter the system, it may be more or less com-plicated to do so. A framework for solving this problem is described in [2, p.433]. The biggest issues with exact linearization is that it requires an exact knowledge of the nonlinearities, which is the main reason why it is not very well suited for this project.

3.3

Stability Theory

This section will discuss methods for analyzing the stability of nonlinear systems, since this in many cases is a much harder task than proving or disproving stability for linear systems where one can just look at the placement of the poles of the transfer function.

3.3.1

Small gain theorem

The small gain theorem states that given two stable systems, S1and S2, the

feed-back loop in figure 3.1 is stable if the criterion

||S1|| ∗ ||S2||< 1 (3.5) is fullfilled [2, p.30]. The || ∗ ||-operator in this case represents the infinity norm, or in other words the maximum gain of the transfer function over all frequencies. This theorem will be useful when trying to determine the properties of the system

Figure 3.1:An illustration of a feedback loop. The inputs to the system can be any arbitrary finite signals.

(26)

12 3 Theory

3.3.2

Static nonlinearities

There are no requirements for the two systems S1 and S2discussed above to be

linear. One of them could be, and in reality quite commonly is, a static nonlinear-ity where the output is a direct function of the input. This could for instance be a saturation of some sort. If the function f (x) satisfies

|f (x)| ≤ K|x|, (3.6)

then the gain of the function is said to be K [2, p.28].

3.3.3

Circle criterion

Let us now assume that S1 can be described by a linear transfer function G(s)

and S2is a function that satisfies (3.6) and therefore has gain K. The small gain

theorem then yields

K sup

s

|G(s)| < 1 (3.7)

if the feedback loop is stable. While this criterion guarantees stability, it is often too strict and it therefore exists feedback loops that do not fulfill it, yet still are stable.

In [2, p.31] it is shown that small gain theorem can also be used to produce an ex-tended version of the Nyquist criterion which handles nonlinear functions. This is done by extending the confinement of the nonlinearity with a lower bound which gives us

k1|x| ≤ |f (x)| ≤ k2|x| (3.8)

where k1is the lower bound and k2the upper bound. This can then be shown to

lead to a criterion very similar to the Nyquist criterion, but to include a circle that intersects the real axis at a 90◦

angle in −k1 1 and

1

k2, that must not be enclosed or intersected by the Nyquist curve to ensure stability. An example where stability can be assured is illustrated in Figure 3.2 and one where it cannot be assured is given in Figure 3.3.

(27)

3.3 Stability Theory 13

Figure 3.2:The blue nyquist curve does not intersect or enclose the red cir-cle, and therefore the system is stable according to the circle citerion.

Figure 3.3:The nyquist curve intersects the circle, and therefore no conclu-sions about the stability can be drawn in this case.

3.3.4

Tustin’s Formula

In order to better approximate the transition from continuous systems to dis-crete ones, Tustin’s formula can be used. Using the standard Euler forward ap-proximation, where the transition from Laplace transform s to the time discrete

(28)

14 3 Theory

Z-transform is given by

s ≈ 1

Ts

(1 − z−1), (3.9)

where z is the discrete time shift operator. This approximation is good enough in most cases, where the dynamics of the system that is being studied are slow enough, or the sampling frequency is relatively high in relation to the system dynamics, but there are slightly more accurate formulas. Tustin’s formula states that the transition can be approximated by

s ≈ 2

Ts (z − 1)

(z + 1). (3.10)

This approximation can be shown to not only be better than the ordinary Euler forward method, but also has better stability properties [8, p.90].

(29)

4

Method

In order to solve the task at hand, the main problem is divided into smaller prob-lems that will be discussed individually in the following subsections.

Figure 4.1:Schematic description of the inputs and outputs as well as inter-nal structure for the model.

Figure 4.1 gives an overview of how the model should be structured. The model utilizes a number of sensory inputs:

• ρcylwhich measures the pressure in the hydraulic system. • IAand IF which are the armature and field currents in the motor. • UBattwhich is the battery voltage.

(30)

16 4 Method

• A magnetic sensor mounted on the mast that registers when the forks pass a certain height (approximately 1.8m).

• ˙yf orks,ref, which is the lifting speed reference signal from the user.

The measurements and the model are then combined using an observer as in [9, p.192], in order to generate estimates of the relevant states. Mainly these are the rotational velocity of the pump, the lifting height and velocity of the forks, but it may also be interesting to try to estimate the temperature of the motor. These states are used both as outputs from the model, and as input to the control unit which along with the reference signal uses the states to calculate its own output. The outputs are:

• ˆωpump which is the rotational velocity of the pump.

• ˆy and ˙ˆy which are the lifting height and velocity.

• ˆTewhich is the temperature of the motor.

• A control signal in the form of a PWM-signal to the motor.

4.1

Modeling

A lot of effort will be put into creating a good model of the system, since the model is the basis of all further work. The system consists of a DC motor, a pump, a hydraulic cylinder and a load. At first an analytical model will be cre-ated by using bond graphs, as done in [10, p.117], to get a state space model. However, non-linear factors have to be added to the model to reflect the true system more accurately. To do this, the plan is to create a more in-depth model of each sub-part of the system, i.e. the motor, the pump, and the hydraulic sys-tem. The biggest benefit of doing so is that the work becomes more modular, and an eventual modification where for instance the hydraulic system is replaced can be handled easier. These models will then be implemented in software.

4.2

Software

Once the model is derived, each part is then implemented as a separate module MATLAB/Simulink. Some simulations will be made on the modules individu-ally, but since we cannot generate validation data for each sub part on the real system, verification of functionality on the module level will only be performed briefly. The modules are instead interconnected and simulations are run with the complete model, and compared with data from the real system.

(31)

4.3 Data gathering 17

4.3

Data gathering

To collect the data, a special forklift that is equipped with a lifting height sen-sor, will be used. This will yield a reference for y, and since this state is closely related not only ˙y, but also ωpump because the fluid displacement of the pump is assumed to be constant, and therefore there is a static connection between the states, see (5.3). This will give a good idea of how the model performs.

A series of tests will be performed during the data gathering phase, where a number of system configurations will be studied. The load on the fork and the properties of the input signal are factors that surely will affect the system. How and if the temperature significantly affects the characteristics of the system will also be investigated. The parameters that will be modified during the tests are first and foremost the mass of the load on the forks. Secondly, the input signal will also be varied, and a set of different constant speeds, as well as sinusoidal and irregular signals will be used. Last but not least, data will also be gathered when the system is running hot, with a motor temperature of at least 30◦

C above

ambient temperature.

During a test, all the input signals to the model depicted in Figure 4.1, and as many measurements of the outputs as possible will be saved for analysis. The outputs that can be measured are mainly the mass m and the altitude y, but ˙y and ω can be calculated from y.

4.4

Control

A number control strategies will be developed and tested such as for instance the Model Predictive Control(MPC), PID- or LQ-controllers described in [8, p.69 & p.153]. Each controller will be evaluated in terms of its performance regarding stability in the first place, and reference following as the second most important feature. The computational complexity may also be an interesting factor since the computational power in the forklift is limited. The performance of the con-trollers will be presented in the results of the thesis, along with a comparison between them and a suggestion for which controller that is the most suitable to implement in forklifts in the future.

In order to ensure the stability of the controllers, the small gain theorem or cir-cle criterion may have to be used since we are dealing with non-linearities in the system [2, p.33]. The nature of the non-linearities may however be "nice" enough so that the system can be seen as linear in different intervals, and linear stability analysis can be used instead.

(32)

18 4 Method

4.5

Verification

Most of the verifications will be done by simulation and theoretical reasoning. As mentioned before, to support the simulations, some data will be gathered from a special truck with a lifting height sensor. This data will be divided into two parts: estimation data and validation data. The estimation data will be used to tune the model, and the validation data to make sure the model works as intended.

4.6

Implementation

Once the system has been fully implemented in MATLAB/Simulink, it has to be adapted to the real system - the forklift. The first step in doing this will be to convert the MATLAB-code to C-code. This will be done by using auto-coder soft-ware, since it saves a lot of time compared to doing it by hand, and the result is most probably the same. The code will then be loaded into a development hard-ware that can be connected to the CAN-bus in the forklift. The communication device connected to the truck will then form the prototype.

4.7

Final testing

When the prototype is finished, its functionality will be tested thoroughly. Mainly the estimated states will be compared with the measured signals where this is pos-sible, for instance by using loads with accurately measured mass and measuring how close to the 1.8m mark the forks halt. A subjective opinion from an opera-tor’s point of view may also be included in the test summary, since this of course also is of interest for the company.

(33)

5

Modeling

In this chapter, a model of the system will be described. The model will later be used when designing the control structure, and while evaluating the results in simulations, to determine the performance of the model in the validation phase as well as the performance of the controller. Some assumptions have been made, to make the model less complicated. The fluid inside the hydraulic part is con-sidered incompressible and flows without losses. The friction coefficient is also considered to be constant in all parts of the system. This may make the model untrue, but still good enough without getting too time consuming.

5.1

Bond graph

To get a good overview of the system dynamics, a bond graph [10, p. 117] is made, see Figure 5.1. The bond graph is a compressed and simplified version. The in-ductive and resistive elements in the middle s-node is a summation of friction coefficients and moments of inertia, in both the motor and the pump.

The transformer is a result from a total of three transformers in a row. From the pump we get its displacement 1/r, multiplied with the cylinder area A, and finally through the chains, which scales the velocity of the mass by a factor 2. This results in a value of the transformer of rA/2.

The gyrator has a value of kif according to (2.1) , which will create an non-linearity, because if, the field current, is a function of the armature current ia.

A conflict in the causality does not really matter. It limits the possibility to

(34)

20 5 Modeling

Figure 5.1:Simplified bond graph of the system with causality conflict in TF.

ensure the ability to describe the system equations as a Dynamic Algebraic Equa-tion System(DAE-System). In our thesis, we simply extract the equaEqua-tions.

5.2

Model equations

By using the bond graph in Figure 5.1, equations can be extracted, and presented in Appendix A. With (A.3), (A.4), (A.5) and (A.6), (5.1) can be derived.

ua= Raia+ La˙ia+ kifω (5.1) By using (A.7), (A.8), (A.9), (A.10) and (A.10), (5.2) is obtained.

kifia= J ˙ω + Dω + p/r (5.2)

With equations (A.12) and (A.14), (5.3) is found.

ω = rAv (5.3)

Finally, by using (A.13), (A.15) and (A.16), (5.4) completes the model.

pA = m ˙v + mg (5.4)

(35)

5.3 Check valve 21

5.3

Check valve

The model still has some major flaws. For instance, before the pressure is built up within the cylinder, the cylinder is falling. In a real forklift, the forks stop almost immediately because of the check valve building up the pressure very fast, since the hydraulic oil is very close to incompressible. The check valve can be described by the following pseudo-code:

i f ( q_cyl >0)

p _ c y l = p_pump e l s e

p _ c y l = max( 2mg/A, p_pump )

where q is the flow in the cylinder, p is the pressure in the pump or cylinder and 2mg/A is the required pressure in the cylinder with area A to keep an object with mass m at constant velocity.

5.4

Mast change dynamics

To achieve lifting heights up towards 6m while still getting through doors, tele-scopic masts are required, where for instance one mast is used for the first half of the lift, and then a different mast with another set of cylinders lifts the last bit up to the top. This further complicates the model in two ways: parameters may change their values (for instance the cylinder area could theoretically be differ-ent), and the switching between masts causes impulses in the system. The main parameter change would be the mass m, since a different cylinder, or a different set of cylinders is used and parts of the masts also have to be lifted. This results in a perfectly inelastic collision, where

m1v1 = m2v2 (5.5)

describes the preservation of momentum during the collision. The left hand side of the equation is the momentum before the collision and the right hand side is the momentum after the collision. The sudden change in the velocity of the forks causes some trouble, since the derivative of the velocity is used in some of the dynamic equations of the system. This leads to very large forces on the forks, pump and motor, which may cause numerical trouble for the solver that will be used in the Simulink model later on.

5.5

Summarized mathematical model

Before the model is implemented in Simulink, let us summarize what the mathe-matical model should look like, and talk about its features and problematic areas.

(36)

22 5 Modeling

The mathematical model consists of the four equations in Section 5.2, along with the temperature dependent armature resistance from Section 2.3. This model is unfortunately flawed in some ways, and overly complicated in other ways. For instance, the moment of inertia J of the pump can, without any losses in model performance, be neglected since the dynamics of this part simply was much faster than the rest of the system.

The biggest flaw, however, lies in the assumption that the motor function is di-rectly proportional to the field current, which is a good approximation for small currents, but as the current increases in amplitude, the iron that is magnetized to create the magnetic field in the motor comes closer to its maximum magnetic potential and eventually becomes completely saturated.

This phenomenon is extremely difficult to describe with mathematical equations, and will therefore be approximated with a look-up table instead, as it is often done in the industry. This leaves us with the following set of equations:

˙ ia= u(t) − g1(ia)ω − Raia τ Ra ω = g1(ia)iap/r D p = m ˙v + mg + g2(m) A/2 ω = rAv 2 (5.6)

where g1(ia) is the motor function (look-up table) that relates angular velocity of the motor to the back-EMF, and the current to the torque produced. The function

g2(m) is a model of the friction in the hydraulics. τ is a low pass filter design

parameter used as a replacement for the inductance La. It does however fill the same function. The reason for replacing La is because the motor supplier did not have a value for the constant, only a handful of measurements that suggested it actually varied depending on the frequency of the input. One theory is that this is because parasitic capacitances between the coils in the motor affect the inductance. The velocity and current can be written in state space form, resulting in (5.7). ˙v = −DrA 2 4m v + Ag1(ia)r 2m iag − g2(m) m ˙ ia= − g1(ia)rA 2τ Ra v −1 τia+ Ubatt τ Ra u(t) v ≥ 0 (5.7)

(37)

5.6 Simulink model 23

There are also a number of limitations on states and signals in the system. We have for instance the input signal which becomes saturated outside u(t) ∈ [0, 1], and is also discretized into 256 levels due to the PWM modulation. The work has also been restricted to only upward motion, since the outflow from the lifting cylinder is handled by a separate valve that has been omitted from the model. This means that the velocities and the flows in the system (apart from the arma-ture current) will not be negative at any time. This limitation of signals has some consequences, which were discussed in Section 5.3.

5.6

Simulink model

One good way to implement the model into a software is to build a Simulink model. By using the equations above, a basic model can be built and simulated. Each subpart of the system gets its own block and all its functionality is imple-mented inside it. This means that from the highest level, only the flows and efforts that enter and exit the block are visible. See Figure 5.2, to get a overview of the Simulink model.

Figure 5.2: The model made in Simulink. Measured velocity, height, tem-perature and angular velocity. The input is a PWM-signal.

All computations of how the signals relate to each other are hidden inside each block. This block structure makes it easy to further improve the model and to for instance replace or add another block, if the system is changed or a specific part of the system is replaced in the future.

Furthermore, the model is structured in a way motivated by the bond graph, in the sense that all the effort signals are calculated in succession throughout the entire chain, and then the flows in the opposite direction all the way back. As can be seen in Figure 5.2, the efforts have been placed on the top half of the blocks, and the flows are all placed on the bottom half. This makes for a clear structure and it is easy to follow how everything is calculated in the model. Another bene-fit of doing this is that it makes it easy to calculate the power that is entering and the power that is exiting each part of the system, simply by multiplying the effort and flow.

(38)

24 5 Modeling

of mast, or change in any parameter, it’s hard to put it onto the Simulink model, since certain parameters for blocks in Simulink are only read at the start of the simulation and cannot be altered during simulation.

5.6.1

Battery

The battery, seen in Figure 5.3, has a voltage of 24V with a small inner resistance of 5.7mΩ. The Resistance results in a small, yet significant voltage drop, going into the control unit.

Figure 5.3:Subsystem of the battery, made in Simulink.

5.6.2

Motor control unit

The control unit, seen in Figure 5.4, scales the voltage from the battery by the Pulse Width Modulation(PWM)-signal, controlled by for instance a joystick. This voltage is later used in the motor.

To follow the laws of energy preservation, the armature current is scaled too, but in the opposite direction. Field current is then added to the armature current which is the total current drawn from the battery.

(39)

5.6 Simulink model 25

5.6.3

DC motor

The motor block, as can be seen in Figure 5.5, calculates the torque that goes into the pump and the field and armature current drawn from the control unit. There is a block that contains the temperature model, which calculates the ar-mature resistance from the estimated temperature. The equations for the tem-perature model are there, but the parameters are not known, and therefore the block is turned off at the moment. The resistance is set to be a constant 0.0192Ω instead. This value was acquired from the pump manufacturer.

The lookup table returns a motor function g1(ia), or kif in 5.5. More detailed calculations for the table can be found in Appendix A.

The MATLAB function block calculates the field current from armature current. More information in appendix A.

The value of the time constant in the low pass filter τ was finally set to 1.2 sec-onds. This to maintain the stability of the model for the model when lifting low masses with a low sample frequency. Note that this parameter is very uncertain, as its main purpose is to maintain stability and avoid algebraic loops in Simulink.

Figure 5.5:Subsystem of the motor, made in Simulink.

5.6.4

Pump

The pump, as can be seen in Figure 5.6, scales both the effort and flow part by pump displacement. It also takes friction into account, by subtracting some

(40)

26 5 Modeling

torque, depending (linearly) on how big the angular velocity is.

Figure 5.6:Subsystem of the pump, made in Simulink.

5.6.5

Check valve

The check valve, Figure 5.7, prevents the load from falling down when no steer-ing input is given.

Figure 5.7:Subsystem of the check valve, made in Simulink.

5.6.6

Cylinder

(41)

5.6 Simulink model 27

Figure 5.8:Subsystem of the cylinder, made in Simulink.

5.6.7

Chains

The lifting construction is made with chains, in a way such that velocity is dou-bled, but the force is halved. This results in a model that can be seen in Figure 5.9.

Figure 5.9:Subsystem of the chains, made in Simulink.

5.6.8

Forks

This is were the force from the chains is subtracted by the gravitation and friction force. To return velocity, force is divided by the mass m and integrated over time. The Figure 5.10 shows this.

(42)

28 5 Modeling

Figure 5.10:Subsystem of the forks, made in Simulink.

5.6.9

Extended Kalman Filter

The structure of the EKF can be see in Figure 5.11. Most of the calculations are done inside the MATLAB-function, except for the linearization, which was moved outside to reduce the amount of needed inputs.

Figure 5.11:Subsystem of the EKF, made in Simulink.

5.6.10

Frequency analysis

It is interesting to find the dominating frequency of the model. The sampling theorem[11, p.37] tells that the sample frequency must be at least double the bandwidth to describe the signal. However, it turned out to be hard to find. All higher frequencies are filtered out by the low pass filter within the motor block.

(43)

5.6 Simulink model 29

To be able to find something, the low pass filter is removed temporarily, by setting the parameter τ to zero. By looking at the frequency domain from velocity of a step response, one should be able to observe what frequencies that is exist within the system. 0 2 4 6 8 10 Tid [s] 0 0.2 0.4 0.6 0.8 1 1.2 Velocity[m/s] 1000 kg 0 2 4 6 8 10 Tid [s] 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Velocity[m/s] 2000 kg 0 2 4 6 8 10 Tid [s] 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 Velocity[m/s] 3000 kg 0 2 4 6 8 10 Tid [s] 0 0.05 0.1 0.15 0.2 0.25 0.3 Velocity[m/s] 4000 kg

Figure 5.12:Step response of model for really heavy loads. Without any low pass filter and a sample frequency of 100 Hz

0 10 20 30 40 50 Frequency [Hz] 0 20 40 60 80 100 Amplitude 1000 kg 0 10 20 30 40 50 Frequency [Hz] 0 10 20 30 40 50 60 70 Amplitude 2000 kg 0 10 20 30 40 50 Frequency [Hz] 0 10 20 30 40 50 Amplitude 3000 kg 0 10 20 30 40 50 Frequency [Hz] 0 5 10 15 20 25 30 35 Amplitude 4000 kg

Figure 5.13: Frequency response of model for really heavy loads. Without any low pass filter and a sample frequency of 100 Hz

(44)

re-30 5 Modeling

sponse can be seen in Figure 5.13 For regular masses, it is hard to see something more than an evenly distributed noise. For heavier load, as in heavier than al-lowed to lift on the real system, some spikes for come frequencies started to ap-pear. It is possible to argue that the peak at 20 Hz gives a hint of what dominating frequency the system has. It still does not prove anything, considering the low pass filter is taken out and the mass is heavier than allowed for our system. How-ever, it shows how hard it is to find the dominating frequency of our model.

(45)

5.7 Model validation 31

5.7

Model validation

In this section, the performance of the model will be discussed, along with how it can be improved by means of tuning parameters or changing how the model fun-damentally works. First, as mentioned earlier, some data will be gathered from a slightly modified forklift, where references for the lifting height and velocity are measured. This data will then be used and compared to the output of the model, and the sum of the squared errors will be used as a performance measure.

5.7.1

Data gathering

To generate the data, the system was connected to a computer that reads the data from the CAN-bus in the truck. Two major parameters were varied during the experiment: the type of input signal and the load on the forks. The importance of the temperature of the motor was also studied.

The input signals were generated manually, and are therefore not exactly simi-lar to each other, but this will most likely not cause any trouble. It may even be a good thing, because the system should work as intended with any form of input signal. The input signals that were used can be found in Table 5.1.

Table 5.1:The input signals that were used.

Ramp Starting from lowest possible amplitude and slowly reaching the maximum.

Small step A step with a small amplitude Big step A step with maximum amplitude

Sinusoidal A noisy, irregular signal that somewhat resembles a sinusoidal signal

For each load on the forks (no load, 500 kg, 1000 kg and 1500 kg) these input signals were generated and the data from the system was saved and converted to a format that MATLAB can handle.

Finally, the system was allowed to heat up by performing a series of heavy lifts. When the motor was feeling hot to the touch, the set of experiments with no load was repeated in order to get some comparison data between a hot and a cold motor. The hydraulic oil is also affected by temperature changes, but we have disregarded this in our thesis.

5.7.2

Performance measure

The validation data contains velocity measurements, and therefore this can be directly compared to the estimated velocity in the model. The same goes for the

(46)

32 5 Modeling

motor current and the hydraulic pressure.

For each of these quantities the sum of squared errors,

E = 1 N N X t=0 (xtxˆt)2, (5.8)

where N is the number of data points, is a good way of measuring how well the model represents the real system.

Since Simulink is used in this project, another way of measuring the performance is to feed the signals into a scope and with ocular inspection determine how closely the modelled signals follow the measured ones. This is of course a less pre-cise way of measuring things, but it comes with the benefit that it takes less time and gives a better understanding of how certain parameters affect the model per-formance. It also provides information about oscillatory behaviour and if there are any particular situations where the model performs better or worse.

5.7.3

Parameter estimation

Most of the parameters in the model are related to physical quantities and can therefore be read from the data sheets of the system components. Some parame-ters, for instance those related to friction in the pump and the hydraulics have to be estimated somehow.

It was quickly realized that a friction model in the hydraulic system was nec-essary, because the measured pressure differed quite substantially from the cal-culated pressure in the model. A friction model on the form

g2(m) = c1+ c2m (5.9)

was assumed while the forks were moving. Here m is the mass of the load on the forks. The friction coefficients c1 and c2along with the friction in the pump, D, were tuned roughly by hand until the model performance was pretty good in

order to get an idea of the order of magnitude of the parameters.

If the parameters enter the model as in (5.9), a suitable approach to use for es-timating the parameters would be a least square method [10, p.284] as

ˆ

θ = (XTX)−1Xy (5.10)

where in the example above, y is the measured force g2(m),

θ ="c1 c2

(47)

5.7 Model validation 33

Figure 5.14:Simulated and measured data of the same PWM-signal. In this case, a ramp signal and a load of 500 kg.

X =" 1 m

#

.

Simulink has a parameter estimation feature, which uses a least square method, where an arbitrary number of parameters in a model can be estimated from sets of input-output pairs of data. Here, the accuracy is of course dependent on the amount of parameters that needs to estimated, the amount of data that is used and the complexity of the model. With a sample frequency of 500 Hz, the param-eters mentioned above was set to values that can be read in Table 5.2. Note how the total friction cannot be negative as the mass of the forks m0is 294 kg.

Table 5.2: Values gathered from parameter estimation for the friction pa-rameters

Value c1 -197.56 c2 0.74 D 0.00875719

The parameters are estimated to fit the sensor value of the velocity for a total of 14 runs. Four different masses and four different type of runs, with two runs that was erased due problem with the height sensor. One of the runs can be seen in Figure 5.14, and the others can be found in AppendixB.

(48)
(49)

6

Control Strategies

When the system is completely described as a model, it is time to controlling the velocity of the load. To do this, a few control strategies will be tested and com-pared within simulations, where the effects of different reference signals, noise levels and parameter uncertainties are investigated, to decide what fits this appli-cation best.

6.1

Generating the reference signal

The input from the user is in the form of a PWM-signal from the throttle control. This has to be rescaled to an appropriate velocity. The minimum velocity should be one that fulfills the 600 rpm criterion, which can be calculated as

vmin= 40π

rA . (6.1)

For this particular truck it turns out the be approximately 0.03m/s.

The maximum lifting velocity is specified in the requirements for each truck. Our trucks required lifting speed is 0.27m/s at no load and 0.16m/s at maximum load. In order to fulfill the no load maximum velocity requirement, full PWM-signal must correspond to this velocity. This means that, in theory, velocity completely independent of load only can be achieved up for velocities up to 0.16m/s. For velocities higher than that, smaller loads may be lifted at a faster pace. An illus-tration of this is given in Figure 6.1. The area between vminand vmax(1500) is the area where mass independent velocity is possible.

(50)

36 6 Control Strategies

This gives us a linear mapping where PWM-signals in the interval u(t) ∈ [1, 255] corresponds to velocities vref[0.03, 0.27], and zero PWM of course corresponds to zero velocity.

Figure 6.1: An illustration of maximum lifting velocity as a function of the load.

6.2

Model Predictive Control

Model Predictive Control, MPC, uses the knowledge of the model to predict where the states will be a certain number of steps from current time. By using the prediction to calculate an optimal control signal each time update, will most likely result in a computationally heavy control that requires fast and expensive hardware to be implemented.

In an effort to reduce required hardware performance, but also work needed in the implementation, a linearized model of the system will be derived by making the assumption that the motor function is constant over the prediction horizon. This means that the current value from the look-up table for the motor function is fed into the controller at each time step. This value is then used to predict the future states and optimal control signals.

6.2.1

Quadratic programming

One of the reasons why MPC controllers have become so popular lately is the fact that the optimization problem can be formulated in a way that it fits into the framework of quadratic programming, which is a commonly used algorithm

(51)

6.2 Model Predictive Control 37 for solving optimization problems in many different areas. There are many soft-wares available that can handle quadratic programming, including MATLAB. The quadratic programming optimization problem consists of a quadratic func-tion that is to be minimized, with a set of linear constraints. It can be written as min w 1 2w TH w + fTw (6.2) with contraints Aw ≤ b,

where w is an arbitrary variable, for instance the control signal in the following sections.

6.2.2

The MPC framework

The very basics of the MPC controller is to predict and optimize the control signal

u so that it fulfills a set of constraints in an optimal way. In order to formulate

the problem in a compact way, let us define a number of matrices in the same manner as in [8, p.157]. Given the one step ahead prediction,

xk+1= Fxk+ Guk

z = Mx, (6.3)

we can extend this by writing all the predictions from 1 to N − 1,

X =               xk xk+1 .. . xk+N −1               = Fbxk+ GbU , (6.4) where Fb=                I F .. . FN −1                , Gb=                    0 0 0 . . . 0 G 0 0 . . . 0 FG G 0 . . . 0 .. . . .. ... ... ... FN −2G . . . FG G 0                    . (6.5)

Let us also define

Ub=               uk uk+1 .. . uk+N −1               , (6.6)

(52)

38 6 Control Strategies Q1b=               Q1 Q1 . .. Q1               , (6.7) Q2b=               Q2 Q2 . .. Q2               (6.8) and Mb=               M M . .. M               , (6.9)

where Q1and Q2are two design parameters that determines how the states and

input signals in the model should affect the objective function. Given this com-pact description, we can write the objective function as

(Fbxk+ GbUb)TMbTQ1bMb(Fbxk+ GbUb) + UbTQ2bUb. (6.10) If we expand this expression, disregard the constant term since it does not affect the optimization problem, and divide it by half, we get an equation

1 2U

T

b(GTbMbTQ1bMbGb+ Q2b)Ub+ (GbTMbTQ1bMbFbxk)TUb (6.11) which fits into the Quadratic programming algorithm.

6.2.3

Choosing the cost function

There are a number of ways to choose the cost function that is to be minimized, and some of them are described in [8, p.160]. In (6.11), the most basic cost func-tion N −1 X j=0 ||z(k + j)||2 Q1+ ||u(k + j)|| 2 Q2 (6.12)

is used. This cost function has an obvious flaw: it tries to minimize both the state and the control signal at the same time, which for most systems can never be achieved fully, and therefore ends up with a stationary error. We would also like to implement reference following, so let us therefore define

(53)

6.2 Model Predictive Control 39 R =               rk rk+1 .. . rk+N −1               (6.13) and ΩU − δ =               ukuk−1 uk+1uk .. . uk+N −1uk+N −2               =               II I . .. ...I I               U −               uk−1 0 .. . 0               . (6.14)

Note that the future values for the reference signals are used here. Since the reference signal in reality is generated by the user, it is not known what it will be in the future in this case, but an educated guess that it is constant during the prediction horizon is made. Now we can use the cost function

N −1 X j=0 ||z(k + j) − r(k + j)||2 Q1+ ||u(k + j) − u(k + j − 1)|| 2 Q2 (6.15)

which compares the difference between the states and the reference signal, and in-crements in the control signal. This is good, because if one tries to minimize this function, reference following and integral action is achieved, and the stationary error tends towards zero. With this cost function, (6.11) becomes

1 2U T b(GbTMbTQ1bMbGb+ ΩTQ2bΩ)Ub+ (GbTMbTQ1bMb(FbxkRb) − ΩTQ2bδ)TUb (6.16)

6.2.4

Constrains in MPC

If you disregard the fact that this system contains nonlinearities, an MPC con-troller would suit it very well, because you could use just about any set of rele-vant constraints in the optimization problem. This means that the limitations in speed, as well as the acceleration can be accounted for. One could also think of scenarios where keeping the power consumption down by limiting the armature current could be useful, for instance if the battery is running low. Another ben-efit of the MPC controller is that the constraints on for instance height can be handled with ease.

6.2.5

Main drawbacks

The main drawbacks of the MPC controller are that it requires a lot of compu-tational power, and that you either have to know future values of the reference

(54)

40 6 Control Strategies

signal, or make an educated guess of what the reference signal might be.

The first problem makes it more expensive to use the controller in a real time application with fast dynamics, since a much better computer has to be imple-mented in the system in order to run the algorithm fast enough. This may, how-ever, not be a problem in the future as the cost of computational power seems to be decreasing steadily at the moment.

There is no way to predict how the driver of the truck wants move the forks in the future, and therefore no way of acquiring the true future reference signal. This leads to that an educated guess will have to be made, for instance that the driver will hold a constant reference signal over the prediction horizon. This means that the controller theoretically could achieve faster reference following, but it is not possible in practice.

6.2.6

MPC Stability

Due to model predictive control being a very advanced and complicated algo-rithm, it is hard to prove if it is stable or not. In most cases one simply has to try and hope for the best, but there are ways to at least make it more likely that the controller will behave as intended. One of the most important factors is the pre-diction horizon, which has to be long enough to fully explore the dynamics of the system that is to be controlled, but there are ways of modifying the optimization problem to ensure stability, some of which are discussed in [12].

6.3

PID

A PID controller contains a proportional, an integral, and a derivative term. All of these terms are calculated from the difference between the measured velocity and the reference signal. To decide how big impact each term has on the control signal, each term contains a tuning gain that can be varied during the design of the control.

To decide the value of these constants, Ziegler-Nichols method will be used [8, p.74]. This requires the system to be brought to self-sustaining oscillations, and this can be a problematic if it has to be done using the real system. By using simulations to get the parameters instead, together with manual tuning, we will get a simple control.

6.4

IMC

IMC, or Internal Model Control, uses knowledge of the model to feedback the difference from the output of the model and the real system. The model in our

(55)

6.4 IMC 41 case will consist of a three parameter model, made from a total of three different kinds of step responses. This yields a total of three IMC controllers. All three step responses are done on different masses: 0, 500, 1000 and 1500kg, and for the third step a warm motor is used with a load of 0kg. The warm motor step is not used further in the work, other than for showing that temperature does matter. The first two step responses are from the more advanced Simulink model. What differs the two, is the time constant τ within the low pass filter in the motor block. The values are 1 and 0.5, the steps can be seen in Figure 6.2 and 6.3. The reason two different values of τ were used, is because of the uncertainty of it. The third step in Figure 6.4, is from measurements of the real system.

9 9.5 10 10.5 11 Time (seconds) 0 0.05 0.1 0.15 0.2 0.25 0.3 Velocity 0 kg 9 9.5 10 10.5 11 Time (seconds) 0 0.05 0.1 0.15 0.2 0.25 0.3 Velocity 500 kg 9 9.5 10 10.5 11 Time (seconds) 0 0.05 0.1 0.15 0.2 0.25 0.3 Velocity 1000 kg 9 9.5 10 10.5 11 Time (seconds) 0 0.05 0.1 0.15 0.2 0.25 0.3 Velocity 1500 kg

Figure 6.2:Step response of Simulink model with time constant τ = 1. Blue line is the velocity step. Orange line is 63% of the final value. Yellow line is 5% of the final value.

From the plots, three parameters is taken from each step configuration: Rise time

T , gain Kp and delay L. T is the time from where the step start to where 63% of

the final value is reached, Kpis the final value of the step response, and L is time from where the step start to where it has reached 5% of the final value. All pa-rameters from all configurations with all masses, can be seen in Figure 6.5, where they also are linearized to generate parameters dependent on the load mass.

References

Related documents

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

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

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

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

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

Den förbättrade tillgängligheten berör framför allt boende i områden med en mycket hög eller hög tillgänglighet till tätorter, men även antalet personer med längre än

På många små orter i gles- och landsbygder, där varken några nya apotek eller försälj- ningsställen för receptfria läkemedel har tillkommit, är nätet av

The EU exports of waste abroad have negative environmental and public health consequences in the countries of destination, while resources for the circular economy.. domestically