Skip to content

Latest commit

 

History

History
127 lines (96 loc) · 4.57 KB

ballbeam.rst

File metadata and controls

127 lines (96 loc) · 4.57 KB

Ball and Beam (ballbeam)

A beam is pivoted on a bearing in its middle. The position of a ball on the beam is controlable by applying a torque into the bearing.

The ball has a mass M, a radius R and a moment of inertia Jb. Its distance r to the beam center is counted positively to the right. For the purpose of simplification, the ball can only move in the horizontal direction.

The beam has a length L, a moment of inertia J and its deflection from the horizontal line is the angle θ.

The task is to control the position r of the ball with the actuation variable being the torque τ. The interesting part in this particular system is that while being nonlinear and intrinsically unstable, it's relative degree is not well-defined. This makes it an exciting but yet still clear lab example. The description used here is taken from the publication [Hauser92] .

The ball and beam system

The ball and beam system

With the state vector

$$\begin{aligned} \boldsymbol{x} = \begin{pmatrix} x_1 \\\ x_2 \\\ x_3 \\\ x_4 \end{pmatrix} = \begin{pmatrix} r \\\ \dot{r} \\\ \theta \\\ \dot{\theta} \end{pmatrix}, \end{aligned}$$

the nonlinear model equations are given by

$$\begin{aligned} \boldsymbol{\dot{x}} = \begin{pmatrix} \dot{x}_1 \\\ \dot{x}_2 \\\ \dot{x}_3 \\\ \dot{x}_4 \end{pmatrix} = \begin{pmatrix} x_2 \\\ \frac{M R^2}{J_b + M R^2} (x_1 x_4^2 - g \sin(x_3)) \\\ x_4 \\\ \frac{\tau - M \cdot (2x_1 x_2 x_4 + g x_1 \cos(x_3))}{M x_1^2 + J + J_b} \end{pmatrix}. \end{aligned}$$

Violations of the model's boundary conditions are the ball leaving the beam

$$|x_1| > \frac{L}{2}$$

or the beam's deflection reaching the vertical line

$$|x_3| > \frac{\pi}{2}.$$

The ball's position


y = x1 = r

is chosen as output.

The example comes with five controllers. The :pyFController and :pyGController both implemenent a input-output-linearization of the system and manipulate the second output derivative by ignoring certain parts of the term. The :pyJController ignores the nonlinear parts of the linearized model equations, also called standard jacobian approximation. The :pyLSSController linearizes the nonlinear model in a chosen steady state and applies static state feedback. The :pyPIXController also linearizes the model and additionally integrates the control error.

:pyLinearFeedforward implements a compensation of the linear system equation parts, with the aim of reducing the controllers task to the nonlinear terms of the equations and disturbances.

The example comes with four observers. :pyLuenbergerObserver, :pyLuenbergerObserverReduced and :pyLuenbergerObserverInt are different implementations of the Luenberger observer. The second of these improves its performance by using a different method of integration and the third uses the solver for integration. The :pyHighGainObserver tries to implement an observer for nonlinear systems, However, the examination for observability leads to the presumption that this attempt should fail.

A 3D visualizer is implemented. In case of missing VTK, a 2D visualization can be used instead.

An external :pysettings file contains all parameters. All implemented classes import their initial values from here.

At program start, the main loads two regimes from the file :pydefault.sreg. :pytest-nonlinear is a setting of the nonlinear controller moving the ball from the left to the right side of the beam. :pytest-linear shows the step response of a linear controller, resulting in the ball moving from the middle to the right side of the beam.

The example also provides ten different modules for postprocessing. They plot different combinations of results in two formats, one of them being :py.pdf. The second format of files can be given to a metaprocessor.

The structure of :py__main__.py allows starting the example without navigating to the directory and using an :py__init__.py file to outsource the import commands for additional files.

Hauser92

Hauser, J.; Sastry, S.; Kokotovic, P. Nonlinear Control Via Approximate Input-Output-Linearization: The Ball and Beam Example. IEEE Trans. on Automatic Control, 1992, vol 37, no. 3, pp. 392-398