Skip to content

Commit 1e25a78

Browse files
elseversnpetersen2anirudhupadhyayanoguchi-takahiroDaehoon-Sung
authored
Publish encoder feedback "control with AMDC" article (#183)
* Add initial template of new docs control content per #77 * initial commit * Update index.md * Add content * Update docs * Update doc * Update docs * Update docs * Update doc * Update block diagram * Apply suggestions from code review Co-authored-by: Eric Severson <eric.severson@wisc.edu> * Update doc to address review comments * Add line on low pass filter * Update source/getting-started/control-with-amdc/encoder-fb/index.md Co-authored-by: Eric Severson <eric.severson@wisc.edu> * Add current sensor calibration documentation (#95) * Initial commit * Update readme * Update readme * Update readme * Add files * Update files * Changes * Changes * Update files * Get rif of scope image * Minor updates * Address review comments * Remove resources * Add back resources * Address review comments * Address review comments * Update index.md * Edit current sensor calibration method section * Edit calibration method section * Add section on Recalcilating current sensor offset * Clarify that we measure a voltage. * Edit conclusion * Update index.md * Update index.md * Address review comments * Update index.md * Update index.md * Update index.md * Apply suggestions from code review Co-authored-by: Eric Severson <eric.severson@wisc.edu> * Update source/getting-started/control-with-amdc/current-sensor-cal/index.md * Update source/getting-started/control-with-amdc/current-sensor-cal/index.md --------- Co-authored-by: Nathan Petersen <npetersen2@wisc.edu> Co-authored-by: Eric Severson <eric.severson@wisc.edu> * Edit background * Fix file name type-o * Fix type-os * Add config instructions * Edit first 1/3 of document * Fix current calibration images (#116) * add simulink model of pll * Add pll test files * Change indexme file * Update index.md * Edit finding offset and step 1 * Edit finding the offset section * Add encoder angle diagram, first edits of text to use it. * Add latex source for motor cross section * add test code * - Edit everything before finding the offset - Fix links * change image naming to dash-case * Improve typesetting around the image * Add torque characteristic and update step 1 instructions. * Make motor cross-section plot 2 poles, add phave v and w axes * Add clarifying comment to torque characteristic * Update index.md Apply feedback from Professor's comment (option 2) to revise the steps to find offset * Update the encoder offset plot * Update index.md Update the image * Update index.md Add the formula * Update source/getting-started/control-with-amdc/encoder-fb/index.md Co-authored-by: Takahiro <114006024+noguchi-takahiro@users.noreply.github.com> * Update index.md * Update index.md * Update index.md * Fix rendering of equation * Fix rendering issue of image * Update the encoder image * Update index.md Update the variable names * Update the figure * Clarify terminology for mechanical angle in documentation * Enhance encoder offset determination section Added detailed explanation and equations for determining encoder offset using closed-loop control and voltage measurements. * Clarify voltage equation with angular velocity note Added clarification about electrical angular velocity in the voltage equation. * Clarify voltage vector description in index.md * Fix voltage vector equation formatting Corrected the formatting of the voltage vector equation in complex vector form. * Refine description of encoder offset estimation process Clarified the conditions for estimating encoder offset by refining language regarding the alignment of the gamma-delta and d-q frames. * Fix minor grammatical error in encoder offset section * Fix formatting in encoder offset determination section * Revise current command notation in encoder equations Updated notation for current commands in the equation for v_gamma. * Fix rendering issues for images * Clarify angle calculation and encoder offset procedure Updated explanations regarding the calculation of the motor's angle and the determination of the encoder offset. Improved clarity on the relationship between electrical angle and voltage vector. * Revise encoder offset section contents (#146) * Edit encoder offset precise section * Improve typesetting and clarify vd * fix typo * clean up reference * cleanup msc lint errors * fix reference warning and eq typsetting * rename files to dash case * fix typo * replace encoder block diagram * Add encoder feedback TOC * remove placeholder articles * remove placeholder TOC entries * fix references header level * edit speed section intro * fix typo * Add dark mode support --------- Co-authored-by: Nathan Petersen <nathan.petersen@wisc.edu> Co-authored-by: Anirudh Upadhyaya <aupadhyaya4@wisc.edu> Co-authored-by: Anirudh Upadhyaya <90214161+anirudhupadhyaya@users.noreply.github.com> Co-authored-by: Nathan Petersen <npetersen2@wisc.edu> Co-authored-by: Takahiro Noguchi <tnoguchi@umn.edu> Co-authored-by: AD\sung0058 <sung0058@umn.edu> Co-authored-by: Takahiro <114006024+noguchi-takahiro@users.noreply.github.com> Co-authored-by: Harley Peterson <harleypeterson@gmail.com>
1 parent 295dbf3 commit 1e25a78

18 files changed

Lines changed: 5806 additions & 1 deletion

source/getting-started/control-with-amdc/encoder-fb/index.md

Lines changed: 280 additions & 0 deletions
Large diffs are not rendered by default.

source/getting-started/control-with-amdc/encoder-fb/resources/encoder-code-flow-dark.svg

Lines changed: 736 additions & 0 deletions
Loading

source/getting-started/control-with-amdc/encoder-fb/resources/encoder-code-flow.svg

Lines changed: 715 additions & 0 deletions
Loading

source/getting-started/control-with-amdc/encoder-fb/resources/encoder-offset.svg

Lines changed: 250 additions & 0 deletions
Loading

source/getting-started/control-with-amdc/encoder-fb/resources/motor-cross-section-dark.svg

Lines changed: 874 additions & 0 deletions
Loading

source/getting-started/control-with-amdc/encoder-fb/resources/motor-cross-section.svg

Lines changed: 223 additions & 0 deletions
Loading
Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
\documentclass[class=IEEEtran]{standalone}%[conference,10pt]{IEEEtran}
2+
\usepackage{amsmath}
3+
\ifCLASSINFOpdf
4+
\usepackage[pdftex]{graphicx}
5+
\else
6+
\usepackage[dvips]{graphicx}
7+
\fi
8+
9+
\usepackage{color} % required for `\textcolor' (yatex added)
10+
11+
%ERIC ADDED:
12+
\usepackage{xcolor, tikz, pgfplots, ifthen}
13+
\usepackage[american,cuteinductors,smartlabels]{circuitikz}
14+
\pgfplotsset{compat=newest}
15+
\usetikzlibrary{intersections,calc,backgrounds}
16+
17+
\begin{document}
18+
19+
20+
\centering
21+
\newcommand{\thisScale}{.09}
22+
23+
24+
%THE CALLING TEX FILE MUST DEFINE TWO COMMANDS:
25+
%\thisScale and \setupFig
26+
%for example:
27+
% \newcommand{\setupFig}
28+
%{
29+
% \def\TopLayerLabels{{"v", "v", "-u", "w", "w", "-v", "u", "u", "-w", "v", "v", "-u", "w", "w", "-v", "u", "u", "-w","v", "v", "-u", "w", "w", "-v", "u", "u", "-w","v", "v", "-u", "w", "w", "-v", "u", "u", "-w"}}
30+
% \def\BotLayerLabels{{"v", "-u", "-u", "w", "-v", "-v", "u", "-w", "-w", "v", "-u", "-u", "w", "-v", "-v", "u", "-w", "-w","v", "-u", "-u", "w", "-v", "-v", "u", "-w", "-w","v", "-u", "-u", "w", "-v", "-v", "u", "-w", "-w"}}
31+
%}
32+
\definecolor{motoGreen}{RGB}{34, 139, 34}
33+
\definecolor{motoRed}{RGB}{196,0,100} % HEX #fedeed
34+
\definecolor{motoBlue}{RGB}{0,110,191}
35+
36+
%PREAMBLE:
37+
% \usetikzlibrary{intersections}
38+
% \usetikzlibrary{calc}
39+
%
40+
% \newcommand{\setupFig}{\def\showX{0}}
41+
% \newcommand{\thisScale}{1/10}
42+
%
43+
\scalebox{3}{
44+
\begin{tikzpicture}[font=\tiny,scale=\thisScale,remember picture, >=stealth]
45+
46+
47+
%default values:
48+
\def\StatorOR{25}
49+
\def\StatorIR{17.5}
50+
51+
\def\IntraSlotDepth{.3}
52+
\def\IntraSlotWidth{2}
53+
\def\SlotWidth{2}
54+
\def\SlotDepth{4.1}
55+
\def\NumSlots{36}
56+
\def\CondRadius{1.25}
57+
\def\UseCond{0}
58+
\def\NumberSlots{0}
59+
\def\StatorRotOffset{5} %angle that slot 1 should be at with respect to the x axis
60+
\def\TopLayerLabels{{"v", "v", "-u", "w", "w", "-v", "u", "u", "-w", "v", "v", "-u", "w", "w", "-v", "u", "u", "-w","v", "v", "-u", "w", "w", "-v", "u", "u", "-w","v", "v", "-u", "w", "w", "-v", "u", "u", "-w"}}
61+
\def\BotLayerLabels{{"v", "-u", "-u", "w", "-v", "-v", "u", "-w", "-w", "v", "-u", "-u", "w", "-v", "-v", "u", "-w", "-w","v", "-u", "-u", "w", "-v", "-v", "u", "-w", "-w","v", "-u", "-u", "w", "-v", "-v", "u", "-w", "-w"}}
62+
\def\phaseUcolor{"motoBlue!30!white"}
63+
\def\phaseVcolor{"motoRed!30!white"}
64+
\def\phaseWcolor{"motoGreen!30!white"}
65+
\def\TopCondColors{{\phaseUcolor,\phaseUcolor,\phaseVcolor,\phaseVcolor,\phaseWcolor,\phaseWcolor,\phaseUcolor,\phaseUcolor,\phaseVcolor,\phaseVcolor,\phaseWcolor,\phaseWcolor}}
66+
\def\BotCondColors{{\phaseVcolor,\phaseVcolor,\phaseWcolor,\phaseWcolor,\phaseWcolor,\phaseWcolor,\phaseUcolor,\phaseUcolor,\phaseWcolor,\phaseVcolor,\phaseWcolor,\phaseWcolor}}
67+
\def\nodeFontSize{\tiny}
68+
69+
%draw rotor:
70+
\def\drawPMrotor{0}
71+
\def\PMrotorPoles{4}
72+
\def\PMrotorRotation{15}
73+
\def\PMrotorPMthick{2}
74+
\def\PMrotorAG{1}
75+
\def\PMnorthColor{red!20!white}
76+
\def\PMsouthColor{green!20!white}
77+
\def\showRotorAngle{1}
78+
\def\rotorAngleLabel{$\theta$}
79+
\def\showRotorAngleTwo{0}
80+
\def\rotorAngleTwoStart{15}
81+
\def\rotorAngleTwoLabel{$\theta_b$}
82+
\def\showAlpha{1}
83+
84+
85+
% Overrides for this image
86+
\newcommand{\setupFig}
87+
{
88+
\def\TopLayerLabels{{
89+
" ", " ", " "," "," "," ",
90+
" "," "," "," "," "," "}} %back of the slot
91+
\def\BotLayerLabels{{
92+
" ", " "," "," "," "," ",
93+
" "," "," "," "," "," "}} %front of the slot
94+
\def\TopCondColors{{\phaseUcolor,\phaseVcolor,\phaseWcolor,\phaseUcolor,\phaseVcolor,
95+
\phaseWcolor,\phaseUcolor,\phaseVcolor,\phaseWcolor,\phaseUcolor,\phaseVcolor,\phaseWcolor}} %back of slot
96+
\def\BotCondColors{{\phaseWcolor,\phaseUcolor,\phaseVcolor,\phaseWcolor,\phaseUcolor,\phaseVcolor,
97+
\phaseWcolor,\phaseUcolor,\phaseVcolor,\phaseWcolor,\phaseUcolor,\phaseVcolor}} %front of slot
98+
\def\NumSlots{0}
99+
\def\SlotWidth{3.6}
100+
\def\SlotDepth{6.0}
101+
\def\IntraSlotDepth{.75}
102+
\def\StatorRotOffset{-60} %angle that slot 1 should be at with respect to the x axis
103+
\def\StatorOR{16}
104+
\def\StatorIR{12}
105+
\def\drawPMrotor{1}
106+
\def\PMrotorPoles{2}
107+
\def\PMnorthColor{red!20!white}
108+
\def\PMsouthColor{green!20!white}
109+
\def\showRotorAngle{1}
110+
\def\showRotorAngleTwo{1}
111+
\def\rotorAngleTwoStart{-30}
112+
\def\PMrotorRotation{15}
113+
\def\showAlpha{0}
114+
\def\NumberSlots{0}
115+
\def\UseCond{0}
116+
\def\rotorAngleTwoLabel{$\theta_{\rm enc}$}
117+
\def\rotorAngleLabel{$\theta_{\rm m}$}
118+
}
119+
120+
\setupFig %must be defined, this can overwrite the above definitions
121+
122+
123+
124+
%Stator laminations
125+
\filldraw[fill=gray!40!white] circle(\StatorOR);
126+
\filldraw[fill=white,very thin] circle (\StatorIR);
127+
128+
129+
%make slots:
130+
%find x y coordinate for slot
131+
\pgfmathparse{(\SlotWidth/4.5)/\StatorOR}; %was: \SlotWidth/6
132+
\edef\slope{\pgfmathresult};
133+
\pgfmathparse{sqrt((\StatorIR)^2/(1+\slope^2))};
134+
\edef\xcord{\pgfmathresult};
135+
\pgfmathparse{sqrt((\StatorIR)^2/(1+(1/\slope)^2))};
136+
\edef\ycord{\pgfmathresult};
137+
138+
\pgfmathparse{sqrt((\StatorIR-1)^2/(1+\slope^2))};
139+
\edef\xcordsnip{\pgfmathresult};
140+
\pgfmathparse{sqrt((\StatorIR-1)^2/(1+(1/\slope)^2))};
141+
\edef\ycordsnip{\pgfmathresult};
142+
143+
\ifthenelse{\NumSlots = 0}{}{
144+
\begin{scope}
145+
\foreach \x in {1,2,...,\NumSlots}
146+
{
147+
\path[fill= white,draw=black,rotate=360/\NumSlots*(\x-1)+\StatorRotOffset, name path =slotPath] (\xcord, \ycord) -- ++(\IntraSlotDepth,0) -- ++(0, \SlotWidth/3) -- ++(\SlotDepth, 0) -- ++(0,-\SlotWidth) -- ++(-\SlotDepth,0) -- ++(0, \SlotWidth/3) -- ++(-\IntraSlotDepth,0) -- cycle;
148+
}
149+
\end{scope}
150+
151+
\begin{scope}
152+
\foreach \x in {1,2,...,\NumSlots}
153+
{
154+
\pgfmathparse{\TopLayerLabels[\x-1]};
155+
\edef\TopLayerLabel{\pgfmathresult};
156+
\pgfmathparse{\BotLayerLabels[\x-1]};
157+
\edef\BotLayerLabel{\pgfmathresult};
158+
\path[fill= white,rotate=360/\NumSlots*(\x-1)+\StatorRotOffset, name path =slotPath](\xcordsnip, \ycordsnip) -- ++(\IntraSlotDepth+1,0) -- ++(0, \SlotWidth/3) -- ++(\SlotDepth, 0) -- ++(0,-\SlotWidth) -- ++(-\SlotDepth,0) -- ++(0, \SlotWidth/3) -- ++(-\IntraSlotDepth-1,0) -- cycle;
159+
\ifthenelse{\UseCond = 1}
160+
{
161+
\pgfmathparse{\TopCondColors[\x-1]}
162+
\edef\TopCondColor{\pgfmathresult}
163+
\pgfmathparse{\BotCondColors[\x-1]}
164+
\edef\BotCondColor{\pgfmathresult}
165+
166+
\filldraw[fill = \BotCondColor, very thin,rotate=360/\NumSlots*(\x-1)+\StatorRotOffset-.5] (\StatorIR+\IntraSlotDepth+\CondRadius+.25,0) circle(\CondRadius) node[font=\tiny]{\BotLayerLabel};
167+
\filldraw[fill = \TopCondColor, very thin, rotate=360/\NumSlots*(\x-1)+\StatorRotOffset-.5] (\StatorIR+\IntraSlotDepth+\SlotDepth-\CondRadius-.25,0) circle(\CondRadius) node[font=\nodeFontSize]{\TopLayerLabel};
168+
}
169+
{
170+
\draw[rotate=360/\NumSlots*(\x-1)+\StatorRotOffset] (\StatorIR + \IntraSlotDepth+\SlotDepth/2, -\SlotWidth/2) -- +(0, \SlotWidth);
171+
\draw [rotate=360/\NumSlots*(\x-1)+\StatorRotOffset](\StatorIR + \IntraSlotDepth + \SlotDepth/4, 0) node{\BotLayerLabel};
172+
\draw [rotate=360/\NumSlots*(\x-1)+\StatorRotOffset](\StatorIR + \IntraSlotDepth + 3*\SlotDepth/4, 0) node{\TopLayerLabel};
173+
}
174+
\ifthenelse{\NumberSlots = 1}
175+
{
176+
\draw [rotate=360/\NumSlots*(\x-1)+\StatorRotOffset](\StatorIR + \IntraSlotDepth + 5*\SlotDepth/4, 0) node{\x};
177+
}{}
178+
}
179+
\end{scope}}
180+
181+
\begin{scope}[rotate = \PMrotorRotation]
182+
183+
\ifthenelse{\drawPMrotor = 1}
184+
{
185+
\edef\rotorPMOR{\StatorIR-\PMrotorAG}
186+
\edef\rotorShaftOR{\rotorPMOR - \PMrotorPMthick}
187+
\edef\PMangle{180/\PMrotorPoles}
188+
189+
\fill[gray!40!white] (0,0) circle(\rotorShaftOR);
190+
\foreach \x in {1,2,...,\PMrotorPoles}
191+
{
192+
\begin{scope}[rotate=(\x-1)*\PMangle*2]
193+
\pgfmathparse{int(mod(\x,2))}
194+
\edef\NorthPole{\pgfmathresult}
195+
196+
\def\pmColor{\PMnorthColor}
197+
\def\pmColor{\PMsouthColor}
198+
\ifthenelse{\NorthPole = 1}
199+
{
200+
\def\pmColor{\PMnorthColor}
201+
}
202+
{
203+
\def\pmColor{\PMsouthColor}
204+
}
205+
%\filldraw[gray!40!white,draw=black] ([shift=(-180\PMrotorPoles:\rotorShaftOR)]0,0) arc (-180/\PMrotorPoles:180/\PMrotorPole:\rotorShaftOR);
206+
\fill[\pmColor] ([shift=(-\PMangle:\rotorShaftOR)]0,0) arc (-\PMangle:\PMangle:\rotorShaftOR)
207+
-- (\PMangle:\rotorPMOR)
208+
-- ([shift=(\PMangle:\rotorPMOR)]0,0) arc (\PMangle:-\PMangle:\rotorPMOR)
209+
-- (-\PMangle:\rotorShaftOR);
210+
\draw([shift=(-\PMangle:\rotorShaftOR)]0,0) arc (-\PMangle:\PMangle:\rotorShaftOR)
211+
-- (\PMangle:\rotorPMOR)
212+
-- ([shift=(\PMangle:\rotorPMOR)]0,0) arc (\PMangle:-\PMangle:\rotorPMOR);
213+
214+
215+
\ifthenelse{\NorthPole = 1}
216+
{
217+
\draw[->] (\rotorShaftOR+.25, 0) -- (\rotorPMOR-.25, 0);
218+
}
219+
{
220+
\draw[<-] (\rotorShaftOR+.25, 0) -- (\rotorPMOR-.25, 0);
221+
}
222+
\end{scope}
223+
}
224+
225+
}
226+
{}
227+
\end{scope}
228+
229+
\ifthenelse{\showRotorAngle = 1}
230+
{
231+
\draw(\PMrotorRotation:\StatorIR-\PMrotorAG/2) -- (\PMrotorRotation:\StatorOR+5);
232+
\draw(0:\StatorOR+.5) -- (0:\StatorOR+9) node[right]{phase $u$ axis};
233+
\draw[rotate=120](0:\StatorOR+.5) -- (0:\StatorOR+9) node[right, xshift=-2, yshift=9, rotate=120+180]{phase $v$ axis};
234+
\draw[rotate=240](0:\StatorOR+.5) -- (0:\StatorOR+9) node[right, xshift=-7, yshift=-8, rotate=240+180]{phase $w$ axis};
235+
%\draw[dashed](0:\StatorOR+5) -- (0:\StatorOR+10) node[right]{phase $u$ axis};
236+
\draw[->]([shift=(0:\StatorOR+2.5)]0,0) arc (0:\PMrotorRotation:\StatorOR+2.5) node[xshift=-3,pos=0.5, right]{\rotorAngleLabel};
237+
}
238+
{}
239+
240+
\ifthenelse{\showRotorAngleTwo = 1}
241+
{
242+
\draw(\PMrotorRotation:\StatorIR-\PMrotorAG/2) -- (\PMrotorRotation:\StatorOR+10);
243+
\draw(\rotorAngleTwoStart:\StatorOR+.5) -- (\rotorAngleTwoStart:\StatorOR+10) node[pos=1, right,rotate=\rotorAngleTwoStart] {z-pulse};
244+
\draw[->]([shift=(\rotorAngleTwoStart:\StatorOR+7.5)]0,0) arc (\rotorAngleTwoStart:\PMrotorRotation:\StatorOR+7.5) node[xshift=-2,pos=0.85, right]{\rotorAngleTwoLabel};
245+
\draw[->]([shift=(\rotorAngleTwoStart:\StatorOR+2.5)]0,0) arc (\rotorAngleTwoStart:0:\StatorOR+2.5) node[xshift=-3,pos=0.5, right]{$\theta_{\rm off}$};
246+
}
247+
{}
248+
249+
\ifthenelse{\showAlpha = 1}
250+
{
251+
\draw(0,0) -- (60:\StatorIR-\PMrotorAG-\PMrotorPMthick*1.5);
252+
\draw(0,0) -- (0:\StatorIR-\PMrotorAG-\PMrotorPMthick*1.5);
253+
%\draw(0:\StatorOR+.5) -- (0:\StatorOR+5);
254+
\draw[->]([shift=(0:\StatorIR-\PMrotorAG-\PMrotorPMthick*1.5-2.5)]0,0) arc (0:60:\StatorIR-\PMrotorAG-\PMrotorPMthick*1.5-2.5) node[pos=0.95, right]{$\alpha$};
255+
}
256+
{}
257+
\showAlpha{1}
258+
\end{tikzpicture}
259+
}
260+
\end{document}
261+

0 commit comments

Comments
 (0)