# State observer feedback

It proved relatively easy to do State Observers and State Feedback in LTSPICE, see Fig. 1.

In the diagram, the equation for B4 is the state-feedback (found with Matlab). State-feedback allows to arbitrarily place the poles of the closed-loop system. Here I have defined the poles for fast rise-time and no overshoot or ringing.

The box in the bottom half of the diagram describes a State-Observer. This observer is able to predict the voltage on all capacitors and the current through all inductors, just by "observing" the output voltage (out) and the error voltage (err) of the controller. In the circuit of Fig. 1 the current through L1 is not actually measured. You may note that the observer will take just two lines of C code in the system micro-controller. The model for the observer is also found with Matlab tools. Although the outcome is very simple, it takes hundreds of pages to explain how it works and mathematically prove that the method is correct, so I will not attempt that here.

Figure 1. Simple buck converter with state-feedback and state-observer control.

The openloop results of the circuit are quite bad:

Figure 2. The open-loop step response of the circuit of Fig. 1, using no feedback.

The closed-loop results in Fig. 3 show the spectacular results that can be achieved. There is almost no overshoot and ringing on the output voltage any more (The Matlab recommendations were used without adjustments and could be tweaked). The rise- and falltime of the voltage can be made arbitrarily fast, only constrained by the allowable current through the switches (here limited to 20 Ampere).

Figure 3. Results of using State-Feedback and a State-Observer with the circuit of Fig. 1. The real voltage and current are V(out) and I(L1). The signals V(vz) and V(iz) are the predictions of the state-observer.

The signals V(vz) and V(iz) are computed inside the micro-controller and are normally invisible. LTSPICE allows us to plot them directly. You will see that V(vz) is a nearly perfect copy of the real V(out). The V(iz) is the predicted inductor current I(L1) and is also a very good replica. (By design, the observer does not predict the HF switching ripple, but all other details are there.)

Please note that I took a very simple example here. In practice SMPS topologies have more inductors and capacitors (i.e. states), and gas-discharge lamps have many additional hidden state variables. If we are able to supply appropriate dynamic models for all components (especially lamps), we may be able to use state-observer techniques to move from all-hardware measurements to software predictions, at the same time improving quality.