Skip to content

Commit

Permalink
Missing figures of 18/05/2020
Browse files Browse the repository at this point in the history
  • Loading branch information
edomora97 committed May 18, 2020
1 parent 213aea9 commit a01be23
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 5 deletions.
36 changes: 35 additions & 1 deletion lectures/2020-05-14.tex
Original file line number Diff line number Diff line change
Expand Up @@ -367,5 +367,39 @@ \section{Non-linear Systems}
Since these regressors are obtained by integration to avoid drifting (by DC components of noise integration) we have to high-pass the inputs with high-pass filters ($\frac{z-1}{z-a}$).

\paragraph{Full filtering scheme} \phantom{lol}
\missingfigure{Fig1}
\begin{figure}[H]
\centering
\begin{tikzpicture}[node distance=2cm,auto,>=latex']
\draw[int, dashed border] (0.5,-0.5) rectangle ++(5.5,6);
\node[int, double border, minimum width=1.5cm, minimum height=6cm] at (8,2.5) (f) {$f(\cdot, \theta)$};
\node[left] at (0,0) (c) {$c(t)$};
\node[left] at (0,3) (d) {$z-z_d$};
\node[left] at (0,5) (z) {$\ddot{z}$};
\node[sum] at (2,0) (mult) {$\times$};
\node[int] at (2,1.5) (d1) {$\frac{z-1}{z}$};
\node[int] at (3.5,0) (d2) {$\frac{z-1}{z-a}$};
\node[int] at (5,0) (d3) {$\frac{1}{z-1}$};
\node[int] at (3.5,3) (d4) {$\frac{z-1}{z-a}$};
\node[int] at (5,3) (d5) {$\frac{1}{z-1}$};
\node[int] at (3.5,5) (d6) {$\frac{z-1}{z-a}$};
\node[int] at (5,5) (d7) {$\frac{1}{z-1}$};

\node[below] at (3,-0.7) {regressors building block};

\draw[->] (c) -- (mult);
\draw[->] (d1) -- (mult);
\draw[->] (mult) -- (d2);
\draw[->] (d2) -- (d3);
\draw[->] (z) -- (d6);
\draw[->] (d6) -- (d7);
\draw[->] (d) -- (d4);
\draw[->] (d4) -- (d5);
\draw[->] (d) -| (d1);

\draw[->] (d7) -- (d7-|f.west) node[pos=0.7] {$r_3(t)$};
\draw[->] (d5) -- (d5-|f.west) node[pos=0.7] {$r_1(t)$};
\draw[->] (d3) -- (d3-|f.west) node[pos=0.7] {$r_2(t)$};
\draw[->] (f) -- (9.5,2.5) node[right] {$\hat{\dot{z}}$};
\end{tikzpicture}
\end{figure}
\end{exercise}
58 changes: 54 additions & 4 deletions lectures/2020-05-18.tex
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,35 @@ \section{Using Kalman Filter}
It is a $n_\theta\times n_\theta$ and usually it is assumed that $\lambda_{1\theta}^2=\lambda_{2\theta}^2=\dots=\lambda_{n_\theta\theta}^2$.
We assume that $v_\theta(t)$ is a set of independent W.N. all with the same variance $\lambda_\theta^2$ (tuned empirically).

\missingfigure{Fig2}
\begin{figure}[H]
\centering
\begin{tikzpicture}[
node distance=2cm,auto,>=latex',
declare function={
f1(\x) = (\x < 2) * (\x/2*(3-1)) +
(\x >= 2) * (3-1) +
(\x > 0.2) * rand/2.5 +
1;
f2(\x) = (\x < 4.5) * (\x/4.5*(3-1)) +
(\x >= 4.5) * (3-1) +
(\x > 0.2) * rand/15 +
1;
}
]
\draw[->] (0,0) -- (6,0) node[below] {$t$};
\draw[->] (0,0) -- (0,4) node[left] {$\theta$};

\node[green] at (2.3,1.5) {\footnotesize small $\lambda_\theta^2$};
\node[blue] at (2.3,3.7) {\footnotesize big $\lambda_\theta^2$};

\draw[dotted] (6,3) -- (0,3) node[left] {$\overline{\theta}$};
\draw[domain=0:5.5,smooth,variable=\x,blue,samples=70] plot ({\x},{f1(\x)});
\draw[domain=0:5.5,smooth,variable=\x,green,samples=70] plot ({\x},{f2(\x)});

\draw[mark=*] plot coordinates {(0,1)} node[left, align=right] {Initial\\condition};
\end{tikzpicture}
\caption*{Influence of choice of $\lambda_\theta^2$}
\end{figure}

With a small value of $\lambda_\theta^2$ there is a slow convergence with small oscillations (noise) at steady-state (big trust to initial conditions).
With large values of $\lambda_\theta^2$ there's fast convergence but noisy at steady-state.
Expand All @@ -84,15 +112,37 @@ \section{Using Kalman Filter}
In practice it works well only on a limited number of parameters (e.g. 3 sensors, 5 states and 2 parameters).

\begin{example}
\missingfigure{Fig3}
\begin{figure}[H]
\centering
\begin{tikzpicture}[node distance=2cm,auto,>=latex']
\draw (0,0) -- (6,0);
\draw[pattern=north east lines] (0,0) rectangle (-0.5,2);
\draw[] (2,0) rectangle (4,1.5);
\node at (3,0.75) {$M$};
\draw[decoration={aspect=0.3, segment length=1mm, amplitude=2mm,coil},decorate] (0.5,0.75) -- (1.5,0.75);
\draw (0,0.75) -- (0.5,0.75);
\draw (1.5,0.75) -- (2,0.75);
\draw[->] (4,0.75) -- (5,0.75) node[right] {$F$};
\fill[pattern=north east lines] (1.8,0) rectangle ++(2.4,-0.1) node[above right] {\footnotesize friction $c$};
\draw[->] (3,-0.5) -- (4,-0.5) node[right] {$x$};
\draw (3,-0.55) -- (3,-0.45);
\end{tikzpicture}
\end{figure}

\begin{description}
\item[Input] $F(t)$
\item[Output] Position $x(t)$ (measured)
\item[Parameters] $K$ and $M$ are known (measured), $c$ is unknown`
\item[Parameters] $K$ and $M$ are known (measured), $c$ is unknown
\end{description}

\missingfigure{Fig4}
\begin{figure}[H]
\centering
\begin{tikzpicture}[node distance=2cm,auto,>=latex']
\node[int,align=center] at (0,0) (s) {system\\$c = ?$};
\draw[<-] (s) -- ++(-1.5,0) node[left] {$F(t)$};
\draw[->] (s) -- ++(1.5,0) node[right] {$x(t)$};
\end{tikzpicture}
\end{figure}

\paragraph{Problem} Estimate $c$ with a K.F.

Expand Down

0 comments on commit a01be23

Please sign in to comment.