• Nem Talált Eredményt

Let us consider now the the parametrization of the dimensionless torque parameters:

 Cl Cm

Cn

=

0 Cl

δa Cl

δr

Cm

δe 0 0

0 Cn

δa Cn

δr

 δe δa

δr

+

Clp 0 Clr 0 Cmq 0 Cnp 0 Cnr

psb q2Vsc¯ 2Vrsb 2V

+

0 Cl

β

Cmα 0 0 Cn

β

 α

β

(3.49)

=L1ear)T+L2(psb 2V ,qs

2V,rsb

2V)T+L3(α,β)T (3.50) Notice that the second term belonging toL2is usually an angular velocity dependent damping term linear inωb:

L2

b

2V 0 0

0 2Vc¯ 0 0 0 2Vb )

Cα 0 Sα

0 1 0

−Sα 0 Cα

 P Q R

 (3.51)

Simplifying the details in notations the main structure of the motion equations can be formulated in the following forms:

mv˙=−ω×(mv) +fv+gv1uv+gv2uω (3.52) Jω˙ =−ω×(Jω) + fω−Dωω+Gωuω (3.53) As can be seen the position equation is coupled with the attitude equation since it depends on both fromuv=FT anduω = (δear)T hence the nonlinear position control is a complex problem. Fortunately, the orientation equation is not coupled thus the attitude control is less complex. Notice also that the total system is underactuated.

The identification of the model parameters can be performed using test-flight data and robust identification techniques (Bayes estimator, Least-Squares, nonlinear state estimator etc.). Notice that the problem is simpler in the stability axis model.

50 3.3 Attitude Control of Fixed Wing UAVs

3.3.1 Euler angles

The Euler (roll, pitch, yaw) angles based orientation description is defined as follows:

Rnb(Φ,Θ,Ψ) =Rot(z,Ψ)Rot(y,Θ)Rot(x,Φ)

=

CΨCΘ CΨSΘSΦ−SΨCΦ CΨSΘCΦ+SΨSΦ SΨCΘ SΨSΘSΦ+CΨCΦ SΨSΘCΦ−CΨSΦ

−SΘ CΘSΦ CΘCΦ

(3.54)

Notice that the gravity acceleration inKbandKware respectivelygb= (Rnb)T(0,0,1)Tgscal andgw=Rwbgb.

3.3.2 Quaternion exponential and logarithm

The fundamentals for quaternions can be found in many resources, see for example [18].

First the main relations are summarized.

A quaternion consists of a scalar and a vector:q= (s,w)¯ ∈R1×R3. It can be identified also withq= (s,w) = (q¯ 0,q1,q2,q3)∈R4. The conjugate isq?= (s,−w), the norm square¯ iskqk2=s2+w¯Tw. Quaternion product is defined by¯

q1⊗q2= (s1s2−w¯T12,s12+s21+w¯1×w¯2). (3.55) Considering only unit norm quaternions in the sequel a multiplicative unite= (1,¯0) can be introduced with respect to quaternion multiplication wheree=q⊗q?=q?⊗q thus the inverseq−1=q?can be identified. Denote[ω×]the matrix of the vector product.

The orientation matrixR and general rotation Rot(¯t,φ)can be described by unit norm quaternion according to ([S6])

R=I+2s[w×] +¯ 2[w×][¯ w×],¯ (3.56) Rot(¯t,φ) ⇐⇒ ϑ :q= (Cϑ/2,Sϑ/2t),¯ (3.57) q⊗(0,r)¯ ⊗q?= (0,R¯r). (3.58) The quaternion satisfies the new kinetic equation as follows:

d dt

s

¯ w

= 1 2

−w¯T sI3+ [w×]¯

ω =:T(q)ω. (3.59)

Let us consider now the gerneralization of exp(q) and log(q). Usingez =∑n=0z

n

n!

