• No results found

Study on Low Voltage Power Electronics Used for Actuator Control

N/A
N/A
Protected

Academic year: 2021

Share "Study on Low Voltage Power Electronics Used for Actuator Control"

Copied!
90
0
0

Loading.... (view fulltext now)

Full text

(1)

Study on Low Voltage

Power Electronics Used for

Actuator Control

(2)

Study on Low Voltage Power Electronics Used for Actuator Control

Oskar Kleback LiTH-ISY-EX–17/5030–SE Supervisor: Kent Palmkvist

isy, Linköpings universitet

Patrik Härdner

Volvo CE

Robert Eriksson

Volvo CE

Examiner: Kent Palmkvist

isy, Linköpings universitet

Avdelningen för Datorteknik Department of Electrical Engineering

Linköping University SE-581 83 Linköping, Sweden Copyright © 2017 Oskar Kleback

(3)
(4)
(5)

The aim of this thesis is to understand the current implementation, how differ-ent hardware and output frequency affects the hydraulic actuators in the currdiffer-ent platform and Then an improve the controller should be presented. This needs to be both faster then the current controller and should not use more CPU recurses then necessary.

With the understanding of current controller, three new regulators where imple-mented and tested. One uses a PI regulator and the other two uses an adap-tive algorithm to generate the control signal. All where faster than the current one and the PI-implementation uses the lowest amount of CPU recurses, on the other hand this needs to be calibrated for the different hardware and output fre-quency’s. The two adaptive controllers requires a higher amount of CPU recurses, instead it requires less calibration to work.

(6)
(7)

First I would like to thank Robert Eriksson and Patrik Härdner to let me do my thisis work at Volvo CE. Thank you to my examiner Kent Palmkvist for making this thesis possible. My friend and opponent, Dapeng Han for been patient he have shown me.

And a great thanks to my family and especially to my fiancée Maria Jönsson. Stockholm, April 2017

Oskar Kleback

(8)
(9)

Notation xi 1 Introduction 1 1.1 Background . . . 1 1.2 Problem Description . . . 2 1.3 Methodology . . . 2 1.4 Limitations . . . 2 1.5 Thesis Outline . . . 2 2 Theory 5 2.1 Power Electronics . . . 5 2.1.1 Buck converter . . . 6 2.2 Signal Processing . . . 9 2.2.1 System Identification . . . 9

2.2.2 Correlation- and Spectral Analysis . . . 10

2.2.3 Linear and nonlinear black-box model . . . 11

2.2.4 Adaptive Algorithms . . . 13

2.3 Control Theory . . . 17

2.3.1 PID controller . . . 18

2.3.2 Conversion from continuous- to discrete-time . . . 19

3 System Description 23 3.1 Actuator . . . 24

3.1.1 Mathematical model . . . 24

3.1.2 Electrical model . . . 25

3.2 Electrical Control Unit (ECU) . . . 26

3.2.1 Electronics . . . 27 3.2.2 Identification . . . 28 3.2.3 Modelling . . . 31 3.3 Data collection . . . 34 4 Implementation 35 4.1 Current Controller . . . 35 ix

(10)

4.2 PI controller . . . 37

4.3 Diagnostic . . . 39

4.4 Different Controllers . . . 42

4.5 Self-Tuning Controller . . . 44

4.5.1 Bányász/Keviczky PID Controller . . . 44

4.5.2 Dahlin PID Controller . . . 46

4.5.3 Simulations . . . 47

5 Results 51 5.1 Comparing Dahlin and Bányász/Keviczky . . . 51

5.1.1 Parameter Estimation . . . 51

5.1.2 Ramp Response . . . 56

5.1.3 Step Response . . . 59

5.2 Comparing STC’s with the old regulator and PI regulator . . . 62

5.2.1 Step Response . . . 62

5.2.2 Ramp Response . . . 64

6 Conclusion and Future work 67 6.1 Conclusions . . . 67 6.1.1 PI-controller . . . 67 6.1.2 Self-tuning controller . . . 67 6.2 Future Work . . . 68 A Figures 71 Bibliography 77

(11)

Förkortningar

Förkortning Betydelse

AC Alternating current

ARX Autoregressive model

ARMAX Autoregressive Moving-average model

bat Battery voltage

BJ Box Jenkins model

CAN Controller Area Network

DC Direct current

gnd Zero voltage

LQ Linear–quadratic regulator

pid Proportional, integral, differential (regulator)

PWM Pulse width modulation

OE Output error model

RLS Recursive Least Square STC Self-tunning controller

t.u. Time unit

(12)
(13)

1

Introduction

This master thesis has been carried out at Volvo Construction Equipment (Volvo CE) in Eskilstuna during the period from 20 of January, 2014 to 30 of June, 2014. Volvo CE is a subsidiary of Volvo AB, focusing on development and manufac-turing of Wheel loaders, Excavators, articulated haulers and others construction equipment. They have manufacturing in Sweden, France, Germany, China, Brazil, Mexico, South Korea, India, USA and Poland.

1.1

Background

Each new generation of construction machinery that is rolled out onto the mar-ket is characterized by an increasing amount of functionality being realized by electronic hardware and software governing mechanical systems.

One key example is PWM control. The PWM control is frequently used to ac-tuate solenoids used in pumps and valves typically found in gearboxes and also the major hydraulic systems used in construction equipment. The PWM control hardware today consists of a limited number of hardware components. It is un-clear if they have an optimal design when it comes to calculating/controlling the power output. The output power needs to be accurately calculated but still it can-not use too much processing power. The currently used approximation of electric current is very quick but unfortunately not very accurate. The products are now suffering drawbacks due to the current rough PWM control strategy.

(14)

1.2

Problem Description

The current control strategy described in section 1.1 is rough but can handle different loads without much effort and drops on the battery voltage. There are properties that need to be converted to the new strategy. Also the new strategy should be more robust and hopefully faster than the current strategy. The new implementation shall also be able to handle different fault cases to signal to the application that something is wrong.

The goal for this new controller is the following, but is not necessarily limited to: • To have a steady state error of max 1 mA.

• To have a maximal overshoot of max 5% of requested current.

• To have a settling time of at most 20 t.u. within 5 mA of the requested current.

• To detect an open circuit, short to GND, above requested- and below re-quested current.

1.3

Methodology

First a literature study is done to get an understanding of power electronics and control theory. This is to get an knowledge of how to implement a first prototype control strategy to evaluate against the current one.

This prototype was implemented using a PI regulator. Then the algorithm is optimized for different actuators and different sample times.

Then a new literature study is preformed to get an understanding about how adaptive algorithm works and how to implement the diagnostics.

Then a more advanced algorithm is implemented to be able to adapt to the differ-ent actuators and/or differdiffer-ent sample rates.

1.4

Limitations

The hardware is fixed but suggestions can be made to improve the algorithm. The PWM frequency is limited to 500 Hz and the control algorithm can be schedule to run every 1,2 or 4 t.u. limiting the sample of the output from the actuator to the 200,100,50 Hz respectively.

1.5

Thesis Outline

• The introduction is in this chapter 1

(15)

• The description of the hardware and software platform used in this thesis is covered in chapter 3

• The implementation of the new controller and the diagnostics is covered in chapter 4

• The result from the different implementations is covered in chapter 5 • The conclusions that can be drawn from the work and future improvements

