+ All Categories
Home > Documents > Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We...

Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We...

Date post: 29-Mar-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
100
Master of Science Thesis in Electrical Engineering Department of Electrical Engineering, Linköping University, 2016 Modelling and Control of an Electro-Hydraulic Forklift Anders Brändström and Henrik Bäckman
Transcript
Page 1: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

Master of Science Thesis in Electrical EngineeringDepartment of Electrical Engineering, Linköping University, 2016

Modelling and Control of anElectro-Hydraulic Forklift

Anders Brändström and Henrik Bäckman

Page 2: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

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 Hoisy, Linköpings universitet

Linus Helgesson

Examiner: Johan Löfbergisy, Linköpings universitet

Division of Automatic ControlDepartment of Electrical Engineering

Linköping UniversitySE-581 83 Linköping, Sweden

Copyright © 2016 Anders Brändström and Henrik Bäckman

Page 3: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

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 termsof 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 somefriction parameters that had to be estimated caused a slight loss in model gener-ality. An observer (Extended Kalman filter) was used to estimate the unknownstates, including the velocity of the forks. The simulated performance of theMPC controller was slightly better than the PID controller, except for a biggerovershoot 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 inrelation 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 liftingheight accurately. The PID controller worked as intended and it could thereforebe concluded that a more advanced control algorithm, such as an MPC controller,is not necessary for this system.

iii

Page 4: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested
Page 5: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

Acknowledgments

We would like to thank our examiner Johan Löfberg for doing a great job andbeing interested in the work we do. Also a big thanks to our supervisor LinusHelgesson and all other people at the company we have come in touch with. Wehave 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 upwith us all this time, and brought us so much joy.

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

v

Page 6: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested
Page 7: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

Contents

Notation xi

1 Introduction 11.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Problem formulation . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3 Research questions . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.4 Delimitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.5 Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Related Work 52.1 Electric motors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 Hydraulic systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.3 Temperature estimation . . . . . . . . . . . . . . . . . . . . . . . . . 7

3 Theory 93.1 The extended Kalman filter . . . . . . . . . . . . . . . . . . . . . . 9

3.1.1 Linearization . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.1.2 Time update . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.1.3 Measurement update . . . . . . . . . . . . . . . . . . . . . . 103.1.4 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

3.2 Exact Linearization . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.3 Stability Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3.3.1 Small gain theorem . . . . . . . . . . . . . . . . . . . . . . . 113.3.2 Static nonlinearities . . . . . . . . . . . . . . . . . . . . . . . 123.3.3 Circle criterion . . . . . . . . . . . . . . . . . . . . . . . . . 123.3.4 Tustin’s Formula . . . . . . . . . . . . . . . . . . . . . . . . . 13

4 Method 154.1 Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164.2 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164.3 Data gathering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174.4 Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174.5 Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

vii

Page 8: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

viii Contents

4.6 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184.7 Final testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

5 Modeling 195.1 Bond graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195.2 Model equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205.3 Check valve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215.4 Mast change dynamics . . . . . . . . . . . . . . . . . . . . . . . . . 215.5 Summarized mathematical model . . . . . . . . . . . . . . . . . . . 215.6 Simulink model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

5.6.1 Battery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245.6.2 Motor control unit . . . . . . . . . . . . . . . . . . . . . . . 245.6.3 DC motor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255.6.4 Pump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255.6.5 Check valve . . . . . . . . . . . . . . . . . . . . . . . . . . . 265.6.6 Cylinder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265.6.7 Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275.6.8 Forks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275.6.9 Extended Kalman Filter . . . . . . . . . . . . . . . . . . . . 285.6.10 Frequency analysis . . . . . . . . . . . . . . . . . . . . . . . 28

5.7 Model validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315.7.1 Data gathering . . . . . . . . . . . . . . . . . . . . . . . . . . 315.7.2 Performance measure . . . . . . . . . . . . . . . . . . . . . . 315.7.3 Parameter estimation . . . . . . . . . . . . . . . . . . . . . . 32

6 Control Strategies 356.1 Generating the reference signal . . . . . . . . . . . . . . . . . . . . 356.2 Model Predictive Control . . . . . . . . . . . . . . . . . . . . . . . . 36

6.2.1 Quadratic programming . . . . . . . . . . . . . . . . . . . . 366.2.2 The MPC framework . . . . . . . . . . . . . . . . . . . . . . 376.2.3 Choosing the cost function . . . . . . . . . . . . . . . . . . . 386.2.4 Constrains in MPC . . . . . . . . . . . . . . . . . . . . . . . 396.2.5 Main drawbacks . . . . . . . . . . . . . . . . . . . . . . . . . 396.2.6 MPC Stability . . . . . . . . . . . . . . . . . . . . . . . . . . 40

6.3 PID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406.4 IMC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406.5 Code generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

7 Results 477.1 Linearized model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477.2 Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

7.2.1 PID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487.2.2 MPC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

7.3 Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507.3.1 Open loop stability . . . . . . . . . . . . . . . . . . . . . . . 507.3.2 Closed loop stability . . . . . . . . . . . . . . . . . . . . . . 52

Page 9: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

Contents ix

7.4 Model Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547.5 Extended Kalman Filter . . . . . . . . . . . . . . . . . . . . . . . . . 56

7.5.1 Discretization . . . . . . . . . . . . . . . . . . . . . . . . . . 567.5.2 Linearization . . . . . . . . . . . . . . . . . . . . . . . . . . . 567.5.3 Tuning parameters . . . . . . . . . . . . . . . . . . . . . . . 577.5.4 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . 577.5.5 Fault detection . . . . . . . . . . . . . . . . . . . . . . . . . . 57

7.6 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597.7 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

7.7.1 Model based work . . . . . . . . . . . . . . . . . . . . . . . . 627.7.2 The 600 rpm criteria . . . . . . . . . . . . . . . . . . . . . . 627.7.3 Independent lifting velocity . . . . . . . . . . . . . . . . . . 627.7.4 Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637.7.5 Model generality . . . . . . . . . . . . . . . . . . . . . . . . 637.7.6 Other benefits of having an observer . . . . . . . . . . . . . 647.7.7 Precision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647.7.8 Control strategies . . . . . . . . . . . . . . . . . . . . . . . . 64

8 Future work 67

A Calculations 71A.1 Motor function calculation . . . . . . . . . . . . . . . . . . . . . . . 71A.2 Field current calculation . . . . . . . . . . . . . . . . . . . . . . . . 72A.3 Equations from bond graph . . . . . . . . . . . . . . . . . . . . . . 73

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

Bibliography 85

Page 10: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested
Page 11: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

Notation

Abbreviations

Notation Meaning

P ID Proportional, Integrative, Derivative (control)MPC Model Predictive ControlEKF Extended Kalman FilterPWM Pulse Width Modulationrpm Revolutions per minuteSEDC Separately Excited Direct Current (motor)CAN Controller Area Network

xi

Page 12: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested
Page 13: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

Nomenclature

Physical Constants

m0 Mass of the forks without any load 294 kg

A Area of the lifting cylinder 0.0025m3

g Gravitational Constant 9.81m/s2

Ubatt Voltage of the battery 24V

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

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.00875719Nm/ω

c1 Constant part of friction on the forks −197.56N

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

xiii

Page 14: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested
Page 15: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

1Introduction

This is a thesis work concerning modeling, estimation and control of certainstates of an electro-hydraulic system. In this chapter, we will explain why model-ing is interesting 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 algorithmssuch 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 inpopularity for every day that passes.

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

1.2 Problem formulation

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

1

Page 16: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

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 ismounted. 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 pumpinto a lifting force, which in its turn moves the forks carrying the load. A simplesketch of the system is shown in Figure 1.2 below.

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

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

Page 17: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

1.3 Research questions 3

However, for practical and economical reasons, adding a sensor to the systemto measure the pump rpm is not beneficial. Therefore one may be interestedin estimating the angular velocity of the pump in another way. One way to dothis is to use a model based approach, where a model of the system is combinedwith measurements in an observer to estimate the desired states. This could forinstance 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 downwhen lifting above 1.8 m. This is to ensure that the driver has plenty of space toescape if something goes wrong, for instance if something comes falling down orthe 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 brakefast, if side gates are up, but that is not always easy and smooth. If position andvelocity is estimated, the speed of the forks can be ramped down and stopped at1.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 velocityindependent of load on the forks can be solved. This is useful for the operatorbecause the same control signal would then, ideally, always result in the samelifting 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 thetable 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 onthe 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 modelparameters require no individual tuning? I.e. the model parameters shouldbe readable from the data sheets of the components.

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

Page 18: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

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 themodel is therefore relatively simple and has some room left for improvement, inthe form of for instance energy losses, compressibility of the hydraulic fluid andchanges in viscosity due to temperature changes. These factors are however smallenough 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 obtainan 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 assumedto be directly dependent on the field current, but this is not the case for largecurrents. Due to magnetic saturation of the iron core, the motor function is onlya linear function for low currents. Instead of spending an entire semester tryingto find a set of equations that describe the magnetization, some data points weregathered and a look-up table was used instead.