and the scalar and vector part ofq= (s,w)¯ it followse= (1,¯0),(0,w),¯ (0,w)¯ ⊗(0,w) =¯ (−|w|¯ 2,0),(0,w)⊗¯ (0,w)¯ ⊗(0,w)¯ = (0,−|w|¯ 2w),¯ (0,w)⊗¯ (0,w)⊗(0,¯ w)¯ ⊗(0,w)¯ = (−|w|¯ 4,0),etc.

Sincesis scalar hence

exp(q) =ese(0,w)¯ =es

cos(|w|),¯ sin(|w|)¯ w¯

|w|¯

(3.60)

Let log(q) = (a,b)¯ then

elog(q)=ea cos(|b|),¯ sin(|b|)¯ b/|¯ b|¯

=q= (s,w)¯ (3.61) s=eacos(|b|),¯ w¯ = easin(|b|)¯ b/|¯ b|¯ (3.62)

||q||2=s2+|w|¯ 2=e2a(cos2(|b|) +¯ sin2(|b|)b¯T

|b|¯ 2) =e2a (3.63)

a=ln(||q||) (3.64)

log(q) =

ln(kqk), w¯

|w|¯ arccos(s/kqk)

(3.65) Using this with unit norm quaternions we get:

log(q) = (0,1

2t¯ϑ)⇒ d

dtlog(q) = (0,1

2t¯ϑ˙) (3.66)

Remark:Since|¯t|2=<t,¯ t¯>=1⇒t¯⊥t¯0hence ¯t,t¯0×t,¯ t¯0build orthogonal basis (prime denotes derivation here). On the other hand, ω =tϑ¯ 0+ (1−Cϑ)¯t0×t¯+Sϑ0, see [18].

thereforeω=tϑ¯ 0is only an approximation.

3.3.3 Standard Integral Backstepping Control using Euler angles

It is clear that the attitude control and some other problems can be brought to the following form:

˙

x1=g0x2

˙

x2= f1+g1u (3.67)

For attitude control x1= (φ,θ,ψ)T, x2= (p,q,r)T, g0 is the matrix in the kinematic equation, f1+g1u=−Ic−1B×(IcωB)) +Ic−1TBwhereu=TBis the total torque and both g0andg1are invertible matrices.

Letz1=xd1−x1be the error andξ1(t) =R0tz1(τ)dτthe error integral. Let the Lyapunov function and its derivative be

V1=1

2zT1z1+1

1TΛ1ξ1, Λ1T1 >0 V˙1=zT111TΛ1z1

(3.68) Letv1be the virtual control andz2:=v1−x2⇔x2=v1−z2then

˙

z1=x˙d1−g0(v1−z2) =z˙d1−g0v1+g0z21=zT1(x˙d1−g0v1+g0z2) +zT1Λ1ξ1

v1:=g−10 (x˙d11ξ1+A1z1), A1=AT1 >0 V˙1=−zT1A1z1+zT1g0z2

(3.69)

As can be seen, the stability condition forz1is not satisfied, hence let us continue with the

52 3.3 Attitude Control of Fixed Wing UAVs stabilization of the full system.

˙

z2=v˙1−x˙2=v˙1−f1−g1u V2=V1+1

2zT2z2⇒V˙2=V˙1+zT22

2=−zT1A1z1+zT1g0z2+zT2(v˙1− f1−g1u) u:=g−11 (v˙1−f1+A2z2+gT0z1), A2=AT2 >0

˙

z2=v˙1−f1−g1u=−A2z2−gT0z12=−zT1A1z1−zT2A2z2<0

(3.70)

The full system with the IBSC is globally asymptotically stable (GAS). The closed loop system with the IBC controller is as follows:

˙ z1

˙ z2

ξ˙

=

−A1 g0 −Λ1

−gT0 −A2 0

I 0 0

 z1 z2 ξ

 (3.71)

In order to realize the controller, the control signaluand all the variables in it should be computable. It means that beside the errorz1=xd1−x1 and the error integralξ1also the virtual controlv1and its derivative ˙v1etc. have to be determined. The state variables for controller may be the results of high quality state estimation based on sensor fusion.

The derivatives ˙xd1and ¨xd1 need to be continuous and smooth which can be assured with appropriate path design or filtering and numerical derivation. Moreoveruneeds ˙v1and ˙v1 needs dg