(16)
(17)

2

Theory

This chapter will present the necessary background theory for this thesis. In section 2.1 theory behind power converter will be discussed. The main part of section will be about step-down (buck) DC-DC converters. Most of the theory was collected from the book Power Electronics [12], which is commonly used in research as a reference. Understanding of the control theory for power electronics has been concluded from research articles.

In section 2.2 theory behind signal processing will be discussed. The main part of this section will be about system identification and system estimation. Most of this theory is gathered from two books, Signal processing [10] and Modellbygge och Simulering [11]. The books are the course books in two advance courses at Linköping’s University.

In section 2.3 control theory is described. The main part will be about PID-controllers both in the continuous- and discrete- time domain. Most of the theory is gathered from two books, Reglerteknik [8] and Reglerteori [7]. Both are course books in two courses at Linköping’s University. The section about the conversion from the time continuously domain to the time discrete domain is gathered from Digital Self-tuning Controller [2].

2.1

Power Electronics

The power electronics system handles the transformation from the input voltage Vi and input current Ii to either producing a higher or lower output voltage Vo

and output current Io. It can also handle the transition from AC to DC, DC to

AC, AC to AC and DC to DC making the power electronics a highly interesting

(18)

research area. Increase efficiency for the transformation in for example solar cells that produce a DC voltage and needs to be converted to AC before going out in the power network is a hot research topic.

Battery Filter Converter Load

Figure 2.1:General block diagram of a power converter.

There are two main topologies that are used when designing power electronics for DC-DC, the buck converters that step-downs or reduces the input voltage and the boost converter that step-ups or increases the input voltage. Then there is a combination of the two when both step-down and step-up is needed. In figure 2.1 a general block diagram of a power system can be found.

In any converter there is always one or more switch/switches (transistor) and diode. These are used to control the transformation from the input to the output. Because of this a controller is needed, its task is to make the output follow a ref-erence as precisely as possible. This is done by opening and closing the switch. The purpose of the diode is to discharge the inductance and capacitance that also is needed to complete the converter when the switch is in its off state. The sim-plest technique that can be used to produce this is the Pulse-Width Modulation (PWM). The control signal has a fixed pulse-width that is split into two states, a one ”on” state and one ”off” state. The ratio between the on and of the on state, which is a fraction of the total pulse width is called the duty cycle.

2.1.1

Buck converter

The buck converter is used to produce a lower output voltage than the input voltage. In figure 2.2 of the buck converter can be seen. The converter can simply be described by equation 2.1, if the switch and diode is ideal and a resistive load is used. Where D is the duty cycle, Tsis the time period of the total pulse and tonis

the time when the switch is closed. Equation 2.1 is only used in the continuously conducting mode.

(19)

Vo = Ts Z 0 v0(t)dt = 1 Ts ( ton Z 0 Vi(t) + Ts Z ton 0dt) = ton Ts Vi = DVi (2.1)

Continuous Conducting Mode

The converter can work in two modes; continuous conducting, discontinuous con-ducting and also in the boundary between the two. In the continuous mode the current always flows through the inductor. During the time period when the switch is on, the current (IL) flowing through the inductor L, rises with the slope

dIL dt =

ViVo

L , during the on time period the total amount the current will increase

according to equation 2.2a. And during the off time period the decreases with the slope dIL

dt =

Vo

L and the total decreases of the current can be described

ac-cording to equation 2.2b. When the switch is turned off the current stored in the inductance will now flows through the diode instead.

IL+= ViVo L ton= ViVo L DTs (2.2a) ∆IL−= −Vo L toff= −Vo L (Tston) = −Vo L (1 − D)Ts (2.2b)

(20)

Using this information from equation 2.2, together with the knowledge that the converter is used in the steady state (the integral of the inductor voltage vL is

zero over one time period) and figure 2.3 we get (2.3). It can be shown that equation 2.4 holds, but only in the continuous conduction mode. Also in the steady state the average current over the capacitor is zero, for a discussion on this read Chapter 3, Section 3-2-5-1 in [12]. This will make the output current Io

equal to the average inductor current IL.

IL++ ∆IL= 0 ⇒ DVi = VoD = Vo Vi (2.3) Pi = PoIiVi = IoVoIo = DIi (2.4) Discontinuous-Conducting Mode

If the ton is too short to charge the inductor L with enough energy to output

current during the whole tof f time period the converter is said to work in

discon-tinuous conducting mode.

Figure 2.4:The current and voltage over the inductance for a time period. The waveform for the inductor current can be seen in figure 2.4. Now when the inductor current is zero for a time a new variable ∆1is needed, it is the fraction

(21)

through the inductor. This will change the total decreases in the current during the off period to ∆I−

L =

Vo

L ∆1Ts. Using this in equation 2.3 results in equation 2.5.

IL++ ∆IL−= 0 ⇒ ∆1=

ViV0

V0

D (2.5)

To calculate the average output current (Io), the peak value of the iL is needed.

From figure 2.4 it can be shown that iL = VLo∆1Ts using this the average output

current can also be calculated using figure 2.4. Then it can be expressed accord-ing to equation 2.6 [13]. Io = iL D + ∆1 2 = Vo L ∆1Ts D + ∆1 2 (2.6)

2.2

Signal Processing

Based on the previous section 2.1 and together with the circuit diagram in fig-ure 2.2 a good assumption of the transfer function of the buck-converter can be found. This transfer function can then be used to generate a good control law by following the theory in section 2.3. This is in theory all that is needed to gen-erate a good controller. In practice there are problems with differences in the components values that can complicate thing. The components also change with temperature and time. To find a understanding how the model of the system. To do this doing a system identification can be done.

2.2.1

System Identification

To produce an accurate model test data is needed, this is based on the observation of the input/output relationship. To get the best data for the system identifica-tion, no correlation between the input and output is needed. To achieve this the regulator needs to be disabled and the input controlled manually. However this will not be discuses, because this is not needed in this thesis.

The first problem that needs to be solved is what input should be used. The input needs to effect all parts of the system, change fast enough to show the fastest time constant in the system as well as what happens after the transient response don’t effects the system any more. The input also needs to be within the range of the systems operation limits so the system is not damage. If the input can’t be controlled directly then small changes to the set point can be used to generate good input/output or measurements of the disturbance over a longer time. Another problem that needs to be addressed is which techniques to use. There are a few to choose from, all with different strengths and weaknesses. There are two main parts of the system identification, correlation- and spectral analysis pre-sented in section 2.2.2 and black box modeling (or gray box modeling) prepre-sented in section 2.2.3.

(22)

2.2.2

Correlation- and Spectral Analysis

The correlation analysis and spectral analysis is an algorithm to estimate the transfer function of the system based on the frequency response form the identi-fication process. The data is transformed from the time domain to the frequency domain. From input(s) and outputs(s) frequency spectrum(s) the transfer func-tion(s) frequency spectra(um) can be calculated. This method only produce a graph of the spectra and other algorithms are needed to create a model that is possible to simulate, but it gives an understanding of how different frequencies are affected by the system or can be used to estimate the number of pols and zeros in section 2.2.3.

The algorithm works in the following way. First calculates the estimated covari-ance function ( ˆRNu and ˆRNy) for both the input and output. Secondly calculate

