6
Autopilot of Electrical Helicopter Andrey E. Barabanov and Dmitry V Romaev Ahstract- Recently, extensive distribution was received by small-sized helicopters model. A small helicopter can be considered as a test bench of a highly nonlinear unstable multiconnected mechanical control system. An automatic sta- bilization system was designed on a standard computer for a small electrical helicopter. The sensor device consists of two Web cameras connected to the computer and four onboard diodes. The control signal is transmitted to actuators through a wireless control panel connected to the computer. Results of experiments are reported where the full autopilot system stabilizes a helicopter near a fixed 3-dimensional point that is not far from the ground. I. DEVICE DESCRI PTION. Small helicopters with manual control by a wireless control panel are easily available in the market in various configurations. They are extremely unstable and require a skilled driver to prevent a downfall. The time constant in the lateral channel of a small electrical helicopter is much less than 1 s. There are four control actuators that are closely interconnected in a highly nonlinear system. The system can be described to various levels of accuracy om the second order time invariant plants to turbulence equations. It is shown in this paper, that a simple autopilot system can be successfully designed for a widely spread model of helicopter with TV observations and soſtware installed on a standard computer. An electrical helicopter Walkera x450 was chosen for experiments. Fig 1. Walkera x450 This work was supported by the Russian Foundation for Basic Researches under the grant 07-01-00750 Saint Petersburg State University, Faculty of Mathematics and Mechanics, 198504 Saint Petersburg, Russia [email protected] 978-1-4244-7101-0110/$26.00 ©201O IEEE 143 Its height is 830 g. The main rotor has a diameter of 700 mm and a hub of the Hiller type with two blades and two servo blades. Each pair of blades is hard connected on a rod. The control panel has 2 joysticks with 2 degrees of freedom either. Fig 2. Control panel Accordingly, helicopter has 4 controls. The main rotor draſt and tail rotor draſt are controlled by the leſt joystick. Two angles of swash plate position are controlled by the right joystick. The main rotor draſt are controlled by both rotation equency at 27 - 29 Hz and the collective pitch. Dependence of rotation frequency and a collective pitch on a leſt joystick deviation is defined by a combinatory curve. It was approximated in experiments by the stroboscope. The tail rotor draſt is controlled by a collective pitch. Tail rotor rotation frequency is proportional to main rotor rotational equency. The control signals are transmitted from computer directly through DAC to the control panel that sends a radio signal to the onboard actuators. Dependence of the lateral, directional and liſting forces and torques from the controls was approximated in experi- ments on special test benches. A full aerodynamic nonlinear model is derived. It contains both differential and algebraic equations with nonunique solutions. An effective computational algorithm is proposed that finds a unique admissible solution of the system. Bal- anced operational points are determined for arbitrary linear velocity of a helicopter. All algorithms were written on Matlab and C. Their performance was studied by simulations.

[IEEE 2010 IEEE/ASME International Conference on Mechatronic and Embedded Systems and Applications (MESA) - QingDao, China (2010.07.15-2010.07.17)] Proceedings of 2010 IEEE/ASME International

Embed Size (px)

Citation preview

Page 1: [IEEE 2010 IEEE/ASME International Conference on Mechatronic and Embedded Systems and Applications (MESA) - QingDao, China (2010.07.15-2010.07.17)] Proceedings of 2010 IEEE/ASME International

Autopilot of Electrical Helicopter

Andrey E. Barabanov and Dmitry V. Romaev

Ahstract- Recently, extensive distribution was received by small-sized helicopters model. A small helicopter can be considered as a test bench of a highly nonlinear unstable multi connected mechanical control system. An automatic sta­bilization system was designed on a standard computer for a small electrical helicopter. The sensor device consists of two Web cameras connected to the computer and four onboard diodes. The control signal is transmitted to actuators through a wireless control panel connected to the computer. Results of experiments are reported where the full autopilot system stabilizes a helicopter near a fixed 3-dimensional point that is not far from the ground.

I. DEVICE DESCRI PTION.

Small helicopters with manual control by a wireless control panel are easily available in the market in various configurations. They are extremely unstable and require a skilled driver to prevent a downfall. The time constant in the lateral channel of a small electrical helicopter is much less than 1 s. There are four control actuators that are closely interconnected in a highly nonlinear system. The system can be described to various levels of accuracy from the second order time invariant plants to turbulence equations. It is shown in this paper, that a simple autopilot system can be successfully designed for a widely spread model of helicopter with TV observations and software installed on a standard computer.

