\input{ccs_gyak_defs}
\author{Homework 4}

\tikzstyle{block} = [draw, rectangle, minimum height=1em, minimum width=1em]
\tikzstyle{sum} = [draw, circle, node distance=1cm]
\tikzstyle{pinstyle} = [pin edge={to-,thin,black}]

\begin{document}
\begin{center}
\textbf{Computer Controlled Systems} \\
\theauthor \\
Submission deadline: December 14. 2017. 10:00/12:00 (end of the seminar)
\end{center}

\begin{center}
All solutions are expected to be calculated by hand, also all figures have to be drawn by hand. Computer programs can be used for self-verification, but all problems have to contain the detailed steps of solutions!
\end{center}

\subsubsection*{Pole placement controller design for a spring-mass system}

Consider a simple undamped spring-mass system with an external force $F(t)$. The time-dependent position of the mass is $y(t)$, where the zero position $y=0$ belongs to the relaxed state of the spring. 
	\begin{figure}[!h]
	\centering
	\includegraphics[scale=0.45]{fig/spring_mass_undamped.png}
	\end{figure}	

\noindent
The differential equation that describes the dynamics of the spring-mass system is
 \[ \ddot{y}(t) + \frac{k}{m} y(t) = \frac{1}{m}F(t) \hspace{1cm} \dot{y}(0)=0 \quad y(0)=0\] 
By setting the input variable as $u(t)=F(t)$, with the values of system constants $k=0.2Nm^{-1}$ and $m=0.1kg$ the input-output model of the spring-mass system is as follows:
\begin{equation} \ddot{y}(t)  +2 y(t) = 10 u(t) \hspace{1cm} \label{springmass_deq} \end{equation}


By choosing the state variables as the position of the mass ($x_2=y$) and the velocity of the mass ($x_1=\dot{x}_2$)  a second order LTI state space realization can be given:
\begin{align*}
    \dot{x}_1(t) & = -2x_2(t)+10u(t) \\
    \dot{x}_2(t) & = x_1(t) \\
    y(t) &=x_2(t)
\end{align*}
where $x_1(0)=0$ and $x_2(0)=0$.

This system responds to perturbations with undamped oscillations. In order to remove the oscillatory behaviour, and to asymptotically stabilitize the system, a simple pole placement controller can be applied.

\begin{enumerate}
\item Write this state-space model in matrix-vector form!

\item Check the asymptotic stability of the system! What refers to the oscillatory behaviour?

\item Is it possible to design a pole placement controller for this system? 

\item Construct a pole placement controller that stabilizes the system with the prescribed poles $\lambda_1=-3$ and $\lambda_2=-4~$! 

\item Check your result by the eigenvalues of the state matrix of the closed loop system!

\end{enumerate}

\subsubsection*{State observer design for a spring-mass system}
  
The pole placement controller designed uses both state variables, although the time function of the velocity of the mass ($x_1(t)$) is unknown.
To solve this problem, a state observer can be designed.   

\begin{enumerate}

\item Is it possible to design a state observer for this system? 

\item Construct an observer to estimate the state variables, with poles $\lambda_1=-5$ and $\lambda_2=-10~$! 

\end{enumerate}
	

\end{document}

