DF Modelling, simulation and controller design to reduce oscillations when lifting forks of an AGV Master’s thesis in System, Control and Mechatronics David Tobin Department of Electrical Engineering CHALMERS UNIVERSITY OF TECHNOLOGY Gothenburg, Sweden 2020 Master’s thesis 2020 Modelling, simulation and controller design to reduce oscillations when lifting forks of an AGV David Tobin DF Department of Electrical Engineering Division of Systems and Control Chalmers University of Technology Gothenburg, Sweden 2020 Modelling, simulation and controller design to reduce oscillations when lifting forks of an AGV © DAVID TOBIN, 2020. Manager: Christian Skeppstedt, AGVE Supervisor: Patrik Magnusson, AGVE Examiner, supervisor: Balázs Adam Kulcsár, Department of Electrical Engineering Master’s thesis 2020 Department of Electrical Engineering Division of Systems and Control Chalmers University of Technology SE-412 96 Gothenburg Telephone +46 31 772 1000 Cover: Rendered picture of an AGV (Patrik Magnusson, 2020). Gothenburg, Sweden 2020 iii Modelling, simulation and controller design to reduce oscillations when lifting forks of an AGV DAVID TOBIN Department of Electrical Engineering Chalmers University of Technology Abstract An automated guided vehicle (AGV) working as a forklift has problems with oscil- lations when lifting and lowering the forks. This reduces the accuracy when picking and placing objects, as well as leading to excessive wear of components. This project investigates if it is possible to develop a control system that can remove the oscilla- tions, verified by simulations. A model based design method was used in this regard. The lifting system of the AGV was modelled, including voltage control unit, DC- motor, pump, valve, cylinder, and forks. Then measurements were gathered from a real AGV when performing a test drive with different speeds on different heights, to map the behaviour of the oscillations over the spectrum of operation. The mea- surements were used to estimate the parameters of the model, by using a nonlinear least squares method. A PID controller was designed that successfully removed the oscillations in the sim- ulation. The performance was slightly increased by scheduling the PID to change its parameters based on current height and load. Anti-windup was added that solved a problem that occurred due to saturation of the control signal. Noise was introduced on a level similar to what was evident in the measurements. This reduced the perfor- mance as the noise was amplified and the oscillations returned. The filter parameter in the PID was increased until proper oscillation-free tracking was achieved again. Keywords: Modelling, Simulation, Controller design, Matlab, Simulink, Oscillation, AGV, Parameter estimation, PID, Scheduled PID, Anti-windup. iv Acknowledgements First and foremost, I would like to thank my examiner and supervisor Balázs Adam Kulcsár for his genuine interest and support during the whole Master’s thesis process. His insightful ideas and suggestions helped the project to move forward even when troublesome problems stood in the way. I very much appreciate my manager at AGVE Christian Skeppstedt, for making it possible to find and formulate a problem in an interesting area. Without him, the thesis would not even have started. I want to especially thank Patrik Magnusson of AGVE for supervising me throughout the project, by being available for information, discussions, and problem solving. He also helped with taking the measurements of the AGV, as well as rendering pictures of the system. Lastly, I want to thank my opponent Ted Eriksson for giving me useful feedback on the report. David Tobin, Gothenburg, November 2020 vi Contents List of Figures x List of Tables xi 1 Introduction 1 1.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Scope and Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.3 Literature review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.4 Outline of thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 Method 4 2.1 Analysis of the AGV . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.1.1 Information of the AGV . . . . . . . . . . . . . . . . . . . . . 4 2.1.2 Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.2 Modelling of components . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.2.1 Voltage control unit . . . . . . . . . . . . . . . . . . . . . . . . 6 2.2.2 Motor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.2.3 Pump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.2.4 Valve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.2.5 Cylinder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.2.6 Fork and load . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.3 Parameter estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.3.1 Least squares estimation . . . . . . . . . . . . . . . . . . . . . 13 2.3.2 Sets of parameters . . . . . . . . . . . . . . . . . . . . . . . . 13 2.4 Controller design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.4.1 PID controller . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.4.2 Scheduled PID . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.4.3 Anti-windup . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.4.4 Sensor noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3 Results 18 3.1 Gathered measurements . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.2 Model compared to measurements . . . . . . . . . . . . . . . . . . . . 20 3.3 Controller performance . . . . . . . . . . . . . . . . . . . . . . . . . . 25 3.3.1 PID controller . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 3.3.2 Scheduled PID . . . . . . . . . . . . . . . . . . . . . . . . . . 28 3.4 Effect of noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 viii Contents 4 Discussion 31 4.1 Flaws in model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 4.1.1 Simplifications in model . . . . . . . . . . . . . . . . . . . . . 31 4.1.2 Initial values . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 4.1.3 Omitted parameters and phenomena . . . . . . . . . . . . . . 32 4.1.4 Processing frequency . . . . . . . . . . . . . . . . . . . . . . . 32 4.1.5 Overfitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 4.2 Strength of model based design . . . . . . . . . . . . . . . . . . . . . 32 4.2.1 Revealed problems . . . . . . . . . . . . . . . . . . . . . . . . 32 4.2.2 Fast adjustments . . . . . . . . . . . . . . . . . . . . . . . . . 33 4.3 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 4.3.1 More tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 4.3.2 Extended scheduling . . . . . . . . . . . . . . . . . . . . . . . 33 4.3.3 Implementation and verification . . . . . . . . . . . . . . . . . 34 4.3.4 Other controllers . . . . . . . . . . . . . . . . . . . . . . . . . 34 5 Conclusion 35 Bibliography 36 ix List of Figures 2.1 Input sequence used for measurements . . . . . . . . . . . . . . . . . 5 2.2 The components of the system and their interconnections . . . . . . . 6 2.3 Voltage control unit of the AGV (rendered picture by Patrik Mag- nusson, 2020). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.4 DC-motor connected to the pump, with attached oil reservoir (ren- dered picture by Patrik Magnusson, 2020). . . . . . . . . . . . . . . . 7 2.5 Schematic of controlled check valve . . . . . . . . . . . . . . . . . . . 9 2.6 The cylinder of the first stage, with mechanical transmission attached (rendered picture by Patrik Magnusson, 2020). . . . . . . . . . . . . . 10 2.7 Friction force curve for the cylinders . . . . . . . . . . . . . . . . . . 11 2.8 Construct of the frames holding the cylinders and the forks (rendered picture by Patrik Magnusson, 2020). . . . . . . . . . . . . . . . . . . 12 2.9 Reference used for the controller evaluation . . . . . . . . . . . . . . . 14 2.10 Closed loop setup for the PID . . . . . . . . . . . . . . . . . . . . . . 15 2.11 Closed loop setup for the scheduled PID . . . . . . . . . . . . . . . . 15 2.12 Anti-windup added to the PID . . . . . . . . . . . . . . . . . . . . . . 16 2.13 Feedback signal distorted by noise . . . . . . . . . . . . . . . . . . . . 17 3.1 Test run of AGV to gather measurements . . . . . . . . . . . . . . . . 19 3.2 Speed of the forks during the test run . . . . . . . . . . . . . . . . . . 19 3.3 Inspection of oscillations during the test run . . . . . . . . . . . . . . 20 3.4 Input sequence used for validation . . . . . . . . . . . . . . . . . . . . 21 3.5 Simulated results of height of forks compared to measurements, before parameter estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.6 Simulated results of speed of forks compared to measurements, before parameter estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.7 Simulated results of height of forks compared to measurements, after parameter estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.8 Simulated results of speed of forks compared to measurements, after parameter estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.9 Control of system with PI . . . . . . . . . . . . . . . . . . . . . . . . 26 3.10 Control of system with PID . . . . . . . . . . . . . . . . . . . . . . . 27 3.11 Offset resolved with anti-windup . . . . . . . . . . . . . . . . . . . . . 27 3.12 Comparison between regular PID and its scheduled variant . . . . . . 28 3.13 Noise added to the setup with the PID . . . . . . . . . . . . . . . . . 29 3.14 Noise added to the PID, with increased filter constant . . . . . . . . . 30 x List of Tables 3.1 Values of parameters before and after estimation . . . . . . . . . . . . 22 xi 1 Introduction This chapter introduction the project by first providing a background to the problem and explaining the goal. The scope and the limitations outlines the content of the report, while the literature review presents previous knowledge and research on the area that served as an important basis. 1.1 Background The AGVE Group is a provider of Automated Guided Vehicles (AGVs), control de- vices, and AGV management systems. Some AGV models are having problems with oscillations when lowering and raising the forks. The phenomenon is speculated to be dependent on weight of load, speed and current height. The behavior causes the position- and repetition accuracy to decrease and the life span of components to shorten. A smoother operation also gives a better impression. Lifting is done with a DC-motor and a hydraulic pump, while lowering is done by controlling a valve. Attempts with a PID-regulator have previously been made with manual tuning of the parameters, but they were unsuccessful in removing the oscillations. In some cases it even made the oscillations worse. A reason could be that system parameters are varying over the course of a lift, and a regular PID-regulator does not adapt to these changes. AGVE wants to have the oscillations eliminated without altering any existing equip- ment. The objective of this Master’s thesis is to investigate if it is possible to develop a control system that can reduce the oscillations. The reason why the project is of interest is because it can simplify future system designs. The project can be seen as a first step in investigating the possibility of developing a flexible model structure that can be varied based on different AGV models and their specifications. That structure can be used in forthcoming projects to initially design control systems in a simulation environment, saving time and potentially leading to better results. 1 1. Introduction 1.2 Scope and Limitations Five main tasks will be performed in the project: • A model of the lifting system of an AGV will be created, with some reasonable simplifications. • Data will be measured from a real AGV during a test drive. • The measurements will be analysed to find possible explanations for the oscil- lations. • Model parameters will be fitted against the measured data. • A control system will be designed to remove the oscillations in the model. The following limitations are made to ensure a reasonable size of the project: • Only lifting will be considered due to the differences in how lifting and lowering are being performed. • The model will not take into account how the construction of the AGV (other than the parts responsible for lifting) is affecting the oscillations. • Eventual effects of the suspension of the wheels will not be considered. • A method to measure the load will not be developed. Instead the load is seen as known. • The control system will not be implemented or verified on a real vehicle. 1.3 Literature review Modelling of electro-hydraulic systems that can be applied to forklifts has been widely researched. In [1], a mathematical model of electro-hydraulic servo system is derived, that is used to examine the dynamic behaviour. Furthermore, a mathemat- ical model based on control theory for an electro-hydraulic position servo system is created in [2]. A system identification technique is used by [3] to obtain another mathematical model of an electro-hydraulic system. The drawbacks about these models are that they assume the cylinder is controlled by a proportional valve. The AGV in question is controlled by regulating speed of the motor that directly affects the pump and the flow to the cylinder. Therefore the results cannot be directly applied, although inspiration can be taken. The effects of oscillations in hydraulic systems have been researched by [4], among others. They showed that the mounting of the cylinder acts as damping which causes changes to the eigenfrequency of the cylinder. A formulation of the solution for the problem of damped vibration in hydraulic cylinders has been done by [5]. The problem of stick-slip oscillations in hydraulic driving system are investigated in [6]. In [7], modelling and control of an electro-hydraulic actuator has been done, where an adaptive pump displacement is used. 2 1. Introduction A self-tuning-parameter fuzzy PID speed control has been developed to control an electro-hydraulic forklift in [8]. To conclude, work has been done regarding generalized modelling and control of electro-hydraulic systems such as forklifts, although not specifically with the intent of removing existing oscillations in a specific model, as in this project. 1.4 Outline of thesis Chapter 2 explains how the work of the project has proceeded. The first section presents information about the AGV and how the measurements were taken. The next section explains how all components were modelled and the trade-offs between simplicity and accuracy. Then, a parameter estimation procedure is presented. Fi- nally, it is shown how the controller was designed. Chapter 3 first shows an analysis of the measurements. Then, the result of the pa- rameter estimation and how the model behaves compared to the measured data is presented. After that, the performance of the PID controller is evaluated, with its variations of scheduling and anti-windup. Lastly, the effect of noise in the system is investigated. Chapter 4 discusses the limitations of the model and how it can affect the result in the simulations. A couple of strengths of the model based design method are noted. In the end, some proposals are made regarding future work to get a more trustworthy result. Chapter 5 concludes that a control system can be designed to remove the oscillations according to the simulations. 3 2 Method This chapter describes how the model based design (MBD) method has been used. First the AGV was analysed to set the conditions of the model. Then the lifting system was modelled by describing the components with relevant mathematical equations. After that the unknown model parameters were estimated to match the measured data. Finally, a controller was designed to remove any occurring oscillations. 2.1 Analysis of the AGV A brief overview of the AGV is presented to establish some preconditions for the modelling. Then a short description follows on how the measurements were gathered of the AGV during as test run. 2.1.1 Information of the AGV The AGV in question is the model A4, an automated forklift truck with a lifting height of around 5 m. It weighs between 1300 and 3000 kg depending on setup, and can lift a load up to 1500 kg. The lifting apparatus consists of three stages, where the first one consists of one big cylinder and the other two stages consists of two smaller cylinders each. Each stage adds additional mass to the system and a stage shift occurs mechanically when a certain height is reached. There is a mechanical transmission due to how the cylinder and the forks are con- nected. The ratio is 1:2, where the forks travel twice as fast but with half the force as the cylinder piston. A wire sensor is mounted on the frame that measures the position of the fork. Not all A4 models have oscillations which indicates that the parameters and variables causing the oscillations can differ between the same model. The oscillations occur more frequently at low speeds, which is problematic since positioning for picking and placing is performed at low speeds. 2.1.2 Measurements Measurements were taken from a real AGV when doing an open loop test run of different speeds at different heights. Those were used to analyse the behaviour of 4 2. Method the vehicle as well as show the characteristics of the oscillations. The used input sequence can be seen in Figure 2.1. Position, speed and requested lift speed was recorded over time and saved in logs. 20 40 60 80 100 120 Time [s] 0 20 40 60 80 100 P W M Figure 2.1: Input sequence used for measurements 2.2 Modelling of components This section describes how the modelling was performed. The whole system consist of multiple subsystems corresponding to individual components, e.g. motor, pump, and cylinder. Each subsystem was independently modelled and then connected. This improved workflow and led to easy signal monitoring that was useful when ver- ifying behaviour. The components were modelled by describing their mathematical models in Matlab Simulink, where all simulations were performed. The components are presented as they appear in the chain of signals, from input to output. From here on, referring to the “forklift model” means the combination of the modelled components 1-6 in the list below. The components and their intercon- nections can be seen in Figure 2.2. 1. Voltage control unit 2. Motor 3. Pump 4. Valve 5. Cylinder 6. Fork and load A theme of the modelling procedure was to find the least complex model that still captured the behaviour of the dynamics. Simplifications helped with keeping the model clean and simulations fast, but more complex models have the capacity of being more accurate. However, a complex model with many unknown parameters can create problems if the associated parameters cannot be chosen well. Therefore, every simplification needed to be well thought out as it could limit the trustworthi- ness of the results. 5 2. Method Figure 2.2: The components of the system and their interconnections The structure for each section of the component modelling is; first a short introduc- tion to the specific part, describing what it is and how it works. Then the next part describes how it was modelled and the reasoning behind eventual simplifications. 2.2.1 Voltage control unit The voltage control unit is the first component in the model chain. Its input is a PWM signal that depending on the duty cycle converts the voltage of the battery to the desired level, which is applied to the motor. The battery voltage is speci- fied to 24 V, and the output voltage is seen as directly proportional to the duty cycle. Figure 2.3: Voltage control unit of the AGV (rendered picture by Patrik Magnus- son, 2020). The voltage unit, shown in Figure 2.3, was simply modeled to scale the battery 6 2. Method voltage with the control signal PWM(t), as follows; U(t) = PWM(t) · Ubatt (2.1) The battery was seen as an ideal voltage source. In reality there is an internal re- sistance that causes a slight voltage drop. This effect was dismissed as it was not affecting the dynamics in the model. 2.2.2 Motor A 4 kW brushed DC-motor is used to drive the pump, which can be seen together in Figure 2.4. An oil reservoir is also present in the picture but is not modelled. First a standard model is presented and then a simplified linear model that actually was used will be shown. Figure 2.4: DC-motor connected to the pump, with attached oil reservoir (rendered picture by Patrik Magnusson, 2020). As derived by [10] a brushed DC-motor can be described by the following two equa- tions, assuming constant field current and flux, di(t) dt = 1 L (U(t)−Ri(t)−Keω(t)) (2.2) dω(t) dt = 1 J (KT i(t)− bω(t)− TL) (2.3) where i(t) is the motor current, L is the motor inductance, U(t) is the applied voltage, R is the motor resistance, and Ke is the electromotive force constant. Fur- thermore, ω(t) is the angular velocity, J is the moment of inertia, KT is the motor torque constant, and b is the viscous friction constant. TL is the torque from the load. 7 2. Method There are six motor parameters that are needed to use the model. These could not be received from the manufacturer of the motor (due to the Covid-19 pandemic). An approach to estimate the parameters using the specified nominal speed of 3500 rpm and the nominal current of 230 A was used. Those values could be achieved in an isolated simulation of the motor after some trial and error parameter estimation. However, there was no way of knowing whether other factors (transients, accelera- tion, inertia, friction etc.) were correct. A problem also occurred in this model due to a feedback loop in the chain {angular velocity -> pump friction -> load torque -> angular velocity}. A high frequency signal was appearing with unknown source that was detrimental to the performance. A possible explanation could be unfortunate combinations of parameters. Due to the uncertainties around the parameters and the problem that arose, the motor was simplified to a linear function. In this case the motor is series wound, a type of motor that does not follow a linear behaviour regarding torque and speed. The added mass due to a stage shift increases the load of the motor and decreases its speed. To catch this behaviour in the linear model, there were three sets of parameters corresponding to the stages, resulting in that the added mass indirectly lowers the speed of the motor. The linear equations for the speed of the motor became ω(t) = U(t)ki + zi (2.4) where U(t) is the applied voltage from the voltage unit, and ki and zi are linear parameters, for i = 1, 2, 3 corresponding to the active stage. The parameters ki and zi were given initial values by examining the logged data from measurements of requested speed versus the actual speed of the forks. Thus, the gain was able to be extracted which could be described as a linear function. 2.2.3 Pump The pump is modelled as a positive displacement type, connected directly on the shaft of the motor. Thus, the flow is directly proportional to the speed of the motor. The flow is given by Q(t) = ω(t)D 2π n (2.5) where ω(t) is the angular speed of the motor, D is the displacement of the pump, and n is the volumetric efficiency. The displacement is 43 cm3/rev and the volumet- ric efficiency was approximated to 95 %, based on [11]. The friction in a pump is dependant on speed and pressure [12], and a friction model could be derived as in [13] that includes both static and viscous friction. However, the friction was not modeled in the pump for two reasons. First of, it would mean additional parameters to estimate. Secondly, the major effect of friction in this 8 2. Method system is that it acts as a damper for the oscillations. The same level of dampening that were visible in the measurements could be achieved with only the friction in the cylinder model, thus the friction model was not needed in the pump. 2.2.4 Valve A valve is placed between the pump and cylinder, that is open when DC-motor is being driven, and else closed. The schematic for this type of valve can be seen in Figure 2.5. This locks the forks into position when no movement is requested. Figure 2.5: Schematic of controlled check valve It was modeled as a multiplication of 0 or 1 with the flow, when the condition is met. The outflow of the valve, Qv(t), is given by Qv(t) = Q(t)vs (2.6) where Q(t) is the inflow and vs is the valve state given by vs = { 0, PWM(t) = 0 1, PWM(t) 6= 0 (2.7) This could also be modelled more complexly as seen in [14] and [15], but was not seen as the source of any dynamic behaviour of interest, since when the valve is open, it can be disregarded due to not interfering with the flow anymore. The oscillations occur when the valve is open (and thus disregarded) and therefore this simple model is motivated. 2.2.5 Cylinder In this section the cylinders, hoses, and the oil are modelled, where one of the cylin- ders is shown in Figure 2.6. Connections from the pump, through the valve, to the cylinder adds volume that affects the system. The cylinders are single-acting and therefore only has one input. The area of the piston depends on which stage is active. The first stage has one cylinder with area 28.27 cm2, while the second and third stages have two cylinders each with combined area 22.68 cm2. 9 2. Method Figure 2.6: The cylinder of the first stage, with mechanical transmission attached (rendered picture by Patrik Magnusson, 2020). The flow from the pump enters a restricted area of the cylinder. This will create a pressure which through the area of the piston turns into a force that is exerted through the piston rod. When the force is greater than the opposing force due to gravity and friction, the cylinder will move. A fact of great importance is that the flow is not constant throughout the whole hydraulic system. Due to the compressibility of the oil, a spring effect appears. This effect can be captured by using the flow continuity equation from fluid mechanics, as shown in [13], which gives the equation dP (t) dt = β V (t)(Qv(t)− dV (t) dt ) (2.8) where P (t) is the pressure, β is the bulk modulus of the oil, Qv(t) is the flow from the valve. V (t) is the total volume, given by V (t) = V0 + ApxP (t) (2.9) where V0 is the dead volume of hoses, the valve, and the cylinder. Ap is the area of the piston and xp(t) = x(t) 2 is the position of the piston. When the piston is in its most retracted state its position is defined as xp = 0. The spring effect are determined by the ratio of bulk modulus and total volume in equation (2.8). The bulk modulus is a measure of how much a liquid is being reduced in volume under a certain pressure. It is expected that the characteristics of the oscillations will change during a lift since the volume is dependant of the current height of the forks. The bulk modulus parameter varies by temperature and dissolved/trapped air in the system, where the latter can have a substantial effect on 10 2. Method frequency and amplitude of the oscillations. As presented in [17], for hydraulic oils with a pressure of around 50 bar, the presence of 0.5 % air reduces the bulk mod- ulus with about 10 %. If the air is 5 %, the bulk modulus is reduced by around 40 %. The force on the piston rod is given by Fr(t) = ApP (t)− Ff (2.10) where Ff is the friction force. Many ways have been presented to describe the friction force when stick-slip is of importance, for example the Tustin friction model, the Gaussian model, or the Lorentzian model [16]. However, none of the models caused the dampening effect that was seen in the measurements. By analysing the measurements it could be seen that the system is dampened more with increased speed. No tests were performed for measuring the friction or how it behaved, thus a black box approach was used. An arbitrary exponential function was created that greatly increases the friction force as the speed increases; Ff = cfcon + |ẋ(t)cfin|5cfout (2.11) The coefficients cfcon, cfin, and cfout were approximated so the friction force impacts more when oscillations occurs at high speeds. The increased force over speed curve is presented in Figure 2.7. Note that the function is only viable for a certain speed interval, as the friction force increases too much over higher speeds. This did not become a problem in the project since the speed of the cylinder never reaches the problematic areas. The piston speed is limited since it cannot increase more when full voltage is applied to the motor. 0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 Speed [m/s] 0 100 200 300 400 500 F o rc e [ N ] Figure 2.7: Friction force curve for the cylinders 2.2.6 Fork and load This section contains the masses of the construct that is being lifted, as well as the mass of the load. The mass will change over the course of a lift, since the three 11 2. Method stages of cylinders with corresponding structures adds mass when a stage shift oc- curs. Figure 2.8 shows the complete three stage construction with cylinders and fork. Figure 2.8: Construct of the frames holding the cylinders and the forks (rendered picture by Patrik Magnusson, 2020). The mass of the load is for the purpose of the simulation seen as known, but in reality you would have to derive it somehow. A way to do this could be by measur- ing the acceleration with a known constant input. With some filtering to remove any oscillations or noise, the input signal corresponds to a force that can be used in F = ma to obtain the mass. The masses are used together with the output force of the cylinder to set up a force balance equation. A friction term is showing up due to the rail construction hold- ing the fork, and is acting like an additional damper to the system. The resulting equation is mẍ(t) = Fr(t)−mg − dẋ(t) (2.12) where m is the total mass, x is the height of the forks relative to the ground, Fr(t) is the force from the piston, g is the gravitational constant and d is a frictional constant. The mass is given by m = ml +mi (2.13) where ml is the mass of the load and mi is the mass based on active stage, for i = 1, 2, 3. The stage masses are mi = [100, 145, 140]. By integrating equation (2.12), the speed of the fork can be retrieved, which is the output of the system. 12 2. Method 2.3 Parameter estimation All unknown parameters from the modelling section needs to be estimated and tuned until the simulated model behaves similar to the measurements of the AGV. The parameters to estimate are k1, k2, k3, z1, z2, z3, cfcon, cfin, cfout, β, d Instead of relying on manual trial and error estimation and simulation, an automated parameter estimation was performed. More specifically, the Simulink ”Parameter Estimation Toolbox” was used, with SSE (sum squared error) as cost function and NLS (nonlinear least squares) as optimization method. 2.3.1 Least squares estimation The toolbox formulates an optimization problem whose solution is the estimated parameters. The error between the measurements, ymea, and the simulated model, ysim, is defined as e(t) = ymea − ysim (2.14) The SSE cost function is S = Nd∑ i=1 e2 i (2.15) where Nd is the number of data points. In short, the NLS method solves the optimization problem by finding the minimum of S, that is when the gradient is zero, δS δα = Nd∑ i=1 ei δei δαj = 0 (2.16) where j = 1, ..., nd, and nd denotes the number of parameters. Since the system is nonlinear, the derivatives in (2.16) do not necessarily have a closed solution, and initial values are important. The procedure is iterated and the parameters are refined until the model is sufficiently close to the measurements. There are several methods for the optimization, and an example of an optimal recursive iterative algorithm for nonlinear least squares estimation is presented in [18]. 2.3.2 Sets of parameters The number of parameters determines how long it takes for the algorithm to find good candidates for the parameters, as more combinations are possible. Thus, the parameters were split into sets based on how dependent on each other they were. For example, the parameters of the linear function of the motor were highly independent of the parameters of the oil that influenced the frequency of the oscillation. To make the estimation more efficient, one set of parameters were first estimated while others were kept static. Then the first set was static while the rest were estimated. This 13 2. Method greatly reduced the time taken, however it might have reduced the accuracy of the model slightly. The sets were ”motor parameters”, k1, k2, k3, z1, z2, z3 and ”dynamic parameters”, cfcon, cfin, cfout, β, d 2.4 Controller design A controller could be designed once the model was derived and its parameters esti- mated. Multiple different controllers were initially considered since the existing PID on the AGV could not control the oscillations. But as it turned out, early results with the PID were promising and thus no other controllers were tested or imple- mented. However, some techniques were implemented to increase the performance of the controller. The regular PID was scheduled to linearly change its parame- ters based on the mass. It also changed its instance of one of three individually tuned PIDs based on what stage was active, effectively changing parameters based on current height in three discrete steps. An anti-windup was added to increase performance when control signals were at its limit. Finally, the effect of noise was investigated and parameters tuned thereafter. The reference sequence in Figure 2.9 was designed to test the controller over the whole operation range. Similar to the sequence that was used for measurement, it consists of fast and slow sections for the three stages. 0 20 40 60 80 100 120 140 160 180 200 Time [s] 0 0.01 0.02 0.03 0.04 0.05 S p e e d [ m /s ] Figure 2.9: Reference used for the controller evaluation 2.4.1 PID controller As claimed in [19], PID controllers are the most common way to control industrial processes. The objective is to maintain a set reference level. The error between the 14 2. Method reference and the process variable (in this case the speed of the forks) is sent to the PID where the control signal is calculated, based on the equation for the filtered PID u = e(P + I 1 s +D N 1 +N 1 s ) (2.17) where u is the control signal and e is the error. The P , I and D parameters needs to be chosen with regards to balancing settling time, overshooting and oscillatory behaviour. The PID:s were designed with a low pass filter to minimizes the impact of amplified noise by the derivative, but a consequence is added delay and longer calculations. The N parameter determines the cut off frequency of the low pass filter. The PID setup is shown in Figure 2.10. Figure 2.10: Closed loop setup for the PID 2.4.2 Scheduled PID A scheduled PID changes its parameters based on external factors. In this case the mass, m, was used to tweak the parameters in real-time. The height was measured to know what stage is active. Three PIDs were designed and seamlessly switched between based on the active stage. This allowed for individual tuning of each PID. The setup for the scheduled PID can be seen in Figure 2.11. Figure 2.11: Closed loop setup for the scheduled PID The equations for each PID are the same as in equation (2.17) but the parameters are given by Pi(m) = Pb,i + Pm,im (2.18) 15 2. Method Ii(m) = Ib,i + Im,im (2.19) Di(m) = Db,i +Dm,im (2.20) where Pb,i, Pm,i, Ib,i, Im,i, Db,i, and Dm,i are linear parameters that are tuned to change the P, I, and D parameters based on the mass, with i = 1, 2, 3 denoting the active stage. To get the values of all parameters, the PIDs were manually tuned for m = [500, 1500] kg where performance was independently evaluated for the height sections given by x = [0 : 1.5, 1.5 : 3, 3 : 4]m The x values corresponds to the height of the active stage. The result was six sets of parameters, for a total of 36 parameters. The sets were linearly fitted and could be reduced to the three equations (2.18)-(2.20) for each PID, for at total of 18 parameters describing the final scheduled PID. 2.4.3 Anti-windup A problem for the PID was when the control signal hit the upper saturation value, since the controller could not counteract the oscillations by increasing the control signal more. The anti-windup measures the differences between the control signal and the saturated signal, as shown in Figure 2.12. It is then scaled and subtracted from the integral in the PID. This allowed the controller to better counteract oscil- lations near the maximum of the control signal. Another problem was the accumulation (or windup) of integral error due to the spike that occurs when a stage shift happens. It takes time for the error to unwound, leading to a temporary error in tracking. The anti-windup solves this problem. Figure 2.12: Anti-windup added to the PID 2.4.4 Sensor noise The position sensor was affected by noise. To imitate this, a band limited white noise was added in the model, as in Figure 2.13. The level was set to 1 · 10−7 [m/s] to match the amplitude of the noise from the measurement. 16 2. Method Figure 2.13: Feedback signal distorted by noise 17 3 Results This chapter presents the result of the modelling compared to the measurements, the performance of the controller, and the impact of noise. After the parameter estimation, the model shows close resemblance to the measure- ments, where oscillations appear in a similar manner. Based on the simulations of the derived model, it is possible to remove the oscillations of the forklift with a PID controller. The performance increased slightly with the scheduled PID. The anti-windup managed to solve the problem of saturated control signal, as well as improve the tracking when sudden spikes in speed appear due to stage shifts. The results are based on the validity of all simplifications and considerations that have been made when the model was derived and parameters estimated. It is not certain that the result is transferable to a real AGV without further tests regarding robustness and validation of the model. The main part that can make it harder to remove the oscillations in reality is the time constraints. The plant needs to counter the oscillations in the time frame of the oscillations. That means that factors such as operating frequency of the controller, delay due to low pass filter in PID, and accuracy of the position sensor will affect the result. Those are factors that have not been investigated in this project. 3.1 Gathered measurements The height of the forks is shown in Figure 3.1 (a) over the time of the test run, and Figure 3.1 (b) displays a time interval where oscillations are visible. A frequency analysis was done for that time selection and the frequency spectrum of the oscil- lations can be seen in Figure 3.1 (c). The frequency of the oscillation is 2.03 Hz. There is a spike near 0 Hz that is due to the data not being successfully processed to remove the linear trend when the frequency analysis was made. For all practical purposes, that spike can be ignored. 18 3. Results 20 40 60 80 100 120 Time [s] 0 0.5 1 1.5 2 2.5 3 3.5 4 H e ig h t [m ] (a) Height of the forks during the test run 112 114 116 118 120 122 124 126 Time [s] 3.9 3.95 4 H e ig h t [m ] (b) Visible oscillations during the test run 0 1 2 3 4 5 6 Frequency [Hz] 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 M a g n it u d e [ m m ] (c) Frequency spectrum of the oscilla- tion Figure 3.1: Test run of AGV to gather measurements The speed of the forks over time can be seen in Figure (3.2), where the oscillations are visible, as well as the constant prevalence of noise. Two sections at 45-55 s and 115-125 s have ongoing oscillations and the section 70-80 s have a decaying oscil- lation. There are also hints at decaying oscillations after the changes in speed at 15-20 s and 60-65 s. The stage shifts at 40 s and 85 s can also be seen to induce some decaying oscillations. 20 40 60 80 100 120 Time [s] 0 20 40 60 80 100 S p e e d [ m m /s ] Figure 3.2: Speed of the forks during the test run 19 3. Results A time selection of a noisy section without prevalent oscillations can be seen in Figure 3.3 (a) and (b). A section with ongoing oscillations is shown in Figure 3.3 (c) and (d). What is interesting is how the oscillations for the most parts decays, but in some cases are sustained. This could hint at a slip-stick effect since the ongoing oscillations seem to reach close to zero speed in every low part of the cycle. If static friction is active and must be overcome, the extra effort can cause the system to overcompensate as a higher pressure have been built up. When the static friction releases, the piston will be slung above its set point, which coupled with a spring effect in the system can cause these ongoing oscillations. Similar behaviour is found in [9], although with a pneumatic setup. 6 8 10 12 14 16 Time [s] 60 65 70 75 S p e e d [ m m /s ] (a) Close up of noise during constant speed 11 11.5 12 12.5 13 13.5 14 14.5 15 Time [s] 64 66 68 70 72 74 S p e e d [ m m /s ] (b) Hints of oscillations with low am- plitude 44 46 48 50 52 54 56 58 Time [s] 0 5 10 15 20 25 30 35 S p e e d [ m m /s ] (c) Close up of oscillations 50 51 52 53 54 Time [s] 0 5 10 15 20 25 30 35 S p e e d [ m m /s ] (d) Oscillations slightly distorted by noise Figure 3.3: Inspection of oscillations during the test run 3.2 Model compared to measurements The validation of the model compared to the measurements is vital to be able to determine the performance when the control system is being designed. The same input sequence that was used to get the measurements was used as input for the model when validation was performed. That sequence can be seen in Figure 3.4. 20 3. Results 20 40 60 80 100 120 Time [s] 0 20 40 60 80 100 P W M Figure 3.4: Input sequence used for validation It is not necessary for the output of the model to match exactly, as long as the gen- eral behaviour of the oscillations is captured. However, a closer behaviour means the results can be trusted more, as it shows the model is capable of acting as the AGV. The simulation of the height of the forks over time is shown in Figure 3.5 with the initial manually tuned values that are presented in the ’Before’ column in Table 3.1. The response from the motor is off, as it is too slow in some sections and too fast in others. In Figure 3.6 the speed of the forks is shown and oscillations are visible. However, neither amplitude nor frequency matches. Only the level of damping is reasonably close in some sections. 20 40 60 80 100 120 Time [s] 0 1 2 3 4 H e ig h t [m ] Measured Simulated Figure 3.5: Simulated results of height of forks compared to measurements, before parameter estimation 21 3. Results 20 40 60 80 100 120 Time [s] 0 0.02 0.04 0.06 0.08 0.1 0.12 S p e e d [ m /s ] Measured Simulated (a) Speed of forks over the whole test run 46.5 47 47.5 48 48.5 49 Time [s] 0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 S p e e d [ m /s ] Measured Simulated (b) Frequency mismatch for low heights 117.5 118 118.5 119 119.5 120 120.5 121 121.5 Time [s] 0 0.005 0.01 0.015 0.02 0.025 S p e e d [ m /s ] Measured Simulated (c) Frequency mismatch for high heights Figure 3.6: Simulated results of speed of forks compared to measurements, before parameter estimation Table 3.1: Values of parameters before and after estimation Before After k1 0.00185 0.00193 k2 0.00252 0.00234 k3 0.00231 0.00660 z1 0.296 0.287 z2 0.256 0.130 z3 0.136 -0.180 cfcon 10 3.88 cfin 16 27.61 cfout 545 518.28 β 1.4 ·109 0.44 ·109 d 300 285.42 22 3. Results After the parameter estimation was performed, the simulations was much closer to the measurements, as can be seen in Figure 3.7 (a). The system responds in a similar way, where the same final height is reached when following the same input sequence. The oscillations are similar for certain regions, where the frequency matches the mea- surement, which can be seen when comparing the frequency spectrum in Figure 3.1 (c) and Figure 3.7 (c). The frequencies are 2.03 Hz in the measurements and 2.02 Hz in the simulation. It was apparent, however, that the frequency of the oscillations in the simulated model changed more when the height changed, compared to in the measurements. The speed over time can be seen in Figure 3.8, where the oscilla- tions are clearly visible. Figure 3.8 (b) and Figure 3.8 (c) shows time selections that reveals that the frequency is not constant throughout the simulation period. 20 40 60 80 100 120 Time [s] 0 0.5 1 1.5 2 2.5 3 3.5 4 H e ig h t [m ] Measured Simulated (a) Height of the forks in the simulation compared to the measurements 112 114 116 118 120 122 124 126 128 Time [s] 3.85 3.9 3.95 4 H e ig h t [m ] Measured Simulated (b) A section with matching oscillations 0 1 2 3 4 5 6 Frequency [Hz] 0 0.2 0.4 0.6 0.8 1 1.2 M a g n it u d e [ m m ] (c) Frequency spectrum of the oscilla- tion Figure 3.7: Simulated results of height of forks compared to measurements, after parameter estimation No way of tuning the parameters could result in both the same frequency and ampli- tude as the measured data at the same time. An effect of this is that the amplitude is higher than it should be. The possible reasons for this are addressed in the dis- cussion chapter. 23 3. Results 20 40 60 80 100 120 Time [s] 0 0.02 0.04 0.06 0.08 S p e e d [ m /s ] Measured Simulated (a) Speed of forks during over the whole test run 46.5 47 47.5 48 48.5 Time [s] 0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 S p e e d [ m /s ] Measured Simulated (b) Slight mismatch in frequency 118 118.5 119 119.5 120 120.5 121 Time [s] -0.005 0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 S p e e d [ m /s ] Measured Simulated (c) Frequency matches perfectly Figure 3.8: Simulated results of speed of forks compared to measurements, after parameter estimation An important remark has to do with the estimated value of the bulk modulus of the oil. This parameter was the main contributor that affected the frequency of the oscillations. An ideal hydraulic oil has a value of about 1.4 · 109 Pa but the value that gave the same frequency as the measurements was 0.44 · 109 Pa. That is 69 % less, which could be a sign of a high amount of dissolved or trapped air in the oil of the AGV. Based on [17] the amount of dissolved air in the oil is critical for an accurate bulk modulus value, where more air increases the compressibility. A lower value results in lower frequency and higher amplitude of the oscillations. If there also happens to be slip-stick effect in the cylinders, a higher amplitude of the oscillations increases the risk of the speed of the forks reaching zero, where slip-stick induced oscillations occur. Thus, a potential solution for the oscillation problem could be to better bleed the system. Ultimately, this section show that the model is not perfect but behaves similar enough to the AGV to be used when designing a control system. 24 3. Results 3.3 Controller performance Surprisingly, the model was successfully controlled by a PID to remove the oscilla- tions, in contrast to how the AGV acts in reality when controlled by a PID. The scheduled PID increased the performance, but not significantly. In general, the P and I parameters were tuned to give a rise time of about one second. The operation is not time critical and therefore it does not matter if some extra time is spent on ramping the speed if this reduces the risk of inducing oscillations. The D parameter was necessary to avoid the oscillations from diverging on higher altitudes. It is important to notice that the D parameter should be as low as possible when noise is introduced. The parameter is used to correct fast changes, but a side effect is that noise can be amplified. 3.3.1 PID controller The result of controlling the model with just P and I parameters is shown in Figure 3.9. It can be seen that the oscillations are induced when quick changes to the speed are made. For low heights (when time is under 70 s) the oscillations are dampened out, see Figure 3.9 (b). With increased height, the volume of the hydraulic system will also increase. This increases the springiness of the system making it harder to control, resulting in the diverging oscillations which can be seen in Figure 3.9 (c). The parameters used to get the result in Figure 3.9 are P = 20, I = 120, D = 0, N = 100. 25 3. Results 0 20 40 60 80 100 120 140 160 180 200 Time [s] -0.06 -0.04 -0.02 0 0.02 0.04 0.06 0.08 S p e e d [ m /s ] Simulated Reference (a) Unsuccessful control with PI 45 46 47 48 49 50 Time [s] 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05 S p e e d [ m /s ] Simulated Reference (b) Decaying oscillations on low heights 75 76 77 78 79 80 Time [s] 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05 S p e e d [ m /s ] Simulated Reference (c) Diverging oscillations on increased heights Figure 3.9: Control of system with PI To control the oscillations, the D parameter was introduced and increased until the controller could handle any starting oscillations. This result can be seen in Fig- ure 3.10 where no ongoing oscillations are present. The inclusion of the derivative parameter allowed the integral parameter to be tuned higher, resulting in a faster responding system. The parameters used to get the result in Figure 3.10 are P = 20, I = 300, D = 2, N = 100. 26 3. Results 0 20 40 60 80 100 120 140 160 180 200 Time [s] -0.06 -0.04 -0.02 0 0.02 0.04 0.06 0.08 S p e e d [ m /s ] Simulated Reference (a) Successful control with PID 44 46 48 50 52 Time [s] 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05 S p e e d [ m /s ] Simulated Reference (b) No oscillations 74 76 78 80 82 Time [s] 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05 S p e e d [ m /s ] Simulated Reference (c) Offset appeared Figure 3.10: Control of system with PID A problem that appeared is visible in Figure 3.10 (c), where there is an offset between the reference and the simulated value. This is a side effect of the control signal being saturated in combination with the integral error accumulating due to the stage shift. The result of the implemented anti-windup can be seen in Figure 3.11 where the offset is gone. 65 70 75 80 Time [s] 0.04 0.045 0.05 0.055 0.06 S p e e d [ m /s ] Simulated Reference (a) Before anti-windup 65 70 75 80 Time [s] 0.04 0.045 0.05 0.055 0.06 S p e e d [ m /s ] Simulated Reference (b) After anti-windup Figure 3.11: Offset resolved with anti-windup 27 3. Results 3.3.2 Scheduled PID The scheduled PID had the potential to perform better, but the difference turned out to be marginally. This can be seen when comparing the plots in Figure 3.12. 0 20 40 60 80 100 120 140 160 180 200 Time [s] -0.04 -0.02 0 0.02 0.04 0.06 S p e e d [ m /s ] Simulated, Scheduled Simulated Reference (a) No remarkable differences 96 98 100 102 104 106 108 Time [s] 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05 S p e e d [ m /s ] Simulated, Scheduled Simulated Reference (b) Slight difference noticed Figure 3.12: Comparison between regular PID and its scheduled variant The chance is very low that a set of static parameters are optimal for all combinations of different heights and masses. Therefore, even though in this case the scheduled PID did not increase performance by much, the option to schedule a controller can be valuable in the cases where the behaviour is more affected by changing parameters. 3.4 Effect of noise Noise was added, and the unscheduled version of the PID controller in section 3.3.1 was used, with parameters P = 20, I = 300, D = 2, N = 100. The result can be seen in Figure 3.13 where the oscillations are removed, but the noise is being magnified by the derivative term. The amplitude of the noise in the output is near the same level as the original oscillations, and thus this level is not acceptable. 28 3. Results 0 20 40 60 80 100 120 140 160 180 200 Time [s] -0.04 -0.02 0 0.02 0.04 0.06 S p e e d [ m /s ] Simulated Reference (a) Noise corrupts the tracking of reference 35 40 45 50 55 60 Time [s] 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05 S p e e d [ m /s ] Simulated Reference (b) The controller does not reach the reference Figure 3.13: Noise added to the setup with the PID With a lower D value, the oscillations came back. When instead the filter gain was increased, the effect of the noise was reduced. This is shown in Figure 3.14. The tracking is close to the reference, although slightly distorted by the noise. 29 3. Results 0 20 40 60 80 100 120 140 160 180 200 Time [s] -0.06 -0.04 -0.02 0 0.02 0.04 0.06 0.08 S p e e d [ m /s ] Simulated Reference (a) The impact of the noise is reduced 35 40 45 50 55 60 Time [s] 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05 S p e e d [ m /s ] Simulated Reference (b) Controller manages to track the reference Figure 3.14: Noise added to the PID, with increased filter constant The parameters used in Figure 3.14 are P = 20, I = 300, D = 3, N = 10000. This result shows that the model can be controlled to reduce the oscillations even when noise is present. The high value of the filter gain reduced the impact of the noise, however the simulation took longer to run. The added delay may be an issue for the on board controller of the AGV. 30 4 Discussion This chapter explains sections of the project that are important for the interpreta- tion of the results. The simulations show that it is possible to control the AGV with a PID to remove the oscillations. This is in contrast to the real AGV and multiple possible explanations are presented. The chapter begins with discussing how dif- ferent parts in the modelling could have affected the result, such as simplifications, parameter estimation, and limited measurements. Then a couple of remarks are made regarding the benefits of the MBD method. Finally, some ideas about future work are presented that would improve the reliability of the result. 4.1 Flaws in model Having an accurate model is vital since the results of the controller design are based on the legibility of the model. The fact that the oscillations cannot be matched over the whole range of operation points to a weakness in the model. There might be something of importance that has not been modelled correctly. Or it could potentially be because of some oversimplifications. 4.1.1 Simplifications in model There is a possibility that too many simplifications were made that could affect the system dynamics. First of, the effect of friction in the pump was included in the friction model for the cylinders. It was assumed that eventual effects would be captured by the parameter estimator. Secondly, the cylinder friction model is quite arbitrary and thus reliant on the parameter estimator being able to tune the friction parameters to match with the measurements. It is possible that it was not achievable. The final impactful remark is regarding the simplification of the DC- motor model. Due to the inertia of the rotor in the DC-motor and the pump there is an acceleration phase before the requested speed is reached. Thus, every time the controller changes its control signal there will be a delay before the actuator is fully affected. This dynamic behaviour was lost by simplifying the motor model to the linear model, but to what extent it affected the result is unknown. 4.1.2 Initial values As stated in the parameter estimator section, initial values are important. However, there were no method used to conclude if a initial value was good or not. The risk 31 4. Discussion is that the estimator only found local minima, thus not matching the model as close as possible. 4.1.3 Omitted parameters and phenomena There are also equations that are not as complex as they could be, for example taking into considerations changes in temperature, viscosity, internal leakage, etc. Including more variables would require more complex models but could potentially give a more accurate result. It can be speculated that the structure of the whole forklift acts as sources of absorp- tion for the oscillation, and therefore affects the characteristics.. That is a difference between the model and the real AGV, since only the lifting mechanism was modeled in this project. 4.1.4 Processing frequency A factor in the delay of the whole system is the response time of the voltage control unit. The clock speed of the processor and delay in the IO affects how fast the control signal can be given. Any delay makes it harder to control the system. The response time for the unit used in the AGV is unknown and has not been modelled, but could affect the result. 4.1.5 Overfitting Parameter estimation and verification of the model were done with the same set of measured data. Therefore, there is a risk that the model is overfitted. This means that the tuned model is working good with a specific set of measurements, but worse on other measurements. It is desirable to use multiple different sets of data when doing the tuning and validation to avoid this problem. 4.2 Strength of model based design Disregarding the obvious reason of using MBD to be able to design and test a controller, there were two other benefits of using the method in this project. The first is how possible problems can be found by inspecting the model and compare parameters to expected values. The second is how fast changes can be implemented and tested comparing to doing it in reality. 4.2.1 Revealed problems The parameter estimation chose values for the bulk modulus of the oil to match the frequency of the oscillations, but the value was lower than what was expected from an ideal oil. No other parameters were affecting the frequency. Therefore it could be suspected that the lower bulk modulus could be a result of air in the hydraulic system. Reducing the air by bleeding the system would increase the effective bulk 32 4. Discussion modulus and increase the stiffness of the system. The oscillations would then have a lower amplitude and not be as influential. It was also seen in the measurements that the oscillations started after fast changes in speed. The input signal is ramped to smoothen the transitions but it might still be aggressive enough to induce oscillations. Performance could be increased by experimenting with the appearance of the ramping. 4.2.2 Fast adjustments With the setup of the model and the controller, it is possible to adjust parameters and simulate the result in a short time that is not possible on the real AGV. This is important for the tuning of the PID since a better result can be achieved in a shorter amount of time. It is even more important if the scheduled PID was to be implemented since tuning consists of more steps. 4.3 Future work The project did what it set out to do, although the reliability of the result is lower than preferred. Therefore, more things could be done to this project in that regard. The most important areas are discussed here. 4.3.1 More tests More test runs would be beneficial, not only to avoid overfitting, but also to test different input sequences. By testing over the wider spectrum of speeds it could be possible to find out if there is a natural frequency of the system that causes or amplifies the oscillations. In that case it could be possible to avoid operating at a specific range of speeds to stop the oscillations from appearing. It would also be beneficial to gather data with the controlled system, to get addi- tional information of how the system responds. This could give insight of any delay in the controller. 4.3.2 Extended scheduling The PID was scheduled to change parameters based on mass and height. But a problem with the scheduled PID was the cumbersomeness of tuning due to the re- quirements of multiple simulations with different values of the parameters and inter- polation of the data to multiple functions. By developing a more flexible scheduling script it would make the procedure simpler and faster. This would not only improve the tuning of parameters, but also make it easier to explore more options regarding what parameters to schedule with. 33 4. Discussion 4.3.3 Implementation and verification Once a controller has been designed on a model that has been more thoroughly tested and verified, the next step is to test it on a real AGV. This would ultimately verify if the controller can control the vehicle to remove the oscillations in a similar manner as in the simulation. 4.3.4 Other controllers While the results showed that the PID was sufficient in removing the oscillations, if the verifications on the real AGV are unsuccessful, it may be time to explore other controller options. This could require the linearization of the forklift model, to allow linear controllers to be used. Or the option to use nonlinear controllers can be examined. In any case, if the behavior of the system can be predicted by having an accurate model, it will be easier to control for the oscillations comparing to the PID that is only depending on the error between the set point and the process variable. 34 5 Conclusion It is possible to remove the oscillation when lifting the forks of an AGV controlled by a PID, based on the result of the simulations and the validity of the derived model. A model of the lifting system has been created with some simplifications and as- sumptions. The difficulty of finding parameters for the motor and friction models led to simpler models being used with fewer parameters. It is unclear how much it affected the result, and thus needs further investigations. A procedure to evaluate the accuracy of the model would be helpful in this respect. The parameters of the model were estimated and tuned by a parameter estimator to match the measurements from the real AGV. Similar behaviour was achieved, although there are some concerns to note. The measurements that were used to val- idate the model are the same that were used to estimate the parameters. Therefore, the model might be overfitted. It is necessary to perform more measurements that can be used independently for estimation and verification. The model was used to design a control system. A PID controller was tuned until proper tracking was achieved. Better performance can be gained by scheduling the PID, as well as including an anti-windup scheme. When noise was added, the low pass filter coefficient was increased until the impact was reduced enough to track the reference signal properly. The result of the controller simulations looks promising, but further work needs to be done regarding verification of the model before any final conclusions can be made. 35 Bibliography [1] A. Kővári, ”Mathematical model and simulation of electrohydraulic servo sys- tems,” 2009. [2] J. Cheng, W. Liu and Z. Zhang, ”Modeling and simulation for the electro- hydraulic servo system based on Simulink,” 2011 International Conference on Consumer Electronics, Communications and Networks (CECNet), pp. 466-469, 2011. [3] M. Rahmat, S Rozali, A. W. Norhaliza, Z. Has, K. Jusoff, ”Modeling and Controller Design of an Electro-Hydraulic Actuator System,” American Journal of Applied Sciences, vol. 7, no. 8, pp. 1100-1108, 2010. [4] W. Sochacki, M. Bold, ”Damped vibrations of hydraulic cylinder with a spring- damper system in supports,” Procedia Engineering, vol. 177, pp. 41-48, 2017. [5] W. Sochacki, ”Modelling and analysis of damped vibration in hydraulic cylin- der,” Mathematical and Computer Modelling of Dynamical Systems, vol. 21, no. 1, pp. 23-37, 2015. [6] M. Saeki, Y. Ohya, E. Takano, ”Oscillations Caused by Solid Friction in a Hy- draulic Driving System (In Consideration of Friction-Velocity Characteristics of Hysteresis Curves for Increasing and Decreasing Velocity Motions),” Trans- actions of the Japan Society of Mechanical Engineers Series C, vol. 58, no. 547, pp. 910-917, 1992. [7] Y. Wang, S. Gud, H. Dong, ”Modeling and control of a novel electro-hydrostatic actuator with adaptive pump displacement,” Chinese Journal of Aeronautics, vol. 33, no. 1, pp. 365-371, 2020. [8] T. Minav, D. Filatov, V. Vtorov, L. Laurila, J. Pyrhönen, ”Self-tuning- parameter fuzzy PID speed control in an electro-hydraulicforklift,” Interna- tional Review of Automatic Control (I.RE.A.CO.), vol. 5, no. 1, 2012. [9] L. R. Tokashiki, T. Fujita, T. Kagawa, T. Ikegami. ”Stick-Slip Motion in Pneu- matic Cylinders Driven by Meter Out Circuit,” Transactions of The Japan Hydraulics and Pneumatics Society, vol. 31, no. 6, pp. 170-175, 2000. [10] S. Maheriya,P. Parikh. ”A Review: Modelling of Brushed DC Motor and Var- ious type of Control Methods,” Journal for Research, vol 1, no. 12, pp. 18-23, 2016. [11] C. Langewis Jr., C.W. Gleeson, ”Practical Hydraulics of Positive Displacement Pumps for High-Pressure Waterflood Installations,” Journal of Petroleum Tech- nology, vol. 23, no. 2, 1971. [12] J. L. Johnson. 2009, Feb 9. Modeling the hydraulic pump. Retrieved from https://www.hydraulicspneumatics.com/technologies/hydraulic-pumps- motors/article/21881099/modeling-the-hydraulic-pump 36 Bibliography [13] T. Minav, D. Filatov, L. Laurila, J. Pyrhönen, V. Vtorov, ”Modelling of an electro-hydraulic forklift in Matlab Simulink,” International Review on Mod- elling and Simulations, vol. 4, no. 8, 2011. [14] A. Josifovic, J. Corney, B. Davies, ”Valve dynamics in multi-cylinder positive displacement pump model,” Advanced Intelligent Mechatronics (AIM), 2015 IEEE International Conference, pp. 35–41, IEEE, 2015. [15] Z. Pandula, G. Halász, ”Dynamic model for simulation of check valves in pipe systems,” PERIODICA POLYTECHNICA SER. MECH. ENG., vol. 46, no. 2, pp. 91–100, 2001. [16] L. Marton, B. Lantos, ”Modeling, Identification, and Compensation of Stick- Slip Friction,” IEEE Transactions on Industrial Electronics, vol. 54, no. 1, pp. 511-521, 2007. [17] D. Knežević, A. Milašinoviü, Z. Milovanovic, V. Saviü, ”Analysis of changes of bulk modulus of mineral oil - effects on the dynamic behaviour of hydraulic actuators,” presented at the 12th International Conference on Tribology, Kragu- jevac, Serbia, 11 – 13 May, 2011. [18] G.Haupt, N. Kasdin, G. Keiser, B. Parkinson, ”An optimal recursive itera- tive algorithm for discrete nonlinear least-squares estimation,” presented at the AIAA Guidance, Navigation, and Control Conference, Baltimore, MD, 7 - 10 August, 1995. [19] T. L. Blevins, ”PID Advances in Industrial Control,” IFAC Proceedings Vol- umes, vol. 45, no. 3, pp. 23-28, 2012. 37 List of Figures List of Tables Introduction Background Scope and Limitations Literature review Outline of thesis Method Analysis of the AGV Information of the AGV Measurements Modelling of components Voltage control unit Motor Pump Valve Cylinder Fork and load Parameter estimation Least squares estimation Sets of parameters Controller design PID controller Scheduled PID Anti-windup Sensor noise Results Gathered measurements Model compared to measurements Controller performance PID controller Scheduled PID Effect of noise Discussion Flaws in model Simplifications in model Initial values Omitted parameters and phenomena Processing frequency Overfitting Strength of model based design Revealed problems Fast adjustments Future work More tests Extended scheduling Implementation and verification Other controllers Conclusion Bibliography