An electrical helicopter Walkera x450 was chosen for experiments.

Fig 1. Walkera x450

This work was supported by the Russian Foundation for Basic Researches under the grant 07-01-00750

Saint Petersburg State University, Faculty of Mathematics and Mechanics, 198504 Saint Petersburg, Russia

[email protected]

978-1-4244-7101-0110/$26.00 ©201O IEEE 143

Its height is 830 g. The main rotor has a diameter of 700 mm and a hub of the Hiller type with two blades and two servo blades. Each pair of blades is hard connected on a rod. The control panel has 2 joysticks with 2 degrees of freedom either.

Fig 2. Control panel

Accordingly, helicopter has 4 controls. The main rotor draft and tail rotor draft are controlled by the left joystick. Two angles of swash plate position are controlled by the right joystick. The main rotor draft are controlled by both rotation frequency at 27 - 29 Hz and the collective pitch. Dependence of rotation frequency and a collective pitch on a left joystick deviation is defined by a combinatory curve. It was approximated in experiments by the stroboscope. The tail rotor draft is controlled by a collective pitch. Tail rotor rotation frequency is proportional to main rotor rotational frequency.

The control signals are transmitted from computer directly through DAC to the control panel that sends a radio signal to the onboard actuators.

Dependence of the lateral, directional and lifting forces and torques from the controls was approximated in experi­ments on special test benches.

A full aerodynamic nonlinear model is derived. It contains both differential and algebraic equations with nonunique solutions. An effective computational algorithm is proposed that finds a unique admissible solution of the system. Bal­anced operational points are determined for arbitrary linear velocity of a helicopter. All algorithms were written on Matlab and C. Their performance was studied by simulations.

Page 2: [IEEE 2010 IEEE/ASME International Conference on Mechatronic and Embedded Systems and Applications (MESA) - QingDao, China (2010.07.15-2010.07.17)] Proceedings of 2010 IEEE/ASME International

II. TV OBSERVATION

A. Primary recognition Four diodes are installed on the helicopter and fed from

the onboard battery. The distances between them are fixed and this information is enough for calculation of their 3-dimensional coordinates by the screen image.

A particular measurement of the helicopter positIOn is a single TV image that contains spots from diodes on the nonhomogeneous background.

Fig 3. TV image

The image processing is traditionally divided into the primary stage where the grey image is transformed to the set of points, and the secondary stage that builds objects from the extracted points and eliminates alarms. Primary processing is made in the full image or in the tracking strobes.

The primary recognition stage consists of a search of spots from all 4 diodes on the nonhomogeneous background. The shape and amplitude of a spot depends on the diode foreshortening with respect to the camera. A diameter of a spot is normally between 4 and 10 pixels at the level of 70% amplitude for the distance 1.5 - 2 m between a camera and a helicopter.

Fig 4. Spot shape

144

The spot shape may be distorted if the diode is directed outside or if it is located on a bright background or it is shaded. Images contain in addition specks of light, bright borders of objects and reflections from surfaces.

A search of the diode spots is made by the following algorithm. First, the average brightness level is eliminated by filtering that contracts the low frequency component. Then areas with sufficiently big remaining amplitude are extracted. Then the image is processed by a local moving average filter that calculates a discrete second derivative. Samples with positive or relatively small values of this derivative are eliminated.

The remaining samples are collected into connected areas. That is performed through one pass of the image. Then very small and very long objects are removed. The remaining spots are approximated by ellipsoids and the discrepancy is measured by consistent filtering.

As a result of primary recognition, a number of objects are obtained that have the best values of likelihood after filtering. For each spot the center is determined together with an approximating ellipsoid. The second order matrix describing the ellipsoid is considered as the covariance of the center estimate.

B. Three dimensional estimation

The helicopter position as well as the both cameras po­sitions are not known at the stage of primary recognition. These objects are three solid bodies, and their positions are determined by coordinates of the center of gravity or focuses and by the Euler angles.