the estimated cross-covariance function ( ˆRNyu) for the input/output. This is done

in according to equation 2.7. These functions are based on the time discrete Fourier transform. From these function the spectral estimation ˆΦcan be calcu-lated. These can be found in equation 2.8. Combining these produce a transfer function can be estimated using equation 2.10.

ˆ RNu(k) = 1 N N X t=1

u(t + k)u(t) (2.7a)

ˆ RNy(k) = 1 N N X t=1 y(t + k)y(t) (2.7b) ˆ RNyu(k) = 1 N N X t=1 y(t)u(t − k) (2.7c)

The covariance function is a function that describes how much the signal follows older values of itself. For the input this is not really interesting if the signal is not random, it is more interesting for the output. The cross-covariance function describes the output depends on older values of the input. The results gives an understanding of how the system reacts.

The spectral estimation describes the frequency components of the signal, both the amplitude and phase. This gives information on how the system reacts to

(23)

different frequencies and this is crucial in the design of the regulator. ˆ ΦNu = γ X k=−γ ωγ(k) ˆRNu(k)eiωk (2.8a) ˆ ΦNy = γ X k=−γ ωγ(k) ˆRNy(k)eiωk (2.8b) ˆ ΦNyu = γ X k=−γ ωγ(k) ˆRNyu(k)eiωk (2.8c)

Here the ωγis a window function that creates an average over the closest

frequen-cies using a gain that reduce depending on the window length γ. There are a lot of different window functions; the one that is commonly used is the Hamming window which is defined according to equation 2.9.

ωγ(k) =

