Files
PBSwissMX/MXfastStageDoc/MXfastStage.tex
2019-02-05 16:51:35 +01:00

629 lines
22 KiB
TeX
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
\documentclass[10pt,a4paper]{article}
\usepackage[margin=1.5cm]{geometry} %other geomentry
\setlength{\parindent}{0cm} %other indent of paragraphs
\usepackage[utf8]{inputenc}%needed for äöüàéè etc.
\usepackage[T1]{fontenc} %needed for äöüàéè etc. read http://de.wikipedia.org/wiki/LaTeX
\usepackage[bookmarks]{hyperref} %adds commands as \url for external links
\usepackage{fancyvrb} %Verbatim
\usepackage[abspath]{currfile} %%works only with PDFLaTeX-argument -recorder
\usepackage{fancyhdr} %define new headers and footers
\pagestyle{fancy}
\fancyhead{} % sets header to nothing (instead of chapter)
\renewcommand{\headrulewidth}{0pt}%remove header line
\fancyfoot[R]{\currfilename}
\input{|"/home/zamofing_t/Documents/doc-git/git2texInfo.sh"}%works only with PDFLaTeX-argument -shell-escape
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{amsmath}
\renewcommand{\deg}{$^\circ$}
\usepackage[section]{placeins} %place images in section
\title{Tuning/modeling fast stages of ESB-MX}
\author{Thierry Zamofing}
\usepackage{datetime}
\date{\today, \currenttime\\
\texttt{git:\gitAbrHash, ver:\gitVerNo{ }\gitStatus}}
\begin{document}
\maketitle
\tableofcontents
\section{Introduction}
This document describes the tuning and modeling process of the ESB-MX fast stages.
\section{Measurements}
The tool used to record data of the fast stages is the bode plots is MXTuning.py, a script specially developed to record system responses. The main call to collect all data was:\\
\verb|./MXTuning.py --dir MXTuning/19_01_29 --mode 64|\\
The used frequencies are: 20 kHz Phase, 5 kHz Servo, 6.25MHz AdcAmp. This results in 50us PhaseTime and 0.2ms ServoTime.\\
According to the amplifier specs \cite[19]{PMAClv} a DAC Value of $32737=2^{15}$ corresponds to 33.85A current. So 1 \verb|curr_bit| is $33.85/32737A =1.034mA$.\\
\cite[245-259]{PMACusr} Shows how the PwmSf works and is explained with some calculation examples.\\
This is set in the gpasciiCommander templates:
\begin{verbatim}
PwmSf=15134.8909 # =.95*16384. PMAC3-style DSPGATE3 ASIC is being used for the output,
the counter moves between +/- 16384. PwmSf is typically set to 95% of 16384
\end{verbatim}
Nerverless the documentation is confusing. Therefore PwmSf will be measured to convert idCmd bits values to idVolts bits in section \ref{sec:measCurStep}
The Parker stages are configured to contCur=800mA ,peakCur=2400mA. Specs of the D11 stage are 0.8Amp RMS (producing 4N force) and 2.4Amp RMS peak.\\
It should be save to set 0.92Amp DC and 2.8Amp DC.
\subsection{Measure Current Step}\label{sec:measCurStep}
\verb|MXTuning.py mode 1| $\rightarrow$ \verb|identifyFxFyStage.m|\\
\includegraphics[scale=.5]{../matlab/figures/currstep_1.eps}
\includegraphics[scale=.5]{/home/zamofing_t/Documents/doc-ext/DeltaTau/UsrMan257.png}
The current step looks similar for both motors.
The transfer function is: $k \cdot {w_0}^2/({w_0}^2+2 \cdot damp \cdot w_0 \cdot s+s^2)$\\
rise time $(0\rightarrow 100\%)$ ca. 0.4ms\\
rise time: \url{https://nptel.ac.in/courses/101108056/module7/lecture20.pdf}\\
$\rightarrow$ \verb|1/(w0*np.sqrt(1-0.75**2))*(np.pi/2+np.arcsin(0.75))|\\
The loop parameters are:\\
IiGain=5, IpfGain=8, IpbGain=8
In steady state an idCmd=idMeas=406. results in aprox. idVolts=7400\\
This has been measured precisly from gathered data \verb|chirp_all_1a.npz|
at frequencies from 10 to 220 Hz.
The images have been generated with
\verb|./MXTuning.py --dir MXTuning/19_01_29 --mode 128|.\\
The overall aplification $iqCmd \rightarrow iqVolts$ is approx. 18.2.
\begin{figure}[h!]
\includegraphics[scale=.45]{../python/MXTuning/19_01_29/img/iqCmd_TF0.eps}
\includegraphics[scale=.45]{../python/MXTuning/19_01_29/img/iqCmd_TF1.eps}
\caption{IqCmd->IqMeas of motor 1 (bode same for both motors)}
\end{figure}
\begin{figure}[h!]
\includegraphics[scale=.45]{../python/MXTuning/19_01_29/img/iqCmd_TF2.eps}
\includegraphics[scale=.45]{../python/MXTuning/19_01_29/img/iqCmd_TF3.eps}
\caption{IqCmd->IqVolts of motor 1 (bode same for both motors)}
\end{figure}
\FloatBarrier
\subsection{Measure Open Loop}
The frequency response has been measured with chirps at different amplitudes and frequency regions. The yellow line is averaged measurement data. The black line is the approximated model. The diagram shows \verb|curr_bits| (ca.1mA) to \verb|ActPos| (in um) transfer function.\\
The images have been generated with
\verb|./MXTuning.py --dir MXTuning/19_01_29 --mode 32|.\\
\begin{figure}[h]
\includegraphics[scale=.45]{../python/MXTuning/19_01_29/img/bode_model_plot0.eps}
\includegraphics[scale=.45]{../python/MXTuning/19_01_29/img/bode_model_plot2.eps}
\caption{open loop of motor 1 and 2}
\label{fig:mot_open}
\end{figure}
\emph{Motor 1 (fy) has a better response, as expected because it has less mass to move.}\\
\hbox{
\parbox[t]{5cm}{
Motor 1:\\
0dB at 20.28Hz\\
10 Hz: 9.63 dB -134\deg \\
100Hz: -28.5dB -191.7\deg\\
resonances 198 Hz \\
}
\parbox[t]{6cm}{
Motor 2\\
0dB at 12.39Hz\\
10 Hz: 4.68 dB -162\deg\\
100 Hz: -38.15 dB -187.5\deg\\
resonances 60Hz,142Hz,414Hz,231Hz\\
}
}
\subsection{Closed Loop}
\subsubsection{Deltatau schematics}
\includegraphics[scale=.7]{/home/zamofing_t/Documents/doc-ext/DeltaTau/UsrMan290.png}
\includegraphics[scale=.2]{/home/zamofing_t/Documents/doc-ext/DeltaTau/ServoBlockDiag.png}
\\
Closed loops have been measured with the following control loop settings.
\begin{verbatim}
motor_servo(mot=1,Kp=25,Kvfb=400,Ki=0.02,Kvff=350,Kaff=5000,MaxInt=1000)
motor_servo(mot=2,Kp=22,Kvfb=350,Ki=0.02,Kvff=240,Kaff=1500,MaxInt=1000)
\end{verbatim}
\subsubsection{chirp sine closed loop}
Chirp plot with input(blue) and output(green) and its bode plots.
The parameters for that sweep is:\\
\verb| amp: 5, minFrq: 10, maxFrq: 220, ts: 0.0002, tSec: 20|
\begin{figure}[h!]
\includegraphics[scale=.45]{../python/MXTuning/19_01_29/img/chirp_all_1b0.eps}
\includegraphics[scale=.45]{../python/MXTuning/19_01_29/img/chirp_all_1b1.eps}
\caption{DesPos->ActPos of motor 1}
\end{figure}
\begin{figure}[h!]
\includegraphics[scale=.45]{../python/MXTuning/19_01_29/img/chirp_all_2b0.eps}
\includegraphics[scale=.45]{../python/MXTuning/19_01_29/img/chirp_all_2b1.eps}
\caption{DesPos->ActPos of motor 2}
\label{fig:mot1_chirp}
\end{figure}
\begin{figure}[h!]
\includegraphics[scale=.45]{../python/MXTuning/19_01_29/img/chirp_all_1b2.eps}
\includegraphics[scale=.45]{../python/MXTuning/19_01_29/img/chirp_all_1b3.eps}
\caption{DesPos->IqCmd of motor 1}
\label{fig:mot2_chirp}
\end{figure}
\begin{figure}[h!]
\includegraphics[scale=.45]{../python/MXTuning/19_01_29/img/chirp_all_2b2.eps}
\includegraphics[scale=.45]{../python/MXTuning/19_01_29/img/chirp_all_2b3.eps}
\caption{DesPos->IqCmd of motor 2}
\end{figure}
Moving 5um with frequencies from 10 to 220Hz\\
$\rightarrow$ at frequencies above 200 Hz, the current increses up to 2 amps, and the the following error kicks in\\
$\rightarrow$ The closed loop response becomes bad above 20Hz (motor 1 ca. -10\%, motor 2 +5\% )\\
$\rightarrow$ Moving 1um at 1kHz seems to consume a current of about 2 amps.\\
%→n times higher mass → n times lower frequency for same amplitude response
%→n times higher frequency → n times higher velocity → n² times more acceleration==current
%1um at 12Hz with 1 mA →with 2000mA → sqrt(2000)*12Hz=540Hz
%
%A very simplified transfer function of the system is G(s)=k/s²
\newpage
\section{Modeling the system}
\subsection{Electrical model}
\begin{figure}[h!]
\centering
\includegraphics[scale=.45]{model1.eps}
\includegraphics[scale=.6]{model2.eps}
\caption{electrical model}
\end{figure}
Basic formulas: $U=R \cdot I$ \hspace{.5cm}
$U=L \cdot \frac{di}{dt}$\\
Solving in Laplace space:\\
$iqVolts=(R+Ls)\cdot iqMeas$\\
$s \cdot iqMeas =\frac{1}{L}iqVolts - \frac{R}{L}iqMeas$\\
Transferfunction open loop of $G_1(s)=iqVolts \rightarrow iqCmd$
\\
using Masons rule:
\url{https://en.wikipedia.org/wiki/Mason's_gain_formula}:
\[
G_1(s)=\frac{y_{out}}{y_{in}}=\frac{iqCmd}{iqVolts}=
\frac{\frac{1}{Ls}}{1+ \frac{R}{Ls}} = \frac{1}{Ls+R} = \frac{k}{1+Ts} = \frac{\frac{1}{R}}{1+\frac{L}{R}s}
\]
\vspace{1pc}
Transferfunction closed loop of $G_2(s)=iqCmd \rightarrow iqMeas$:
\[
\begin{aligned}
&\text{with}\quad
a=Ipf+\frac{Li}{s} \quad
b=PwmSF \cdot G(s) \quad
c=Ipb \quad
d=1\\
&\text{using Masons rule:} \quad G_2(s)=\frac{ab}{1+bc+abd}\\
\\
&\text{extending:} \quad =\frac{(Ipf+\frac{Ii}{s}) \cdot PwmSF \cdot G_1(s)}
{1+PwmSF \cdot G_1(s) \cdot Ipb +(Ipf+\frac{Ii}{s})
\cdot PwmSF \cdot G_1(s)}\\
\\
&=\left.\frac{(Ipf+\frac{Ii}{s}) \cdot PwmSF \cdot \frac{1}{Ls+R}}
{1+PwmSF \cdot \frac{1}{Ls+R} \cdot Ipb +(Ipf+\frac{Ii}{s}) \cdot PwmSF \cdot \frac{1}{Ls+R}} \right| \cdot (Ls+R) \cdot s\\
\\
&=\frac{(Ipf \cdot s+Ii) \cdot PwmSF }
{(Ls+R)s+PwmSF \cdot Ipb \cdot s +(Ipf \cdot s+Ii) \cdot PwmSF }\\
\\
&=\frac{Ipf \cdot s+Ii }
{\frac{L}{PwmSF}s^2 +(\frac{R}{PwmSF}+ Ipb+Ipf)s +Ii}\\
\\
\end{aligned}
\]
To use real values we have to consider: The values
$IiGain=5, IpfGain=8, IpbGain=8$ for the Deltatau are in z-domain.\\
Therefore for the continous domain they have to be scaled:
$Ii=IiGain/ts \quad Ipf=IpfGain \quad Ipb=IpbGain$ with $ts=50\mu s$ (20kHz)\\
The overall aplification $iqCmd \rightarrow iqVolts$ measured in section {sec:measCurStep} is approx. 18.2.
The resistance of the stage is 8.8 $\Omega$\\
The inductance of the stage is 2.4 mH.\\
It seems that this works only in the discrete space. s.a. \verb|current_loop.slx|.\\
Therefore the only approach is to use the transfer function as approximated in section \ref{sec:measCurStep}.
\subsection{Mechanical model}
\begin{figure}[h!]
\centering
\includegraphics[scale=.45]{model3.eps}
\caption{mechanical model}
\end{figure}
Input: Force $u(t)=F$\\
Output: Position $y(t)=x_1(t)$\\
mass $m=m_1+m_2+\ldots+m_n$\\
damping: $d=d_1+d_2+\ldots+d_n$\\
springs: $k=k_1+k_2+\ldots+k_n$\\
\eqref{mech1} shows the mechanical differential equations:
\begin{equation}
\begin{aligned}
m_1\ddot{x}_1 = & u(t) -k_1x_1-d_1\dot{x}_1\\
& + k_2(x_2-x_1)+d_2(\dot{x}_2-\dot{x}_1)
+ k_3(x_3-x_1)+d_3(\dot{x}_3-\dot{x}_1)
+ k_4(x_4-x_1)+d_4(\dot{x}_4-\dot{x}_1)\\
m_2\ddot{x}_2= & k_2(x_2-x_1)+d_2(\dot{x}_2-\dot{x}_1)\\
m_3\ddot{x}_3= & k_3(x_3-x_1)+d_3(\dot{x}_3-\dot{x}_1)\\
m_4\ddot{x}_4= & k_4(x_4-x_1)+d_4(\dot{x}_4-\dot{x}_1)\\
\end{aligned}\label{mech1}
\end{equation}
\begin{equation}
\begin{aligned}
\dot{x} = Ax + Bu\\
y = Cx + Du
\end{aligned}\label{mech2}
\end{equation}
\eqref{mech2} are the general input output equations in matrix form with x and A defines as \eqref{mech3}:
\begin{equation}
x=
\begin{bmatrix}
x_1\\
\dot{x}_1\\
x_2\\
\dot{x}_2\\
x_3\\
\dot{x}_3\\
x_4\\
\dot{x}_4\\
\end{bmatrix},\quad
\dot{x}=
\begin{bmatrix}
\dot{x}_1\\
\ddot{x}_1\\
\dot{x}_2\\
\ddot{x}_2\\
\dot{x}_3\\
\ddot{x}_3\\
\dot{x}_4\\
\ddot{x}_4\\
\end{bmatrix},\quad
A=
\begin{bmatrix}
0 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\
-\frac{k}{m_1} & -\frac{d}{m_1} & \frac{k_2}{m_1} & \frac{d_2}{m_1} & \frac{k_3}{m_1} & \frac{d_3}{m_1} & \frac{k_4}{m_1} & \frac{d_4}{m_1}\\
0 & 0 & 0 & 1 & 0 & 0 & 0 & 0\\
-\frac{k_1}{m_2} & -\frac{d_1}{m_2} & \frac{k_2}{m_2} & \frac{d_2}{m_2} & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 1 & 0 & 0\\
-\frac{k_1}{m_3} & -\frac{d_1}{m_3} & 0 & 0 & \frac{k_3}{m_1} & \frac{d_3}{m_3} & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 1\\
-\frac{k_1}{m_4} & -\frac{d_1}{m_4} & 0 & 0 & 0 & 0 & \frac{k_4}{m_1} & \frac{d_4}{m_4} \\
\end{bmatrix},\quad
B=\begin{bmatrix}
\frac{1}{m_1} \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0\\
\end{bmatrix}
%,\quad
%C=\begin{bmatrix}
%\1 \\ 1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0\\
%\end{bmatrix},\quad
%D=0
\label{mech2}
\end{equation}
\subsection{Stage data}
This data comes from datasheets and construction information [biblio: 'Dynamics of Parker Stage', Wayne Glettig 5.12.2018].
\begin{tabular}{|r|l|}
\hline
Stage Y mass& 340g \\
Stage X mass& 950g \\
Interferometer mirrors & 51g (additional)\\
Aluminun (instead ABS) & 42g (additional)\\
\hline
\end{tabular}
\vspace{1pc}
\begin{tabular}{|r|c|l|}
\hline
Continous force && 5.51N \\
Peak force && 12N \\
Static friction && 1N\\
Viscose damping && 0.5N$\cdot$s/m\\
Motor constant &Km& 1.46N/$\sqrt{watt}$\\
Resistance &R&8.8$\Omega$\\
Inductance &L& 2.4mH\\
\hline
\end{tabular}
\vspace{1pc}
The data in the data sheet are quite confusing. But lets check the motor Konstant Km.\\
The data sheet says:\\
Stall Current Continous 0.92A, Stall force Continous 4N
\[
U=R\cdot I \qquad P=U \cdot I \quad \rightarrow \quad P=R \cdot I^2\\
\]
at a constant current of 0.92A we have $ 8.8 \cdot 0.92^2 = 7.44 $W the resulting force will be:\\
$1.46N \cdot \sqrt{7.44} = 3.98 N$
\subsection{identification of stages}
The goal is to build an optimal state space model of the plant with following input and output taps:
\begin{figure}[h!]
\center
\includegraphics[scale=.7]{model4.eps}
\caption{model taps}
\end{figure}
\verb|full_bode_mot[1|2].mat| is generated from \verb|MXTuning.py| in function \verb|bode_model_plot()|. It contains the bode data of real measurements and approximated transfer functions.
\verb|identifyFxFyStage.m| reads the python data \verb|full_bode_mot[1|2].mat| and build motor objects with transfer functions and state space models.
The approximated transfer functions can be tweaked and edited with: e.g. \verb|controlSystemDesigner('bode',1,mot1.tf_xx)| to enhance the model.
The full transfer function is then split in individual parts that are put back into \verb|MXTuning.py|.\\
the transfer functions for each two motors are separated in:\\
\begin{tabular}{|l|l|l|l|}
\hline
key & description & motor1 (fy) & motor2 (fx) \\
\hline
tfc & curren loop tf & f=694 ? 1389 , d=0.75 & same \\
tf1 & \vtop{\hbox{\strut main mechanical tf} \hbox{\strut with -40dB/dec }}
& mag=6dB f=7.96Hz d=0.6 & mag=12dB f=3.34 d=0.4 \\
tf2 & mechanical resonance tf & f=[197,199] d=[0.02,0.02] & f=[55|61] d=[0.2|0.2] \\
tf3 & mechanical resonance tf & & f=[128|137] d=[0.05|0.05] \\
tf4 & mechanical resonance tf & & f=[410|417] d=[0.015|0.015] \\
tf5 & mechanical resonance tf & & f=[230|233] d=[0.04|0.04] \\
\hline
\end{tabular}
\vspace{1pc}
The black line on figure \ref{fig:mot_open} shows the concatenate transfer function.
\vspace{1pc}
\fbox{\parbox[t]{15cm}{The current loop frequency from the MATLAB identification looks different than the used one. Matlab identifies $w_0=8727rad/sec = f0=1389Hz$ but to match the bode plot a value of half frequency need to be taken:$f_0=694$.}}
\vspace{1pc}
The motor objects contains also 'state space models' of different complexity. From the best approach to the most simlified model.
As first approach the tf function is just converted to the ss space and the ss matrices are glued together.
The matlab models are:\\
\begin{tabular}{ll}
\texttt{ssPlt:} & best approach of the plant with mechanics, resonance, current loop etc.\\
\texttt{ssMdl\_c1:} & model without resonance (only current and main mechanical)\\
\texttt{ssMdl\_12:} & model without current loop, with one resonance (main mechanical + first resonance)\\
\texttt{ssMdl\_1:} & model without current loop, no resonance (only main mechanical)\\
\end{tabular}
\section{Simulink/MATLAB simulations}
It has to be checked if the model matches the real stage. Therefore simulations in MATLAB have been done to validate the identification process of the stages.
\subsection{chirp sine closed loop with simulink model}
To compare the measurements with the model following lines were executed in MATLAB
\begin{verbatim}
clear;clear global;close all;
mot=cell(2,1);
[mot{1},mot{2}]=identifyFxFyStage();
for k =1:2
[pb]=simFxFyStage(mot{k});sim('stage_closed_loop');
f=figure(); h=plot(desPos_actPos.Time,desPos_actPos.Data,'g');
set(h(1), 'color', 'b'); set(h(2), 'color', [0 0.5 0]);
print(f,sprintf('figures/sim_cl_DTGz_%d',mot{k}.id),'-depsc');
end
\end{verbatim}
The Simulink model \verb|stage_closed_loop| contains various controller blocks. as \verb|PID G(s)|, \verb|PID G(z)|, \verb|ServoDeltaTau_z G(s)| and \verb|ServoDeltaTau_z G(z)|.
With the controller block \verb|ServoDeltaTau_z G(z)| the real measurements can be compared with the simulated model.
Figures \ref{fig:mot_chirp_sim} showed similar response as the real stages (Figures \ref{fig:mot1_chirp}, \ref{fig:mot2_chirp}). Therefore the model matches the real stage well.
\begin{figure}[h!]
\center
\includegraphics[scale=.45]{../matlab/figures/sim_cl_DTGz.png}
\includegraphics[scale=.65]{../matlab/figures/sim_cl_DTGz_1.eps}
\includegraphics[scale=.65]{../matlab/figures/sim_cl_DTGz_2.eps}
\caption{Motor 1 sim Motor 2 sim}
\label{fig:mot_chirp_sim}
\end{figure}
The model can be used to imrove the controller in MATLAB/simulink.
Improvement of the regulation with a simple PID loop and with prefilters did not improve the regulation quality.\\
Therefore for better regulation quality more sophisticated controllers as state controllers will be tested.
\subsection{State Space Controller with Observer}
\verb|(s.a. http://ctms.engin.umich.edu/CTMS/index.php?example=Introduction&section=ControlStateSpace)|
A standard PID controller uses feedback to detect errors between the desired position and the actual position and applies corrective commands to compensate for those errors. Although PID control is the most common type of industrial controller, it does have limitations.
The idea of a state space controller with observer is to have a model of the plant which follows all internal states of the real plant. All these internal states of the model can then be used states to build an optimal controller.
opposite to the PID cpntroller which is a black-box design, the state space controller with observer is a white box design
To implement a state space controller with observer the model has to be observable and controllable. The full model as used above is not controllable due to the various resonance frequencies. Therefore for the state space controller a simplified model without the resonance frequencies is used.
Following lines are used to build the state space controller
\begin{figure}[h!]
\centering
\includegraphics[scale=.75]{observer_statefeedback.png}
\caption{observer controller}
\end{figure}
\begin{verbatim}
clear;clear global;close all;
[mot{1},mot{2}]=identifyFxFyStage();
for k =1:2
close all;[ssc]=StateSpaceControlDesign(mot{k});sim('observer');
f=figure();
h=plot(desPos_actPos.Time,desPos_actPos.Data,'g');
set(h(1), 'color', 'b');
set(h(2), 'color', [0 0.5 0]);
print(f,sprintf('figures/sim_cl_DTGz_%d',mot{k}.id),'-depsc');
end
close all;[ssc]=StateSpaceControlDesign(mot2);sim('observer');
close all;[ssc]=StateSpaceControlDesign(mot1);sim('observer');
[pb]=simFxFyStage(mot2);sim('stage_closed_loop');
close all;[ssc]=StateSpaceControlDesign(mot2);sim('observer');
\end{verbatim}
This plot displays bode diagrams of motor 2. The used model for the controller is the blue line, which contains the current loop model and the mechanical model.
The state space controller is calculated by pole placement on the observer model and on the closed loop system
Now the controller must be implemented on deltatau to check the performance on the real stage.
\subsection{Implementing state space controller on Deltatau}
In MATLAB the function StateSpaceControlDesign() MATLAB produces files /tmp/ssc[1|2].mat.
The driver code can be generated with: MXTuning.py mode 8
Finally the real time servo code for the DeltaTau has to be compiled with:
\verb|/epics_ioc_modules/ESB_MX/python/usr_code$ make|
The system was simulated with 5kHz servo loop frequency
Higher servo loop frequency does not help, because a continious state space controller behaves not relevantly better than a sampled state space controller at 5kHz.
Model of the stage instead of measuring transfer function
\textbf{Overview of code}\\
\vspace{1pc}
\begin{tabular}{ll}
\texttt{identifyFxFyStage.m}& read python data and build motor objects. plot bode\\
\texttt{simFxFyStage.m}& build a pb structure which contains current (Jan 2019) Powerbrick controller settings\\
\texttt{StateSpaceControlDesign.m}& design a discrete observer for Fx,Fy stages\\
\end{tabular}
\newpage
\section{SCRATCH}
\begin{verbatim}
clear;
clear global;
close all;
[mot1,mot2]=identifyFxFyStage();
[pb]=simFxFyStage(mot1);sim('stage_closed_loop');
close all;[ssc]=StateSpaceControlDesign(mot1);sim('observer');
[pb]=simFxFyStage(mot2);sim('stage_closed_loop');
close all;[ssc]=StateSpaceControlDesign(mot2);sim('observer');
mögliche tf:
iqCmd---->iqMeas
iqVolts-->iqMeas
iqMeas--->actPos
identifyFxFyStage.m
controlSystemDesigner('bode',1,mot1.tf_py); % <<<<<<<<< This opens a transferfunction that can be edited
\end{verbatim}
\begin{figure}[h!]
\center
\framebox[5cm]{\vtop{\vspace{2cm}\hbox{INSERT GRAPHICS}\vspace{2cm}}}
\framebox[5cm]{\vtop{\vspace{2cm}\hbox{INSERT GRAPHICS}\vspace{2cm}}}
%\includegraphics[scale=.7]{model4.eps}
\caption{Motor 1 sim Motor 2 sim}
\end{figure}
\newpage
\section{shapepath}
\begin{verbatim}
Add section shapepath:
----------------------
TODO:
trajectory generation: trajectory.py
images of spiral motion:
with pvt motion ->
with pvt0 motion ->
with ift motion ->
TODO:
timing of motion
\end{verbatim}
\newpage
\section{HelicalScan coordinates}
\begin{figure}[h!]
\includegraphics[scale=.4]{helicalscan1a.eps}
\includegraphics[scale=.4]{helicalscan2a.eps}
\includegraphics[scale=.4]{helicalscan3a.eps}
\caption{coordinate transformation}
\end{figure}
%proces compiled as job \texttt{\jobname} from the file \texttt{\currfileabspath}\\
%\eject
%
%hyperref package sample
%\url{http://stackoverflow.com/questions/9845292/converting-matlab-to-python}\\
%
%fancyvrb package sample
%\begin{Verbatim}[frame=single]
%Verbatim Verbatim Verbatim
%Verbatim
% Verbatim
%\end{Verbatim}
\newpage
\bibliographystyle{alpha}
\bibliography{myBib}
%\printbibliography
\end{document}