I explained about state feedback control here, but there is a problem.
It means that state variables cannot always be measured.
For example, in the following system, if you want to control the rotation speed of the motor to the target position, you need information on the actual rotation speed and current value.
However, if the current value cannot be actually measured due to various reasons, the State Observer is useful.

■What is a State Observer?

The simple idea of a state observer is to estimate unmeasurable information with a model from other measurable information.
The shape of the observer is as follows. Since the observer is a function to estimate the state, it is not possible to feed back the controlled object by this alone.
The method of state feedback using the state observer is explained here.

Since the initial value of the state observer is not known, the disadvantage is that an error occurs in the controlled object at the initial stage.
Observer gain h is effective to converge this error as soon as possible.
Multiplies the observer gain according to the deviation between the actual output value of the controlled object and the output value estimated by his observer.

The error between the real x (t) and the estimated x (t) is defined as the error-state equation as follows.

The equation of state of the controlled object is as follows (after Laplace transform).

The equation of the state observer is as follows (after Laplace transform).

(2) Subtract (4),

Substitute (3) and (5) into the above equation.

From (1),

■ Observer gain settings

Use the pole placement method used to set the state feedback gain.
From (6), find h where the root of the characteristic equation is negative below.

Note that the system must be observable in order to design an observer.
Now, let's find the observer gain specifically. A, b, c, are as follows.

Details are omitted, but the above shows that this system is observable. Next, the characteristic equation is as follows.

Here, the value of observer gain h should be set so that the root (pole) of the above characteristic equation becomes a negative value, and it is up to you to decide what kind of value it should be.
Therefore, here we determine h such that the pole is -6.

Here, the formula with a pole at -6 is as follows. This is the result of expanding (x + 6)^{2} = 0.

If you compare (2) and (3) here,

Now you can find the observer gain. Observer gain can be easily obtained with Scilab.
Enter as shown in the red line below on the console. The ppol function is explained here.

■Design a state observer with Scilab

The above system is represented by a block diagram below.

The design result with Scilab is as follows. The initial value of i (t) of the controlled object is 1, and the initial value of the estimated i (t) of the observer is 0.

■State observer simulation results

as below. You can see that the observer matches the value of the controlled object earlier.

■Observer benefits. More accurate than the reverse model

An observer estimates a state quantity that cannot be measured, but there is another way to estimate the state quantity.
It is a method of calculating back from the output value as follows. This method may seem good at first glance, but it is known that the output value often contains noise, and it is difficult to obtain the correct state quantity if differentiation is performed in that state.
If an observer is used, the state quantity can be estimated accurately even if there is noise in the output value.

■Observer's shortcomings. Does not correct modeling error

The observer does not correct the modeling error, so if there is an error in the model, the state quantity cannot be estimated correctly.
The simulation result when the value of B of the above observer is changed from 10 to 8 is shown. You can see that it does not match the controlled object.

The above is how to estimate the state by the observer. Next, I will explain how to use the observer for state feedback. Click here.