AIsys_1.mws

**Ball and Wheel - Example of a Non-Linear Affine-Input System **

*by *
*A. Kugi, K. Schlacher and R. Novak, Department of Automatic Control, Johannes Kepler University, Linz, Austria,*

*kugi@mechatronik.uni-linz.ac.at*

NOTE: This worksheet demonstrates the use of the AIsys package to solve a system of a Ball and Wheel.

**Introduction**

The AIsys package contains several algorithms for the analysis and synthesis of nonlinear Affine-Input control systems, or AI-systems for short. This class of systems describes a large number of physical systems in many engineering applications. However, only the increasing availability of low cost digital signal processors in combination with the increasing power of computer algebra programs like Maple enable the practical use of these nonlinear control strategies.

The AIsys package contains four examples which prove that the proposed algorithms are also feasible for practical problems. This mechanical example is the ball and wheel experiment. Other examples in the Maple Application Center include benchmark tests for nonlinear control systems, namely the chemical stirrer vessel, the squirrel cage induction motor and a hydraulic system.

**Loading the AIsys package**

The AIsys package has been archived into a Maple Library. To install it download the file AIsys2.zip and extract the contents into a directory.

Note: Do not extract these files into your Maple "lib" directory since you could overwrite your main Maple library.

`> `
**restart;**

`> `
**libname := "C:/mylib/aisys", libname:**

`> `
**with(AIsys);**

To find out more read this worksheet or the help file:

`> `
**?AIsys**

**Example 1: Ball and Wheel**

A very interesting example of a nonlinear system that is also commercially available is the ball and wheel model. The wheel (green), driven by a motor is used to position the ball (blue). The parameters are given by Jb (Jw), moment of intertia of the ball (wheel), radii r2 (r1) and the mass of the ball mb. As coordinates, we use the angular displacement of the wheel x1, the the rod x2 and their time derivatives w1, w2, as shown above. It is assumed, that the rod has no mass.

`> `
**f_x := [w1, w2, 2*mb*g*sin(x2)*r1/(7*Jw+2*mb*r1^2), g*sin(x2)*(5*Jw+2*mb*r1^2)/((r1+r2)*(7*Jw+2*mb*r1^2))];**

g_x := [0, 0, 7*1/(7*Jw+2*mb*r1^2), 2*r1/((r1+r2)*(7*Jw+2*mb*r1^2))];

xx:=[x1,x2,w1,w2];

Setup mathematical model for AIsys package

`> `
**f_x:=M_AIsys(f_x);**

g_x:=M_AIsys(g_x);

Check relative degree for output x2

`> `
**RelDeg(f_x,g_x,x2,xx);**

``Attention - Jacobian not checked.``

As one can see, the relative degree is 2

Calculate the maximum possible relative degree

`> `
**MaxRelDeg(f_x,[g_x],xx);**

As a result, we obtain 4, hence the system must be exact input-state linearizable. In the next step, we will check if this is the fact.

`> `
**LinPart(f_x,g_x,xx);**

``The system is state space linearizable.``

Indeed, the system is exact input-state linearizable.

For the special choice of the output function h, we get relative degree 4 and we calculate the corresponding diffeomorphism.

`> `
**h:=(-2*r1*x1+7*x2*r1+7*x2*r2)/((r1+r2)*(7*Jw+2*mb*r1^2));**

trans:=RelDeg(f_x,g_x,h,xx);

``Attention - Jacobian not checked.``

At last we calculate the nonlinear feedback law for the considered output h with relative degree 4.

`> `
**UTrans(f_x,g_x,h,xx,v,true);**

``Checking column dimension of jacobian A = dt/dx``

``Computed relative degree is 4 and jacobian of A is regular``

``Used coefficients: a0, a1, a2, a3, ``

``Coefficient: a4 set to 1``

The same result is obtained by the corresponding MIMO algorithm

`> `
**MUTrans(f_x,[g_x],[h],xx,v);**

``Checking the rank of the decoupling matrix``

``Decoupling matrix seems to be regular.``

``Computing inverse matrix``

``Computing Transformation``

Checking singularities by means of the `AIsys/SIMP` command

`> `
**`AIsys/SIMP`[2]:={x2=Pi/2};**

UTrans(f_x,g_x,h,xx,v,true);

``Cannot assign relative degree.``

`> `

`> `

**Disclaimer:**
While every effort has been made to validate the solutions in this worksheet, Waterloo Maple Inc. and the contributors are not responsible for any errors contained and are not liable for any damages resulting from the use of this material.