diff --git a/matlab/index.html b/matlab/index.html index 1bfd971..0079520 100644 --- a/matlab/index.html +++ b/matlab/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + On the Design of Complementary Filters for Control - Computation with Matlab @@ -279,44 +279,52 @@ for the JavaScript code in this tag.

Table of Contents

@@ -336,30 +344,31 @@ To achieve this, the sensors included in the filter should complement one anothe

When blending two sensors using complementary filters with unknown dynamics, phase lag may be introduced that renders the close-loop system unstable.

Then, three design methods for generating two complementary filters are proposed:

-
-

1 Optimal Sensor Fusion for noise characteristics

+
+

1 Optimal Sensor Fusion for noise characteristics

- +

The idea is to combine sensors that works in different frequency range using complementary filters. @@ -380,11 +389,11 @@ All the files (data and Matlab scripts) are accessible -

1.1 Architecture

+
+

1.1 Architecture

-Let's consider the sensor fusion architecture shown on figure 1 where two sensors 1 and 2 are measuring the same quantity \(x\) with different noise characteristics determined by \(W_1\) and \(W_2\). +Let's consider the sensor fusion architecture shown on figure 1 where two sensors 1 and 2 are measuring the same quantity \(x\) with different noise characteristics determined by \(W_1\) and \(W_2\).

@@ -392,18 +401,18 @@ Let's consider the sensor fusion architecture shown on figure +

-We consider that the two sensor dynamics \(G_1\) and \(G_2\) are ideal (\(G_1 = G_2 = 1\)). We obtain the architecture of figure 2. +We consider that the two sensor dynamics \(G_1\) and \(G_2\) are ideal (\(G_1 = G_2 = 1\)). We obtain the architecture of figure 2.

-
+

fusion_two_noisy_sensors.png

Figure 2: Fusion of two sensors with ideal dynamics

@@ -438,8 +447,8 @@ For that, we will use the \(\mathcal{H}_2\) Synthesis.
-
-

1.2 Noise of the sensors

+
+

1.2 Noise of the sensors

Let's define the noise characteristics of the two sensors by choosing \(W_1\) and \(W_2\): @@ -459,7 +468,7 @@ W2 = ( +

nosie_characteristics_sensors.png

Figure 3: Noise Characteristics of the two sensors (png, pdf)