−1 0

dt . Let us consider the details of IBSC attitude control algorithm:

g0=

1 TθSφ TθCφ

0 Cφ −Sφ

0 Sφ/Cθ Cφ/Cθ

g−10 =

1 0 −Sφ

0 Cφ CθSφ 0 −Sφ CθCφ

 dg−10

dt =

0 0 −Cφφ˙

0 −Sφφ˙ −SθSφθ˙+CθCφφ˙ 0 −Cφφ˙ −SθCφθ˙−CθSφφ˙

 (φ˙,θ˙,ψ)˙ T =g0(p,q,r)T

v1=g−10 (x˙d11ξ1+A1z1)

˙

v1= dg−10

dt (x˙1d1ξ1+A1z1) +g−10 (x¨d11z1+A11) u:=g−11 (v˙1−f1+A2z2+gT0z1)

(3.72)

According these formulas the algorithm for computing control deflections is the fol-lowing:

1) The result of the IBSC attitude control algorithm is the driving torqueu=TB in the basis of thebody frame KB:

u=TB=diag([qS¯ wab,qS¯ wac,¯ qS¯ wab])

| {z }

D

 l m

n

 (3.73)

Here(l,m,n)T is the sum of two effects:

(l,m,n)T =L1(δ) +L2(p,ˆ q,ˆ r,ˆ α,β, . . .) (3.74) where ˆp=pb/(2V), ˆq=qc/V¯ , ˆr=rb/(2V)and the factors L1 andL2 are linear in their variables with coefficients of the aircraft dynamic model. Therefore

L1(δ) =D−1u−L2(p,ˆ q,ˆ r,αˆ ,β, . . .) (3.75) which is a linear equation forδ that can be solved easily.

2) In many cases the parametrization of the force/torque effects is given in thewind axes frame, see [8], [23]. SinceTB=STTW andTW =D(l,m,n)T =D(L1+L2)therefore

L1(δ) =D−1Su−L2(p,ˆ q,ˆ r,ˆ α,β, . . .) (3.76) The characteristic equation can be used for robust controller parameter design. However the kinematic differential equations are singular forΘ=±π/2 and cannot be used for attitude control in its neighborhood, where cos(θ) =p

˙

x2+y˙2/p

˙

x2+y˙2+z˙2.

3.3.4 Attitude control without the use of quaternion logarithm

LetKnandKbbe the earlier introduced inertia and body frames, respectively. A new frame Kd will be introduced which is the prescribed (desired) frame for the body COG. It is the result of the path design and the goal is to matchKband Kd after the control transients satisfyingKb=Kd. SinceRbn=RdnRbd hence

Rbd= (Rdn)−1Rbn⇐⇒qd,b=q−1n,d⊗qn,b=qd,n⊗qn,b, (3.77) Rbd=I3(goal) ⇐⇒qd,b= (±1,¯0) (3.78) which means that(±1,¯0)should be equilibrium state. Notice that two solutions are possible and the shortest rotation angle should be chosen during the transients.

The quaternion error and the angular velocity error will be defined as

qe:=qd,b−qd,b= (1,¯0)−(sd,b,−w¯d,b) = (1−sd,b,w¯d,b) (3.79) ωd,bbn,bb −Rbdωn,dd (3.80) Hereqe is the difference of two quaternions hencekqek 6=1 whilekqd,bk=1 thusqd,b satisfies the quaternion differential equation.

54 3.3 Attitude Control of Fixed Wing UAVs The system to be controlled consists of two parts (J=Ic):

˙

qe= (−s˙d,b,w˙¯d,b) =T(−sd,b,w¯d,bd,bb =:Teωd,bb , (3.81) Jω˙b=−[ωb×]Jωb+f(x)−D(x)ωb+G(x)u. (3.82) Notice that the original backstepping control (BSC) cannot be applied becauseTeis of type 4×3 and not invertible. Therefore some modifications are necessary.

Using ˙R=R[ω×]and (3.80) the time derivative ofωd,bb can be determined for use in Jω˙d,bb :

ω˙d,bb =ω˙n,bb −R˙bdωn,dd −Rbdω˙n,dd (3.83)

=ω˙n,bb −Rbdb,dd ×]ωn,dd −Rbdω˙n,dd . (3.84) Multiplying the result by the inertia matrix it follows

