Main Content

Extremum Seeking Control for Reference Model Tracking of Uncertain Systems

The design of feedback and feedforward gains for a given system is a common controller design technique. In this example, you use an extremum seeking controller to track a given reference plant model by adapting feedback and feedforward gains for an uncertain dynamical system.

Adaptive Gain Tuning for Uncertain Linear Systems

For this example, consider the following first-order linear system.

x˙(t)=a0x(t)+b0u(t)

Here, x(t) and u(t) are the state and control input of the system, respectively. The constants a0 and b0 are unknown.

The goal of this example is to track the performance of the following reference plant model, which defines the required transient and steady-state behavior.

x˙ref(t)=a*xref(t)+b*r(t)

Here, xref(t) is the state of the reference plant and r(t) is the reference signal.

The aim of the control signal u(t) is to make the states x(t)of the uncertain system track the reference states xref(t).

u(t)=-Kx(t)+Kr(t)

The designed controller contains a feedback term -Kx(t) and a feedforward term Kr(t).

Substitute this control signal into the unknown linear system dynamics.

x˙(t)=a0x(t)+b0(-Kx(t)+Kr(t))

You can rewrite this expression as shown in the following equation.

x˙(t)=-(a0+b0K)x(t)+b0Kr(t)

In the ideal case, if the coefficients a0 and b0 of the nominal system dynamics are known, then you can determine the controller gain K using pole-placement techniques. Doing so produces the following matching condition.

a0+b0K=a*,b0K=b*

When you use a single gain value as both the feedforward and feedback gain, this matching condition might not be satisfied for all the possible values of a0 and b0. For a more general solution, you can tune two different gain values (multiparameter tuning).

For this example, use the following unknown system and the reference dynamics.

x˙(t)=-1x(t)+u(t)

x˙ref(t)=-3xref(t)+2r(t)

In this case, the ideal control gain is K=-2.

Extremum Seeking Control Adaptive Gain Tuning

To implement an extremum seeking control (ESC) approach to the preceding problem, you define an objective function, which the ESC controller then maximizes to find the controller gain K.

For this example, use the following objective function.

J=-5(x(t)-xref(t))2dt

The following figure shows the setup for extremum seeking control.

  • The cost function is computed from the outputs of the reference system and the actual system.

  • The extremum seeking controller updates the gain parameter.

  • The control action is updated using the new gain value.

  • This control action is applied to the actual system.

This problem configuration is implemented in the firstOrderrefTracking_Esc Simulink model.

mdl = 'firstOrderRefTracking_Esc';
open_system(mdl)

In this model, the gain value is optimized using the Extremum Seeking Control block.

The System Dynamics and Objective subsystem contains the reference model, the plant (including the actual system and control action), and the objective function computation. These elements are all implemented using MATLAB Function blocks.

open_system([mdl '/System Dynamics and Objective'])

Specify an initial guess for the gain value.

IC = 0;

The Extremum Seeking Control block perturbs the parameter value using a modulation signal. It then demodulates the resulting change in the objective function signal before computing the parameter update. Configure the extremum seeking control parameters for this block.

First specify the number of parameters to be tuned (N) and the learning rate (lr).

N = 1;
lr = 0.55;

Configure the demodulation and modulation signals by specifying their frequency (omega), phases (phi_1 and phi_2), and their amplitudes (a and b).

omega = 5; % Forcing frequency
a = 1; % Demodulation Amplitude
b = 0.1; % Modulation Amplitude
phi_1 = 0; % Demodulation phase
phi_2 = 0; % Modulation phase

For this example, the Extremum Seeking Control block is configured to remove high-frequency noise from the demodulated signal. Set the cutoff frequency for the corresponding low-pass filter.

omega_lpf = 1;

Simulate the model.

sim(mdl);

To check the reference tracking performance, view the state trajectories from the simulation. The actual trajectory converges to the reference trajectory in less than five seconds.

open_system([mdl '/System Dynamics and Objective/State'])

To examine the behavior of the ESC controller, first view the objective function, which reaches its maximum value quickly.

open_system([mdl '/System Dynamics and Objective/Cost'])

By maximizing the objective function, the ESC controller optimizes the control gain value around its ideal value of –1. The fluctuations in the gain value are due to the modulation signal from the Extremum Seeking Control block.

open_system([mdl '/System Dynamics and Objective/Gain K'])

bdclose('firstOrderRefTracking_Esc')

See Also

Blocks

Related Topics