@@ -467,15 +476,15 @@ W2 = ( -

1.3 H-Two Synthesis

+
+

1.3 H-Two Synthesis

-We use the generalized plant architecture shown on figure 4. +We use the generalized plant architecture shown on figure 4.

-
+

h_infinity_optimal_comp_filters.png

Figure 4: \(\mathcal{H}_2\) Synthesis - Generalized plant used for the optimal generation of complementary filters

@@ -493,7 +502,7 @@ Thus, if we minimize the \(\mathcal{H}_2\) norm of this transfer function, we mi

-We define the generalized plant \(P\) on matlab as shown on figure 4. +We define the generalized plant \(P\) on matlab as shown on figure 4.

P = [0   W2  1;
@@ -523,30 +532,30 @@ Finally, we define \(H_2 = 1 - H_1\).
 
-
-

1.4 Analysis

+
+

1.4 Analysis

-The complementary filters obtained are shown on figure 5. The PSD of the 6. -Finally, the RMS value of \(\hat{x}\) is shown on table 1. +The complementary filters obtained are shown on figure 5. The PSD of the 6. +Finally, the RMS value of \(\hat{x}\) is shown on table 1. The optimal sensor fusion has permitted to reduced the RMS value of the estimation error by a factor 8 compare to when using only one sensor.

-
+

htwo_comp_filters.png

Figure 5: Obtained complementary filters using the \(\mathcal{H}_2\) Synthesis (png, pdf)

-
+

psd_sensors_htwo_synthesis.png

Figure 6: Power Spectral Density of the estimated \(\hat{x}\) using the two sensors alone and using the optimally fused signal (png, pdf)

- +
@@ -580,18 +589,18 @@ The optimal sensor fusion has permitted to reduced the RMS value of the estimati -
-

2 Robustness to sensor dynamics uncertainty

+
+

2 Robustness to sensor dynamics uncertainty

- +

-Let's first consider ideal sensors where \(G_1 = 1\) and \(G_2 = 1\) (figure 7). +Let's first consider ideal sensors where \(G_1 = 1\) and \(G_2 = 1\) (figure 7).

-
+

fusion_two_noisy_sensors_with_dyn_bis.png

Figure 7: Fusion of two sensors

@@ -621,16 +630,16 @@ All the files (data and Matlab scripts) are accessible -

2.1 Unknown sensor dynamics dynamics

+
+

2.1 Unknown sensor dynamics dynamics

In practical systems, the sensor dynamics has always some level of uncertainty. -Let's represent that with multiplicative input uncertainty as shown on figure 8. +Let's represent that with multiplicative input uncertainty as shown on figure 8.

-
+

fusion_gain_mismatch.png

Figure 8: Fusion of two sensors with input multiplicative uncertainty

@@ -675,7 +684,7 @@ Which is approximately the same as requiring

-The uncertainty set of the transfer function from \(\hat{x}\) to \(x\) is bounded in the complex plane by a circle centered on 1 and with a radius equal to \(\epsilon\) (figure 9). +The uncertainty set of the transfer function from \(\hat{x}\) to \(x\) is bounded in the complex plane by a circle centered on 1 and with a radius equal to \(\epsilon\) (figure 9).

@@ -684,7 +693,7 @@ We then have that the angle introduced by the super sensor is bounded by \(\arcs

-
+

uncertainty_gain_phase_variation.png

Figure 9: Maximum phase variation

@@ -696,8 +705,8 @@ Thus, we choose should choose \(\epsilon\) so that the maximum phase uncertainty
-
-

2.2 Design the complementary filters in order to limit the phase and gain uncertainty of the super sensor

+
+

2.2 Design the complementary filters in order to limit the phase and gain uncertainty of the super sensor

Let's say the two sensors dynamics \(H_1\) and \(H_2\) have been identified with the associated uncertainty weights \(W_1\) and \(W_2\). @@ -730,8 +739,8 @@ This is of primary importance in order to ensure the stability of the feedback l

-
-

2.3 First Basic Example with gain mismatch

+
+

2.3 First Basic Example with gain mismatch

Let's consider two ideal sensors except one sensor has not an expected gain of one but a gain of \(0.6\). @@ -743,19 +752,19 @@ G2 = 0.10. +Let's design two complementary filters as shown on figure 10. The complementary filters shown in blue does not present a bump as the red ones but provides less sensor separation at high and low frequencies.

-
+

comp_filters_robustness_test.png

Figure 10: The two complementary filters designed for the robustness test (png, pdf)

-We then compute the bode plot of the super sensor transfer function \(H_1*G_1 + H_2*G_2\) for both complementary filters pair (figure 11). +We then compute the bode plot of the super sensor transfer function \(H_1*G_1 + H_2*G_2\) for both complementary filters pair (figure 11).

@@ -763,7 +772,7 @@ We see that the blue complementary filters with a lower maximum norm permits to

-
+

tf_super_sensor_comp.png

Figure 11: Comparison of the obtained super sensor transfer functions (png, pdf)

@@ -771,15 +780,15 @@ We see that the blue complementary filters with a lower maximum norm permits to
-
-

2.4 TODO More Complete example with model uncertainty

+
+

2.4 TODO More Complete example with model uncertainty

-
-

3 Complementary filters using analytical formula

+
+

3 Complementary filters using analytical formula

- +

@@ -789,8 +798,8 @@ All the files (data and Matlab scripts) are accessible -

3.1 Analytical 1st order complementary filters

+
+

3.1 Analytical 1st order complementary filters

First order complementary filters are defined with following equations: @@ -801,7 +810,7 @@ First order complementary filters are defined with following equations: \end{align}

-Their bode plot is shown figure 12. +Their bode plot is shown figure 12.

@@ -813,7 +822,7 @@ Hl1 = 1
-
+

comp_filter_1st_order.png

Figure 12: Bode plot of first order complementary filter (png, pdf)

@@ -821,8 +830,8 @@ Hl1 = 1
-
-

3.2 Second Order Complementary Filters

+
+

3.2 Second Order Complementary Filters

We here use analytical formula for the complementary filters \(H_L\) and \(H_H\). @@ -848,12 +857,12 @@ where:

-This is illustrated on figure 13. +This is illustrated on figure 13. The slope of those filters at high and low frequencies is \(-2\) and \(2\) respectively for \(H_L\) and \(H_H\).

-
+

comp_filters_param_alpha.png

Figure 13: Effect of the parameter \(\alpha\) on the shape of the generated second order complementary filters (png, pdf)

@@ -871,7 +880,7 @@ xlabel('$ +

param_alpha_hinf_norm.png

Figure 14: Evolution of the H-Infinity norm of the complementary filters with the parameter \(\alpha\) (png, pdf)

@@ -879,8 +888,8 @@ xlabel('$ -

3.3 Third Order Complementary Filters

+
+

3.3 Third Order Complementary Filters

The following formula gives complementary filters with slopes of \(-3\) and \(3\): @@ -899,7 +908,7 @@ The parameters are:

-The filters are defined below and the result is shown on figure 15. +The filters are defined below and the result is shown on figure 15.

@@ -913,7 +922,7 @@ Hl3_ana = ( +

complementary_filters_third_order.png

Figure 15: Third order complementary filters using the analytical formula (png, pdf)

@@ -922,11 +931,11 @@ Hl3_ana = ( -

4 H-Infinity synthesis of complementary filters

+
+

4 H-Infinity synthesis of complementary filters

- +

@@ -936,8 +945,8 @@ All the files (data and Matlab scripts) are accessible -

4.1 Synthesis Architecture

+
+

4.1 Synthesis Architecture

We here synthesize the complementary filters using the \(\mathcal{H}_\infty\) synthesis. @@ -945,18 +954,18 @@ The goal is to specify upper bounds on the norms of \(H_L\) and \(H_H\) while en

-In order to do so, we use the generalized plant shown on figure 16 where \(w_L\) and \(w_H\) weighting transfer functions that will be used to shape \(H_L\) and \(H_H\) respectively. +In order to do so, we use the generalized plant shown on figure 16 where \(w_L\) and \(w_H\) weighting transfer functions that will be used to shape \(H_L\) and \(H_H\) respectively.

-
+

sf_hinf_filters_plant_b.png

Figure 16: Generalized plant used for the \(\mathcal{H}_\infty\) synthesis of the complementary filters

-The \(\mathcal{H}_\infty\) synthesis applied on this generalized plant will give a transfer function \(H_L\) (figure 17) such that the \(\mathcal{H}_\infty\) norm of the transfer function from \(w\) to \([z_H,\ z_L]\) is less than one: +The \(\mathcal{H}_\infty\) synthesis applied on this generalized plant will give a transfer function \(H_L\) (figure 17) such that the \(\mathcal{H}_\infty\) norm of the transfer function from \(w\) to \([z_H,\ z_L]\) is less than one: \[ \left\| \begin{array}{c} H_L w_L \\ (1 - H_L) w_H \end{array} \right\|_\infty < 1 \]

@@ -975,7 +984,7 @@ We then see that \(w_L\) and \(w_H\) can be used to shape both \(H_L\) and \(H_H

-
+

sf_hinf_filters_b.png

Figure 17: \(\mathcal{H}_\infty\) synthesis of the complementary filters

@@ -983,8 +992,8 @@ We then see that \(w_L\) and \(w_H\) can be used to shape both \(H_L\) and \(H_H
-
-

4.2 Weights

+
+

4.2 Weights

omegab = 2*pi*9;
@@ -995,7 +1004,7 @@ wL = (s 
+

weights_wl_wh.png

Figure 18: Weights on the complementary filters \(w_L\) and \(w_H\) and the associated performance weights (png, pdf)

@@ -1003,8 +1012,8 @@ wL = (s -

4.3 H-Infinity Synthesis

+
+

4.3 H-Infinity Synthesis

We define the generalized plant \(P\) on matlab. @@ -1046,7 +1055,7 @@ Test bounds: 0.0000 < gamma <= 1.7285

-We then define the high pass filter \(H_H = 1 - H_L\). The bode plot of both \(H_L\) and \(H_H\) is shown on figure 19. +We then define the high pass filter \(H_H = 1 - H_L\). The bode plot of both \(H_L\) and \(H_H\) is shown on figure 19.

Hh_hinf = 1 - Hl_hinf;
@@ -1055,15 +1064,15 @@ We then define the high pass filter \(H_H = 1 - H_L\). The bode plot of both \(H
 
-
-

4.4 Obtained Complementary Filters

+
+

4.4 Obtained Complementary Filters

-The obtained complementary filters are shown on figure 19. +The obtained complementary filters are shown on figure 19.

-
+

hinf_filters_results.png

Figure 19: Obtained complementary filters using \(\mathcal{H}_\infty\) synthesis (png, pdf)

@@ -1072,11 +1081,11 @@ The obtained complementary filters are shown on figure 19<
-
-

5 Feedback Control Architecture to generate Complementary Filters

+
+

5 Feedback Control Architecture to generate Complementary Filters

- +

The idea is here to use the fact that in a classical feedback architecture, \(S + T = 1\), in order to design complementary filters. @@ -1093,11 +1102,11 @@ All the files (data and Matlab scripts) are accessible -

5.1 Architecture

+
+

5.1 Architecture

-
+

complementary_filters_feedback_architecture.png

Figure 20: Architecture used to generate the complementary filters

@@ -1124,8 +1133,8 @@ Which contains two integrator and a lead. \(\omega_c\) is used to tune the cross
-
-

5.2 Loop Gain Design

+
+

5.2 Loop Gain Design

Let's first define the loop gain \(L\). @@ -1139,7 +1148,7 @@ L = (wc +

loop_gain_bode_plot.png

Figure 21: Bode plot of the loop gain \(L\) (png, pdf)

@@ -1147,8 +1156,8 @@ L = (wc -

5.3 Complementary Filters Obtained

+
+

5.3 Complementary Filters Obtained

We then compute the resulting low pass and high pass filters. @@ -1160,7 +1169,7 @@ Hh = 1/

-
+

low_pass_high_pass_filters.png

Figure 22: Low pass and High pass filters \(H_L\) and \(H_H\) for different values of \(\alpha\) (png, pdf)

@@ -1169,14 +1178,129 @@ Hh = 1/
+
+

6 Analytical Formula found in the literature

+
+

+ +

+
+ +
+

6.1 Analytical Formula

+
+

+min15_compl_filter_desig_angle_estim +

+\begin{align*} + H_L(s) = \frac{K_p s + K_i}{s^2 + K_p s + K_i} \\ + H_H(s) = \frac{s^2}{s^2 + K_p s + K_i} +\end{align*} + +

+corke04_inert_visual_sensin_system_small_auton_helic +

+\begin{align*} + H_L(s) = \frac{1}{s/p + 1} \\ + H_H(s) = \frac{s/p}{s/p + 1} +\end{align*} + +

+jensen13_basic_uas +

+\begin{align*} + H_L(s) = \frac{2 \omega_0 s + \omega_0^2}{(s + \omega_0)^2} \\ + H_H(s) = \frac{s^2}{(s + \omega_0)^2} +\end{align*} + +\begin{align*} + H_L(s) = \frac{C(s)}{C(s) + s} \\ + H_H(s) = \frac{s}{C(s) + s} +\end{align*} + +

+shaw90_bandw_enhan_posit_measur_using_measur_accel +

+\begin{align*} + H_L(s) = \frac{3 \tau s + 1}{(\tau s + 1)^3} \\ + H_H(s) = \frac{\tau^3 s^3 + 3 \tau^2 s^2}{(\tau s + 1)^3} +\end{align*} + +

+baerveldt97_low_cost_low_weigh_attit +

+\begin{align*} + H_L(s) = \frac{2 \tau s + 1}{(\tau s + 1)^2} \\ + H_H(s) = \frac{\tau^2 s^2}{(\tau s + 1)^2} +\end{align*} +
+
+ +
+

6.2 Matlab

+
+
+
omega0 = 1*2*pi; % [rad/s]
+tau = 1/omega0; % [s]
+
+% From cite:corke04_inert_visual_sensin_system_small_auton_helic
+HL1 = 1/(s/omega0 + 1); HH1 = s/omega0/(s/omega0 + 1);
+
+% From cite:jensen13_basic_uas
+HL2 = (2*omega0*s + omega0^2)/(s+omega0)^2; HH2 = s^2/(s+omega0)^2;
+
+% From cite:shaw90_bandw_enhan_posit_measur_using_measur_accel
+HL3 = (3*tau*s + 1)/(tau*s + 1)^3; HH3 = (tau^3*s^3 + 3*tau^2*s^2)/(tau*s + 1)^3;
+
+
+ + +
+

comp_filters_literature.png +

+

Figure 23: Comparison of some complementary filters found in the literature (png, pdf)

+
+
+
+ +
+

6.3 Discussion

+
+

+Analytical Formula found in the literature provides either no parameter for tuning the robustness / performance trade-off. +

+
+
+
+ +
+

7 Comparison of the different methods of synthesis

+
+

+ +The generated complementary filters using \(\mathcal{H}_\infty\) and the analytical formulas are very close to each other. However there is some difference to note here: +

+
    +
  • the analytical formula provides a very simple way to generate the complementary filters (and thus the controller), they could even be used to tune the controller online using the parameters \(\alpha\) and \(\omega_0\). However, these formula have the property that \(|H_H|\) and \(|H_L|\) are symmetrical with the frequency \(\omega_0\) which may not be desirable.
  • +
  • while the \(\mathcal{H}_\infty\) synthesis of the complementary filters is not as straightforward as using the analytical formula, it provides a more optimized procedure to obtain the complementary filters
  • +
+
+

-ref.bib +

Bibliography

+
  • [min15_compl_filter_desig_angle_estim] Min & Jeung, Complementary Filter Design for Angle Estimation Using Mems Accelerometer and Gyroscope, Department of Control and Instrumentation, Changwon National University, Changwon, Korea, 641-773 (2015).
  • +
  • [corke04_inert_visual_sensin_system_small_auton_helic] Peter Corke, An Inertial and Visual Sensing System for a Small Autonomous Helicopter, Journal of Robotic Systems, 21(2), 43-51 (2004). link. doi.
  • +
  • [jensen13_basic_uas] Austin Jensen, Cal Coopmans & YangQuan Chen, Basics and guidelines of complementary filters for small UAS navigation, nil, in in: 2013 International Conference on Unmanned Aircraft Systems + (ICUAS), edited by (2013)
  • +
  • [shaw90_bandw_enhan_posit_measur_using_measur_accel] Shaw & Srinivasan, Bandwidth Enhancement of Position Measurements Using Measured Acceleration, Mechanical Systems and Signal Processing, 4(1), 23-38 (1990). link. doi.
  • +
  • [baerveldt97_low_cost_low_weigh_attit] Baerveldt & Klang, A Low-Cost and Low-Weight Attitude Estimation System for an Autonomous Helicopter, nil, in in: Proceedings of IEEE International Conference on Intelligent Engineering Systems, edited by (1997)
  • +

Author: Thomas Dehaeze

-

Created: 2019-08-14 mer. 12:08

+

Created: 2019-08-14 mer. 12:13

Validate

diff --git a/matlab/index.org b/matlab/index.org index db15140..1419b8d 100644 --- a/matlab/index.org +++ b/matlab/index.org @@ -42,6 +42,7 @@ Then, three design methods for generating two complementary filters are proposed - in section [[sec:comp_filters_analytical]], analytical formulas are proposed - in section [[sec:h_inf_synthesis_complementary_filters]], the $\mathcal{H}_\infty$ synthesis is used - in section [[sec:feedback_generate_comp_filters]], the classical feedback architecture is used +- in section [[sec:analytical_formula_literature]], analytical formulas found in the literature are listed * Optimal Sensor Fusion for noise characteristics :PROPERTIES: @@ -1021,6 +1022,122 @@ We then compute the resulting low pass and high pass filters. #+CAPTION: Low pass and High pass filters $H_L$ and $H_H$ for different values of $\alpha$ ([[./figs/low_pass_high_pass_filters.png][png]], [[./figs/low_pass_high_pass_filters.pdf][pdf]]) [[file:figs/low_pass_high_pass_filters.png]] +* Analytical Formula found in the literature + <> + +** Analytical Formula +cite:min15_compl_filter_desig_angle_estim +\begin{align*} + H_L(s) = \frac{K_p s + K_i}{s^2 + K_p s + K_i} \\ + H_H(s) = \frac{s^2}{s^2 + K_p s + K_i} +\end{align*} + +cite:corke04_inert_visual_sensin_system_small_auton_helic +\begin{align*} + H_L(s) = \frac{1}{s/p + 1} \\ + H_H(s) = \frac{s/p}{s/p + 1} +\end{align*} + +cite:jensen13_basic_uas +\begin{align*} + H_L(s) = \frac{2 \omega_0 s + \omega_0^2}{(s + \omega_0)^2} \\ + H_H(s) = \frac{s^2}{(s + \omega_0)^2} +\end{align*} + +\begin{align*} + H_L(s) = \frac{C(s)}{C(s) + s} \\ + H_H(s) = \frac{s}{C(s) + s} +\end{align*} + +cite:shaw90_bandw_enhan_posit_measur_using_measur_accel +\begin{align*} + H_L(s) = \frac{3 \tau s + 1}{(\tau s + 1)^3} \\ + H_H(s) = \frac{\tau^3 s^3 + 3 \tau^2 s^2}{(\tau s + 1)^3} +\end{align*} + +cite:baerveldt97_low_cost_low_weigh_attit +\begin{align*} + H_L(s) = \frac{2 \tau s + 1}{(\tau s + 1)^2} \\ + H_H(s) = \frac{\tau^2 s^2}{(\tau s + 1)^2} +\end{align*} + +** Matlab Init :noexport:ignore: +#+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name) + <> +#+end_src + +#+begin_src matlab :exports none :results silent :noweb yes + <> +#+end_src + +** Matlab +#+begin_src matlab + omega0 = 1*2*pi; % [rad/s] + tau = 1/omega0; % [s] + + % From cite:corke04_inert_visual_sensin_system_small_auton_helic + HL1 = 1/(s/omega0 + 1); HH1 = s/omega0/(s/omega0 + 1); + + % From cite:jensen13_basic_uas + HL2 = (2*omega0*s + omega0^2)/(s+omega0)^2; HH2 = s^2/(s+omega0)^2; + + % From cite:shaw90_bandw_enhan_posit_measur_using_measur_accel + HL3 = (3*tau*s + 1)/(tau*s + 1)^3; HH3 = (tau^3*s^3 + 3*tau^2*s^2)/(tau*s + 1)^3; +#+end_src + +#+begin_src matlab :exports none + freqs = logspace(-1, 1, 1000); + + figure; + % Magnitude + ax1 = subaxis(2,1,1); + hold on; + set(gca,'ColorOrderIndex',1); plot(freqs, abs(squeeze(freqresp(HH1, freqs, 'Hz')))); + set(gca,'ColorOrderIndex',1); plot(freqs, abs(squeeze(freqresp(HL1, freqs, 'Hz')))); + set(gca,'ColorOrderIndex',2); plot(freqs, abs(squeeze(freqresp(HH2, freqs, 'Hz')))); + set(gca,'ColorOrderIndex',2); plot(freqs, abs(squeeze(freqresp(HL2, freqs, 'Hz')))); + set(gca,'ColorOrderIndex',3); plot(freqs, abs(squeeze(freqresp(HH3, freqs, 'Hz')))); + set(gca,'ColorOrderIndex',3); plot(freqs, abs(squeeze(freqresp(HL3, freqs, 'Hz')))); + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); + set(gca, 'XTickLabel',[]); + ylabel('Magnitude'); + hold off; + ylim([1e-2 2]); + % Phase + ax2 = subaxis(2,1,2); + hold on; + set(gca,'ColorOrderIndex',1); plot(freqs, 180/pi*angle(squeeze(freqresp(HH1, freqs, 'Hz')))); + set(gca,'ColorOrderIndex',1); plot(freqs, 180/pi*angle(squeeze(freqresp(HL1, freqs, 'Hz')))); + set(gca,'ColorOrderIndex',2); plot(freqs, 180/pi*angle(squeeze(freqresp(HH2, freqs, 'Hz')))); + set(gca,'ColorOrderIndex',2); plot(freqs, 180/pi*angle(squeeze(freqresp(HL2, freqs, 'Hz')))); + set(gca,'ColorOrderIndex',3); plot(freqs, 180/pi*angle(squeeze(freqresp(HH3, freqs, 'Hz')))); + set(gca,'ColorOrderIndex',3); plot(freqs, 180/pi*angle(squeeze(freqresp(HL3, freqs, 'Hz')))); + set(gca,'xscale','log'); + yticks(-180:90:180); + ylim([-180 180]); + xlabel('Relative Frequency $\frac{\omega}{\omega_0}$'); ylabel('Phase [deg]'); + hold off; + linkaxes([ax1,ax2],'x'); + xlim([freqs(1), freqs(end)]); +#+end_src + +#+HEADER: :tangle no :exports results :results none :noweb yes +#+begin_src matlab :var filepath="figs/comp_filters_literature.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") + <> +#+end_src + +#+NAME: fig:comp_filters_literature +#+CAPTION: Comparison of some complementary filters found in the literature ([[./figs/comp_filters_literature.png][png]], [[./figs/comp_filters_literature.pdf][pdf]]) +[[file:figs/comp_filters_literature.png]] + +** Discussion +Analytical Formula found in the literature provides either no parameter for tuning the robustness / performance trade-off. + +* Comparison of the different methods of synthesis + <> +The generated complementary filters using $\mathcal{H}_\infty$ and the analytical formulas are very close to each other. However there is some difference to note here: +- the analytical formula provides a very simple way to generate the complementary filters (and thus the controller), they could even be used to tune the controller online using the parameters $\alpha$ and $\omega_0$. However, these formula have the property that $|H_H|$ and $|H_L|$ are symmetrical with the frequency $\omega_0$ which may not be desirable. +- while the $\mathcal{H}_\infty$ synthesis of the complementary filters is not as straightforward as using the analytical formula, it provides a more optimized procedure to obtain the complementary filters * Bibliography :ignore: bibliographystyle:unsrt bibliography:ref.bib
Table 1: RMS value of the estimation error when using the sensor individually and when using the two sensor merged using the optimal complementary filters