Jω˙d,bb = −[ωn,bb ×]Jωn,bb +f(x)−D(x)(ωd,bb +Rbdωn,dd ) +G(x)u−JRbdω˙n,dd

(3.85)

= −[ωn,bb ×]Jωn,bb + f(x)−D(x)(ωd,bb +Rbdωn,dd )

−JRbdω˙n,dd +G(x)u+J[ωn,bb ×]Rbdωn,dd

(3.86) where it was used that

Rbdb,dd ×]ωn,dd =Rbd[(ωn,dd −ωn,bd )×]ωn,dd =−[ωn,bb ×]Rbdωn,dd .

Hereωn,bb −Rbdωn,db can be considered to be the angular velocity error. Let the first Lyapunov function beV1=12qTeqethenV1is positive definite and

1=qTee=qTeTeωd,bb =qTeTen,bb −Rbdωn,dd ) (3.87) Choosekq>0∈R1and define the virtual control as

z=ωd,bb +kqTeTqe

˙

z=ω˙d,bb +kqd

dt(TeTqe) (3.88)

1=−kqqTeTeTeTqe+qTeTez (3.89) Here ˙V1is not negative because of the second term.

With the earlier results forωn,bb and ˙ωd,bb yields

ωn,bb =z−kqTeTqe+Rbdωn,dd (3.90) z=ωn,bb −Rbdωn,dd +kqTeTqe (3.91) Jz˙=Jω˙d,bb +kqJ d

dt(TeTqe)

=−[ωn,bb ×]Jωn,bb +f(x)−D(x)ωn,bb

−JRbdω˙n,dd +G(x)u+J[ωn,bb ×]Rbdωn,dd +kqJd

dt(TeTqe)

(3.92)

Now it is possible to prescribeTeTqe and choose the controlu using Lyapunov theory.

Define the 3D vector byTeTqe:= 12d,band letV2be the new Lyapunov function, then V2=V1+1

2zTJz (3.93)

2=−kqqTeTeTeTqe+qTeTez+zTJz˙ (3.94) The use of the above form of ωn,bb allows of separating a damping term −zTD(x)zfor stabilization. Hence the control can be chosen as

u=G−1[JRbdω˙n,dd −f(x) +D(x)(Rbdωn,dd −kqTeTqe) +[ωn,bb ×]Jωn,bb −J[ωn,bb ×]Rbdωn,dd −TeTqe−kq

2Jw˙¯d,b−kωz] (3.95) wherekω >0∈R1. With this control law a lot of terms are canceled in ˙V2and with the remaining terms yields

2=−kqqTeTeTeTqe−zT(D(x) +kωI3)z (3.96) Here we used a special choice for the matrixTeTeT which is only positive semidefinit.

However,qTeTeTeTqe= 14Td,bd,b= 14(1−s2d,b)≥ 18((1−sd,b)2+w¯Td,bd,b)≥ 18kqek2. Similarly, if the wind velocity is bounded below byVav>0,xmin= (βv,0,0)T) and the eigenvalue satisfiesλmin{D(xmin} ≥βD>0, then

2≤ −kq

8kqek2−(βD+kω)kzk2 (3.97) and the equilibrium point(qe,z) = (0,0)is uniformly exponentially stable (UES).

Control law without the use of log(q):

The quaternion based BSC attitude control law consists of (3.88) and (3.95). The case qe− = (−1+sd,b,w¯d,b)can be proved similarly.

3.3.5 Attitude control using quaternion logarithm

Let Kn and Kb be the earlier introduced inertia and body frames, respectively. A new frameKd will be introduced which is the prescribed (desired) frame for the body COG.

56 3.4 Altitude control of fixed wing UAVs