optimize
This commit is contained in:
@@ -32,27 +32,20 @@
|
||||
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, to plot bode diagrams and to do further analysis is MXTuning.py. The main call to collect all data is:\\
|
||||
The tool used to record data of the fast stages, to plot bode diagrams and to do further analysis is \verb|MXTuning.py.| The main call to collect all data is:\\
|
||||
\verb|./MXTuning.py --dir MXTuning/19_01_29 --mode 64|\\
|
||||
|
||||
The used frequencies on the DeltaTau are: 20 kHz phase loop, 5 kHz servo loop, 6.25MHz AdcAmp. This results in 50us phase time and 0.2ms servo time.\\
|
||||
|
||||
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 parameter works and is explained with some calculation examples.\\
|
||||
|
||||
The settings of the PwmSf is done in the templates of gpasciiCommander:
|
||||
\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}
|
||||
Nevertheless the documentation is confusing. Therefore PwmSf is 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 \cite[23]{ParkerStage} are 0.8Amp RMS (producing 4N force) and 2.4Amp RMS peak.\\
|
||||
It should be save to use the higher DC value of 0.92Amp and 2.8Amp instead of the RMS value.
|
||||
|
||||
\subsection{Measure Current Step}\label{sec:measCurStep}
|
||||
\verb|MXTuning.py –mode 1| $\rightarrow$ \verb|identifyFxFyStage.m|\\
|
||||
|
||||
The current regulation loop controls the voltage to reach the desired commanded current. It is measured and analyzed with:
|
||||
\verb|MXTuning.py –mode 1| and \verb|identifyFxFyStage.m|\\
|
||||
|
||||
\includegraphics[scale=.5]{../matlab/figures/currstep_1.eps}
|
||||
\includegraphics[scale=.5]{/home/zamofing_t/Documents/doc-ext/DeltaTau/UsrMan257.png}
|
||||
@@ -72,6 +65,14 @@ at frequencies from 10 to 220 Hz.
|
||||
The images have been generated with
|
||||
\verb|./MXTuning.py --dir MXTuning/19_01_29 --mode 128|.\\
|
||||
|
||||
\cite[245-259]{PMACusr} shows how the PwmSf parameter works and explains it with some calculation examples.
|
||||
The settings of the PwmSf is done in the templates of gpasciiCommander:
|
||||
\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}
|
||||
Nevertheless the documentation is confusing and the PwmSf is not directly a value to scale from cvurrent to voltage. Therefore PwmSf is measured to convert idCmd bits values to idVolts bits in section \ref{sec:measCurStep}\\
|
||||
|
||||
The overall aplification $iqCmd \rightarrow iqVolts$ is approx. 18.2.
|
||||
|
||||
\begin{figure}[h!]
|
||||
@@ -152,7 +153,7 @@ Therefore the whole current is used to overcome the friction and the bode amplit
|
||||
\\
|
||||
|
||||
For now only features of the basic PID loop are used: \verb|Kp, Kvfb, Ki, Kvff, Kaff, MaxInt|.\\
|
||||
These values have been tweaked as it is recommended by various DeltaTau turorials. But this twearing is just based on trial and error and not on regulation theory.\\
|
||||
These values have been tweaked as it is recommended by various DeltaTau turorials. But this is just based on trial and error and not on regulation theory.\\
|
||||
The settings so far are:
|
||||
\begin{verbatim}
|
||||
motor_servo(mot=1,Kp=25,Kvfb=400,Ki=0.02,Kvff=350,Kaff=5000,MaxInt=1000)
|
||||
@@ -226,10 +227,10 @@ The standard PID servo loop (figure\ref{fig:deltatau_std_ctrl}) has some additio
|
||||
\begin{description}
|
||||
\item[A:] $Ka_0+Ka_1z^{-1}+\ldots+Ka_1z^{-7}$
|
||||
\item[B:] $Kb_0+Kb_1z^{-1}+\ldots+Kb_1z^{-7}$
|
||||
\item[C/D:] $\frac{Kc_0+Kc_1z^{-1}+\ldots+Kc_1z^{-7}}
|
||||
{Kd_0+Kd_1z^{-1}+\ldots+Kd_1z^{-7}}$
|
||||
\item[E:] $\frac{1}{Ke_0+Ke_1z^{-1}+Ke_1z^{-2}}$
|
||||
\item[F:] $\frac{1}{Kf_0+Kf_1z^{-1}+Kf_1z^{-2}}$
|
||||
\item[C/D:] $\frac{1+Kc_1z^{-1}+\ldots+Kc_1z^{-7}}
|
||||
{1+Kd_1z^{-1}+\ldots+Kd_1z^{-7}}$
|
||||
\item[E:] $\frac{1}{1+Ke_1z^{-1}+Ke_1z^{-2}}$
|
||||
\item[F:] $\frac{1}{1+Kf_1z^{-1}+Kf_1z^{-2}}$
|
||||
\end{description}
|
||||
|
||||
Filters A, B, C, and D are 7th-order polynomials.
|
||||
@@ -536,7 +537,8 @@ The goal is to build an optimal state space model of the plant with following in
|
||||
|
||||
\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 approximated transfer functions can be tweaked and edited in MATLAB 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 atomic transfer function as stated in table \ref{tab:trfFunc1} :\\
|
||||
@@ -853,7 +855,7 @@ The Standard Delta Tau controller (figure \ref{fig:deltatau_std_ctrl}), shows a
|
||||
Kp and Ki values will attenuate the errors. Kvff=Kvfb makes the system stable at higher Kp values, but setting the filter B seems to be more appropriate.\\
|
||||
Now that we had some experimental experiences the focus is to use regulation theory knowledge to find the best parameters.\\
|
||||
|
||||
\subsection{Controller with pole placement}
|
||||
\subsection{Controller with pole placement}\label{sec:ctr_pp}
|
||||
|
||||
As a full observer controller is not possible, the goal is to implement a controller with pole placement with a simplified plant model. The simplified motion (tfq) with simplified current (tfd) loop has all the needed states directly as measurement values or as calculated values in the default DeltaTau servo controller. The used states are: position, velocity, acceleration(proportional to measured current). With these states a pole placement controller can be implemented. The calculated values are: Kp Kvfb and Kafb. The result is a quite good looking controller.\\
|
||||
Additional feed forward gains follows the trajectory even better by setting of these values:
|
||||
@@ -861,7 +863,7 @@ Additional feed forward gains follows the trajectory even better by setting of t
|
||||
\setlength\itemsep{0em}
|
||||
\item optimize Kfff by tests to roughly 10
|
||||
\item Kvff=Kvfb
|
||||
\item Kaff as caldulated in equation \ref{eq:calc_Kaff}.
|
||||
\item Kaff as calculated in equation \ref{eq:calc_Kaff}.
|
||||
\item Ki value will attenuate the static error, but also make the dynamic regulation worse
|
||||
\end{itemize}
|
||||
|
||||
@@ -876,6 +878,20 @@ One point that is very important to keep in mind: The response analyses focused
|
||||
|
||||
For the time being, these regulation parameters should be good enough for the beam time in March 2019 but still some further minor improvements should be possible.\\
|
||||
|
||||
In a test following situations have been observed:\\
|
||||
Use parameters as stated in section: \ref{sec:ctr_pp} with poles \verb|[-600+750i -600-750i -2513]| and \verb|Ki=0|
|
||||
|
||||
$\rightarrow$ The pure feed forward controller will be close to 1 at high frequencies\\
|
||||
$\rightarrow$ The pure feed back controller will be close to 1 at high frequencies\\
|
||||
$\rightarrow$ The feed forward with feed back controller will overshoot at high frequencies\\
|
||||
|
||||
The reason for that is that the delayed position is feed back and overcompensated then by the feedback\\
|
||||
To avoid this behaviour, the feed forward filter F can be tweaked as a lowpass filter to attenuate this overcompensation.\\
|
||||
|
||||
This works good and enhanced the trajectory following at high frequencies. But this will not enhance a lot the real application, because high frequencies are suppressed in the trajectory planing.\\
|
||||
|
||||
Much more important is to focus now on the closed loop filters B, C/D and E.
|
||||
|
||||
|
||||
% Motor 2:11.84Hz 0dB
|
||||
% Kaff = 1/((11.84*2*np.pi)**2/5000/5000) = 4517.278506241804
|
||||
@@ -974,40 +990,51 @@ With that approach crystal alignment is very fast and user friendly.
|
||||
|
||||
\FloatBarrier
|
||||
\begin{appendix}
|
||||
\section{Appendix}\label{ax:optimize}
|
||||
\section{Appendix}
|
||||
|
||||
\subsection{real measurements motor 1,2}
|
||||
\label{sec:real_meas}
|
||||
|
||||
Real measurements have been done. The quality of the measurement is done with:\\
|
||||
$\rightarrow$ spiral motion move at 25Hz (quantitative values)\\
|
||||
$\rightarrow$ following trajectory of a chirp (graphics) signal \verb|amp: 5, minFrq: 10, maxFrq: 220, ts: 0.0002, tSec: 20|
|
||||
|
||||
\begin{verbatim}
|
||||
amp: 5, minFrq: 10, maxFrq: 220, ts: 0.0002, tSec: 20
|
||||
|
||||
***ORIG***
|
||||
***ORIG 19_01_29***
|
||||
Motor[1] Kp=25 Kvfb=400 Ki=0.02 Kvff=350 Kaff=5000 MaxInt=1000 Kfff=0
|
||||
Motor[2] Kp=22 Kvfb=350 Ki=0.02 Kvff=240 Kaff=1500 MaxInt=1000 Kfff=0
|
||||
(spiral motion 25 Hz)
|
||||
motion average error x 1.54099 um, y 1.04259 um, 2.0391 um
|
||||
shot average error x 1.68984 um, y 1.42837 um, 2.47304 um
|
||||
|
||||
**OPTIMIZED***
|
||||
Motor[1] Kp=25 Kvfb=350 Ki=0.02 Kvff=350 Kaff=1615. MaxInt=1000 Kfff=10
|
||||
Motor[2] Kp=22 Kvfb=450 Ki=0.02 Kvff=450 Kaff=4517. MaxInt=1000 Kfff=10
|
||||
motion average error x 0.663518 um, y 0.585719 um, 1.01806 um
|
||||
shot average error x 0.865708 um, y 0.965126 um, 1.49323 um
|
||||
|
||||
\end{verbatim}
|
||||
|
||||
|
||||
\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}
|
||||
|
||||
\includegraphics[scale=.45]{../python/MXTuning/opt1/img/chirp_all_1b0.eps}
|
||||
\includegraphics[scale=.45]{../python/MXTuning/opt1/img/chirp_all_1b1.eps}
|
||||
|
||||
\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}
|
||||
|
||||
|
||||
\begin{verbatim}
|
||||
**OPTIMIZED opt1***
|
||||
Motor[1] Kp=25 Kvfb=350 Ki=0.02 Kvff=350 Kaff=1615. MaxInt=1000 Kfff=10
|
||||
Motor[2] Kp=22 Kvfb=450 Ki=0.02 Kvff=450 Kaff=4517. MaxInt=1000 Kfff=10
|
||||
motion average error x 0.663518 um, y 0.585719 um, 1.01806 um
|
||||
shot average error x 0.865708 um, y 0.965126 um, 1.49323 um
|
||||
\end{verbatim}
|
||||
\includegraphics[scale=.45]{../python/MXTuning/opt1/img/chirp_all_1b0.eps}
|
||||
\includegraphics[scale=.45]{../python/MXTuning/opt1/img/chirp_all_1b1.eps}
|
||||
|
||||
\includegraphics[scale=.45]{../python/MXTuning/opt1/img/chirp_all_2b0.eps}
|
||||
\includegraphics[scale=.45]{../python/MXTuning/opt1/img/chirp_all_2b1.eps}
|
||||
|
||||
|
||||
|
||||
\subsection{simulations}
|
||||
|
||||
|
||||
|
||||
|
||||
\begin{tcolorbox}[colback=red!5!white,colframe=red!75!black,colbacktitle=red!50,coltitle=black,title=TODO]
|
||||
\begin{verbatim}
|
||||
images of spiral motion: with pvt,pvt0,ift motion
|
||||
|
||||
Reference in New Issue
Block a user