Human eyes have no problems with identification of three­dimensional object coordinates because the distance between eyes is fixed and known and the survey directions are the same. In the TV observation these parameters are to be estimated, and the only data for estimation are two TV shots that contain images of the same helicopter. Therefore, the first task is study of a single image from one camera and a restoration of the 3-dimensional coordinates of the helicopter in the coordinate system of the camera.

The 2-dimensional image of the helicopter on the camera screen is projective. An image on the screen of an arbitrary point in the space can be considered as an intersection of the screen plane with a line connecting this point and the camera focus. Thus, the image on the camera screen contains a projective image of the tetrahedron formed by the diodes.

The origin of the camera coordinate system is its focus. The axes OX and OY are the natural coordinates on the screen. The axis OZ is directed forward and makes the right triple of coordinate axes. Denote the coordinate vector of the i-th diode in the camera coordinate system by

i = 1,2,3,4.

Projection of this vector to the screen is denoted by (�i' 'TIi)

Page 3: [IEEE 2010 IEEE/ASME International Conference on Mechatronic and Embedded Systems and Applications (MESA) - QingDao, China (2010.07.15-2010.07.17)] Proceedings of 2010 IEEE/ASME International

and measured in pixels. It follows from geometry that

where p is the coefficient of transformation from angle to pixels. For the cameras chosen it is equal to p = 800. Substitution of this equation results in the representation

The image recogmtlOn is based on the distances dij between each pair of diodes that are considered to be known. The square distance is

d;j = p-2 [(Zi�i - Zj�j) 2 + (Zi7]i - Zj7]j) 2] + (Zi - Zj) 2.

Since the measurements (�, 7]) are known for each diode, this expression is a quadratic form with respect to the un­known pair (Zi' Zj) . A tetrahedron has totally 6 edges. Hence measurements of the vertices projections give 6 equations with respect to 4 unknown variables (Zl' Z2, Z3, Z4) :

1 <::: i < j <::: 4.

This is the overdetermined system of algebraic equations. An effective algorithm and corresponding software were developed to solve this system by the maximum likelihood method. The cost function in this method contains covari­ances of noises that are taken from ellipsoids describing the diode spots.

The algorithm is based on triangle recognition. Each triple of the equations above, with i E D, JE D, i ic j and D = {h, i2, i3} can be considered as a quadratic system of 3 equations with 3 unknown variables (Zi" Zi2 , Zi3) ' This system is then reduced to one polynomial 4-th order equation. Thus, each triangle gives three vectors of the vertex coordinates.

There are four triangles in a tetrahedron. Combination of the four solutions gives more precise estimate of each vertex vector together with the expected matrix of covariance.

Experiments have shown that the estimate error for the coordinates (Xi, Yi) is less than I mm and that accuracy of the coordinate Zi is within 2% of the distance to the helicopter.

A considerable number of false points are extracted by the primary recognition procedure. For all combinations of the points the overdetermined algebraic system is solved and the corresponding value of likelihood is calculated. The biggest value of the likelihood index extracts one or several candidates for the helicopter image. Each selected image is provided with the likelihood value that is used later for the dynamic filtering and for estimation of the cameras positions.

The connected coordinate system is defined as a system that is attached to the helicopter as a solid body. Its origin and axes are defined from geometry of diodes positions. The coordinates of the diodes calculated in a camera coordinate system are transformed to the connected coordinate system. This procedure is made for each camera separately, but the

145

result should be the same for both cameras. The discrep­ancy of estimates obtained is a good test for accuracy of the previous calculations. All experiments have shown the discrepancy less than 0. 1 mm at the distance of 1.5 - 2 m.

C. Mutual camera position Tracking of the moving body is made with respect to a

fixed earth coordinate system. In this system estimates of the state variables of the cameras and the helicopter are calculated together with their joint covariance.

The earth coordinate system cannot be attached to the helicopter or to its initial position because this information will be lost after the motion starts. Therefore, the system must be attached to the immovable cameras.

Origin of the earth coordinate system is defined as the middle of the segment between the cameras focuses. The plane OYZ contains both focuses, the horizontal axis OX is directed to the helicopter and makes the right triple of axes. If the image contains a vertical plumb-line then the axis OY can be directed upward.

In the chosen coordinate system vectors of the cameras focuses have the coordinates (0, Yc, Zc) and (0, -Yc, -Zc) , respectively, where the values of Yc and Zc are included into the total system state vector.

The Euler angles of the cameras with respect of the earth coordinate system are denoted by hel, <Pel, ecd and hc2, <Pc2, ec2) , respectively. Hereafter I denotes roll, <P denotes yaw and e denotes pitch.

