A multivariable toy helicopter makes for an impressive, visually arrest- ing, classroom control demonstration. It also possesses the dubious distinc- tion of being practically uncontrollable under manual operation. However the challenge to obtain a robust, stable, multivariable controller is non-trivial given the nonlinear nature of the helicopter, severe stiction in the bearings, the stochastic nature of the disturbances, and the limitations of modest PCs. This paper describes a model predictive controller (MPC), applied to an actual bench-scale helicopter using the Mathworks xPC target. Considerable effort was required to develop a semi-physical model of the two degrees of freedom (elevation and azimuth) helicopter dynamics. Four states are needed to model the position and velocity of the body in the two axes,(µ1; _ µ1; µ2; _ µ2 ). In addition two further states, (!1; !2 ), are needed to model the dynamics of the two rotors giving a total of six, coupled, highly- nonlinear states. These nonlinearities are succiently crucial that ignoring them results in an unstable controller. While simulations in Matlab worked perfectly, the combination of un- modelled dynamics, sloppy sampling, and saturation in input and discretiza- tion of output all contributed to deteriorate the actual experimental con- trolled response. Furthermore, MPC has demanding inter-sample compu- tation requirements, which are exacerbated in fast-acting plants. Due to the necessity of employing the full nonlinear model for the prediction step, the demand for relatively short sampling times, coupled with long predic- tion, and in particular, control horizons, Simulink or even raw Matlab using real-time toolbox did not su±ce. Since the operation count scales as the cube of the control horizon in receding horizon controllers, balancing the sampling time against the control and prediction horizons becomes an important design parameter. In order for the controller to be su±ciently robust and to meet the chal- lenge that the controller must be implemented on modest hardware, we used the dedicated xPC target real-time kernel. The main algorithmic stumbling blocks for the MPC calculations each sample time are the re-linearization of the nonlinear system, and the nonlinear integration step required for the prediction. These operations are not suited for the block diagram nature of Simulink , and even if attempted, are comparatively slow compared to C code. The disadvantage of C code is that it blurs the transparency of the application. The streamlining of the computation required the following three steps: (1) employing simple fast explicit integrators, (2) using ana- lytical Jacobians and a Pad¶e approximation method for the linearization and discretization steps, and (3) only partially computing the least-squares solution to the optimization using a Cholesky decomposition. The last sav- 1
2002. , p. 165