The plan was initially to model a double mast that uses multiple cylinders toachieve 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 structureof 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 isan 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 isnecessary and will be used in the work.

• Chapter 4 describes the method throughout the project, while chapter 5investigates 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.

• Last but not least, further improvements are handled in chapter 8.

Page 19: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

2Related Work

This is not the first time someone tries to set up a model and control strategyfor this kind of system. Similar system has been modeled, but often with othersensors 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 basicequations that describe their dynamics can be derived from Kirchoff’s voltagelaw, 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) motor. The maindifference compared to a regular DC motor, is that this motor uses an electromag-net with a controllable magnetic field instead of a permanent magnet. A simplesketch of how it looks can be found in Figure 2.1. The main benefit of using anSEDC motor is that the operating range can be extended, so that the motor canachieve 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

La ia = Ua − Raia − UeUe = kif ω

Jω = Td − Dω − TlTd = kif ia

(2.1)

where La is the inductance of the armature, ia is the current through the arma-ture, Ua is the armature supply voltage, Ra is the armature resistance, Ue is the

5

Page 20: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

6 2 Related Work

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

motor voltage, if is the field current, k is the motor function, ω is the rotationalvelocity of the motor, J is the inertia in the system, Td is the torque producedby the motor, D is the friction coefficient and Tl is the load torque. Comparedto a regular, permanent magnet DC motor, the motor constant is replaced by amotor function depending linearly on the field current, which from now on willbe called g1(if ).

One quickly realizes that this model contains a non-linearity in (2.1), since thefield 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 solutionmight be a method called exact linearization, as described in [2, p.433], or anextended Kalman filter (EKF) [3, p.153]. Furthermore, it will later in the reportbe shown that this model of the motor is flawed, because the assumption that themotor 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 tomeasure frequencies of the ripple that occurs when the brushes connect and dis-connect from the commutators, as explained in [4]. However, since the system ispart of a noisy environment, with other motors and factors that are likely to causea 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 tosample and read the current fast enough to achieve an appropriate bandwidthto capture the high frequency ripple, and therefore this method will be excludedfrom further investigation at this point.

Page 21: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

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 thesystem 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 structureof the model will be salvaged and used as a basis for this project. By assuming noleakage, (2.2) is used to get a linear relationship between the angular velocity ofthe motor and the velocity.

f = ω/r