The full state vector of the dynamic system under inves­tigation contains 20 variables:

8 (x, y, z, Vx, Vy, Vz, S1x, S1Y' S1z, I, <P, e,

lel, <Pel, eel, Ic2, <Pc2' ec2, Yc, Zc) T,

where r = (x, y, z)T is the vector of the helicopter center of gravity, V = (Vx, VY' vzf is the linear velocity vector, S1 = (S1x, S1y, S1z)T is the angular velocity vector, I, <P, e are the Euler angles of the helicopter. All the vectors are written in the earth coordinate system.

Initial estimation of this vector is made by the maximum likelihood method. The estimate is calculated together with its covariance matrix. Thus, the step of initial estimation of the cameras and helicopter positions is completed with calculation of the 20-dimensional vector 8 and of the full covariance matrix P of this vector.

Under hard observation conditions a number of such pairs (8, P) can be obtained. After tracking the moving object all spurious pairs will show bad performance and therefore they will be extracted and removed.

III. TRAC KIN G OF HELICOPTER MOTION

The TV images are received asynchronously with the averaged speed of 30 shots per second. The tracking system calculates the predicted diodes positions after receiving a new TV image. Then a strobe is selected around the predicted position for each diode. A spot from a diode is searched in the strobe in a similar way to the primary recognition.

Page 4: [IEEE 2010 IEEE/ASME International Conference on Mechatronic and Embedded Systems and Applications (MESA) - QingDao, China (2010.07.15-2010.07.17)] Proceedings of 2010 IEEE/ASME International

When all spots are found their centers and approximating ellipsoids are determined. They describe the results of posi­tion estimates on the screen and their expected accuracy.

The spot positions on the screen are nonlinear functions of the state vector

y = h(S)

where the vector y consists of 2-dimensional coordinates of the diodes images on the camera screen. Some diodes can be lost or shadowed, and therefore the dimension of y may vary from image to image.

The state dynamics is described by

S = f(S, u) .

Assume the state vector S is estimated as Sa to an appropriate accuracy such that the error S = S - Sa is relatively small. Then linearization gives

S R; f(So, u) + f�(SO, u) S, y R; h(So) + h'(SO) S.

The linearized K�man filter is applied to obtain an estimate of the deviation S.

The functions f and h are linearized in the strobe of tracking to an appropriate accuracy. Experiments have shown that the measurement noises are small enough such that this filter provides good performance.

The observation system does not depend on the number of detected diode spots in the image. Some of spots can be shadowed or lost on the bright background. Even in the case of completely shadowed diodes for a couple of images the Kalman filter does not lose the helicopter unless it makes a new manoeuvre.

A search in the strobes is the most consuming part of the algorithm. Nevertheless, we did not meet speed limitations with the standard C program in the real time system.

IV. AERODYNA MIC MODEL OF HELICOPTER

Helicopter dynamics is described by the equation

S = f(S, u) ,

where u is control containing cyclic and collective pitch control of the main rotor and directional control by the tail rotor. The function f is given by a system of nonlinear algebraic equations.

The state vector S contains 12 variables of the helicopter position in the earth coordinate system. The equations

are trivial. Dynamics of the Euler angles is determined by the angular velocities according to the equations

Dx - (Dy cos '{ - Dz sin '{) tan 8, Dy sin '{ + Dz cos ,{,

. 1 (Dy cos'{ - Dz sm '{) --8. cos The most important part of the helicopter dynamics are the equations for linear and angular velocities that are

146

determined by forces and torques. In the earth system of coordinates the helicopter dynamics is described by the equations

1 -D x V + -(Fmain + Fgyro + Ftail + Fmg),

m

Mmain + Mgyro + Mtai1

m is the mass of helicopter, I = diag(Ix , Iy, Iz ) is the diago­nal matrix with moments of inertia, (F main, Fgyro, Ftail) and (Mmain, Mgyro, Mtai1) are the forces and torques vectors of main rotor blades, servo rotor blades and tail rotor blades, respectively, F mg vector of gravity.

The forces and torques are the functions of the state vector. The explicit formulas for them and the corresponding numerical algorithm of their implementation were developed from the impulse theory of the main rotor [ 1]

The balanced mode of the stationary position with S = canst is achieved with the following parameters:

'{ = 4.70; u"( = 2.61;

8 = 0.30; Ue = 2.47.

An effective numerical algorithms and software were also developed to calculate balanced realization with an arbitrary constant linear velocity vector V and an arbitrary constant yaw velocity Dy.

V. IDENTIFICATION

The real time experiments have shown that the closed loop system is very sensitive to the model parameters and that the theoretical model does not describe the helicopter dynamics to the necessary accuracy.

The linearized helicopter dynamic equations were sim­plified and divided into separate channels. Equations of longitudinal and lateral channels in the helicopter coordinate system are

Cv (�) + Co (g:) + gJ G) + dv (�:) ,

(� X) �l [c (g:) + d (�)] where col (,{, 8) are the roll and pitch angles, g is the acceler­ation of gravity, cal (Ux , Uz ) are controls in the longitudinal and lateral channels. The matrices cv, co, dv, c and dare linear combination of matrices I and J:

Cv = Co = dv = c= d=

1=

cvoI + CVIJ, cool + cmJ, dvoI + dVIJ, Col + cl J, dol + dl J,

G �) , J = (�

-1) o

.

Page 5: [IEEE 2010 IEEE/ASME International Conference on Mechatronic and Embedded Systems and Applications (MESA) - QingDao, China (2010.07.15-2010.07.17)] Proceedings of 2010 IEEE/ASME International

The impulse theory of the main rotor gives the following values:

Cvo = 0.05, Cno = 3.71, dvo = 2.41, Co = 17.76, do = 2.92,

CVI = 0.00, Cm = � 37. 15, dVI =

� 9. 73, CI = 5 . 73,

dl = 0.52.

Values of scalar parameters each of matrix were adjusted by records of experimental data. The data was obtained from the camera observations and Kalman filtering. We used a gradient method with integration of sensitivity function. Linear trends has been added in simplified equations. The cost function was chosen as the square distance between real and simulated data:

(Co, CI, do, dd =

tl

argmin L [ IDx � Oxl2 + IDz � Oz12] t=to

(cvo, CVI, Cno, cm, dvo, dvd =

tl

argmin L [lVx � Vxl2 + I Vz � Vz12] t=to

where [to, tIl is the time interval of experiment, Dx and Qz are t�e measured angular velocities from experiment, Dx and Dz are the simulated angular velocities obtained by integration of the model equation with input taken from experimental observations, Vx �nd Vz a� the measured linear velocities from experiment, Vx and Vz are the simulated linear velocities obtained by integration of the model equa­tions with input taken from experimental observations. Initial values of scalar parameters were calculated by the linearized model equations.

Results of identification of linear and angular velocities equations are presented in Figure 5.

!.::� llme(WO)

I:� > ."

25 3l :J!i 4J 46 llm1(U1O)

!� ·"L-------c!.-"' -----''---------.!.,.--- -----,�!;-------''',,-------.!!�

llm1(MO)

Fig 5. Linear and angular velocities adjusting

Additional TV-tracking estimation delays were observed during the identification procedure in the longitudinal and lat-

147

eral channels were revealed. Delays are caused by Kalman­Bucy filter. It was identified as 0.08 sec.

The vector of the identified parameters differs essentially from their theoretical values:

Cvo = 0.04, Cno = 14.3, dvo = 1.12, Co = 2.66, do = 0.97,

CVI = �0.01, cm = � 65. 5, dVI = �3.02,

CI = 22.62, dl = 0.53.

But the controller designed for this model appeared to be stabilizing for the helicopter.

VI. CONTROL DESIGN

The main goal of the controller is stabilization of the he­licopter around a chosen balanced state vector. In particular, the stationary state was of the main interest. Stabilization was achieved by the linear feedback

u(t) = Lor5(t) + LnD(t) + LvV(t) + LxX(t) + (a + bt)

where r5 = col ( I, <Ii, B) is the vector of Euler angles, X =

col(x, y, z) is the helicopter position, Lo, Ln, Lv are the constant matrices to be designed, a and b correspond to the linear trend of the electrical part of the main rotor. The vectors D and V are in the helicopter coordinate system.

This controller was obtained from the standard LQ theory with appropriate choice of coefficients in the cost function. The helicopter equations were linearized

where A and B contain partial derivatives in the balanced state vector.

The cost function contains only deviations of the heli­copter position (x, y, z) from its initial value and a regu­larizing term with deviation of control from the balanced values.

Auxiliary controls are entered to consider the Kalman filter delay:

. 1 Ux = Tu (bxue � Ux)

. 1 Uz = Tu (bzu, � Uz)

where Tu is the time constant in aperiodic link, bx and

bz are the hub driving gear gains, Ue and u, are the measured controls, Ux and Uz are the controls from the model equations.

VII. LABORATORY EX PERI MENTS

The main goal of experiments is verification of controller in the balanced mode. Flight tests consist of automatic take­off, landing and stabilization of hovering. The LQ optimal control theory was implemented for the continuous-time plant with discrete asynchronous measurements from two cameras. One controller was designed for longitudinal and

Page 6: [IEEE 2010 IEEE/ASME International Conference on Mechatronic and Embedded Systems and Applications (MESA) - QingDao, China (2010.07.15-2010.07.17)] Proceedings of 2010 IEEE/ASME International

lateral channels, the other two controllers determine thrusts of the main and tail rotors.

Results of flight experiments are presented below.

0.2 0, o -� -0.2

L-----�2� 0 ------��L---��30�----� $L · --�---"40· 0.4 0.2 - V,

o - �

-0.2 L-----�2� 0�-----��-�L---�30�----�$L-----�40 0.4 O

� ; -0.2.

L-----���------ �=-------�30�----� $�----�40 Fig 6. Longitudinal and lateral channels data

t:2::::1 10 15 20 25 30 35 40 45 50

10 15 20 25 30 35 40 45 50

10 15 20 25 30 35 40 45 50 Fig 7. Main rotor thrust channel

' :� ·10 � � � � � m _ M � W �

3.3�'" 3.2 3.1

�LO--�2L 2 ---2L 4 ---2�6�L2� 8--�30--�32��34--�36---- 3L8 ---D40

22 24 26 28 30 32 34 36 38 40

Fig 8. Tail rotor thrust channel

Coordinates are in meters, linear velocities in meters per second, angles in radians, angular velocities in radians per second, controls in hundredth parts of volt.

148

VIII. ONBOARD SENSOR

An onboard sensor was attached to the helicopter fuselage. It contains three gyroscopes and three acceleration gauges. The gyroscopes measure angular velocities of the helicopter. The range between -3 and +3 rad/s is covered by a grid with 1024 points. The sample rate is around 273.5 samples per second. It corresponds to 10 samples per revolution of the main rotor.

Roll velocity measured by sensor and estimated from TV image

seconds

Pitch velocity measured by sensor and estimated from TV image

seconds

Fig 4. Sensor and camera measurements.

The data from gyroscopes show big and fast oscillations of fuselage forced by the rotation of the main rotor. Angles variations are small but the angular velocities of oscillations appear to be 3-4 times greater than their smoothed values. The Pitch and Roll velocities of the helicopter are shown in Fig. 9. The sensor data are blue, Kalman filter estimates by camera observations are red.

A detailed study of the oscillation signal have shown that it is a sum of pure harmonics with frequencies multiple to the main rotor rotation frequency F. The disturbances in the angular velocity measurements forced by the main rotor rotation can be attenuated by means of the corresponding filtering. A simple time invariant FIR filter of the 10-th order was designed with zeros in the areas of the 5 first multiple harmonics frequencies. It can be concluded that the helicopter angular velocities can be successfully estimated from the onboard sensor measurements.

IX. CONCLUSION

The full autopilot system was designed for a small elec­trical helicopter. Flight results have shown good accuracy of hovering stabilization. Sensors are images from two stanard video cameras. Identification of the model parameters gave essentially different values than the aerodynamics theory.

REFERENCES

[I] M.L Mil, AV Nekrasov, AS. Braverman, LN. Grodko, M.A Leikand. Helicopters. Designing and calculations. Moscow, 1966.

[2] AE.Barabanov, N.Yu.Vazhinsky, DVRomaev. Full autopilot for small electrical helicopter. Proc. of the 33th European rotorcraft forum. 2007. Kazan. September 11-13.