( 1

2(1 + cos(πkγ )) |k| < γ

0 |k| > γ (2.9)

The window length is a design variable where different values give a different re-sult. A higher value gives a more “noisy” spectrum and lower can hide resonance spikes. Using the results from equation 2.8 gives the estimated transfer function in equation 2.10. ˆ GN(iω) = ˆ ΦyuN(k) ˆ ΦNu(k) (2.10)

2.2.3

Linear and nonlinear black-box model

This section will discuss some of the linear black-box models and one type of the nonlinear black box models will also be discussed. The black box model are used when the dynamics of the system cannot be analytical analyzed. There are different models that can be used and the difference of the model is how the dynamics of the input and disturbance is model. The different models are ARX, ARMAX, BJ and OE. The block graphs of the different models can be seen in figure 2.5.

The different components of the models are described according to Ljung and Glad [11] is: A(z) = 1 + a1z1 + a2z2 + . . . + anzn (2.11) B(z) = 1 + b1z −1+ b 2z −2+ . . . + b mzm (2.12)

(24)

B e u 1 y 1 A (a)ARX B F e u 1 y 1 (b)OE B e u C y 1 A (c)ARXM B F e u C D y 1 (d)BJ

Figure 2.5:The current and voltage over the inductance for a time period.

C(z) = 1 + c1z1 + c2z2 + . . . + ckzk (2.13) F(z) = 1 + f1z1 + f2z2 + . . . + fizi (2.14) D(z) = 1 + d1z1 + d2z2 + . . . + djzj (2.15) Equation 2.11 is used when the disturbance and input are affected by the same dynamic. This is the case when the disturbance is introduced “early” in to the system. Equation 2.12 is how the system reacts to the input. The equation 2.13 is how the system reacts to disturbance. Equation 2.14 and equation 2.15 are used instead of equation 2.11 if there are differences how the system dynamics reacts to the input and the disturbance.

The differences in the model structure are used for different things, if the model will describe the position of a rocket a more advanced model is needed compared to how the height of a water tank. The problem is to choose the right model for the problem. When the model is chosen the numbers of parameters that are necessary to describe the system is needed to be decided.

If some understanding of the system can be used to decide the order of the differ-ent transfer functions else some kind of algorithm can be used to find the right order. This can be done with correlation- and spectral analysis together with understanding of how the poles and zeros affect the frequency spectra.

(25)

coef-ficients for the model. Using data from a system identification process together with an adaptive algorithm the best coefficients can be found. There are many different adaptive algorithms that can be used for this problem. Some of these are presented in section 2.2.4, they are limited to linear regression. The linear re-gression algorithm uses a parameter- (θ) and rere-gression vector (ϕ), for the simple ARX model the vectors is described in equation 2.16.

θ =                                   a1 a2 .. . an b1 b2 .. . bm                                   ϕ(t) =                                   −y(t − 1)y(t − 2) .. .y(t − n) u(t − 1) u(t − 2) .. . u(t − m)                                   (2.16)

More advance techniques are used to describe a model if the system is not static. These are using neural networks but that is to fare away from the theory that is needed in this thesis. The simplest solution is instead of using the same model for the whole dynamic range of the system. A more realistic approach is to use different models that is more accurate in one smaller part of the system. This is practical if there is a few different gains/time constant, making it practical to use in simulations and when to create the controller.

2.2.4

Adaptive Algorithms

There are many different techniques that can be used in adaptive algorithms; this thesis will only present the ones that are able to be implemented as a recursive function. This restriction is because of that they will be used in a real time system that doesn’t have the computation time or the memory resources to generate a system estimation based on too old information.

The basic problem that the estimation tries to solve is to find the smallest error between the model estimation and the real signal. This can be achieved in differ-ent ways for example finding the minimum sum of the square prediction error or if there are more than one output or input some quadratic norm of the vector pre-diction error (this is not further discussed as this thesis is only will examine single input single output systems). The prediction error is defined in equation 2.17a.

ε = y(t) − ˆy(t, θ) (2.17a)

y(t) = ˆy(t) + e(t) = ϕT(t)θ + e(t) (2.17b)

In the following sections, two different algorithms will be described is taken from [10]. These will estimate the parameter vector using the regression vector for

(26)

example the one presented in equation 2.16 and the current output using equa-tion 2.17b. The different between the two algorithms is that the Kalman filter is a more general the Recursive Least Square. It has been shown that the recursive least square algorithm is a special case of the Kalman filter.

Recursive Least Square (RLS)

The RLS algorithm tries to minimize the criteria defined in equation 2.18. Where λ are called the forgetting factor, that is a number between 0 < λ ≤ 1. This factor is used to put more weight to newer samples in the estimation. The algorithm tries to minimize the cost function equation 2.18b.

ˆ θ(t) = min Vt(θ) (2.18a) Vt(θ) = t X k=1 λt−kε(k)2= t X k=1 λt−k(y(k) − ϕT(k)θ)2 (2.18b)

If the square is completed for equation 2.18b (which is called the loss function),the result is equation 2.19. Now two new functions R(t) and f (t) that is defined in equation 2.20 and equation 2.21.

Vt(θ) = t X k=1 λt−k(y(k) − ϕT(k)θ)2= = t X k=1 λt−ky(k)2−T t X k=1 λt−kϕ(k) + θT( t X k=1 λt−kϕ(k)ϕT(k))θ = (2.19) = t X k=1 λt−ky(k)2+ (θ − R(t)−1f (t))TR(t)(θ − R(t)−1f (t)) − f (t)TR(t)−1f (t) R(t) = t X k=1 λt−kϕ(k)ϕT(k) (2.20) f (t) = t X k=1 λt−kϕ(k)y(k) (2.21)

Equation 2.20 is a quadratic form and will there for be at least positive semidef-inite. To have the second equality in equation 2.19, equation 2.20 needs to be strictly positive-definite, this is true if there is enough information about the system in input/output to describe the whole system. This will be true if the identification of the system has been done properly.

(27)

To minimize the equation 2.19 it is the second term that is needed to become zero. This results in a new cost function.

minV (θ) = ˆθ = R−1(t)f (t) (2.22)

To be able to calculate ˆθ recursively equation 2.20 and equation 2.21 needs to be rewritten into equation 2.23. One more problem is that the matrix inversion in equation 2.22 has a cubic complexity based on the numbers of the parameters. The solution is to update R−1(t) instead of R(t). This is done by rewriting equa-tion 2.23 as a funcequa-tion of R1

(t − 1) and ˆθ instead and the use the matrix inversion lemma [A + BCD]1 = A1 A1 B(DA1 B + C1 )−1 DA1

. The resulting equation can be found in equation 2.24. Where P (t) = R−1(t)

R(t) = λR(t − 1) + ϕ(t)ϕT(t) (2.23a)

f (t) = λf (t − 1)ϕ(t)y(t) (2.23b)

P (t) = R−1(t) (2.23c)

ˆ

θ(t) = R−1(t)f (t) = . . . = ˆθ(t − 1) + P (t)ϕ(t)(y(t) − ϕT(t) ˆθ(t − 1)) (2.23d)

Using equation 2.23c in equation 2.23a an updating scheme for the P (t) matrix is achived that looks like equation 2.24.

P (t) = R−1(t) = 1

λ(P (t − 1) −

P (t − 1)ϕ(t)ϕT(t)P (t − 1)

λ + ϕT(t)P (t − 1)ϕ(t) ) (2.24)

The whole RLS algorithm is present in equation 2.25. To get the best result differ-ent values for λ is needed to be tested.

K(t) = P (t − 1)ϕ(t) λ + ϕT(t)P (t − 1)ϕ(t) (2.25a) P (t) = 1 λ(P (t − 1) + P (t − 1)ϕ(t)ϕT(t)P (t − 1) λ + ϕT(t)P (t − 1)ϕ(t) ) (2.25b) ˆ θ(t) = ˆθ(t − 1) + K(t)(y(t) − ϕT(t) ˆθ(t − 1)) (2.25c) Kalman Filters

The Kalman filter tries to estimate the state of a system where the dynamics are known, but the state is not known or uncertainty. One example of this can be to estimate the position for a body using the knowledge of the speed and maybe the acceleration. The laws of physics describe how the speed and acceleration affects

(28)

the body from the knowledge of the start value an estimation of current position is possible.

Often in these types of problems there is some noise in the measurement of the speed and acceleration, this causes an uncertainty in the estimation. This can be described by equation 2.26. The A and C are the system description and ˆx(t) is the state of the system, w(t) is the process noise and v(t) is the noise from the measurement.

x(t + 1) = Ax(t) + w(t)

y(t) = Cx(t) + v(t) (2.26)

If the process/measurement noise cannot be measured it can be seen as a stochas-tic process that have a mean value of 0 and varies with a value σ . The Q is a covariance matrix of the process noise and R is the covariance matrix of the mea-surement noise. The uncertainty of the start value is presented in P (0) and the start value is given in state x(0). These are used in the Kalman estimation that is presented in equation 2.27 this is presented in [9].

ε(t) = y(t) − C ˆx(t − 1) (2.27a) S(t) = CP (t − 1)CT + R (2.27b) K(t) = P (t − 1)CTS−1(t) (2.27c) ˆ x(t) = ˆx(t − 1) + K(t)ε(t) (2.27d) P (t) = P (t − 1) − K(t)CP (t) + Q (2.27e)

This can only be used if the state space model is known. One thing that can be done about that is to assume that the variations in the parameters are a random walk process that can be estimate using the following equation 2.28.

θ(t + 1) = θ(t) + w(t)

y(t) = ϕT(t)θ(t) + e(t) (2.28)

Comparing equation 2.26 and equation 2.28 shows that the matrix A = I and the vector C = ϕ(t). Then equation 2.27 can be rewritten into equation 2.29. According to [10] the matrix R can be set to one without loss of generality, if it is a scalar measurement.

(29)

ε(t) = y(t) − ϕT(t)θ(t − 1) (2.29a) S(t) = ϕ(t)P (t − 1)ϕT(t) + 1 (2.29b) K(t) = P (t − 1)ϕ(t) S1(t) (2.29c) ˆ θ(t) = ˆθ(t − 1) + K(t)ε(t) (2.29d) P (t) = P (t − 1) − K(t)ϕT(t)P (t − 1) + Q (2.29e)

2.3

Control Theory

The goal of the control theory is to make a system follow one or more references signals r(t), this is achieved by calculating one or more input signals. To calcu-late this input signal a more or less complex model of the system is used. A general block diagram of a single input single output (SISO) system can be seen in figure 2.6. System y u r Control Block F r Control Block F y Controller

Figure 2.6:A block diagram of a feedback control system.

The first block named Fr is a controller for the input reference it can either be

used to convert the reference signal from one unit to another (for example pres-sure to current) or filter the input to reduce a big change in the reference value it have three different smaller steps resulting in a smother change that reduces the overshoot of the actual controller. Then controller named Fyis the controller

that is designed to make the output follow the reference. Then there is the system that is controlled.

Based on knowledge about the time constants and gains of the system ether a transfer function or a state space model of the system can be acquired. These can then be used to tune the control algorithm to produce an input that minimizes the feedback error e(t) = r(t) − y(t) where y(t) is the feedback output signal from the system. There are different algorithms that do this; the PID controller is a simple algorithm that uses old values of the error and some gain constants to produce a input or the LQ algorithm that uses a state space model of the system to produce an optimal input(s).

During this thesis a time discrete PID algorithm will be use; the theory will first describe time-continuous PID controllers and then describe how these theories can be used in the time-discrete case.

(30)

2.3.1

PID controller

The PID controller uses equation 2.30 to generate the input. The different pa-rameters are named after their respective part. The KP is called the Proportional

gain, KI is called the Integral gain and KD is called the Derivative gain. There

are some different variations of the PID controller. Using the Laplace transform the PID control function can be written according to equation 2.31. The Laplace transform will describe how the system reacts to different frequencies. This gives an understanding which frequency that will be suppressed or increased. This is critical when the input is a sinus wave.

u(t) = KPe(t) + KI t Z t0 e(τ)dτ + KD de(t) dt (2.30) U (s) = (KP + KI s + KDs)E(s) (2.31)

The different parameters affect the system in different ways. This list tries to explain what the different parameters do [8].

KP this parameter reacts to the changes in the system and tries to compensate

for these changes.

KI this parameter tries to compensate for the differences in the reference and the

feedback, to do this over time with the help of the integral. This can be-come problematic if the integral bebe-comes too big and makes the controller unstable and starts to oscillate.

KD this parameter tries to predict the coming differences in the reference and

the feedback based on the slope of the changes. This will make the system more stable. If the signal is noisy a filter can be needed for this parameter. The goal of the controller is to follow the reference as good as possible as fast as possible. These two goals are often not compatible. The problem is that different values on the parameters gives the controller different qualities. If a fast system is required, one most accept that the output can overshoot the reference value, and if the system needs to handle overshoots then one must accept that the system cannot reach the reference value in one or two samples. These differences are presented in figure 2.7. One problem is to fine the optimal parameters that for files all the demands on the controller.

One thing that is needed to be taken into account when creating the controller is to test how it reacts to disturbance. This can be done practical in simulations. Using a random number source that is added to the output can represent the measurement noise, and the see how different values change the dynamics. Or it can be a sinus wave with some frequency and amplitude.

(31)

0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 slow PID fast PID reference

Figure 2.7:Two different PIDs one faster and one slower controlling a second order system.

2.3.2

Conversion from continuous- to discrete-time

In a computer system that works in discrete time with static values between two sample times needs to use a discrete PID instead of continuous PID discussed in the previous section. This is because both the integral and derivative cannot be used in discrete time. This means that there are some differences between contin-uously and discrete time PID, these can if the sample time is small be ignored. In the continuously derivate case can be approximated with equation 2.32 and the integral can be approximated with three different versions [2]. The first called forward rectangular method (FRM) and it assumes that the sampled signal is constant from the previous sample e[t − 1] to the next after the sample period T0.

This results in the equation 2.33.

d(e(t)) dte[t] − e[t − 1] T0 (2.32) t Z 0 e(τ)dτ ≈ T0 t X i=0 e[i − 1] (2.33)

The second is called backward rectangular method (BRM) and it assumes that the sampled signal is constant from the current sample e[t] to the previous sample period T0. This results in the equation 2.34.

(32)

t Z 0 e(τ)dτ ≈ T0 t X i=0 e[i] (2.34)

The third is called trapezoidal method (TRAP) and it assumes that the signal is a straight line between the current sample and the previous sample. This results in the equation 2.35. The TRAP method is the best but also requires the most memory and computation it needs to remember two samples and also a division compared to the FRM and BRM.

t Z 0 e(τ)dτ ≈ T0 t X i=0 e[i] − e[i − 1] 2 (2.35)

A continuously transfer function can also be transformed to a discrete transfer function using the three different transformations. These three can be deducted from the FRM, BRM and TRAP methods discussed before or they can be deducted from these definitions in equation 2.36 are taken from [6]. They all transform the variable s in the Laplace transform, resulting in a discrete frequency transfer function. s = 1 − z1 z1 T0 (2.36a) s = 1 − z1 T0 (2.36b) s = 2 T0 1 − z1 1 + z1 (2.36c)

One more problem that occurs when the input needs to be limited, the problem is that integral term can grove toward infinity. This can be fixed by taking the difference between the input and the previous sample ∆u[t] = u[t] − u[t − 1] this gives equation 2.37 if BRM is used. Then the new input in this way: u[t] =

(33)

u[t] = u[t] − u[t − 1] = =(KPe[t] + KIT0 t X i=0 e[i] + KD e[t] − e[t − 1] T0 )− −(KPe[t − 1] + KIT0 t−1 X i=0 e[i − 1] + KD e[t − 1] − e[t − 2] T0 ) = =/ t X 0 e[t] = e[t] + t−1 X 0 e[t − 1]/ = =KP(e[t] − e[t − 1]) + KIT0e[i] + KD

e[t] − 2e[t − 1] + e[t − 2]

T0

(2.37) Equation 2.37 can become a lot smaller if it is rewritten. Collecting all the param-eters that affects the same error samples. Then equation 2.37 can be rewritten to equation 2.38.

To get an easier formula for the implementation, collecting all the parameters that affect the different error samples. Then equation 2.37 can be rewritten to equation 2.38.

u[t] = q0e[t] + q1e[t − 1] + q2e[t − 2] + u[t − 1] (2.38)

The complete values can be found in table 2.1.

q0 q1 q2 PID KP + KIT0+ KTD0 −KPKD T0 KD T0 PI KP + KIT0 −KP 0

(34)
(35)

3

System Description

This chapter will present a how the actuator behaves and can be described. It will also describe the current implementation of the controller to get a comparison of the implementation done by this thesis.

The actuators that have been studied during this thesis can be seen in figure 3.1. The two small black ones are the same except the age (the one without the red block is the oldest one) and the red block is the connection to the hydraulic. These are solenoid actuators and are described in section 3.1. The in section 3.2.1 the electrics platform is described and the system transfer function is presented.

Figure 3.1:Three actuators that were used to test the software implementa-tion.

(36)

3.1

Actuator

These sections will disuse how a actuator works and how to model it.

3.1.1

Mathematical model

In figure 3.2 a cross section of an actuator is shown. It consists of a coil, a plunger and a spring.

Figure 3.2:A cross section of an actuator. Taken from [14].

The coil will produce a magnetic force when a voltage (and current) is applied over it. This will affect the plunger producing a mechanical force that is used to control the hydraulic pressure. The pressure is used to shift gears or other application. The approximate mechanic force of a regular solenoid actuator can (according to [3]) be written in the following equation 3.1.

Fm(x) = µ0N2S2∗ I 2

4x2 (3.1)

Where S is the “active” area between the plunger and the coil, N is the number of turns of the coil, I is the current going through the coil and x is the length of the air gap between the plunger and the coil. The spring also produces a force that has an opposite force resulting in a total force that is described in equation 3.2, where l is the length of the spring from it is equilibrium.

Ftot = FmFs= Fmkl = µ0N2S2∗

I2

4x2 −kl (3.2)

This is the basic dynamics of the actuator and could be used to control pressure, position of the piston or current. This on the other hand requires the knowledge

(37)

about the force and the position of the piston. The force can be calculated from the pressure if this can be measured but the piston position needs to be estimated and there is more complex then assuming the coil in the actuator can be modu-lated as an inductance and a resistance in series, this simplification is discussed in section 3.1.2. This gives a reasonable model of the current, compared to if equation 3.1 would be used. How this is used is discussed in section 4.1.

3.1.2

Electrical model

The interesting is how to model the electrical properties of the actuator. The coil will act as an inductor, the coil wire and the armature will also have an internal resistance. A first model can be presented in figure 3.3a. If a voltage step is applied over the model, the current will rise up to the value I = V /R, and the rise time will then become τt = L/R.

(a) A simple electrical model of an actuator and simulations result from that model. Taken from [16].

(b) A more complex electrical model of an actuator. Taken from [16].

(c)Simulation result for the model in the figure above. Taken from [16].

Figure 3.3:An electric model of a actuator.

In most cases this model is sufficient and can be used for the controller. This can be seen in figure 3.8. The model does not capture some of the phenomenon that happens in the actuator. This can be that the inductance changes based on the air gap and the plunger will induce a voltage to the circuit when it moves based

(38)

on the speed. These changes are often too small to notice and can be neglected. In figure 3.3b a more complex model be seen. When a step voltage is applied over the model the current will still rise to I = V /R but the rise time is not τt , L/R anymore. This can be seen in figure 3.3c, it also shows up in the system identification at 0 t.u. in figure A.1.

3.2

Electrical Control Unit (ECU)

The ECU is a PCB with a CPU, both flash memory and SRAM, general I/O as well as communication units and other electronic components. The ECU handles all the software control of the mechanics that is connected to it. The CPU runs a real time OS that handles the scheduling and resources of the different software con-trollers. It also handles the communication between the different ECU through the CAN buss.

Figure 3.4:The lab bench where the software was tested.

The hardware setup used in this thesis can be seen in figure 3.4. The PCB contains the ECU, debugging interfaces, connectors to the CAN busses and I/O ports. The debugging tool and the CAN busses are connected to a PC to read out data from the ECU.

The controller studied in this thesis is the controller used for the actuator used in hydraulic applications. The hydraulic application consists of two different controllers. The first controls the pressure of the oil and the other controlling the actual actuator. The block diagram for this can be seen in figure 3.5. The first measures the pressure of the oil comparing it to a reference value. Then it uses an algorithm to calculate a wanted piston position. This is then transformed using something that resembles equation 3.2 to a wanted current that is used in the second controller to regulate the current through the actuator resulting in a position in the piston and pressure of the oil. The controller studied is the second

(39)

controller or the on handling the fast dynamics. These dynamics is based on the electronic properties of the actuator and is discussed below in section 3.2.1.

Figure 3.5:Block diagram of the different controllers that affects the system.

3.2.1

Electronics

The electronics that are used in the platform is based on the theory in the section 2.1. Some additions to protect from to big currents and fast transitions are aloe included. This is done with the second diode and capacitor in figure 3.6. The actuator is modelled according to figure 3.3a. The low pass filter in the section 2.1 is moved to the battery source, changing the transfer function of the circuit that is used by the regulator. The filter have been moved because of that the platform has up to 16 different outputs that can either be used as general I/O outputs or as PWM outputs for the actuator. To have filters for all these output are not practical, the inductance that was used in section 2.1 is now replaced by the inductance in the actuator.

Current Feedback Voltage Feedback Vgs PWM L R2 R3 R4 R1 R R6 R7 R8 R4

Figure 3.6:Circuit diagram of the output for the PWM signal.

The circuit that handles the PWM output can be seen in figure 3.7, this is a simpli-fied from the actual circuit but it does not affect the performance of the controller. This can then be simplified even more using the assumption that the diodes are idle. This means that the diode lets through current when the voltage over it is positive and bigger than zero. While when the voltage is negative the diode dose not let through any current. Also the resistance on both sides of the transistor can be discarded, this because they are too small to have any effect on the perfor-mance. They are there to be able to shut down the I/O port if the voltage becomes too large. Also the capacitance does not affect the output because of steady state the average current over the capacitor is zero according to section 2.1.1. The resis-tance on the other side of load are used for calculating the current feedback and can there for be ignored. The resulting circuit diagram can be seen in figure 3.7.

(40)

Figure 3.7:Simplified circuit diagram of the output for the PWM signal.

3.2.2

Identification

From figure 3.7 a transfer function can be fund. This can be seen in equation 3.3. It is a first order continues transfer function. The values for the three different actuators in figure 3.1 can be found in table 3.1. Because of the output is sampled it can also be interesting to see how the sampling time affects the transfer func-tion. If bilateral transformation presented in section 2.3 is used the time discrete transfer function can be seen in equation 3.4.

I(s) = Vgs Ls + RD(s) (3.3) I[z] = b1z1 1 − a1z−1 (3.4)

Actuator Resistance [Ω] Inductance [mH]

Black actuator (A1) 17 98

Black actuator with red block (A2) 17 98

Gray actuator (A3) 24 220

Table 3.1:The values for equation 3.3.

To verify if these transfer functions are properly describing the dynamics of the system, an identification process is preformed. section 2.2. A 5000 t.u. long test run is produced that should follow the theory in section 2.2.The run is split into five equally long time slots that works with five different duty cycle regions. These different regions are not using the whole 1 − 100% span of the duty cycle, because the output current has a gain around 1.1 − 1.4 times greater than the duty cycle. If not limited it can harm the circuit if the output is at max for longer times high. So the actual duty cycle is limited to 80%. To get some reaction to the system the lower limit is set to 6%. The five duty cycle regions is therefore 6 − 30; 30 − 40; 40 − 50; 50 − 60; 60 − 80%. Then the time slots are split into 5 sub slots, where the amplitude was decided randomly in the given interval.

(41)

1000 1100 1200 1300 1400 1500 1600 1700

time [t.u]

300

320

340

360

380

400

420

440

460

Cu

rre

nt

[m

A]

System Identification

Current A1, 1tu

Current A2, 1tu

Current A1, 2tu

Current A2, 2tu

Figure 3.8:A part of the system identification procedure on A1 and A2 with the sample time of ether t.u= 1 or 2.

These values are then feed through to the system, an section of the identification process for actuator A1 and A2 with a sample interval of 1 t.u. and 2 t.u. can be seen in figure 3.8 and the whole process can be seen in figure A.1. From this the conclusion that actuator A1 and A2 do not have the same transfer function even if they have the same resistance and inductance. The cause of this is probably manufacturing variations and ageing. From figure 3.8 shows also there is some difference in the gain between the system with 1 t.u. sample time and the 2 t.u. It is approximately 1.5 mA for the A2 in this case. This can be explained with equation 3.4. When the sample time is increased the gain is also increased. This shows that the control parameter may needs to be different based on the sample time.

Now the transfer function can be simulated to see if it describes the system. The transfer function is simulated using Matlab as a sample continues transfer func-tion with the same sample time. Then the output is the compared to the output signal from the system. Two small sections of these can be seen in figure 3.9 and the difference between them can be seen in figure 3.10. The rest of these plots can be seen in figure A.2 and figure A.3. From figure 3.9 using the blue line, together with figure 3.10 the conclusion that can be drawn is that the transfer function does not follow the output from the system. This can be because of the simpli-fied transfer function compared to the actual system. It can possibly be that the resistance is higher than the internal resistance in the actuator or the inductance is higher. Testing with some new values results in a transfer function, that is the green line in figure 3.9. From figure 3.9 it can be seen that the system seems to

(42)

1000 1100 1200 1300 1400 1500 1600 1700

time [t.u]

300

350

400

450

500

Cu

rre

nt

[m

A]

System Identification

Estimated real values, TF1

Estimated altered values, TF2

Current A1

Current A2

Figure 3.9: A part of the system identification procedure with A2 and A1 together with the two estimated transfer functions (TF1 and TF2).

1000 1100 1200 1300 1400 1500 1600 1700

time [t.u]

0.00

0.02

0.04

0.06

0.08

0.10

Cu

rre

nt

[m

A]

System Identification

Diff between A1 and TF1

Diff between A1 and TF2

Diff between A2 and TF1

Diff between A2 and TF2

Figure 3.10:The difference between the estimated transfer function with the values from table 3.2 (TF1) and the one with altered value (TF2).

vary based on the current going through the actuator. When the current is above 500 mA the gain changes, this can cause a problem for the controller. This can be

(43)

solved using different parameters in the two regions; this will be a little more in section 4.4.

1000 1100 1200 1300 1400 1500 1600 1700

time [t.u]

250

300

350

400

450

Cu

rre

nt

[m

A]

System Identification different battery voltage

Estimated with 26V

Estimated with 24V

Estimated with 22V

A2 with 26V

A2 with 24V

A2 with 22V

Figure 3.11: The difference between the System Identification results with different voltage and the estimated with the same voltage level used to sim-ulate the transfer function (TF2).

One more thing that can be interesting to see is if the battery voltage affects the system in accordance with equation 3.3. The same test case is used as before but now the battery voltage is 24 or 22 instead of 26 V. The same procedure as above is preformed and parts of the result can be seen in figure 3.11. The full plots can be seen in figure A.4. Figure 3.11 shows that the gain of the system actually depends on the voltage.

3.2.3

Modelling

From the result in section 3.2.2 the conclusion is that a more correct version of the transfer function needs to be used. To do this more accurately then guessing is to use a Kalman filter that tries to estimate equation 3.4. This can be seen as an ARX model that was presented in section 2.2.3.

Using Matlab, simulations was done and the result can be seen in figure 3.12. Us-ing the data form figure 3.12, the average error can be calculated to around 0.5 mA for the model for actuator A2 with a sampling time of 1 t.u. One problem however is that the system parameters are changing continually in figure 3.13. One solution is to take the root mean square to produce an average for the differ-ent parameters. Simulation with this transfer function can be seen in figure 3.14. Again the biggest error that is found is 8 mA. One problem with the fix parame-ter transfer function is that it only works great in the region that is near the fix

(44)

0

1000

2000

3000

4000

5000

time [t.u]

300

350

400

450

500

550

600

650

700

Cu

rre

nt

[m

A]

Kalman estimation of Actuator A2

Kalman Estimation

System identification of A2

Figure 3.12: The current response from simulations with parameters from next figure. 0 1000 2000 3000 4000 5000

time [t.u]

0.45 0.50 0.55 0.60 0.65 0.70

[1]

The different parameter estimation

Time constant estimation

RMS Time constant estimation

Gain constant estimation

RMS Gain constant estimation

Figure 3.13:The parameter of a Kalman filter.

parameter. This can be seen in figure A.5. This time the average error was 4 mA so the difference is not that big. Now it can be said that a model of the actuator is found. Now this can be done for the other actuators and with different sample

(45)

times to find models for these. The resulting parameters for equation 3.4 can be found in table 3.2.

1000 1100 1200 1300 1400 1500 1600 1700

time [t.u]

300

320

340

360

380

400

420

440

460

Cu

rre

nt

[m

A]

Kalman estimation with fixed paramteter values

Estimation with Kalman parameters

System identification of A2

Figure 3.14: The simulated response with fix parameters compared to the original transfer function.

Actuator (sample time) a1 b1

Black actuator (A1,1 t.u.) 0.7445 0.3515

Black actuator (A1,2 t.u.) 0.5559 0.6126

Black actuator (A1,4 t.u.) 0.3548 0.8325

Black actuator with red block (A2,1 t.u.) 0.6915 0.4299 Black actuator with red block (A2,2 t.u.) 0.4867 0.7169 Black actuator with red block (A2,4 t.u.) 0.2979 0.9840

Gray actuator (A3, 1 t.u.) 0.8291 0.1801

Gray actuator (A3, 2 t.u.) 0.6979 0.3216

Gray actuator (A3, 4 t.u.) 0.4826 0.5459

(46)

3.3

Data collection

Data is collected using a process that copies data from the controller every 1 t.u. The data is then read out with a debugger tool that is called trace 32 (or t32) developed by Lauterbach. It reads out the array where the data is collected using a scripting language called PRACTICE. The data is then printed to a file. This scripting language is also used to set different parameters when the software is tested. And the hardware setup can be seen in figure 3.4.

(47)

4

Implementation

This chapter will first present the current controller. After this the design and implementation of the PI controller is discussed and with this new controller a different method for the diagnostic of the actuator is needed. Then some more advanced controllers are discussed and one of them is selected to be implemented and evaluated.

4.1

Current Controller

The current implementation of the regulator uses a simple estimation of the resis-tance R in equation 3.3. The resisresis-tance is then used in the controller to calculate the duty cycle, which is sent to the PWM routine. A block diagram can be seen in figure 4.1.

The control law is based on equation 2.4 and is implemented according to equa-tion 4.1, where Ir[n] is the requested current from the hydraulic controller, Vgs

the battery voltage and L is the inductance in the actuator used to give it a push in the right direction when a step change is detected. Vdis a linearizion term that

tries to reduce the overshot/undershot, where x1 > x2 and k1, k2, k3, m1, m2, m3

are constants. The term attempts to compensate for the diode in figure 3.7. The

(48)

Current

Hydraulic regulator

Wanted Current

Resistance

PWM duty

Resistance estimator Controller

Actuator

Figure 4.1:Block diagram of the current controller.

R[n] is the estimated resistance calculated using algorithm 1.

V [n] = R[n] ∗ Ir[n] (4.1a) lc[n] = L ∗ (Ir[n] − I[n − 1]) + lc[n − 1] (4.1b) Vtot[n] = V [n] + lc[n] (4.1c) Vd[n] =          k1∗Ir[n] + m1 if Ir[n] > x1 k2∗Ir[n] + m2 if Ir[n] > x2 k3∗Ir[n] + m3 if Ir[n] < x2 (4.1d) D[n] = Vd[n] + Vtot[n] Vd[n] + Vgs[n] (4.1e)

The problem with the current implementation of the controller is that it does not use the current feedback in the regulator directly; instead it comes from the re-sistance estimation. The indirect feedback takes some time before the controller reduces/increase the duty cycle when an overshoot/undershot occurs, if the esti-mated resistance is too high or too low when a change is requested. This can be seen in figure 4.2 at 1120 t.u.

The resistance estimation is done according to algorithm 1. Where k[n] is a filter coefficient to filter out the big error in the beginning of a step change and I[n] is the feedback current. Algorithm 1 produces a good estimation of the resistance for the actuator. In figure 4.2 the resistance estimation can be seen when a change of the requested current occurs. This causes the estimated first increase a little because of the positive difference between the requested current and the feedback current. This then decreases when the feedback current becomes bigger then the reference. The filter constant is the problem to why it takes time for the overshoot to be reduced.

(49)

Kmax= 1 − Ir[n]; if |Ir[n] − Ir[n − 1]| > 0.005 then k = 0.00025; else ifk < Kmaxthen k∗ = 1.3; else k = Kmax; end end R[n] = (1 + k ∗ (Ir[n] − I[n])) ∗ R[n − 1];

Algorithm 1:Resistance estimation

The estimation of the resistance is good, comparing the value in table 3.1 where the actuator used under the test is A1 whit a resistance of 17 Ω. The main source to the variations is that it is used to control a more or less no-linear system with only on control parameter. Then resistance is also affected by temperature, varia-tions in the electronics and so on.

1100

1120

1140

1160

1180

1200

time [t.u]

500

550

600

650

700

750

800

Cu

rre

nt

[m

A]

Feedback current

Feedback Current

Wanted Current

1100 1120 1140 1160 1180 1200

time [t.u]

17.2

17.3

17.4

17.5

17.6

Re

sist

an

ce

[O

hm

]

Resistance

1100 1120 1140 1160 1180 1200

time [t.u]

0.0

0.1

0.2

0.3

0.4

0.5

0.6

Fil

ter

co

eff

ici

en

t [

1]

Filter coefficient

Figure 4.2:Output from a test with the old controller.

4.2

PI controller

A good starting point to solve the problem is to use one of the basics from control theory. The PI regulator can easily be implemented and can be tuned to work in

(50)

different scenarios. A block diagram of the system can be seen in figure 4.3.

PI-regulator

Actuator

Hydraulic regulator Duty Cycle

Current

wanted Current

Figure 4.3:Block diagram for the PI-controller.

The main problem with the PI controller that needs to be addressed is to find good parameters to use in equation 2.38 using the PI row from table 2.1. To find these parameters a simple optimization technique was used. One parameter was held constant and the other was incremented until an end value was reached. Then the first parameter is increased with a constant and the other is reset to the start value. This is the repeated until the first parameter reaches it end value. Then the parameter pair which performed best was chosen either for a new sweep or as the parameters to use. Finding a good starting point to equation 4.2 from [8] was used. These parameter are described in section 2.3.1.

Kp= 0.15 K + (0.35 − dT (d + T )2) T K d (4.2a) Ti = 0.35d + 13dT 2 T2+ 12T d + 7d2 (4.2b) Ki = Kp Ti (4.2c)

Converting the values from section 3.2.3 to time continues and inserting them in equation 4.2 gives the starting point for the optimization. These values are then converted back to discrete time. According to Glad and Ljung [7] a time continues controller can be approximated to a discrete controller using the time domain or frequency domain techniques described in section 2.3.2. Doing this gives the values for the discrete controller for the different actuators. In the discrete time three different sample times is used for the system: 1,2,4 t.u.

The discrete control parameters are used as center values for the first round in the optimization process. Then three lesser and three greater values are chosen for both the Kp and Ki. The results are analyzed and then repeted around the

(51)

1060

1080

1100

1120

1140

1160

1180

time [t.u]

600

650

700

750

800

Cu

rre

nt

[m

A]

Optimazation

Ki=95 Kp=0.9

Ki=95 Kp=0.95

Ki=100 Kp=0.9

Ki=100 Kp=0.95

Old Controller

Wanted Current

1050 1055 1060 1065 1070

time [t.u]

710

715

720

725

730

735

740

745

Cu

rre

nt

[m

A]

Optimazation

1120 1125 1130 1135 1140

time [t.u]

770

775

780

785

790

Cu

rre

nt

[m

A]

Optimazation

Figure 4.4:Optimization for PI parameters for actuator 1.

4.3

Diagnostic

The PWM control software needs to be able to detect if there is something wrong with the electronic circuit or the actuator. When a fault is detected a status code is updated that tells the application layer that something is wrong. It should be possible to detect if the current feedback is over or under the wanted current, or if it is stuck to ground or open circuit. The diagnostic in the current implemen-tation is using the resistance estimation. If the estimated resistance goes above a specific value it changes the state code to “below normal or stuck at ground”. And if it goes below a specific value it changes to "above normal or open circuit". Figure 4.5 illustrates how the diagnostics works. After 1000 t.u. the high side of the actuator is removed and the feedback goes down to 0. The resistance now increase according to algorithm 1. The maximum value of the resistance is 33 Ω. This will cause the diagnostic to signal that the current is below normal. The high side is reconnected after 180 t.u. and the current feedback returns and causing the estimated resistance to return to 17.5 Ohm. At around 1960 t.u. is low side connected to the battery causing the feedback to rise to the maximal value of 1.24 ampere. This causes the resistance to drop to 14.9 Ohm. This will signal that the current is above normal. And after 50 t.u. the connection is removed the resistance is going back to 17.5 ohm.

The PI-controller needs a different diagnostic strategy. Using the control error to decide if the feedback current is below or above normal is the most obvious. A state machine is chosen that can handle quick transition/large errors. The state machine is updated every 10 t.u. too give the controller time to reduce the error.

(52)

1000

1200

1400

1600

1800

2000

time [t.u]

0

200

400

600

800

1000

1200

Cu

rre

nt

[m

A]

Feedback current

Feedback Current

Wanted Current

1000

1200

1400

1600

1800

2000

time [t.u]

15

20

25

30

Re

sist

an

ce

[O

hm

]

Resistance

Figure 4.5:Removing the high side coupling to the actuator and connecting the battery to the low side coupling to the actuator.

The state machine can be seen in figure 4.6. The start state is state 0 or the ok state. If the absolute error is less than a max error limit it should stay in the state 0. If the absolute error is bigger than max error limit and positive it should change to state 1. This is a intermediate state to give the controller time to reduce the error. The same applys when the error is negative, it goes to state 4 instead. Is the absolute error is still larger than the max error limit it moves to state 2, there it waits until the PWM signal reaches 100 % and the current is only 50 % of the requested current. When these conditions are meet the state machine change to state 3 or "Current above normal or open circuit". When the error becomes lover than the max error limit, it goes to state 6.

In state 4 is a intermediate state when the error is negative. If the absolute error is higere then the max error limit and negative it goes to state 5 where it signals that the "current is blow normal or short circuit to ground". If the error is low than the max error limit it goes to state 6 that is a intermediate state before it goes to the "OK" state.

A test of the implementation can be seen in figure 4.7. The low side connector is connected to the battery, causing the feedback current to become maximal. This will cause the diagnostic to signal current below normal. The error is negative and when the state machine samples the error it will change state S4. And when it samples again it will go to S5 making the diagnostic signal. When the low side connector is disconnected from the battery, the error returns to around zero and the state machine samples it again then it will go to the state S6. If the next

(53)

Figure 4.6:The state machine used for diagnostic.

sample is still around then it will go to S0 and indicate normal function, the controller signals that it is functional again.

In figure 4.8 the high side connector is removed. The feedback goes to zero and the error is positive. When the state machine samples the system it will go to the S1 and the PWM duty cycle will increase to 100%. The second time the state machine samples it will move to state S2. The feedback is still 0 ampere and at third sample the feedback is much less that the wanted current and the state changes to S3. In state S3 it signals to the diagnostics that the current is below normal value. When the diagnostic signals that there is something wrong with the actuator the controller reduces the duty cycle to 10%. This is to be able to detect if the current returns. When the connector is connected again the feedback current goes up to the wanted current again making the error approach zero. This causes a state changes in state machine to the state S6 and after the next sample going to state S0.

References

Related documents

We recommend to the annual meeting of shareholders that the income statements and balance sheets of the parent company and the group be adopted, that the profit of the parent

av kallelsen kommer att framgå en detaljerad dagordning med bland annat förslag till utdelning och val av styrelse samt förslag till arvoden för styrelsen, fördelat på ordförande

We recommend that the Annual General Meeting adopt the income statements and balance sheets of the Parent Com- pany and the Group, that the profit in the Parent Company be dealt

Nettoomsättningen, inklusive intäkter från sålda exploateringsfastigheter, minskade till 888 Mkr (969). Minsk- ningen beror främst på lägre hyresin- täkter efter

We recommend to the annual General Meeting that the income statement and Balance sheet of the parent company and group be adopted, that the profits of the parent company be

NOTEs huvudägare Catella beslutade i november 2007 i samråd med styrelsen att inom ramen för ett nytt incitamentsprogram ställa ut maximalt 500.000 köpoptioner i NOTE till drygt

The consolidated fi nancial statements of Nordnet AB (the parent company) for the fi nancial year ending December 31, 2006 were approved for publication by the Board and Chief

Vi märkte under året en fortsatt ökad efterfrågan från andra fi nansiella aktörer att, genom olika former av partnerskap, använda sig av våra tjänster inom aktier, fonder