For more information, visit the following websites:

## Contents

The universality of this framework has one disadvantage. It is difficult to study it, since it has a large number of facilities. Even the author of this software was frequently discouraged. The best method of studying or using this software is handling a lot of samples of its applications. This article contains samples devoted to automatic control and processing of signals.

Automatic control and processing of signals is, in general, a pure math. In principle, it is possible to use MatCAD for it. However, the purpose of this framework is not only calculation. Calculations should interoperate with other facilities of this software, for example, 3D graphics. So, I'll show application examples of automatic control and the processing of signals.

There are a lot of improvemets of this software. Now it is compatible with Visual Studio2013. Also it supports Simulink and real-time. These new features are briefly described here. I fixed the bug with the phase detector sample.

Now I'm engaged by a very interesting job, so I've little time for writing a profound description of the framework. Also, I cannot find assistants. A person who can catch the problem usually has their own excellent work. However, the framework is being intensively developed and I would like developers to know about its new updates. Therefore, instead of a profound description, I put in brief remarks about changes to the framework.

### Testing

Now the framework can test a set of situations. Testing code belongs to the *TestCategory.csproj* and *AstronomyGL_Test.csproj* projects. The user can put a set of **.cfa* files into a directory or database and the framework can test all of them.

### User Interface

Editors of properties in previous versions can be opened in separate windows only. Now you can find them on the desktop.

Now charts are placed directly on the desktop. Right mouse-clicking on the caption (for example, `Chart`

) shows the old layout in a separate window:

Also, a new version of the software contains DockManager developed by Weifen Luo. I've found that open file operation is very exhausting work. So, the new version enables us to drag a **.cfa* file to the desktop. The result is the same as file open.

The framework uses drag and drop in other situations, as well. For example, if we put the series component on the desktop and drag a **.gra* file onto it, then whatever is contained in the file series will be loaded to the component:

### Time Derivations

The new version of the formula editor contains a new operation, . Let us consider usage of this operation. For example, we have the following picture:

The `Init`

component has following property editor:

`Init`

has a single formula and accepts **Derivation order** 3. This means that any client of `Init`

may use derivations of the formula by order up to 3. `Der`

is a client of `Init`

. Its property editor is exhibited below:

We have two formulas with one input variable, `x`

. This variable is, in fact, **Formula 1** of `Init`

. The variable is provided by `Init`

. So, we can calculate such formula derivations that require derivations of `x`

of orders that do not exceed 3.

### Other Features in Brief

The present day version of the framework contains lots of new components: magnetic field, sensor of 3D field, inertial navigation system, etc. Although these features do not belong to pure automatic control theory, they are related to concrete automatic control systems. For example, magnetic field and field sensor components can be used for simulations of spacecraft orientation control systems.

Now there exists a website devoted to the framework. I and my colleagues are more engineers and scientists than software developers or architects. A lot of our work does not correspond to The Code Project. If you wish to know this work, you can visit the framework site. This article contains a new chapter devoted to transfer functions and the Dirac Delta function.

This example contains a simulation of a follow-up system of radar. See the picture above. It has two channels: the channel of azimuth and the channel of elevation angle. The geometry of this system is represented in the following picture:

In this situation, an antenna is installed on gimbal suspension with two degrees of freedom: azimuth and channel of elevation angle. Let us construct the situation.

We have the `Ground`

frame. We've installed the `Azimuth`

frame on it and the `Elevation`

frame on the `Azimuth`

frame. The `Azimuth`

** **frame is rotated around the y-axis of the `Ground`

frame and the `Elevation`

frame is rotated around z-axis of the `Azimuth`

frame. In result, the `Elevation`

frame is the frame of the antenna.

We also have the `Vehicle`

frame. Its motion is defined by the `Motion`

component. We've chosen such motion that the following graphs look beautiful. The `Measurements`

component performs measurement parameters of the `Vehicle`

frame relative to the `Elevation`

frame. These measurements shall be used below for the construction of the control system. We let that antenna perform an angular measurement of the `axisrving`

line. These measurements are unambiguously defined by `y/d`

and `z/d`

where `y`

, `z`

and `d`

are the y-coordinates, z-coordinates and the distance of the `Vehicle`

expressed in the reference frame of the antenna. We shall use the following control law:

...where and are angles of gimbal suspension and `a`

, `b`

, `c`

, `f`

, `g`

and `h`

are constants. This control law is, in fact, standard of the control theory. Constants are usually selected by stability and other criteria of this theory. Then we shall construct the control law:

The `Delta`

calculates `y/d`

and `z/d`

:

The data-in of `Delta`

are parameters of `Measurements`

**:**

The `System`

component solves differential equations of the control law. These two equations of second order are decomposed by four ordinary differential equations of first order. It looks like this:

Then we add another component to calculate orientation quaternions of the `Azimuth`

** **and `Elevation`