f = Ax(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 systemin 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, toour 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’stemperature dependence is presented as

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

along with a nonlinear thermal equation

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

where Ra0 is the ambient resistance, α is the temperature coefficient of resistance,θ is the deviation from ambient temperature, H is the thermal capacity of thearmature, kir is the iron loss constant, k0 is the thermal power transfer coefficientand kT is the temperature coefficient of angular velocity.

The model parameters are estimated through quite extensive experiments, someof which may not be possible to perform in this project, but if the motor supplierhas values for these parameters and are willing to share this information, thiscould potentially be very valuable for this project. Once the model parametersare known, an extended Kalman filter is used to estimate both the temperatureand 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

Page 22: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

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 −30C to about 50C.

It is however enough to know the ambient resistance for one temperature to beable 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 thatthis means that the resistance changes with 4% for every 10C, which consider-ing the temperature differences mentioned earlier are far from negligible. Thisof course strengthens the thesis that a temperature model is necessary.

Page 23: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

3Theory

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 asa discrete time state space model as

xk+1 = f (xk , uk) + ekyk = h(xk , uk) + vk

(3.1)

where x is the states, y is the measured quantities and e as well as v are assumedto be zero mean Gaussian white noise with covariance Q and R respectively. Thefunctions f and h can both be nonlinear.

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

3.1.1 Linearization

What differentiates the EKF from normal KF is that linearizations of the functionsf and h are used. The linearizations are done according to

Fk =∂f

∂x

∣∣∣∣ xk|k ,ukHk =

∂h∂x

∣∣∣∣ xk|k−1

(3.2)

9

Page 24: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

10 3 Theory

which is known as the Jacobian matrices, and is basically a first order Taylorexpansion around the current state estimates. These linearizations only workwell close to the points of linearization, and therefore they have to be recalculatedat every time sample of the algorithm, which is one of the reasons why the EKFrequires quite a lot of computational power. When the linearization is done, theprocedure follows the same path as for a regular Kalman filter, with the timeupdate 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 nextset of states are estimated as

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

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

(3.3)

where Q is the process noise covariance, which is used as a tuning parameter forthe filter, along with the measurement noise covariance R. By tuning the relationbetween 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 , withthe 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 inthe model. The Kalman gain Kk origins from the Riccati equation, but furtherdetails are omitted from this report, and the equations

Sk = HkPk|k−1HTk + R

Kk = Pk|k−1HTk S−1k

εk = yk − h(xk|k−1, uk)

Pk|k = (I − KkHk)Pk|k−1

xk|k = xk|k−1 + Kkεk

(3.4)

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

3.1.4 Initialization

In order to initialize the EKF, a starting position of the system is necessary, whichmeans that x0|0 and P0|0 have 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.

Page 25: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

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, butdepending 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 knowledgeof the nonlinearities, which is the main reason why it is not very well suited forthis 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 stabilityfor linear systems where one can just look at the placement of the poles of thetransfer function.

3.3.1 Small gain theorem

The small gain theorem states that given two stable systems, S1 and 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 canbe any arbitrary finite signals.

studied in this thesis.

Page 26: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

12 3 Theory

3.3.2 Static nonlinearities

There are no requirements for the two systems S1 and S2 discussed above to belinear. 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 bea 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 S2 is a function that satisfies (3.6) and therefore has gain K . The small gaintheorem then yields

K sups|G(s)| < 1 (3.7)

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

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. Thisis done by extending the confinement of the nonlinearity with a lower boundwhich gives us

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

where k1 is the lower bound and k2 the upper bound. This can then be shown tolead to a criterion very similar to the Nyquist criterion, but to include a circle thatintersects the real axis at a 90 angle in −1

k1and −1

k2, that must not be enclosed or

intersected by the Nyquist curve to ensure stability. An example where stabilitycan be assured is illustrated in Figure 3.2 and one where it cannot be assured isgiven in Figure 3.3.

Page 27: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

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

Page 28: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

14 3 Theory

Z-transform is given by

s ≈ 1Ts

(1 − z−1), (3.9)

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

s ≈ 2Ts

(z − 1)(z + 1)

. (3.10)

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

Page 29: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

4Method

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 modelutilizes a number of sensory inputs:

• ρcyl which measures the pressure in the hydraulic system.

• IA and IF which are the armature and field currents in the motor.

• UBatt which is the battery voltage.

15

Page 30: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

16 4 Method

• A magnetic sensor mounted on the mast that registers when the forks passa 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 therotational velocity of the pump, the lifting height and velocity of the forks, butit may also be interesting to try to estimate the temperature of the motor. Thesestates are used both as outputs from the model, and as input to the control unitwhich 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.

• Te which 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 themodel is the basis of all further work. The system consists of a DC motor, apump, 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 truesystem more accurately. To do this, the plan is to create a more in-depth modelof 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, andan eventual modification where for instance the hydraulic system is replaced canbe 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 moduleMATLAB/Simulink. Some simulations will be made on the modules individu-ally, but since we cannot generate validation data for each sub part on the realsystem, verification of functionality on the module level will only be performedbriefly. The modules are instead interconnected and simulations are run with thecomplete model, and compared with data from the real system.

Page 31: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

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 closelyrelated not only y, but also ωpump because the fluid displacement of the pumpis assumed to be constant, and therefore there is a static connection between thestates, 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 anumber of system configurations will be studied. The load on the fork and theproperties of the input signal are factors that surely will affect the system. Howand if the temperature significantly affects the characteristics of the system willalso be investigated. The parameters that will be modified during the tests arefirst and foremost the mass of the load on the forks. Secondly, the input signalwill also be varied, and a set of different constant speeds, as well as sinusoidaland irregular signals will be used. Last but not least, data will also be gatheredwhen the system is running hot, with a motor temperature of at least 30 C aboveambient temperature.

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

4.4 Control

A number control strategies will be developed and tested such as for instance theModel Predictive Control(MPC), PID- or LQ-controllers described in [8, p.69 &p.153]. Each controller will be evaluated in terms of its performance regardingstability in the first place, and reference following as the second most importantfeature. The computational complexity may also be an interesting factor sincethe 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 comparisonbetween them and a suggestion for which controller that is the most suitable toimplement 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 thesystem [2, p.33]. The nature of the non-linearities may however be "nice" enoughso that the system can be seen as linear in different intervals, and linear stabilityanalysis can be used instead.

Page 32: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

18 4 Method

4.5 Verification

Most of the verifications will be done by simulation and theoretical reasoning. Asmentioned before, to support the simulations, some data will be gathered from aspecial 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 themodel, 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 beadapted to the real system - the forklift. The first step in doing this will be toconvert 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 ismost 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 communicationdevice connected to the truck will then form the prototype.

4.7 Final testing

When the prototype is finished, its functionality will be tested thoroughly. Mainlythe estimated states will be compared with the measured signals where this is pos-sible, for instance by using loads with accurately measured mass and measuringhow 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 coursealso is of interest for the company.

Page 33: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

5Modeling

In this chapter, a model of the system will be described. The model will later beused when designing the control structure, and while evaluating the results insimulations, to determine the performance of the model in the validation phaseas 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 alsoconsidered to be constant in all parts of the system. This may make the modeluntrue, 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 frictioncoefficients 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. Fromthe pump we get its displacement 1/r, multiplied with the cylinder area A, andfinally 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

19

Page 34: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

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 equations.

5.2 Model equations

By using the bond graph in Figure 5.1, equations can be extracted, and presentedin 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.

kif ia = 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 = mv + mg (5.4)

Now the system is described in a total of four equations.

Page 35: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

5.3 Check valve 21

5.3 Check valve

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

i f ( q_cyl >0)p_cyl = p_pump

e l s ep_cyl = max(2mg/A, p_pump)

where q is the flow in the cylinder, p is the pressure in the pump or cylinder and2mg/A is the required pressure in the cylinder with area A to keep an object withmass 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 halfof the lift, and then a different mast with another set of cylinders lifts the last bitup to the top. This further complicates the model in two ways: parameters maychange their values (for instance the cylinder area could theoretically be differ-ent), and the switching between masts causes impulses in the system. The mainparameter change would be the mass m, since a different cylinder, or a differentset of cylinders is used and parts of the masts also have to be lifted. This resultsin a perfectly inelastic collision, where

m1v1 = m2v2 (5.5)

describes the preservation of momentum during the collision. The left hand sideof the equation is the momentum before the collision and the right hand side isthe momentum after the collision. The sudden change in the velocity of the forkscauses some trouble, since the derivative of the velocity is used in some of thedynamic 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 beused 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.

Page 36: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

22 5 Modeling

The mathematical model consists of the four equations in Section 5.2, along withthe temperature dependent armature resistance from Section 2.3. This model isunfortunately flawed in some ways, and overly complicated in other ways. Forinstance, the moment of inertia J of the pump can, without any losses in modelperformance, be neglected since the dynamics of this part simply was much fasterthan 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 smallcurrents, but as the current increases in amplitude, the iron that is magnetizedto create the magnetic field in the motor comes closer to its maximum magneticpotential 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 oftendone in the industry. This leaves us with the following set of equations:

ia =u(t) − g1(ia)ω − Raia

τRa

ω =g1(ia)ia − p/r

D

p =mv + mg + g2(m)

A/2

ω =rAv

2

(5.6)

where g1(ia) is the motor function (look-up table) that relates angular velocity ofthe motor to the back-EMF, and the current to the torque produced. The functiong2(m) is a model of the friction in the hydraulics. τ is a low pass filter designparameter used as a replacement for the inductance La. It does however fill thesame function. The reason for replacing La is because the motor supplier didnot have a value for the constant, only a handful of measurements that suggestedit actually varied depending on the frequency of the input. One theory is thatthis is because parasitic capacitances between the coils in the motor affect theinductance. The velocity and current can be written in state space form, resultingin (5.7).

v = −DrA2

4mv +

Ag1(ia)r2m

ia − g −g2(m)m

ia = −g1(ia)rA

2τRav − 1

τia +

UbattτRa

u(t)

v ≥ 0

(5.7)

Page 37: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

5.6 Simulink model 23

There are also a number of limitations on states and signals in the system. Wehave 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 hasalso been restricted to only upward motion, since the outflow from the liftingcylinder 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 someconsequences, 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 Simulinkmodel. 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 andefforts that enter and exit the block are visible. See Figure 5.2, to get a overviewof 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 eachblock. This block structure makes it easy to further improve the model and to forinstance replace or add another block, if the system is changed or a specific partof the system is replaced in the future.

Furthermore, the model is structured in a way motivated by the bond graph, inthe sense that all the effort signals are calculated in succession throughout theentire chain, and then the flows in the opposite direction all the way back. As canbe 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 structureand 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 andthe power that is exiting each part of the system, simply by multiplying the effortand flow.

Some problems do however occur during the implementation. During the change

Page 38: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

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 thesimulation 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 resistanceof 5.7mΩ. The Resistance results in a small, yet significant voltage drop, goinginto 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 thePulse Width Modulation(PWM)-signal, controlled by for instance a joystick. Thisvoltage 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 currentwhich is the total current drawn from the battery.

Figure 5.4: Subsystem of the control unit, made in Simulink.

Page 39: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

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 intothe 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 theblock 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 detailedcalculations 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 lowmasses 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 partby pump displacement. It also takes friction into account, by subtracting some

Page 40: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

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

The cylinder, Figure 5.8, scales both effort and flow by its cross sectional area A.

Page 41: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

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 Figure5.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 frictionforce. To return velocity, force is divided by the mass m and integrated over time.The Figure 5.10 shows this.

Page 42: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

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 calculationsare done inside the MATLAB-function, except for the linearization, which wasmoved 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 samplingtheorem[11, p.37] tells that the sample frequency must be at least double thebandwidth to describe the signal. However, it turned out to be hard to find. Allhigher frequencies are filtered out by the low pass filter within the motor block.

Page 43: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

5.6 Simulink model 29

To be able to find something, the low pass filter is removed temporarily, by settingthe parameter τ to zero. By looking at the frequency domain from velocity of astep response, one should be able to observe what frequencies that is exist withinthe system.

0 2 4 6 8 10

Tid [s]

0

0.2

0.4

0.6

0.8

1

1.2

Velo

city[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

Velo

city[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

Velo

city[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

Velo

city[m

/s]

4000 kg

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

0 10 20 30 40 50

Frequency [Hz]

0

20

40

60

80

100

Am

plit

ude

1000 kg

0 10 20 30 40 50

Frequency [Hz]

0

10

20

30

40

50

60

70

Am

plit

ude

2000 kg

0 10 20 30 40 50

Frequency [Hz]

0

10

20

30

40

50

Am

plit

ude

3000 kg

0 10 20 30 40 50

Frequency [Hz]

0

5

10

15

20

25

30

35

Am

plit

ude

4000 kg

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

Step responses can bee seen in Figure 5.12, and its corresponding frequency re-

Page 44: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

30 5 Modeling

sponse can be seen in Figure 5.13 For regular masses, it is hard to see somethingmore 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 dominatingfrequency the system has. It still does not prove anything, considering the lowpass 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.

Page 45: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

5.7 Model validation 31

5.7 Model validation

In this section, the performance of the model will be discussed, along with how itcan 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 aslightly modified forklift, where references for the lifting height and velocity aremeasured. 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 datafrom the CAN-bus in the truck. Two major parameters were varied during theexperiment: the type of input signal and the load on the forks. The importanceof 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 agood thing, because the system should work as intended with any form of inputsignal. 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 slowlyreaching the maximum.

Small step A step with a small amplitudeBig step A step with maximum amplitudeSinusoidal 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 inputsignals were generated and the data from the system was saved and converted toa 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 loadwas repeated in order to get some comparison data between a hot and a coldmotor. The hydraulic oil is also affected by temperature changes, but we havedisregarded this in our thesis.

5.7.2 Performance measure

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

Page 46: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

32 5 Modeling

motor current and the hydraulic pressure.

For each of these quantities the sum of squared errors,

E =1N

N∑t=0

(xt − xt)2, (5.8)

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

Since Simulink is used in this project, another way of measuring the performanceis to feed the signals into a scope and with ocular inspection determine howclosely 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 timeand gives a better understanding of how certain parameters affect the model per-formance. It also provides information about oscillatory behaviour and if thereare 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 cantherefore 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 tobe 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 onthe forks. The friction coefficients c1 and c2 along with the friction in the pump,D, were tuned roughly by hand until the model performance was pretty good inorder 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),

θ =[c1c2

]T

Page 47: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

5.7 Model validation 33

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

X =[

1m

].

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 setsof input-output pairs of data. Here, the accuracy is of course dependent on theamount of parameters that needs to estimated, the amount of data that is usedand 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 howthe total friction cannot be negative as the mass of the forks m0 is 294 kg.

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

Valuec1 -197.56c2 0.74D 0.00875719

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

Page 48: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested
Page 49: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

6Control Strategies

When the system is completely described as a model, it is time to controlling thevelocity 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, noiselevels 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 shouldbe 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. Ourtrucks 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-signalmust correspond to this velocity. This means that, in theory, velocity completelyindependent of load only can be achieved up for velocities up to 0.16m/s. Forvelocities 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 vmin and vmax(1500) is thearea where mass independent velocity is possible.

35

Page 50: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

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 correspondsto zero velocity.

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

6.2 Model Predictive Control

Model Predictive Control, MPC, uses the knowledge of the model to predictwhere the states will be a certain number of steps from current time. By usingthe prediction to calculate an optimal control signal each time update, will mostlikely result in a computationally heavy control that requires fast and expensivehardware to be implemented.

In an effort to reduce required hardware performance, but also work needed inthe implementation, a linearized model of the system will be derived by makingthe 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 functionis fed into the controller at each time step. This value is then used to predict thefuture states and optimal control signals.

6.2.1 Quadratic programming

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

Page 51: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

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 writtenas

minw

12wTHw + f Tw (6.2)

with contraints

Aw ≤ b,

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

6.2.2 The MPC framework

The very basics of the MPC controller is to predict and optimize the control signalu so that it fulfills a set of constraints in an optimal way. In order to formulatethe problem in a compact way, let us define a number of matrices in the samemanner as in [8, p.157]. Given the one step ahead prediction,

xk+1 = Fxk + Gukz = Mx,

(6.3)

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

X =

xkxk+1...

xk+N−1

= Fbxk + GbU, (6.4)

where

Fb =

IF...

FN−1

, Gb =

0 0 0 . . . 0G 0 0 . . . 0FG G 0 . . . 0...

. . .. . .

. . ....

FN−2G . . . FG G 0

. (6.5)

Let us also define

Ub =

ukuk+1...

uk+N−1

, (6.6)

Page 52: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

38 6 Control Strategies

Q1b =

Q1

Q1. . .

Q1

, (6.7)

Q2b =

Q2

Q2. . .

Q2

(6.8)

and

Mb =

M

M.. .

M

, (6.9)

where Q1 and Q2 are two design parameters that determines how the states andinput signals in the model should affect the objective function. Given this com-pact description, we can write the objective function as

(Fbxk + GbUb)TMT

b Q1bMb(Fbxk + GbUb) + U Tb Q2bUb. (6.10)

If we expand this expression, disregard the constant term since it does not affectthe optimization problem, and divide it by half, we get an equation

12U Tb (GTbM

Tb Q1bMbGb + Q2b)Ub + (GTbM

Tb Q1bMbFbxk)

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∑j=0

||z(k + j)||2Q1+ ||u(k + j)||2Q2

(6.12)

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

Page 53: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

6.2 Model Predictive Control 39

R =

rkrk+1...

rk+N−1

(6.13)

and

ΩU − δ =

uk − uk−1uk+1 − uk

...uk+N−1 − uk+N−2

=

I−I I

. . .. . .−I I

U −uk−1

0...0

. (6.14)

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

N−1∑j=0

||z(k + j) − r(k + j)||2Q1+ ||u(k + j) − u(k + j − 1)||2Q2

(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 thisfunction, reference following and integral action is achieved, and the stationaryerror tends towards zero. With this cost function, (6.11) becomes

12U Tb (GTbM

Tb Q1bMbGb +ΩTQ2bΩ)Ub + (GTbM

Tb Q1bMb(Fbxk −Rb)−Ω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 inspeed, as well as the acceleration can be accounted for. One could also think ofscenarios where keeping the power consumption down by limiting the armaturecurrent 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 behandled 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

Page 54: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

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 timeapplication 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 tobe decreasing steadily at the moment.

There is no way to predict how the driver of the truck wants move the forks in thefuture, and therefore no way of acquiring the true future reference signal. Thisleads to that an educated guess will have to be made, for instance that the driverwill hold a constant reference signal over the prediction horizon. This means thatthe controller theoretically could achieve faster reference following, but it is notpossible 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 tryand hope for the best, but there are ways to at least make it more likely that thecontroller 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 thesystem that is to be controlled, but there are ways of modifying the optimizationproblem 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. Allof these terms are calculated from the difference between the measured velocityand the reference signal. To decide how big impact each term has on the controlsignal, each term contains a tuning gain that can be varied during the design ofthe 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, andthis can be a problematic if it has to be done using the real system. By usingsimulations to get the parameters instead, together with manual tuning, we willget a simple control.

6.4 IMC

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

Page 55: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

6.4 IMC 41

case will consist of a three parameter model, made from a total of three differentkinds of step responses. This yields a total of three IMC controllers. All threestep responses are done on different masses: 0, 500, 1000 and 1500kg, and for thethird step a warm motor is used with a load of 0kg. The warm motor step is notused further in the work, other than for showing that temperature does matter.

The first two step responses are from the more advanced Simulink model. Whatdiffers 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 reasontwo different values of τ were used, is because of the uncertainty of it. The thirdstep 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

Velo

city

0 kg

9 9.5 10 10.5 11

Time (seconds)

0

0.05

0.1

0.15

0.2

0.25

0.3

Velo

city

500 kg

9 9.5 10 10.5 11

Time (seconds)

0

0.05

0.1

0.15

0.2

0.25

0.3

Velo

city

1000 kg

9 9.5 10 10.5 11

Time (seconds)

0

0.05

0.1

0.15

0.2

0.25

0.3

Velo

city

1500 kg

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

From the plots, three parameters is taken from each step configuration: Rise timeT , gain Kp and delay L. T is the time from where the step start to where 63% ofthe final value is reached, Kp is the final value of the step response, and L is timefrom 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, wherethey also are linearized to generate parameters dependent on the load mass.

Page 56: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

42 6 Control Strategies

From the parameters, PID-parameters can be tuned as 6.17 according to [8].

K =L

Kp(Tc + L)(1d− 1

2)

Ti = L(1d− 1

2)

Td = L1 − d2 − d

d =L

L + T

(6.17)

Tc is a design parameter, that is tuned during a simulation in Simulink with asample rate of 55Hz. A small Tc returns a fast, but oscillating step response,while a higher returns a slow step response. After manual tuning, it was finallyset to 0.5 seconds. This parameter is of course discussable, and may have differentperformance depending on the application. However, if we analyze the plots inFigure 6.6 and 6.7, it can be seen that the value 0.5 is a good choice. Note alsothat the optimal Tc may vary depending on the mass, just as the other parametersdo. This would require a lot of time and testing, therefore we have decided to notinclude it in this thesis.

9 9.5 10 10.5 11

Time (seconds)

0

0.1

0.2

0.3

Ve

locity

0 kg

9 9.5 10 10.5 11

Time (seconds)

0

0.1

0.2

0.3

Ve

locity

500 kg

9 9.5 10 10.5 11

Time (seconds)

0

0.1

0.2

0.3

Ve

locity

1000 kg

9 9.5 10 10.5 11

Time (seconds)

0

0.1

0.2

0.3

Ve

locity

1500 kg

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

Page 57: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

6.4 IMC 43

0 2 4 6 8 10

Time[s]

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

0.18

Velo

city[m

/s]

0 Kg

0 2 4 6 8 10

Time[s]

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

0.18

Velo

city[m

/s]

1500 Kg

0 2 4 6 8 10

Time[s]

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

0.18

Velo

city[m

/s]

1000 Kg

0 2 4 6 8 10

Time[s]

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

0.18

Velo

city[m

/s]

500 Kg

Figure 6.4: Step response of the real forklift. Blue line is the velocity step.Orange line is 63% of the final value. Yellow line is 5% of the final value.

0 500 1000 1500 2000

Mass[kg]

0.05

0.1

0.15

0.2

Para

m v

alu

e

L1

0 500 1000 1500 2000

Mass[kg]

0.02

0.04

0.06

0.08

Para

m v

alu

e

L2

0 500 1000 1500 2000

Mass[kg]

0.15

0.16

0.17

0.18

0.19

0.2

0.21

Para

m v

alu

e

L3

0 500 1000 1500 2000

Mass[kg]

0.16

0.18

0.2

0.22

0.24

0.26

Para

m v

alu

e

K1

0 500 1000 1500 2000

Mass[kg]

0.16

0.18

0.2

0.22

0.24

0.26

Para

m v

alu

e

K2

0 500 1000 1500 2000

Mass[kg]

0.14

0.16

0.18

0.2

0.22

0.24

Para

m v

alu

e

K3

0 500 1000 1500 2000

Mass[kg]

0.1

0.15

0.2

0.25

Para

m v

alu

e

T1

0 500 1000 1500 2000

Mass[kg]

0.06

0.08

0.1

0.12

0.14

Para

m v

alu

e

T2

0 500 1000 1500 2000

Mass[kg]

0.44

0.46

0.48

0.5

0.52

0.54

0.56

Para

m v

alu

e

T3

Figure 6.5: Parameters to the three three-parameter models, linearized withaccount for the mass.

Page 58: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

44 6 Control Strategies

0 1 2 3 4 5 6 7

Velocity[m/s]

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

Tim

e[s

]

Model velocity

0 1 2 3 4 5 6 7

Time[s]

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45

0.5

Am

plit

ude[%

]

Control signal

Figure 6.6: Step responses for different values of Tc with a frequency of 55Hz, and mass of the load is 0 kg. Tc has the value 0.3(blue), 0.5(red) and0.7(yellow).

Page 59: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

6.4 IMC 45

0 1 2 3 4 5 6 7

Velocity[m/s]

0

0.05

0.1

0.15

0.2

Tim

e[s

]

Model velocity

0 1 2 3 4 5 6 7

Time[s]

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Am

plit

ude[%

]

Control signal

Figure 6.7: Step responses for different values of Tc with a frequency of 55Hz, and mass of the load is 1500 kg. Tc has the value 0.3(blue), 0.5(red) and0.7(yellow).

Page 60: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

46 6 Control Strategies

6.5 Code generation

To adapt our model to the real system, the model need to be converted to C-code.Fortunately, Simulink has an built in tool for this. A function is generated, that inevery iteration sets the output values, by reading the variables of the input value.This is not only for the model, but for the closed loop system as well, includingthe extended Kalman filter.

The MPC-block is not currently compatible with code generation, because ofsome toolboxes used to implement it into Simulink. It should be possible to im-plement the MPC controller in a different way, that supports code generation, butthat requires a lot of work hours.

Code generation makes it slightly more troublesome to change model parameters(for instance tuning parameters in the controller or EKF), because the parametersneeds to be changed in the Simulink model and then the whole code needs to begenerated again.

Page 61: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

7Results

The results of this project work will be presented in this chapter.

7.1 Linearized model

To be able to implement an MPC controller, and to perform stability analysis onthe system, a linear approximation of the model is used. The main differencescompared to the nonlinear model is that the motor function is assumed to beconstant, the battery is assumed to be an ideal voltage source, and that the checkvalve has been removed. By doing these approximations, the mathematical modelin (5.6) can be written on state space form:[

vi

]=

−Dr2A2

4mrAg12m

− g1rA2Ra0τ

− 1τ

[vi]

+[

0 −1UbattτRa0

0

] [u(t)

g + g2(m)m

]+ e

y =[1 0

] [vi

],

(7.1)

with a saturation in u(t) ∈ [0, 1], and where e is gaussian noise with Cov(e) = Q.This model is used internally in the MPC controller and in the stability analysislater in this chapter.

7.2 Controller

The final results for the control algorithms that have been investigated are pre-sented in this section. Mainly factors such as overshoot, rise time and stationary

47

Page 62: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

48 7 Results

error will be compared, but other significant benefits or downsides will also bebrought up. The PID controller was implemented on the real forklift, and theresults from this will also be presented.

7.2.1 PID

A number of PID controllers have been investigated in this project. This includessome that were tuned using different IMC:s, and one that was tuned by hand.

The three different IMC tuned controllers and one that was tuned by hand, havethe parameters specified in the Tables 7.1 and 7.2. The hand tuned PID con-troller is in discrete form, and the IMC tuned PID controllers are in continuousform. The major difference between the IMC tuned and the manually tuned PIDcontrollers, is the size of the integral term.

Table 7.1: The parameters for each PID controller, with a load of 1500kg.

IMC1 IMC2 IMC3 Hand tunedP 2.7825 1.6134 3.2723 0.1I 0.3192 0.1610 0.3130 10D 1.6134 0.0324 0.0630 0.1

Table 7.2: The parameters for each PID controller, with a load of 1500kg.

IMC1 IMC2 IMC3 Hand tunedP 0.9996 0.5805 2.8874 0.1I 0.1370 0.0761 0.4440 10D 0.0217 0.0120 0.0703 0.1

In Figure 7.1, a comparison between the different controllers is shown. It showsclearly how the IMCs struggles with heavier loads comparing with both the manu-ally tuned PID controller and the MPC controller. Worth noticing is how well theIMC follows the first step, it is not so strange, considering the three-parametermodels are made from a step response that starts from 0 velocity. When it comesto speed, both the IMC-tuned and the manualy tuned PID controller have decentresults, and none really outperforms the other. One may argue that the IMCs canhave a lower value of the design parameter Tc and from that return a faster stepresponse. That is true for low masses because of of the very small or non existingovershoots. In the case for heavier masses, that is not a good idea, as it will resultin even more oscillating step responses.

Page 63: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

7.2 Controller 49

0 1 2 3 4 5 6 7

Time[s]

0

0.1

Velo

city[m

/s]

Manual PID with 0 kg load.

0 1 2 3 4 5 6 7

Time[s]

0

0.1

Velo

city[m

/s]

Manual PID with 1500 kg load.

0 1 2 3 4 5 6 7

Time[s]

0

0.1

Velo

city[m

/s]

First IMC with 0 kg load.

0 1 2 3 4 5 6 7

Time[s]

0

0.1

Velo

city[m

/s]

First IMC with 1500 kg load.

0 1 2 3 4 5 6 7

Time[s]

0

0.1

Velo

city[m

/s]

Second IMC with 0 kg load.

0 1 2 3 4 5 6 7

Time[s]

0

0.1

Velo

city[m

/s]

Second IMC with 1500 kg load.

0 1 2 3 4 5 6 7

Time[s]

0

0.1

Velo

city[m

/s]

Third IMC with 0 kg load.

0 1 2 3 4 5 6 7

Time[s]

0

0.1

Velo

city[m

/s]

Third IMC with 1500 kg load.

0 1 2 3 4 5 6 7

Time[s]

0

0.1

0.2

Velo

city[m

/s]

MPC with 0 kg load.

0 1 2 3 4 5 6 7

Time[s]

0

0.1

0.2

Velo

city[m

/s]

MPC with 1500 kg load.

Figure 7.1: All step responses from the different controllers during a sim-ulation with 50Hz sample frequency, plotted with the reference signal. Allsimulated with both 0 and 1500 kg.

7.2.2 MPC

The tuning parameters that were chosen for the MPC controller were

Q1 = Q2 = 1

as they turned out to give a good balance between reference following and smoothcontrol output u(t) ∈ [0, 1]. If is was not for this saturation on the output signal,an LQ controller could have been used instead. The prediction horizon N was setto 20 samples (0.4s), so that we are sure that the dynamics of the system is fullyexplored in the prediction. This is important, because with a too short predic-tion horizon, the MPC controller may become unstable. The prediction horizonshould however not be too long either, as this does not improve performance,only slows down the algorithm because unnecessary computations are made.

In Figure 7.1, it is possible to see that the MPC controller outperforms the othersin a step that starts at a non-zero velocity. It does struggle in steps from zero veloc-ity, because of the linearized model within the MPC controller does not describethe non-linearity of the check valve, and only describes the system well duringlifting. It therefore thinks that a larger output is necessary, to prevent the forksfrom falling downwards. One could argue that the resulting overshoot could be

Page 64: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

50 7 Results

dealt with by adding a constraint, for instance limiting the overshoot to 10% ofthe reference value. This does however lead to potential problems, because theoptimization problem may become unsolvable.

7.3 Stability

In this section the stability of the system will be analyzed. Throughout the sec-tion the same linearized model as for the MPC controller will be used. The motorfunction is fixed at its maximum value, since this is close to true for most operat-ing ranges.

Because approximations have been made in the model, the results of the stabil-ity analysis can only give a good hint about the stability properties of the realsystem and never be one hundred percent certain, since it does not represent thereal system fully. But then again the reality can never be completely accuratelymodelled, so the same reasoning applies to any system, independent of whetherit is linear or not.

7.3.1 Open loop stability

Since the system transfer function depends on the load on the mass, let us firstinvestigate what happens to the system when the mass is changed. Figure 7.2shows a so called root locus plot, which displays how the poles of the systemmove with increasing mass.

From this figure we can see that the two poles of the system are located in theleft half plane for the load range that the system is designed for, which meansthat the open loop is stable. Note that for low masses the step response will notovershoot or oscillate, but for a critical mass the step response will become in-creasingly oscillatory, yet still converge to a stationary point.

Implementations of systems in digital machines require discretization, so there-fore we must move into the time discrete Z-domain, where another importantfactor is the sampling time Ts. Here, Ts ∈ [0.002, 2] is used, first with no loadand then with maximum load. In Figure 7.3 the root locus with respect to Ts andminimum load is shown. The same experiment is performed but with maximumload in Figure 7.4. Again, the system has two poles, and they are color codedaccording to Table 7.3.

From this we can see that the sampled model is stable, but we can also clearly seethat the sampling time affects the model performance, as the poles move fromright to left in the unit circle. This means that it will take longer time for themodel to converge to a stationary point, and the step response will be far fromthe reality. From this an obvious conclusion would be that the model needs to

Page 65: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

7.3 Stability 51

Figure 7.2: A root locus plot for the open loop linearized continuous system.Here the mass m is varied from 0kg to 1600kg.

Table 7.3: The colors that correspond to different sampling times.

Blue Ts = 0.002sRed Ts = 0.02sYellow Ts = 0.2sPurple Ts = 2s

be sampled fast enough in relation to the dynamics of the system in order to getdecent model performance.

Figure 7.5 shows a comparison of the step responses for different sampling times.In the top half of the figure, Ts = 0.02 is used, which turns out to be just aboutenough to accurately describe the the real system. In the bottom half of the figure,Ts = 0.2 is used, and it is clearly visible that this model is undersampled and can-not describe the behavior of the real system. An appropriate sampling frequencywould therefore be 50Hz or higher, which happily enough is the frequency thatis used for sampling data in the forklift today.

Page 66: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

52 7 Results

Figure 7.3: A root locus plot for the open loop linearized discrete systemwith 0kg load. Here the sampling time Ts is varied from 0.002s to 2s.

Figure 7.4: A root locus plot for the open loop linearized discrete systemwith 1500kg load. Here the sampling time Ts is varied from 0.002s to 2s.

7.3.2 Closed loop stability

In this section, the closed loop system will be analyzed with help of the theorydiscussed in Section 3.3. Since the stability properties of the MPC controller iscomplicated to determine, focus will instead be directed towards the PID con-troller in this section.

Page 67: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

7.3 Stability 53

Figure 7.5: Comparison of step responses between the continuous systemand the sampled model with Ts = 0.02 and Ts = 0.2 respectively.

The feedback loop is shown in Figure 7.6. Note that the signs on the sum doesnot matter, the gain of the loop is the same either way. The left hand side of thefigure presents the original form of the loop, where G(s) is the linearized modelof the system, F(s) plus the saturation is the PID controller and r is the referencesignal. This loop can be rewritten by pushing F(s) through the sum, and lettingr = rF(s). We then end up with a loop where (3.7) can be applied.

The maximum gain of the saturation f (x) ∈ [0, 1] is 1, since it satisfies

Figure 7.6: The feedback loop with a PID controller.

|f (x)| ≤ 1 ∗ |x|.

Using this result, (3.7) then yields that if

|F(s)G(s)| ≤ 1∀s

Page 68: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

54 7 Results

holds, then the closed loop is stable.

The maximum gain of the feedback loop is presented in Figure 7.7, and is clearlynot less than one, but remember that the feedback system may be stable even ifthis it does not hold, according to the reasoning in Section 3.3. Let us thereforemove on and try to apply the circle criterion instead.

Figure 7.7: The maximum gain of the feedback loop, as a function of theload. From this we cannot draw any conclusions about stability.

The minimum gain of the saturation f (x) is 0, since f (x) = 1∀x > 1. This yields acircle that crosses the real axis in −1 and −∞, which is a vertical line in −1. Thismeans that if

ReF(iω)G(iω) > −1∀ω (7.2)

holds, then the feedback loop is stable. Figure 7.8 shows the nyquist curve forthe feedback loop, for two different masses: maximum load and minimum load.The difference for different masses is quite small, and adding more curves for dif-ferent values would only make the plot more difficult to read without adding anynew, relevant information. The nyquist curves for all other masses is containedbetween these two.

7.4 Model Validation

As written in earlier chapter, the straight forward way to measure how valid amodel is, is by calculating the mean square error.

Page 69: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

7.4 Model Validation 55

Figure 7.8: Nyquist curve for the feedback loop. Only the nyquist curve formaximum and minimum load is shown. The feedback loop is stable.

However, the value itself does not really tell anything, until compared to some-thing. By taking the square root of the mean square error, then dividing it bythe current expected velocity, we can see the error as a percentage of the velocity.This gives a far better understanding about how good the model is.

0 500 1000 1500

Mass of load

0

5

10

15Model error[%]

0 500 1000 1500

Mass of load

0

1

2

3

4

5

6

7

8

9

10Filter error[%]

Figure 7.9: Error measured in percentage of mean velocity for each run.Made for both filter and model error, and with different masses on the load.

As can be seen in Figure 7.9, the error for each run is within reasonable values.The worst run is from the sinusoidal signal of the warm motor. It is also worthnoticing, how all runs for the load with zero mass is significantly worse than theothers. It is not so surprising, because of stability problem with small masses forthe low frequency of 50 Hz.

Page 70: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

56 7 Results

7.5 Extended Kalman Filter

Figure 7.9 does not only provide information that the model itself is quite accu-rate, but also that the EKF improves the estimate slightly.

The EKF observer that is used to combine the estimated states with the sensorysignals in order to generate a better estimate, has not had many additions ormodifications from the theory discussed in Section 3.1. One small alteration hashowever been made in that the filter is reset when both the estimated velocityand the input is zero, to make sure that the estimated state covariance P does notspiral out of control due to bad pressure readings and bias errors when the checkvalve is active. The observer is in other words only active when the forks are mov-ing or the user generates a non-zero input signal, which is the region where themodel is a good approximation of the true system.

7.5.1 Discretization

The EKF has two states: the motor current ia and the fork velocity v. Since theEKF is implemented in discrete form, the state space model in (7.1) needs to bediscretized, which is done in (7.3). For simplicity, Tustin’s formula was not usedhere. [

vk+1ik+1

]=

1 − Dr2A2

4m TsrAg12m Ts

− g1rA2Ra0τ

Ts 1 − Tsτ

[vkiak]

+[

0 −1UbattTs 0

] [g − g2(m)

muk

]y =

[1 0

] [vkiak

] (7.3)

7.5.2 Linearization

The linearization is done with the help of the Jacobian matrices of the measure-ment function and the state update function.

Measurement function

The filter has two measurements: the current ia, and the pressure in the liftingcylinder, p. The measurement function therefore is

f (xk) =[iakpk

]=

[iak

r(g1iak − DrAv2 )

]. (7.4)

This yields the Jacobian matrix

Fk =[

1 0−rg1 −Dr2A

2

]. (7.5)

Page 71: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

7.5 Extended Kalman Filter 57

State update function

The linearized state update function for the EKF can be written as

Hk =

1 − Dr2A2

4m TsrAg12m Ts

− g1rA2Ra0τ

Ts 1 − Tsτ

(7.6)

7.5.3 Tuning parameters

Through experiments it was found that

Q =[1 00 1

]and

R =[1 00 1011

]were appropriate values for the tuning parameters in the observer. The reasonfor the value 1011 being so much larger than the others is that it is related to thehigh noise variance in the pressure sensor, which is much greater than processnoise and the current measurement noise. The reason for this is that the sensormeasures the pressure in Pascal, which is a very small unit and therefore themeasured quantity is much larger than for instance the current.

7.5.4 Performance

The hopes were initially to be able to estimate the actual lifting height of the forks,y, but this turned out to not be possible because of mainly two reasons. Firstly,since the pressure release valve that is used to lower the forks has not been in-cluded in the model, it is not possible to know what the initial elevation is. Thismeans that it would only be possible to know how far the forks have moved sincethe last time the filter was initiated, but an absolute height estimation would notbe possible.

Even if the initial lifting height was known, it would still not be possible to ac-curately estimate the lifting height over time, as the estimate precision quicklydegenerates with every time sample that passes. This is because even the small-est error in the estimate of the velocity accumulates, and grows larger with time,since the elevation is never measured, and therefore never can be corrected.

7.5.5 Fault detection

Even if the filter has not been used for this purpose in this project, it could bevery useful to determine the condition of the truck by estimating the internal

Page 72: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

58 7 Results

states, and comparing these to the sensory data. If for instance the motor wouldconsume more power than it usually does, the difference between the estimatedand measured state would increase noticeably, and it would therefore be simpleto detect that something is wrong. This way the filter could be used to determineif the system is malfunctioning and needs to be repaired, with a pretty good abil-ity to tell what part of the truck that is broken.

An example could be for instance if the friction in the pump suddenly increased,which would lead to a lower efficiency. This would lead to a higher current thanpredicted flowing through the motor, without any significant change in the lift-ing cylinder. One could therefore draw the conclusion that the error must haveoccured somewhere in the pump or motor. If on the other hand the mast wouldbe bent during a collision, with a higher friction in the mast as a result, both thecurrent and the pressure measurements would increase. This would of courseindicate that the change would be somewhere in the later parts of the system.

Figure 7.10: A comparison between the measured (blue) and estimated (red)pressure, with the correct model. The two match each other well.

Page 73: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

7.6 Implementation 59

Figure 7.11: A comparison between the measured (blue) and estimated (red)pressure, with a faulty model where the mast friction has been doubled.Here is it clearly visible that estimated pressure is much larger than it shouldbe, and the conclusion that something is not right can be drawn.

Figure 7.10 and 7.11 illustrate an example of what happens if the mast frictionin the model is changed. This gives the same result as if the friction in the real,measured system would have changed. In the case of an anomaly, it is only possi-ble to tell that something is wrong, not exactly where the problem lies. It couldeither be the model or the sensor that is bad, or the real system that in fact haschanged.

Other than that it is not possible to tell exactly what is wrong, there are someother issues as well. The biggest problem lies in that the load on the fork mayalso vary, which also affects the pressure in the lifting cylinder. This makes itvery difficult to distinguish errors from changes in the load, and one would haveto come up with an idea how to solve this issue before this kind of fault detectioncould be applied to this system.

7.6 Implementation

The code generated is used on an external board, loaded with the generated C-code. The internal software in the truck sends the inputs required: referencevelocity from joystick, and sensor data for the armature current and cylinderpressure. The code on the external board then generates the outputs: controlsignal and velocity from both the model and the Kalman filter. The control signalis then sent to the forklift and the process continuous. This can be seen in figure7.12

Page 74: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

60 7 Results

Figure 7.12: Flow chart to show how signals are sent between the forkliftand the external card.

The manually tuned PID is implemented and tested on a real forklift. The in-tegral part was halved, and the derivative part was removed after some manualtuning. Figure 7.13 shows the results from that.

0 10 20 30 40 50 60 70 80 90

Time (seconds)

0

0.05

0.1

0.15

0.2

0.25

0.3

Ve

locity[m

/s]

Velocity of a forklift without load

Reference

Estimated

Measured

Figure 7.13: Result from a test run with a real forklift, with 0 kg load.

In Figure 7.14 and 7.15, a step with velocity of 0.1 is shown for 1000 kg load, andwithout load. This shows how the control is capable to handle different masses.

Page 75: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

7.6 Implementation 61

0 5 10 15 20 25 30

Time (seconds)

0

0.05

0.1

0.15

Ve

locity[m

/s]

Velocity of a forklift without load

Reference

Estimated

Measured

Figure 7.14: Result from a test run with a real forklift, with 0 kg load.

0 5 10 15 20 25 30

Time (seconds)

0

0.05

0.1

0.15

Ve

locity[m

/s]

Velocity of a forklift 1000 kg load

Reference

Estimated

Measured

Figure 7.15: Result from a test run with a real forklift, with 1000 kg load.

Page 76: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

62 7 Results

7.7 Conclusions

In this section, we will look back on background and research questions to dis-cuss if the main purposes of the thesis has been fulfilled, and what other generalconclusions that can be drawn from this project.

7.7.1 Model based work

The benefits of model based work are many. Without tools for building and simu-lating models in an intuitive way, this thesis work would probably not have beenpossible to realize, at least not in the same time frame. The main benefits of beingable to quickly simulate the model are that many problems can be detected earlyon in the process, and that critical experiments as for instance stability analysiscan be performed in a safe manner. Because of this, model based work has thepotential to speed up work, and reduce the amount of effort needed in the laterphases of project, which is potentially very valuable as projects often cost moremoney later on when more people are engaged.

7.7.2 The 600 rpm criteria

How can the 600 rpm criteria be fulfilled without adding an extra sensor? Thesimple answer to this that is cannot, at least not all the time. This is because themotor shaft is directly connected to the pump, and it will therefore always be adelay where the pump accelerates up to speed after the motor is turned on, butsetting this phase aside, it is indeed possible to estimate the velocity of the pumpwith a model and an observer. With an estimation of the velocity, it is possible toapply a controller, which makes sure the pump velocity never falls below the crit-ical level, until the motor is turned off again. Depending on how the controlleris tuned, the length of the ramp up period to 600 rpm can be adjusted, to makegive the forklift appropriate behavior, i.e. fast enough so the operator does notfeel that the forklift is slow and dull, but slow enough to avoid uncomfortablejerk and oscillations.

Implementing replacements for sensors in software that can be run on the com-puters in the forklift has the potential to save a lot of money, especially if thesensor it replaces is very expensive, or if there is a very large volume of the par-ticular type of forklift that needs to be produced.

7.7.3 Independent lifting velocity

Lifting speed independent of the load is possible in theory, but it may not bepractical, as it requires the maximum reference speed to be set to the highestpossible speed at maximum load. In order to maintain a higher operational speed

Page 77: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

7.7 Conclusions 63

at lower loads, the maximum reference is therefore set to the highest possiblespeed at no load. This means that as long as the input signal is not saturated,independent lifting speed will be achieved, but otherwise the system will go asfast as possible.

7.7.4 Stability

The stability of the system has been thoroughly investigated in Section 7.3, andit was shown that both the open loop system and the closed loop system with aPID-controller working as the feedback link were stable. The non-linearities didhowever call for simplifications and linearizations before the stability analysiscould be done.

During the thesis work it was also found that the sampling frequency of 50 Hzwas just on the verge of being too slow to capture the dynamics of the system.The step response from steering input to the movement of the forks is simply sofast that there is only a couple of samples of the step is captured, if the system issampled at 50 Hz. The MPC controller seems to handle this much better than thePID-controller, but if the sampling frequency would be increased in the future,the benefits of using an MPC controller - according to our simulations - would befurther reduced in relation to the PID, as the performance of the PID controllerincreases with the sampling frequency.

7.7.5 Model generality

An almost general model has been developed, with the exception of the frictionparameters in the mast the and the pump, and the look-up table for the motorfunction. This means that most parts of the model represents data that can beread from the data sheet of each component, and that the model should be appli-cable to just about any forklift with the same basic structure. If it was not for thefriction and the motor, all that would be necessary to modify the model to fit an-other system would then be to change the model parameters. The problem withfriction is also that it often changes with a number of different factors, includingtemperature, lubrication and components wearing out over time to name a few.

The temperature model has been omitted, as it was too hard to properly estimateall the related parameters. As can be seen in (2.4), there are a lot of different pa-rameters related to the thermal capacity, thermal conductivity and cooling, whichwould all have to be estimated by experiments that there simply was no time forin this project. It would also lead to the same problem as for the friction, wherethe parameters are specific for each truck.

Page 78: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

64 7 Results

7.7.6 Other benefits of having an observer

The observer could also be used as a way of predicting if the system is faulty orabout to break down. By estimating the internal states of the forklift, it is possi-ble to detect abnormalities by comparing the measurements with the estimatedstates. If there is a big difference between the two, it could for instance mean thatthe friction has increased in some part of the system and that it might be time forservice.

7.7.7 Precision

As mentioned in the results, the precision is not good enough to accurately esti-mate the lifting height, and it is possible that it may never be in the future either,without measuring velocity or height, because a double integration from the forceacting on the load, is very sensitive to noise. Even if the the noise issue could besolved and an accurate estimate of the elevation changes could be achieved, it isstill necessary to know the initial position of the forks. Also, the lowering func-tionality would have to be modelled as well to make sure the position is not lostwhen the lifting action is mixed with lowering movements. Because of this lackof precision, height estimation applications such as a smooth slowdown towardsthe 1.8 m regulation, is very hard to do.

7.7.8 Control strategies

As of today, the different control algorithms that have been tested performedfairly similar, but there are some differences. Firstly, it should be mentioned thatthe algorithms that were used are meant to be applied to linear systems, whichcauses them to perform worse in the regions where the non-linearities are actingthe most. This is most notable when the controllers are used to start the systemfrom a standstill. Because the check valve is not included in the linearization ofthe system, the controllers cannot predict the behavior properly, and thereforethinks that there is more force than necessary needed to drive the system into thedesired state. This leads to relatively large overshoots in the velocity of the forksin this case.

The benefits of the PID controller are that it is very simple to implement, re-quires little computational power, and it is already a commonly known conceptin the industry. The downsides are that it is difficult to tune to get specific char-acteristics, and that it may cause instability if there are too long time delays inthe system. The IMC-tuned PID controllers have the strength of being tuned au-tomatically, but in this implementation their performance were poor for heavymasses.

The advantages of the MPC controller are that it uses the knowledge about the

Page 79: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

7.7 Conclusions 65

model to its advantage, that it is quite intuitive to tune and that it performs wellat low sampling frequencies. It is also easy to control constraints in states andcontrol signal. The downsides are that it requires a lot of computational power,and is much harder to implement than the PID controller.

The MPC controller also does not benefit from higher sampling frequencies asmuch as the PID controller does, because it requires a longer prediction horizonwhich leads to even higher demands on computational power. This, along withthe simplicity of the PID controller, are the reasons why the PID controller is abetter alternative than the MPC controller.

Page 80: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested
Page 81: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

8Future work

The battery voltage is a measured signal and varies slightly with the charge of thebattery, but we forgot to include this in the model. It should however be easy tomodify.

One of the first things that come to mind for future improvements is of course toinclude the temperature dependant variations in the motor’s internal resistance,as this can vary quite a lot depending on how and where in the world the forkliftis used. The difference in the resistance can be as much as 40% if a cold forkliftin a cold storage compared to a forklift that has recently a series of heavy lifts ina hot country.

As mentioned in the delimitations, there is most likely quite a bit of room forimprovement in the hydraulic parts of the model, as the authors do not have verymuch experience in this field. Someone with more knowledge about hydraulicswould perhaps be able to come with a model that represents the system better, ina more general way so that the model more easily can be modified and applied toa wider variety of forklifts.

If a nonlinear MPC controller could be developed, the transition from stand stillto movement could be handled better, which would reduce the amount of over-shoot in this situation. This could potentially lead to the MPC controller being abetter alternative than the PID controller.

As mentioned in the results and conclusions, the model combined with the ob-server could be expanded in the future, to handle diagnosis and monitoring ofthe system. With this, it would be possible to make the system alert its surround-ing if, or even before it is about to break down, and therefore reduce the amount

67

Page 82: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

68 8 Future work

of service time needed. It would also be quicker and easier to mend broken ma-chines, if an educated guess of what is wrong can be provided to the servicemenby the system. With the rapid expansion of the way we use the internet, it islikely that data from forklifts soon will be gathered in the cloud, and if so, di-agnosis data could be gathered and analyzed in order to find weak spots in thestructure that needs to be fixed in the next generation of trucks.

Page 83: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

Appendix

Page 84: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested
Page 85: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

ACalculations

This appendix contains some calculations that did not fit into the report.

A.1 Motor function calculation

From tests we have a measured armature current ia and pressure inside the cylin-der p. The torque T from the motor is calculated with pump displacement 1/r,pressure p and efficiency η as in A.1.

T =p10−6105

2rπη(A.1)

The motor constant is then calculated from A.2.

kif =Tia

(A.2)

71

Page 86: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

72 A Calculations

Table A.1: Data from a test with calculated values to get motor constant kif .Made with a pump displacement of 4.2

load[kg] ia[A] if [A] p[bar] η T k ∗ if0 112 6.2096 50 0.95 3.518163 0.031412

400 144 8.5552 89 0.95 6.262329 0.043488800 183 11.4139 130 0.95 9.147223 0.049985

1000 205 13.0265 152 0.95 10.69521 0.0521721200 225 14.4925 172 0.95 12.10248 0.0537891600 270 17.791 219 0.95 15.30955 0.057072

A.2 Field current calculation

The forklift manufacturer has developed and verified a model to describe thefield current as a function of the armature current, as can bee seen in figure A.1.

-200 -150 -100 -50 0 50 100 150 200 250 300

Armature

0

2

4

6

8

10

12

14

16

18

20

Fie

ld

Field current calculation

Figure A.1: A linear model of how field current varies for different armaturecurrent.

Page 87: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

A.3 Equations from bond graph 73

A.3 Equations from bond graph

Here are all equations that can be taken from the bond graph, so that a finalmodel can be derived.

ua = uRa + uIa + e (A.3)

uRa = Raia (A.4)

Laia = uIa (A.5)

e = kif ia (A.6)

Td = kif ia (A.7)

Td = TI + TR + Tl (A.8)

Jω = TI (A.9)

Tr = Dw (A.10)

p = rTl (A.11)

Fh = pA (A.12)

f = vA (A.13)

Fh = F + mg (A.14)

F = mv (A.15)

ω = rf (A.16)

Page 88: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested
Page 89: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

BSimulations

B.1 Parameter estimation and model validation

This appendix contains the resulting plots of the velocity,the pressure inside thecylinder, and the armature current. All plots are gathered during the parameterestimation.

The plots contains both sensor data and model data for the same PWM-signal.Some parts of the sensor data is cut off. This is because irrelevant part of the eachrun won’t be taken into account during the parameter estimation.

75

Page 90: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

76 B Simulations

Figure B.1: Simulated and measured data of the same PWM-signal. In thiscase, a full step and a load of 0 kg.

Figure B.2: Simulated and measured data of the same PWM-signal. In thiscase, a small step and a load of 0 kg.

Page 91: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

B.1 Parameter estimation and model validation 77

Figure B.3: Simulated and measured data of the same PWM-signal. In thiscase, a sinusoidal signal and a load of 0 kg.

Figure B.4: Simulated and measured data of the same PWM-signal. In thiscase, a ramp signal and a load of 0 kg.

Page 92: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

78 B Simulations

Figure B.5: Simulated and measured data of the same PWM-signal. In thiscase, a full step and a load of 1500 kg.

Figure B.6: Simulated and measured data of the same PWM-signal. In thiscase, a sinusoidal signal and a load of 1500 kg.

Page 93: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

B.1 Parameter estimation and model validation 79

Figure B.7: Simulated and measured data of the same PWM-signal. In thiscase, a ramp signal and a load of 1500 kg.

Figure B.8: Simulated and measured data of the same PWM-signal. In thiscase, a full step and a load of 1000 kg.

Page 94: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

80 B Simulations

Figure B.9: Simulated and measured data of the same PWM-signal. In thiscase, a small step and a load of 1000 kg.

Figure B.10: Simulated and measured data of the same PWM-signal. In thiscase, a sinusoidal signal and a load of 1000 kg.

Page 95: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

B.1 Parameter estimation and model validation 81

Figure B.11: Simulated and measured data of the same PWM-signal. In thiscase, a ramp signal and a load of 1000 kg.

Figure B.12: Simulated and measured data of the same PWM-signal. In thiscase, a full step and a load of 500 kg.

Page 96: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

82 B Simulations

Figure B.13: Simulated and measured data of the same PWM-signal. In thiscase, a sinusoidal signal and a load of 500 kg.

Figure B.14: Simulated and measured data of the same PWM-signal. In thiscase, a ramp signal and a load of 500 kg.

Page 97: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

B.1 Parameter estimation and model validation 83

Figure B.15: Simulated and measured data of the same PWM-signal. In thiscase, a full step and a load of 0 kg, with a warm motor.

Figure B.16: Simulated and measured data of the same PWM-signal. In thiscase, a small step and a load of 0 kg, with a warm motor.

Page 98: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

84 B Simulations

Figure B.17: Simulated and measured data of the same PWM-signal. In thiscase, a sinusoidal signal and a load of 0 kg, wit a warm motor.

Figure B.18: Simulated and measured data of the same PWM-signal. In thiscase, a ramp signal and a load of 0 kg, with a warm motor.

Page 99: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

Bibliography

[1] M. George, K. P. Basu, and A. T. W. Chiat, “Model reference controlled sep-arately excited dc motor,” Neural Computing & Applications, 2010. Citedon page 5.

[2] T. Glad and L. Ljung, Reglerteori - Flervariabla och olinjära metoder. Stu-dentlitteratur, 2011. Cited on pages 6, 11, 12, and 17.

[3] F. Gustafsson, Statistical Sensor Fusion. Studentlitteratur, 2012. Cited onpages 6 and 9.

[4] C. . S.Yin, “Speed measurement of a general dc brushed motor based onsensorless method,” IPEC Conference on Power & Energy, 2012. Cited onpage 6.

[5] S. André, “Design and optimization of controllers for an electro-hydraulicsystem,” Master’s thesis, Linköping University, 2014. Cited on page 7.

[6] D. Hu, S. Ding, H. Zhu, B. Xu, and H. Yang, “Velocity-tracking control of thevariable-speed controlled hydraulic system: Using compound algorithm ofpd & feedforward-feedback control,” International Conference on Measur-ing Technology and Mechatronics Automation, 2011. Cited on page 7.

[7] P.P.Acarnley and J.K.Al-Tayie, “Estimation of speed and armature tempera-ture in a brushed dc drive using the extended kalman filter,” Neural Com-puting & Applications, 1997. Cited on page 7.

[8] M. Enqvist, T. Glad, S. Gunnarsson, P. Lindskog, L. Ljung, J. Löfberg, T. McK-elvey, A. Stenman, and J.-E. Strömberg, Industriell reglerteknik - Kurskom-pendium. Automatic Control at Linköping University, 2014. Cited on pages14, 17, 37, 38, 40, and 42.

[9] T. Glad and L. Ljung, Reglerteknik - Grundläggande teori. Studentlitteratur,2014. Cited on page 16.

[10] T. Glad and L. Ljung, Modellbygge och Simulering. Studentlitteratur, 2011.Cited on pages 16, 19, and 32.

85

Page 100: Modelling and Control of an Electro-Hydraulic Forklift939067/FULLTEXT01.pdf · Acknowledgments We would like to thank our examiner Johan Löfberg for doing a great job and being interested

86 Bibliography

[11] F. Gustafsson, L. Ljung, and M. Millnert, Signal Processing. Studentlitter-atur, 2010. Cited on page 28.

[12] J. Löfberg, Linear Model Predictive Control, Stability and Robustness. Li-centiate thesis, Linköping University, 2001. Cited on page 40.


Recommended