components. We also add indication components. Click here to download this situation. A graphical analysis of control quantity is presented in the following picture:

Light red and dark red curves correspond to the azimuth of `Vehicle`

and antenna orientation. Similarly, light blue and dark blue curves correspond to elevation channel. Thus, a control system is constructed. Also, we may install a virtual camera on the antenna (`Elevation`

) and observe 3D video of `Vehicle`

motion. At part 7, I installed a camera on the `Ground`

or the `Vehicle`

. Virtual cameras are used at part 2 of this software description. Later, we may to install a virtual radio transmitter/receiver on the antenna and virtual electronic equipment, etc. Click here to download this sample.

A lot of control systems use on-off control elements that have the following in-out function:

This function has the following math description:

If we have several sets of photos of a 3D object, we can obtain its 6D position. In this example, the problem is solved in the following way. From the photos and virtual cameras, we obtain the contours of the object as it is presented in the following picture:

...where are input and output on the n^{th} time moment. We shall use a recursive element for simulation of this element. A simple situation of usage of this element is presented below:

The `Recursive`

component contains recursive equations of the on-off control element. These equations look like this:

As a result, we have the following charts:

A red curve is an input and a green one is an output. Click here to download this sample.

Usually, continuous filters are described by systems of ordinary differential equations. Since we have considered systems of ordinary differential equations above, our description will be very brief. You should click here to download a sample of a continuous filter. The result of filtration is presented in the following picture:

A red curve is an input of the filter and a green one is an output. The output looks more smooth. It is shifted by phase. You can process obtained inverse time signals through this filter to avoid the shift.

A digital filter is any electronic filter that works by performing digital math operations on an intermediate form of a signal. We'll consider a digital version of the third order Butterworth filter. A Z-transform of this filter looks like this:

...where...

The is a cut-off angular frequency. I've constructed the filter as a cascade of recursive elements with transfer functions . As well as continuous filtering, it performs smoothing. Click here to download this sample digital filter.

In this example, I've used a digital version of the standard frequency demodulation of FM signal. The method looks like this:

The `Diff`

component performs numerical differentiation. The `Abs`

component is a digital rectifier. The `Integral`

component is a digital low frequency filter. The input signal is a chirp. The result of demodulation is presented below:

The error of demodulation is caused by the non-linearity gain frequency characteristic of the filter. Click here to download this sample.

This example is devoted to determining the differences cosine of two signals' phases. I've used the following correlation scheme:

The `p1`

and `p2`

contain two harmonic signals, x(t) and y(t), having almost equal frequencies. The `Multiplication`

calculates the squares and product of these signals. The `Integration`

performs a digital calculation of the following integrals:

The `Integration`

also performs digital filtering with the following transfer function:

The `Post`

calculates the cosine by the following expression:

As was expected, this discriminator shows the following determination picture of the differences cosine of the phases:

Click here to download this sample.

A transfer function is the ratio of the output of a system to the input of a system in the Laplace domain, considering its initial conditions to be zero. If we have an input function of X(s) and an output function of Y(s), we define the transfer function H(s) to be:

Readers who have read a circuit theory book will recognize the transfer function as being the Laplace transform of a circuit's impulse response. The new version of the framework contains the new component . Its properties editor is presented in the following picture:

Using the formula editor, we can enter the transfer function. This editor also exhibits transients:

It also represents frequency characteristics using both linear...

...and logarithmic scales:

An example of its usage is presented below:

The `Input`

generates a harmonic input signal. The `Transform`

transforms it. The red curve is input and the blue curve is the result of the transformation. Click here to download this sample.

As has been said above, this task requires the Dirac Delta function. The formula editor supports it. The presence of the Delta function at the right part of the ordinary differential equation shows that the resulting function is not continuous. It is presented in the following chart:

The framework can operate with Dirac Delta functions. For example, the following formula...

...is allowed. You can use these formulae as the input of transformation functions, as presented in the following picture:

Also, the Dirac Delta function can be used in ordinary differential equations. Click here to download samples with Dirac Delta function.

Simulink is a powerful software it is used for digital signal processing. Current verion of my soft suppotrs compatibilty with Simulink. Following pictire contains digital signal processing with a Simulink component.

Above picture contains a Simulink PID controller.

Download these sample 4.37 KB

Now my soft suppotrs real-time, so it supports real time control and signal processing. Following movie shows real-time example of digital filtering.

Download this sample 4.37 KB

More details about real-time are contained in my articles:

The name "Universal Framework" looks like pure advertisement only. However, if I say that this software enables me to operate with every kind of absorbing layer, then it results in the shock of my interlocutor. When I show how I can operate with every kind, "Indeed, your software enables you operate with every kind," replies the interlocutor.

- 24 July, 2006 -- Original version posted
- 13 September, 2007 -- Article and downloads updated
- 14 August, 2014 -- Article and downloads updated and extended