Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass[tikz,border=10pt]{standalone}
- \usepackage{ifthen}
- \usepackage{pgfplots}
- \usepackage{amsmath} % Required for \varPsi below
- \usepackage{tikz}
- \usepackage{animate}
- \usetikzlibrary{calc}
- \usepackage{etoolbox}
- \usepackage[europeanresistors,americaninductors,americanvoltage,smartlabels]{circuitikz}
- \ctikzset{bipoles/thickness=1}
- \ctikzset{bipoles/length=0.8cm}
- \ctikzset{bipoles/diode/height=.375}
- \ctikzset{bipoles/diode/width=.3}
- \ctikzset{tripoles/thyristor/height=.8}
- \ctikzset{tripoles/thyristor/width=1}
- \ctikzset{bipoles/vsourceam/height/.initial=.7}
- \ctikzset{bipoles/vsourceam/width/.initial=.7}
- \tikzstyle{every node}=[font=\small]
- \tikzstyle{every path}=[line width=0.8pt,line cap=round,line join=round]
- \usetikzlibrary{calc,quotes,babel,angles}
- \pgfplotsset{compat=1.9}
- \usetikzlibrary{calc, intersections}
- \newcommand{\gettikzxy}[3]{%
- \tikz@scan@one@point\pgfutil@firstofone#1\relax
- \edef#2{\the\pgf@x}%
- \edef#3{\the\pgf@y}%
- }
- \makeatletter
- %\newcommand*{\getlength}[1]{\strip@pt#1}
- % Or rounded back to `cm` (there will be some rounding errors!)
- \newcommand*{\getlength}[1]{\strip@pt\dimexpr0.035146\dimexpr#1\relax\relax}
- \makeatother
- \begin{document}
- \foreach \angle in {1,5,...,360}{ %Create all the frames with different angle (DEFAULT IS {1,2,...,360} - but that takes about 20min rendering time - testing: {0,45,90,135,180,225,270,315,360})
- \begin{tikzpicture}
- %Definitions - These can be changed to create new figures%
- %===========================================================
- \pgfmathsetmacro \Vmax {1.5}; %Max phase voltage (in cm) (8/3 or 2.667 cm is default as that will create a 4 cm space vector)
- \def \Angle {\angle}; %Angle with regards to phase A
- \def \Osv {35}; %Angle of d-axis wrt space vector
- \def \R {2.5}; %Magnitude of rotor flux in cm
- %Calculated variables. These should not be changed unless you know what you are doing%
- %===========================================================
- \pgfmathsetmacro \Vs {\Vmax * 1.5}; %Magnitude of space vector in cm
- \pgfmathsetmacro \MaxLin {\Vs * cos{30}}; %Magnitude before overmodulation
- \pgfmathsetmacro \Qmag {\Vs * sin{\Osv})}; %Magnitude of Q axis
- \pgfmathsetmacro \Dmag {\Vs * cos{\Osv})}; %Magnitude of Q axis
- \pgfmathsetmacro \Marker {\Angle/45)};
- %\pgfmathsetmacro \Vmax {\Vs * 2/3}; %Max phase voltage (OLD)
- \def \Axisheight {\Vmax *3};
- \pgfmathsetmacro \Va {\Vmax * cos{(\Angle+0)}}; %Magnitude of phase A at angle \Angle
- \pgfmathsetmacro \Vaa {\Va * cos{(\angle+0)}}; %Magnitude of phase A at angle \Angle
- \pgfmathsetmacro \Vb {\Vmax * cos{(\Angle-120)}}; %Magnitude of phase B at angle \Angle
- \pgfmathsetmacro \Vbb {\Vb * cos{(\angle-120)}}; %Magnitude of phase B at angle \Angle
- \pgfmathsetmacro \Vc {\Vmax * cos{(\Angle-240)}}; %Magnitude of phase C at angle \Angle
- \pgfmathsetmacro \Vcc {\Vc * cos{(\angle-240)}}; %Magnitude of phase C at angle \Angle
- \pgfmathsetmacro \Radius {\Vmax}; %Radius of maximum line to line voltage output
- %Locations%
- %===========================================================
- \def \OrigoX {-5 cm}; % If you want to move the circle relative to the wave forms (default -6cm)
- \def \OrigoY {0 cm};
- \coordinate (origo) at (\OrigoX,\OrigoY); %Center of top phasor diagram
- \coordinate (phase_a) at (0:\Va cm); %Tip of phase A
- \coordinate (phase_b) at (120:\Vb cm); %Tip of phase B
- \coordinate (phase_c) at (240:\Vc cm) ; %Tip of phase C
- \coordinate (Y) at (\OrigoX+\Vs cm ,\OrigoY+0); %Where to start the Hexagon
- %Circle background rings%
- %===========================================================
- \node at (origo) [circle,thick,draw=black!80,fill=red!0, inner sep=0pt,minimum size=\Vs*2 cm] {}; %Top Circle with radius 128%
- %Black guide lines with angle notation
- \foreach \x in {30,60,...,360} {
- \draw[-,color=black,dotted, thin] (origo) -- ++(\x:\Vs cm) node[label={[label distance=-0.18cm]\x: $\x^{\circ}$}] {};
- }
- %=============================================================================================================
- %Actual three phase phasors%
- %=============================================================================================================
- \node at (origo) [circle,thick,draw=black!80, inner sep=0pt,minimum size=\Vmax*2 cm] {}; %Circle with radius 100%
- \draw[->,color=red, very thick] (origo) -- ++(phase_a); %Phase A phasor
- \draw[->,color=blue, very thick] (origo) -- ++(phase_b); %Phase B phasor
- \draw[->,color=green, very thick] (origo) -- ++(phase_c); %Phase C phasor
- %SPACE VECTOR %
- \draw[->,ultra thick,black] (origo) -- ++($(phase_a) + (phase_b) + (phase_c)$) coordinate(Vstip); %Space vector resultant
- \pgfgetlastxy{\XCoord}{\YCoord}; % X and Y coordinates of Space vector tip
- %Find space vector angle
- \pgfmathanglebetweenpoints{\pgfpointanchor{origo}{center}}{\pgfpointanchor{Vstip}{center}}
- \let\PhaseBlack\pgfmathresult;
- \draw[->,color=blue, thin] (origo) ++(phase_a) -> ++(phase_b); %Resultant help lines
- \draw[->,color=green, thin] (origo) ++(phase_a) ++(phase_b) -> ++(phase_c); %Resultant help lines
- \coordinate (OrigoSV) at (-5,-5.5);
- \pgfmathsetmacro{\SVradius}{\Vmax*1.5}
- \draw[black, solid] (OrigoSV) circle (\SVradius);
- \draw[-latex,black, very thick] (OrigoSV) --++ (\angle:2 cm);
- %Black guide lines with angle notation
- % \foreach \x in {0,30,60,...,345} {
- % \draw[-,color=black,dotted, thin] (OrigoSV) -- ++(\x:\SVradius cm) node[label={[label distance=-0.18cm]\x: $\x^{\circ}$}] {};
- % }
- %Phasor guide lines%
- \draw[-latex, solid, very thin, dashed] (OrigoSV) -- ++(0:\SVradius cm) node [below, align=center, anchor=west] {$ v_1 $ \\ $ 001 $};
- \draw[-latex, solid, very thin, dashed] (OrigoSV) -- ++(120:\SVradius cm) node [above, align=center, anchor=east, yshift=0.3cm] {$ v_2 $ \\ $ 010 $};
- \draw[-latex, solid, very thin, dashed] (OrigoSV) -- ++(240:\SVradius cm) node [below, align=center, anchor=north, xshift=-0.2cm] {$ v_4 $ \\ $ 100 $};
- \draw[-latex, solid, very thin, dashed] (OrigoSV) -- ++(0:-\SVradius cm) node [below, align=center, anchor=east] {$ v_6 $ \\ $ 110 $};
- \draw[-latex, solid, very thin, dashed] (OrigoSV) -- ++(120:-\SVradius cm) node [above, align=center, anchor=north, xshift=0.2cm] {$ v_5 $ \\ $ 101 $};
- \draw[-latex, solid, very thin, dashed] (OrigoSV) -- ++(240:-\SVradius cm) node [below, align=center, anchor=south, xshift=0.2cm] {$ v_3 $ \\ $ 011 $};
- % Definitions - These can be changed to create new figures
- %===========================================================
- % Space vector data
- %\def \Angle {45}; % Desired angle of the space vector
- \def \modindex {1}; % Desired modulation index
- \def \step {5}; % Higher number equals slower triangular wave (max value = 6). Even numbers please.
- % Figure variables
- \def \sizex {12}; % Desired length of axes in cm
- \def \sizey {2}; % Desired height of axes in cm
- \def \vertspace {2} % Desired distaance between axes in cm
- \pgfmathsetmacro \bottom {\sizey * 2 + \vertspace*2.0}
- % Triangular wave
- %================================================================================================================================================
- \pgfmathsetmacro \maxsigzags {\sizex-\step}; % Number of periods of triangular wave
- \draw [name path=zigzag, ultra thick]
- \foreach \x in {0,\step,...,\maxsigzags} {
- (\x,1.5) -- ++(\step/2,-3) -- ++(\step/2,3) -- ++(\step/4,-1.5)
- };
- \draw[black,-, thin] (5,2) --++ (0,-11.2);
- \draw[black,-, thin] (10,2) --++ (0,-11.2);
- \draw[<->, black, thick] (5,-9)--++(-5,0) node[midway, below]{$ T $};
- \draw[<->, black, thick] (10,-9)--++(-5,0) node[midway, below]{$ T $};
- \draw[black,-, thin] (2.5,2) --++ (0,-10.7);
- \draw[<->, black, thick] (2.5,-8.5)--++(-2.5,0) node[midway, below]{ \scriptsize $ \frac{1}{2} T $} ;
- % Contol signals
- %================================================================================================================================================
- \pgfmathsetmacro \uctrl {\modindex * cos{(\Angle+0)}};
- \pgfmathsetmacro \vctrl {\modindex * cos{(\Angle-120)}};
- \pgfmathsetmacro \wctrl {\modindex * cos{(\Angle-240)}};
- \draw[black, very thin] (0,1) node [left] {$ 1 $} --++ (\sizex*0.85,0);
- \draw[black, very thin] (0,-1) node [left] {$ -1 $} --++ (\sizex*0.85,0);
- % U switching
- %================================================================================================================================================
- %U-LEG
- \draw [red,thick, name path global=wave-1] (0,\uctrl) node [left, xshift=-0.25cm] {$v_{control,u}$} --++ (\sizex*0.85,0);
- \draw [draw=red,fill=red, fill opacity=0.5,name intersections={of={wave-1} and zigzag, total=\n}]
- \foreach \i [remember=\i as \lasti (initially 1)] in {1,...,\n} {
- \ifodd\i { }
- \else
- {
- (intersection-\lasti |- 0,-\vertspace*2) rectangle (intersection-\i |- 0,-\vertspace*2+1)
- }
- \fi
- };
- \draw [draw=red!50, dashed, very thin,name intersections={of={wave-1} and zigzag, total=\n}]
- \foreach \i [remember=\i as \lasti (initially 1)] in {1,...,2} {
- (intersection-\i) -- (intersection-\i|- 0,-\bottom*1.1)
- };
- %Code to find the length of X
- \draw [draw=red,thick ,name intersections={of={wave-1} and zigzag, total=\n}]
- (intersection-1 |- 0,-\bottom*1.5) --++ (0,0);
- \pgfgetlastxy{\XCoordux}{\YCoordux};
- \draw [draw=red,thick ,name intersections={of={wave-1} and zigzag, total=\n}]
- (intersection-2 |- 0,-\bottom*1.5) --++ (0,0);
- \pgfgetlastxy {\XCoorduxx}{\YCoorduxx};
- \pgfmathsetmacro {\xvalue}{\getlength{\XCoorduxx - \XCoordux}/7.4992};
- %Code to draw horizontal lines at bottom
- % \draw [latex-latex,draw=red,thick ,name intersections={of={wave-1} and zigzag, total=\n}]
- % \foreach \i [remember=\i as \lasti (initially 3)] in {1,...,\n} {
- % \ifodd\i { }
- % \else
- % {
- % (intersection-\lasti|- 0,-\bottom*1.1) -- (intersection-\i|- 0,-\bottom*1.1) node[midway, below]{$ U = \xvalue $}
- % }
- % \fi
- % };
- %V-LEG
- \draw [blue,thick, name path global=wave-2] (0,\vctrl) node [left, xshift=-0.25cm] {$v_{control,v}$}--++ (\sizex*0.85,0);
- \draw [draw=blue,fill=blue, fill opacity=0.5,name intersections={of={wave-2} and zigzag, total=\n}]
- \foreach \i [remember=\i as \lasti (initially 1)] in {1,...,\n} {
- \ifodd\i { }
- \else
- {
- (intersection-\lasti |- 0,-\vertspace*3) rectangle (intersection-\i |- 0,-\vertspace*3+1)
- }
- \fi
- };
- \draw [draw=blue!50, dashed, very thin,name intersections={of={wave-2} and zigzag, total=\n}]
- \foreach \i [remember=\i as \lasti (initially 1)] in {1,...,2} {
- (intersection-\i) -- (intersection-\i|- 0,-\bottom*1.1)
- };
- %Code to find the length of Y
- \draw [draw=red,thick ,name intersections={of={wave-2} and zigzag, total=\n}]
- (intersection-1 |- 0,-\bottom*1.5) --++ (0,0);
- \pgfgetlastxy{\XCoordvx}{\YCoordvx};
- \draw [draw=red,thick ,name intersections={of={wave-2} and zigzag, total=\n}]
- (intersection-2 |- 0,-\bottom*1.5) --++ (0,0);
- \pgfgetlastxy {\XCoordvxx}{\YCoordvxx};
- \pgfmathsetmacro {\yvalue}{\getlength{\XCoordvxx - \XCoordvx}/7.4992};
- % \draw [latex-latex,draw=blue,thick ,name intersections={of={wave-2} and zigzag, total=\n}]
- % \foreach \i [remember=\i as \lasti (initially 3)] in {1,...,\n} {
- % \ifodd\i { }
- % \else
- % {
- % (intersection-\lasti|- 0,-\bottom*1.05) -- (intersection-\i|- 0,-\bottom*1.05) node[midway, below]{$ V = \yvalue $}
- % }
- % \fi
- % };
- %W-LEG
- \draw [green,thick, name path global=wave-3] (0,\wctrl) node [left, xshift=-0.25cm] {$v_{control,w}$} --++ (\sizex*0.85,0) ;
- \draw [draw=green,fill=green, fill opacity=0.5,name intersections={of={wave-3} and zigzag, total=\n}]
- \foreach \i [remember=\i as \lasti (initially 1)] in {1,...,\n} {
- \ifodd\i { }
- \else
- {
- (intersection-\lasti |- 0,-\vertspace*4) rectangle (intersection-\i |- 0,-\vertspace*4+1)
- }
- \fi
- };
- \draw [draw=green!50, dashed, very thin,name intersections={of={wave-3} and zigzag, total=\n}]
- \foreach \i [remember=\i as \lasti (initially 1)] in {1,...,2} {
- (intersection-\i) -- (intersection-\i|- 0,-\bottom*1.1)
- };
- %Code to find the length of Z
- \draw [draw=red,thick ,name intersections={of={wave-3} and zigzag, total=\n}]
- (intersection-1 |- 0,-\bottom*1.5) --++ (0,0);
- \pgfgetlastxy{\XCoordwx}{\YCoordwx};
- \draw [draw=red,thick ,name intersections={of={wave-3} and zigzag, total=\n}]
- (intersection-2 |- 0,-\bottom*1.5) --++ (0,0);
- \pgfgetlastxy {\XCoordwxx}{\YCoordwxx};
- \pgfmathsetmacro {\zvalue}{\getlength{\XCoordwxx - \XCoordwx}/7.4992};
- % \draw [latex-latex,draw=green,thick ,name intersections={of={wave-3} and zigzag, total=\n}]
- % \foreach \i [remember=\i as \lasti (initially 3)] in {1,...,\n} {
- % \ifodd\i { }
- % \else
- % {
- % (intersection-\lasti|- 0,-\bottom*1.0) -- (intersection-\i|- 0,-\bottom*1.0) node[midway, below]{$ W = \zvalue $}
- % }
- % \fi
- % };
- % \pgfmathsetmacro{\totalxyz}{\xvalue + \yvalue + \zvalue};
- % \pgfmathsetmacro{\totaly}{(\yvalue - \zvalue) / (\xvalue - \zvalue+0.01)};
- % \pgfmathsetmacro{\totalx}{(1-\totaly)};
- % \node at (2.8,-\bottom+0.5) {$ U + V + W = \totalxyz $};
- %COORDINATES for v-values below axes
- \draw [draw=red,thick ,name intersections={of={wave-1} and zigzag, total=\n}]
- (intersection-1 |- 0,-\bottom*1.5) --++ (0,0);
- \pgfgetlastxy{\XCoordu}{\YCoordu};
- %\node at (-1.5,-9.5) {\scriptsize $ U= \getlength{\XCoordu $}};
- \coordinate (u) at (\XCoordu,-\bottom);
- \draw [draw=red,thick ,name intersections={of={wave-2} and zigzag, total=\n}]
- (intersection-1 |- 0,-\bottom*1.5) --++ (0,0);
- \pgfgetlastxy{\XCoordv}{\YCoordv};
- %\node at (-1.5,-10) {\scriptsize $ V= \getlength{\XCoordv $}};
- \coordinate (v) at (\XCoordv,-\bottom);
- \draw [draw=red,thick ,name intersections={of={wave-3} and zigzag, total=\n}]
- (intersection-1 |- 0,-\bottom*1.5) --++ (0,0);
- \pgfgetlastxy{\XCoordw}{\YCoordw};
- %\node at (-1.5,-10.5) {\scriptsize $ W= \getlength{\XCoordw $}};
- \coordinate (w) at (\XCoordw,-\bottom);
- %CALCULATIONS of the different sectors
- \pgfmathparse{min(\getlength{\XCoordu},\getlength{\XCoordv}, \getlength{\XCoordw})};
- \pgfmathsetmacro{\zerovectora}{(\pgfmathresult/2.5)*100}
- \node[anchor=west] at (-2.5,-8) {$ v_0 = \pgfmathprintnumber[precision=2]{\zerovectora} ~ \% $};
- \pgfmathparse{max(\getlength{\XCoordu},\getlength{\XCoordv}, \getlength{\XCoordw})};
- \pgfmathsetmacro{\zerovectorb}{((2.5 - \pgfmathresult )/2.5)*100}
- \node[anchor=west] at (-2.5,-9.5 ) {$ v_7 = \pgfmathprintnumber[precision=2]{\zerovectorb} ~ \% $};
- %SECTOR 1
- \ifboolexpr{
- test {\ifnumless{\Angle}{60}} and test{\ifnumgreater{\Angle}{0}} or test{\ifnumequal{\Angle}{0}}
- }
- {
- \ifthenelse{\Angle = 30}
- {
- \pgfmathsetmacro{\totaly}{(0.5)};
- \pgfmathsetmacro{\totalx}{(0.5)};
- }
- {
- \pgfmathsetmacro{\totaly}{(\yvalue - \zvalue) / (\xvalue - \zvalue+0.0001)};
- \pgfmathsetmacro{\totalx}{(1-\totaly)};
- }
- \draw[-latex,red, very thick] (OrigoSV) --++ (0:2.25*\totalx cm);
- \draw[-latex,green, very thick] (OrigoSV) --++ (60:2.25*\totaly cm);
- \node[anchor=west] at (-2.5,-3) {$ s = 1 $};
- \node[right, yshift=-0.2cm,red] at (u) {\small $ v_1 $};
- \node[right, yshift=-0.2cm, green] at (v) {\small $ v_3 $};
- %POWER electronics A
- \def \PEax {-10};
- \def \PEay {-14.5};
- \coordinate (origoPE1) at (\PEax,\PEay);
- \def \DClink {4 cm};
- %PROGRESS bar
- \pgfmathsetmacro{\xpercent}{\totalx*100}
- \draw[white, fill=red!50] (origoPE1) ++ (0,4.6) rectangle++ (5*\totalx,0.15);
- \draw[black!80, very thin] (origoPE1) ++ (0,4.6) node[left]{\large $ v_1 $} rectangle++ (5,0.15) node[color=black!100,right]{\large $ \pgfmathprintnumber[precision=1]{\xpercent} ~ \% $};
- \pgfmathsetmacro{\realvectora}{(100-\zerovectora-\zerovectorb)*\xpercent/100}
- \node[anchor=west] at (-2.5,-8.5 ) {$ v_1 = \pgfmathprintnumber[precision=1]{\realvectora} ~ \% $};
- \draw
- % DC sources
- (origoPE1) to[C, l=C, v^>=$ $] ++(0,4) coordinate (Vcc)
- -- ++(1,0) coordinate (LegA) -- ++(4,0)
- (LegA) ++ (2,0) coordinate (LegB)
- (LegB) ++ (2,0) coordinate (LegC)
- (origoPE1) to (\PEax+1,\PEay) coordinate (LegAs)
- (origoPE1) to (\PEax+3,\PEay) coordinate (LegBs)
- (origoPE1) to (\PEax+5,\PEay) coordinate (LegCs)
- (LegA) node[above]{\Large $ 0 $} ++(1.18,-3) node [spdt, rotate=180, anchor=in, yscale=1](SwA) {}
- (SwA.out 2) to[short, -*] (LegA)
- (SwA.out 1) to[short, -*, i>=$i_w$, current/distance=0.5, color=black] (LegAs)
- (LegB) node[above]{\Large $ 0 $} ++(1.18,-2) node [spdt, rotate=180, anchor=in, yscale=1](SwB) {}
- (SwB.out 2) to[short, -*] (LegB)
- (SwB.out 1) to[short, -*, i>=$i_v$, current/distance=0.68] (LegBs)
- (LegC) node[above,red]{\Large $ 1 $} ++(1.18,-1) node [spdt, rotate=180, color=red, anchor=in, yscale=-1](SwC) {}
- (SwC.out 1) to[short, -,color=red, i<=$i_u$,current/distance=0.5 ] (LegC)
- (SwC.out 2) to[short, -,current/distance=0.5] (LegCs)
- % Motor
- (SwA.in) -- ++(4.5,0)
- to[short, o-, i<=$i_w$, current/distance=0.5] ++(1,0)
- to[L,v^>=\raisebox{1.0ex}{$v_w$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- ++(0,-2) coordinate (motorend)
- (SwB.in) -- ++(2.5,0)
- to[short, o-, i<=$i_v$, current/distance=0.5] ++(1,0)
- to[L,v^>=\raisebox{1.0ex}{$v_v$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short, -*] ++(0.5,0)
- ++(0,-2)
- (SwC.in) -- ++(0.5,0)
- to[short, o-,color=red, i>=$i_u$, current/distance=0.7] ++(1,0)
- to[L,v^=\raisebox{1.0ex}{$v_u$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- to[short] ++(0,-2);
- %POWER electronics B
- \def \PEbx {2};
- \def \PEby {-14.5};
- \coordinate (origoPE1) at (\PEbx,\PEby);
- \def \DClink {4 cm};
- %PROGRESS bar
- \pgfmathsetmacro{\ypercent}{\totaly*100}
- \draw[white, fill=green!50] (origoPE1) ++ (0,4.6) rectangle++ (5*\totaly,0.15);
- \draw[black!80, very thin] (origoPE1) ++ (0,4.6) node[left]{\large $ v_3 $} rectangle++ (5,0.15) node[color=black!100,right]{\large $ \pgfmathprintnumber[precision=1]{\ypercent} ~ \% $};
- \pgfmathsetmacro{\realvectorb}{(100-\zerovectora-\zerovectorb)*\ypercent/100}
- \node[anchor=west] at (-2.5,-9 ) {$ v_3 = \pgfmathprintnumber[precision=1]{\realvectorb} ~ \% $};
- \draw
- % DC sources
- (origoPE1) to[C, l=C, v^>=$ $] ++(0,4) coordinate (Vcc)
- -- ++(1,0) coordinate (LegA) -- ++(4,0)
- (LegA) ++ (2,0) coordinate (LegB)
- (LegB) ++ (2,0) coordinate (LegC)
- (origoPE1) to (\PEbx+1,\PEby) coordinate (LegAs)
- (origoPE1) to (\PEbx+3,\PEby) coordinate (LegBs)
- (origoPE1) to (\PEbx+5,\PEby) coordinate (LegCs)
- (LegA) node[above]{\Large $ 0 $} ++(1.18,-3) node [spdt, rotate=180, anchor=in, yscale=1](SwA) {}
- (SwA.out 2) to[short, -*] (LegA)
- (SwA.out 1) to[short, -*, i>=$i_w$, current/distance=0.5, color=black] (LegAs)
- (LegB) node[above,red]{\Large $ 1 $} ++(1.18,-2) node [spdt, rotate=180, color=red, anchor=in, yscale=-1](SwB) {}
- (SwB.out 1) to[short, -*,color=red, i<=$i_v$, current/distance=0.68] (LegB)
- (SwB.out 2) to[short, -*,] (LegBs)
- (LegC) node[above,red]{\Large $ 1 $} ++(1.18,-1) node [spdt, rotate=180, color=red, anchor=in, yscale=-1](SwC) {}
- (SwC.out 1) to[short, -,color=red, i<=$i_u$,current/distance=0.5 ] (LegC)
- (SwC.out 2) to[short, -,current/distance=0.5] (LegCs)
- % Motor
- (SwA.in) -- ++(4.5,0)
- to[short, o-, i<=$i_w$, current/distance=0.5] ++(1,0)
- to[L,v^>=\raisebox{1.0ex}{$v_w$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- ++(0,-2) coordinate (motorend)
- (SwB.in) -- ++(2.5,0)
- to[short, o-, color=red,i>=$i_v$, current/distance=0.7] ++(1,0)
- to[L,v^<=\raisebox{1.0ex}{$v_v$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short, -*] ++(0.5,0)
- ++(0,-2)
- (SwC.in) -- ++(0.5,0)
- to[short, o-,color=red, i>=$i_u$, current/distance=0.7] ++(1,0)
- to[L,v^=\raisebox{1.0ex}{$v_u$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- to[short] ++(0,-2);
- }
- {}
- %SECTOR 2
- \ifboolexpr{
- test {\ifnumless{\Angle}{120}} and test{\ifnumgreater{\Angle}{60}} or test{\ifnumequal{\Angle}{60}}
- }
- {
- \ifthenelse{\Angle = 90}
- {
- \pgfmathsetmacro{\totaly}{(0.5)};
- \pgfmathsetmacro{\totalx}{(0.5)};
- }
- {
- \pgfmathsetmacro{\totaly}{(\xvalue - \zvalue) / (\yvalue - \zvalue+0.0001)};
- \pgfmathsetmacro{\totalx}{(1-\totaly)};
- }
- \draw[-latex,green, very thick] (OrigoSV) --++ (60:2.25*\totaly cm);
- \draw[-latex,blue, very thick] (OrigoSV) --++ (120:2.25*\totalx cm);
- \node[anchor=west] at (-2.5,-3) {$ s = 2 $};
- \node[right, yshift=-0.2cm,blue] at (v) {\small $ v_2 $};
- \node[right, yshift=-0.2cm,green] at (u) {\small $ v_3 $};
- %POWER electronics A
- \def \PEax {-10};
- \def \PEay {-14.5};
- \coordinate (origoPE1) at (\PEax,\PEay);
- \def \DClink {4 cm};
- %PROGRESS bar
- \pgfmathsetmacro{\xpercent}{\totalx*100}
- \draw[white, fill=blue!50] (origoPE1) ++ (0,4.6) rectangle++ (5*\totalx,0.15);
- \draw[black!80, very thin] (origoPE1) ++ (0,4.6) node[left]{\large $ v_2 $} rectangle++ (5,0.15) node[color=black!100,right]{\large $ \pgfmathprintnumber[precision=1]{\xpercent} ~ \% $};
- \pgfmathsetmacro{\realvectora}{(100-\zerovectora-\zerovectorb)*\xpercent/100}
- \node[anchor=west] at (-2.5,-8.5 ) {$ v_2 = \pgfmathprintnumber[precision=1]{\realvectora} ~ \% $};
- \draw
- % DC sources
- (origoPE1) to[C, l=C, v^>=$ $] ++(0,4) coordinate (Vcc)
- -- ++(1,0) coordinate (LegA) -- ++(4,0)
- (LegA) ++ (2,0) coordinate (LegB)
- (LegB) ++ (2,0) coordinate (LegC)
- (origoPE1) to (\PEax+1,\PEay) coordinate (LegAs)
- (origoPE1) to (\PEax+3,\PEay) coordinate (LegBs)
- (origoPE1) to (\PEax+5,\PEay) coordinate (LegCs)
- (LegA) node[above]{\Large $ 0 $} ++(1.18,-3) node [spdt, rotate=180, anchor=in, yscale=1](SwA) {}
- (SwA.out 2) to[short, -*] (LegA)
- (SwA.out 1) to[short, -*, i>=$i_w$, current/distance=0.5, color=black] (LegAs)
- (LegB) node[above,red]{\Large $ 1 $} ++(1.18,-2) node [spdt, rotate=180, color=red, anchor=in, yscale=-1](SwB) {}
- (SwB.out 1) to[short, -*,,color=red, i<=$i_u$,current/distance=0.5 ] (LegB)
- (SwB.out 2) to[short, -*] (LegBs)
- (LegC) node[above]{\Large $ 0 $} ++(1.18,-1) node [spdt, rotate=180, anchor=in, yscale=1](SwC) {}
- (SwC.out 2) to[short, -] (LegC)
- (SwC.out 1) to[short, -, i>=$i_v$, current/distance=0.77] (LegCs)
- % Motor
- (SwA.in) -- ++(4.5,0)
- to[short, o-, i<=$i_w$, current/distance=0.5] ++(1,0)
- to[L,v^>=\raisebox{1.0ex}{$v_w$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- ++(0,-2) coordinate (motorend)
- (SwB.in) -- ++(2.5,0)
- to[short, o-,color=red, i>=$i_v$, current/distance=0.5] ++(1,0)
- to[L,v^=\raisebox{1.0ex}{$v_v$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short, -*] ++(0.5,0)
- ++(0,-2)
- (SwC.in) -- ++(0.5,0)
- to[short, o-, i<=$i_u$, current/distance=0.7] ++(1,0)
- to[L,v^>=\raisebox{1.0ex}{$v_u$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- to[short] ++(0,-2);
- %POWER electronics B
- \def \PEbx {2};
- \def \PEby {-14.5};
- \coordinate (origoPE1) at (\PEbx,\PEby);
- \def \DClink {4 cm};
- %PROGRESS bar
- \pgfmathsetmacro{\ypercent}{\totaly*100}
- \draw[white, fill=green!50] (origoPE1) ++ (0,4.6) rectangle++ (5*\totaly,0.15);
- \draw[black!80, very thin] (origoPE1) ++ (0,4.6) node[left]{\large $ v_3 $} rectangle++ (5,0.15) node[color=black!100,right]{\large $ \pgfmathprintnumber[precision=1]{\ypercent} ~ \% $};
- \pgfmathsetmacro{\realvectorb}{(100-\zerovectora-\zerovectorb)*\ypercent/100}
- \node[anchor=west] at (-2.5,-9 ) {$ v_3 = \pgfmathprintnumber[precision=1]{\realvectorb} ~ \% $};
- \draw
- % DC sources
- (origoPE1) to[C, l=C, v^>=$ $] ++(0,4) coordinate (Vcc)
- -- ++(1,0) coordinate (LegA) -- ++(4,0)
- (LegA) ++ (2,0) coordinate (LegB)
- (LegB) ++ (2,0) coordinate (LegC)
- (origoPE1) to (\PEbx+1,\PEby) coordinate (LegAs)
- (origoPE1) to (\PEbx+3,\PEby) coordinate (LegBs)
- (origoPE1) to (\PEbx+5,\PEby) coordinate (LegCs)
- (LegA) node[above]{\Large $ 0 $} ++(1.18,-3) node [spdt, rotate=180, anchor=in, yscale=1](SwA) {}
- (SwA.out 2) to[short, -*] (LegA)
- (SwA.out 1) to[short, -*, i>=$i_w$, current/distance=0.5, color=black] (LegAs)
- (LegB) node[above,red]{\Large $ 1 $} ++(1.18,-2) node [spdt, rotate=180, color=red, anchor=in, yscale=-1](SwB) {}
- (SwB.out 1) to[short, -*,color=red, i<=$i_v$, current/distance=0.68] (LegB)
- (SwB.out 2) to[short, -*,] (LegBs)
- (LegC) node[above,red]{\Large $ 1 $} ++(1.18,-1) node [spdt, rotate=180, color=red, anchor=in, yscale=-1](SwC) {}
- (SwC.out 1) to[short, -,color=red, i<=$i_u$,current/distance=0.5 ] (LegC)
- (SwC.out 2) to[short, -,current/distance=0.5] (LegCs)
- % Motor
- (SwA.in) -- ++(4.5,0)
- to[short, o-, i<=$i_w$, current/distance=0.5] ++(1,0)
- to[L,v^>=\raisebox{1.0ex}{$v_w$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- ++(0,-2) coordinate (motorend)
- (SwB.in) -- ++(2.5,0)
- to[short, o-, color=red,i>=$i_v$, current/distance=0.7] ++(1,0)
- to[L,v^<=\raisebox{1.0ex}{$v_v$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short, -*] ++(0.5,0)
- ++(0,-2)
- (SwC.in) -- ++(0.5,0)
- to[short, o-,color=red, i>=$i_u$, current/distance=0.7] ++(1,0)
- to[L,v^=\raisebox{1.0ex}{$v_u$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- to[short] ++(0,-2);
- }
- {}
- %SECTOR 3
- \ifboolexpr{
- test {\ifnumless{\Angle}{180}} and test{\ifnumgreater{\Angle}{120}} or test{\ifnumequal{\Angle}{120}}
- }
- {
- \ifthenelse{\Angle = 150}
- {
- \pgfmathsetmacro{\totaly}{(0.5)};
- \pgfmathsetmacro{\totalx}{(0.5)};
- }
- {
- \pgfmathsetmacro{\totaly}{(\zvalue - \xvalue) / (\yvalue - \xvalue+0.0001)};
- \pgfmathsetmacro{\totalx}{(1-\totaly)};
- }
- \draw[-latex,blue, very thick] (OrigoSV) --++ (120:2.25*\totalx cm);
- \draw[-latex,red, very thick] (OrigoSV) --++ (180:2.25*\totaly cm);
- \node[anchor=west] at (-2.5,-3) {$ s = 3 $};
- \node[right, yshift=-0.2cm,blue] at (v) {\small $ v_2 $};
- \node[right, yshift=-0.2cm,red] at (w) {\small $ v_6 $};
- %POWER electronics A
- \def \PEax {-10};
- \def \PEay {-14.5};
- \coordinate (origoPE1) at (\PEax,\PEay);
- \def \DClink {4 cm};
- %PROGRESS bar
- \pgfmathsetmacro{\xpercent}{\totalx*100}
- \draw[white, fill=blue!50] (origoPE1) ++ (0,4.6) rectangle++ (5*\totalx,0.15);
- \draw[black!80, very thin] (origoPE1) ++ (0,4.6) node[left]{\large $ v_2 $} rectangle++ (5,0.15) node[color=black!100,right]{\large $ \pgfmathprintnumber[precision=1]{\xpercent} ~ \% $};
- \pgfmathsetmacro{\realvectora}{(100-\zerovectora-\zerovectorb)*\xpercent/100}
- \node[anchor=west] at (-2.5,-8.5 ) {$ v_2 = \pgfmathprintnumber[precision=1]{\realvectora} ~ \% $};
- \draw
- % DC sources
- (origoPE1) to[C, l=C, v^>=$ $] ++(0,4) coordinate (Vcc)
- -- ++(1,0) coordinate (LegA) -- ++(4,0)
- (LegA) ++ (2,0) coordinate (LegB)
- (LegB) ++ (2,0) coordinate (LegC)
- (origoPE1) to (\PEax+1,\PEay) coordinate (LegAs)
- (origoPE1) to (\PEax+3,\PEay) coordinate (LegBs)
- (origoPE1) to (\PEax+5,\PEay) coordinate (LegCs)
- (LegA) node[above]{\Large $ 0 $} ++(1.18,-3) node [spdt, rotate=180, anchor=in, yscale=1](SwA) {}
- (SwA.out 2) to[short, -*] (LegA)
- (SwA.out 1) to[short, -*, i>=$i_w$, current/distance=0.5, color=black] (LegAs)
- (LegB) node[above,red]{\Large $ 1 $} ++(1.18,-2) node [spdt, rotate=180, color=red, anchor=in, yscale=-1](SwB) {}
- (SwB.out 1) to[short, -*,,color=red, i<=$i_u$,current/distance=0.5 ] (LegB)
- (SwB.out 2) to[short, -*] (LegBs)
- (LegC) node[above]{\Large $ 0 $} ++(1.18,-1) node [spdt, rotate=180, anchor=in, yscale=1](SwC) {}
- (SwC.out 2) to[short, -] (LegC)
- (SwC.out 1) to[short, -, i>=$i_v$, current/distance=0.77] (LegCs)
- % Motor
- (SwA.in) -- ++(4.5,0)
- to[short, o-, i<=$i_w$, current/distance=0.5] ++(1,0)
- to[L,v^>=\raisebox{1.0ex}{$v_w$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- ++(0,-2) coordinate (motorend)
- (SwB.in) -- ++(2.5,0)
- to[short, o-,color=red, i>=$i_v$, current/distance=0.5] ++(1,0)
- to[L,v^=\raisebox{1.0ex}{$v_v$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short, -*] ++(0.5,0)
- ++(0,-2)
- (SwC.in) -- ++(0.5,0)
- to[short, o-, i<=$i_u$, current/distance=0.7] ++(1,0)
- to[L,v^>=\raisebox{1.0ex}{$v_u$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- to[short] ++(0,-2);
- %POWER electronics B
- \def \PEbx {2};
- \def \PEby {-14.5};
- \coordinate (origoPE1) at (\PEbx,\PEby);
- \def \DClink {4 cm};
- %PROGRESS bar
- \pgfmathsetmacro{\ypercent}{\totaly*100}
- \draw[white, fill=red!50] (origoPE1) ++ (0,4.6) rectangle++ (5*\totaly,0.15);
- \draw[black!80, very thin] (origoPE1) ++ (0,4.6) node[left]{\large $ v_6 $} rectangle++ (5,0.15) node[color=black!100,right]{\large $ \pgfmathprintnumber[precision=1]{\ypercent} ~ \% $};
- \pgfmathsetmacro{\realvectorb}{(100-\zerovectora-\zerovectorb)*\ypercent/100}
- \node[anchor=west] at (-2.5,-9 ) {$ v_6 = \pgfmathprintnumber[precision=1]{\realvectorb} ~ \% $};
- \draw
- % DC sources
- (origoPE1) to[C, l=C, v^>=$ $] ++(0,4) coordinate (Vcc)
- -- ++(1,0) coordinate (LegA) -- ++(4,0)
- (LegA) ++ (2,0) coordinate (LegB)
- (LegB) ++ (2,0) coordinate (LegC)
- (origoPE1) to (\PEbx+1,\PEby) coordinate (LegAs)
- (origoPE1) to (\PEbx+3,\PEby) coordinate (LegBs)
- (origoPE1) to (\PEbx+5,\PEby) coordinate (LegCs)
- (LegA) node[above,red]{\Large $ 1 $} ++(1.18,-3) node [spdt, rotate=180, color=red, anchor=in, yscale=-1](SwA) {}
- (SwA.out 1) to[short, -*,color=red, i<=$i_w$, current/distance=0.5,] (LegA)
- (SwA.out 2) to[short, -*, color=black] (LegAs)
- (LegB) node[above,red]{\Large $ 1 $} ++(1.18,-2) node [spdt, rotate=180, color=red, anchor=in, yscale=-1](SwB) {}
- (SwB.out 1) to[short, -*,color=red, i<=$i_v$, current/distance=0.68] (LegB)
- (SwB.out 2) to[short, -*,] (LegBs)
- (LegC) node[above]{\Large $ 0 $} ++(1.18,-1) node [spdt, rotate=180, anchor=in, yscale=1](SwC) {}
- (SwC.out 2) to[short, -] (LegC)
- (SwC.out 1) to[short, -, i>=$i_u$,current/distance=0.77] (LegCs)
- % Motor
- (SwA.in) -- ++(4.5,0)
- to[short, o-,color=red, i>=$i_w$, current/distance=0.7] ++(1,0)
- to[L,v^<=\raisebox{1.0ex}{$v_w$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- ++(0,-2) coordinate (motorend)
- (SwB.in) -- ++(2.5,0)
- to[short, o-, color=red,i>=$i_v$, current/distance=0.7] ++(1,0)
- to[L,v^<=\raisebox{1.0ex}{$v_v$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short, -*] ++(0.5,0)
- ++(0,-2)
- (SwC.in) -- ++(0.5,0)
- to[short, o-, i<=$i_u$, current/distance=0.5] ++(1,0)
- to[L,v^>=\raisebox{1.0ex}{$v_u$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- to[short] ++(0,-2);
- }
- {}
- %SECTOR 4
- \ifboolexpr{
- test {\ifnumless{\Angle}{240}} and test{\ifnumgreater{\Angle}{180}} or test{\ifnumequal{\Angle}{180}}
- }
- {
- \ifthenelse{\Angle = 210}
- {
- \pgfmathsetmacro{\totaly}{(0.5)};
- \pgfmathsetmacro{\totalx}{(0.5)};
- }
- {
- \pgfmathsetmacro{\totaly}{(\yvalue - \xvalue) / (\zvalue - \xvalue+0.0001)};
- \pgfmathsetmacro{\totalx}{(1-\totaly)};
- }
- \draw[-latex,red, very thick] (OrigoSV) --++ (180:2.25*\totaly cm);
- \draw[-latex,green, very thick] (OrigoSV) --++ (240:2.25*\totalx cm);
- \node[anchor=west] at (-2.5,-3) {$ s = 4 $};
- \node[right, yshift=-0.2cm,green] at (w) {\small $ v_4 $};
- \node[right, yshift=-0.2cm, red] at (v) {\small $ v_6 $};
- %POWER electronics A
- \def \PEax {-10};
- \def \PEay {-14.5};
- \coordinate (origoPE1) at (\PEax,\PEay);
- \def \DClink {4 cm};
- %PROGRESS bar
- \pgfmathsetmacro{\xpercent}{\totalx*100}
- \draw[white, fill=green!50] (origoPE1) ++ (0,4.6) rectangle++ (5*\totalx,0.15);
- \draw[black!80, very thin] (origoPE1) ++ (0,4.6) node[left]{\large $ v_4 $} rectangle++ (5,0.15) node[color=black!100,right]{\large $ \pgfmathprintnumber[precision=1]{\xpercent} ~ \% $};
- \pgfmathsetmacro{\realvectora}{(100-\zerovectora-\zerovectorb)*\xpercent/100}
- \node[anchor=west] at (-2.5,-8.5 ) {$ v_4 = \pgfmathprintnumber[precision=1]{\realvectora} ~ \% $};
- \draw
- % DC sources
- (origoPE1) to[C, l=C, v^>=$ $] ++(0,4) coordinate (Vcc)
- -- ++(1,0) coordinate (LegA) -- ++(4,0)
- (LegA) ++ (2,0) coordinate (LegB)
- (LegB) ++ (2,0) coordinate (LegC)
- (origoPE1) to (\PEax+1,\PEay) coordinate (LegAs)
- (origoPE1) to (\PEax+3,\PEay) coordinate (LegBs)
- (origoPE1) to (\PEax+5,\PEay) coordinate (LegCs)
- (LegA) node[above,red]{\Large $ 1 $} ++(1.18,-3) node [spdt, rotate=180, color=red, anchor=in, yscale=-1](SwA) {}
- (SwA.out 1) to[short, -*, i<=$i_w$, current/distance=0.5, color=red] (LegA)
- (SwA.out 2) to[short, -*] (LegAs)
- (LegB) node[above]{\Large $ 0 $} ++(1.18,-2) node [spdt, rotate=180, anchor=in, yscale=1](SwB) {}
- (SwB.out 2) to[short, -*,] (LegB)
- (SwB.out 1) to[short, -*,, i>=$i_u$,current/distance=0.68 ] (LegBs)
- (LegC) node[above]{\Large $ 0 $} ++(1.18,-1) node [spdt, rotate=180, anchor=in, yscale=1](SwC) {}
- (SwC.out 2) to[short, -] (LegC)
- (SwC.out 1) to[short, -, i>=$i_v$, current/distance=0.77] (LegCs)
- % Motor
- (SwA.in) -- ++(4.5,0)
- to[short, o-,color=red, i>=$i_w$, current/distance=0.7] ++(1,0)
- to[L,v^<=\raisebox{1.0ex}{$v_w$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- ++(0,-2) coordinate (motorend)
- (SwB.in) -- ++(2.5,0)
- to[short, o-, i<=$i_v$, current/distance=0.5] ++(1,0)
- to[L,v^>=\raisebox{1.0ex}{$v_v$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short, -*] ++(0.5,0)
- ++(0,-2)
- (SwC.in) -- ++(0.5,0)
- to[short, o-, i<=$i_u$, current/distance=0.5] ++(1,0)
- to[L,v^>=\raisebox{1.0ex}{$v_u$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- to[short] ++(0,-2);
- %POWER electronics B
- \def \PEbx {2};
- \def \PEby {-14.5};
- \coordinate (origoPE1) at (\PEbx,\PEby);
- \def \DClink {4 cm};
- %PROGRESS bar
- \pgfmathsetmacro{\ypercent}{\totaly*100}
- \draw[white, fill=red!50] (origoPE1) ++ (0,4.6) rectangle++ (5*\totaly,0.15);
- \draw[black!80, very thin] (origoPE1) ++ (0,4.6) node[left]{\large $ v_6 $} rectangle++ (5,0.15) node[color=black!100,right]{\large $ \pgfmathprintnumber[precision=1]{\ypercent} ~ \% $};
- \pgfmathsetmacro{\realvectorb}{(100-\zerovectora-\zerovectorb)*\ypercent/100}
- \node[anchor=west] at (-2.5,-9 ) {$ v_6 = \pgfmathprintnumber[precision=1]{\realvectorb} ~ \% $};
- \draw
- % DC sources
- (origoPE1) to[C, l=C, v^>=$ $] ++(0,4) coordinate (Vcc)
- -- ++(1,0) coordinate (LegA) -- ++(4,0)
- (LegA) ++ (2,0) coordinate (LegB)
- (LegB) ++ (2,0) coordinate (LegC)
- (origoPE1) to (\PEbx+1,\PEby) coordinate (LegAs)
- (origoPE1) to (\PEbx+3,\PEby) coordinate (LegBs)
- (origoPE1) to (\PEbx+5,\PEby) coordinate (LegCs)
- (LegA) node[above,red]{\Large $ 1 $} ++(1.18,-3) node [spdt, rotate=180, color=red, anchor=in, yscale=-1](SwA) {}
- (SwA.out 1) to[short, -*,color=red, i<=$i_w$, current/distance=0.5,] (LegA)
- (SwA.out 2) to[short, -*, color=black] (LegAs)
- (LegB) node[above,red]{\Large $ 1 $} ++(1.18,-2) node [spdt, rotate=180, color=red, anchor=in, yscale=-1](SwB) {}
- (SwB.out 1) to[short, -*,color=red, i<=$i_v$, current/distance=0.68] (LegB)
- (SwB.out 2) to[short, -*,] (LegBs)
- (LegC) node[above]{\Large $ 0 $} ++(1.18,-1) node [spdt, rotate=180, anchor=in, yscale=1](SwC) {}
- (SwC.out 2) to[short, -] (LegC)
- (SwC.out 1) to[short, -, i>=$i_u$,current/distance=0.77] (LegCs)
- % Motor
- (SwA.in) -- ++(4.5,0)
- to[short, o-,color=red, i>=$i_w$, current/distance=0.7] ++(1,0)
- to[L,v^<=\raisebox{1.0ex}{$v_w$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- ++(0,-2) coordinate (motorend)
- (SwB.in) -- ++(2.5,0)
- to[short, o-, color=red,i>=$i_v$, current/distance=0.7] ++(1,0)
- to[L,v^<=\raisebox{1.0ex}{$v_v$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short, -*] ++(0.5,0)
- ++(0,-2)
- (SwC.in) -- ++(0.5,0)
- to[short, o-, i<=$i_u$, current/distance=0.5] ++(1,0)
- to[L,v^>=\raisebox{1.0ex}{$v_u$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- to[short] ++(0,-2);
- }
- {}
- %SECTOR 5
- \ifboolexpr{
- test {\ifnumless{\Angle}{300}} and test{\ifnumgreater{\Angle}{240}} or test{\ifnumequal{\Angle}{240}}
- }
- {
- \ifthenelse{\Angle = 270}
- {
- \pgfmathsetmacro{\totaly}{(0.5)};
- \pgfmathsetmacro{\totalx}{(0.5)};
- }
- {
- \pgfmathsetmacro{\totaly}{(\xvalue - \yvalue) / (\zvalue - \yvalue+0.0001)};
- \pgfmathsetmacro{\totalx}{(1-\totaly)};
- }
- \draw[-latex,green, very thick] (OrigoSV) --++ (240:2.25*\totalx cm);
- \draw[-latex,blue, very thick] (OrigoSV) --++ (300:2.25*\totaly cm);
- \node[anchor=west] at (-2.5,-3) {$ s = 5 $};
- \node[right, yshift=-0.2cm,green] at (w) {\small $ v_4 $};
- \node[right, yshift=-0.2cm, blue] at (u) {\small $ v_5 $};
- %POWER electronics A
- \def \PEax {-10};
- \def \PEay {-14.5};
- \coordinate (origoPE1) at (\PEax,\PEay);
- \def \DClink {4 cm};
- %PROGRESS bar
- \pgfmathsetmacro{\xpercent}{\totalx*100}
- \draw[white, fill=green!50] (origoPE1) ++ (0,4.6) rectangle++ (5*\totalx,0.15);
- \draw[black!80, very thin] (origoPE1) ++ (0,4.6) node[left]{\large $ v_4 $} rectangle++ (5,0.15) node[color=black!100,right]{\large $ \pgfmathprintnumber[precision=1]{\xpercent} ~ \% $};
- \pgfmathsetmacro{\realvectora}{(100-\zerovectora-\zerovectorb)*\xpercent/100}
- \node[anchor=west] at (-2.5,-8.5 ) {$ v_4 = \pgfmathprintnumber[precision=1]{\realvectora} ~ \% $};
- \draw
- % DC sources
- (origoPE1) to[C, l=C, v^>=$ $] ++(0,4) coordinate (Vcc)
- -- ++(1,0) coordinate (LegA) -- ++(4,0)
- (LegA) ++ (2,0) coordinate (LegB)
- (LegB) ++ (2,0) coordinate (LegC)
- (origoPE1) to (\PEax+1,\PEay) coordinate (LegAs)
- (origoPE1) to (\PEax+3,\PEay) coordinate (LegBs)
- (origoPE1) to (\PEax+5,\PEay) coordinate (LegCs)
- (LegA) node[above,red]{\Large $ 1 $} ++(1.18,-3) node [spdt, rotate=180, color=red, anchor=in, yscale=-1](SwA) {}
- (SwA.out 1) to[short, -*, i<=$i_w$, current/distance=0.5, color=red] (LegA)
- (SwA.out 2) to[short, -*] (LegAs)
- (LegB) node[above]{\Large $ 0 $} ++(1.18,-2) node [spdt, rotate=180, anchor=in, yscale=1](SwB) {}
- (SwB.out 2) to[short, -*,] (LegB)
- (SwB.out 1) to[short, -*,, i>=$i_u$,current/distance=0.68 ] (LegBs)
- (LegC) node[above]{\Large $ 0 $} ++(1.18,-1) node [spdt, rotate=180, anchor=in, yscale=1](SwC) {}
- (SwC.out 2) to[short, -] (LegC)
- (SwC.out 1) to[short, -, i>=$i_v$, current/distance=0.77] (LegCs)
- % Motor
- (SwA.in) -- ++(4.5,0)
- to[short, o-,color=red, i>=$i_w$, current/distance=0.7] ++(1,0)
- to[L,v^<=\raisebox{1.0ex}{$v_w$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- ++(0,-2) coordinate (motorend)
- (SwB.in) -- ++(2.5,0)
- to[short, o-, i<=$i_v$, current/distance=0.5] ++(1,0)
- to[L,v^>=\raisebox{1.0ex}{$v_v$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short, -*] ++(0.5,0)
- ++(0,-2)
- (SwC.in) -- ++(0.5,0)
- to[short, o-, i<=$i_u$, current/distance=0.5] ++(1,0)
- to[L,v^>=\raisebox{1.0ex}{$v_u$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- to[short] ++(0,-2);
- %POWER electronics B
- \def \PEbx {2};
- \def \PEby {-14.5};
- \coordinate (origoPE1) at (\PEbx,\PEby);
- \def \DClink {4 cm};
- %PROGRESS bar
- \pgfmathsetmacro{\ypercent}{\totaly*100}
- \draw[white, fill=blue!50] (origoPE1) ++ (0,4.6) rectangle++ (5*\totaly,0.15);
- \draw[black!80, very thin] (origoPE1) ++ (0,4.6) node[left]{\large $ v_5 $} rectangle++ (5,0.15) node[color=black!100,right]{\large $ \pgfmathprintnumber[precision=1]{\ypercent} ~ \% $};
- \pgfmathsetmacro{\realvectorb}{(100-\zerovectora-\zerovectorb)*\ypercent/100}
- \node[anchor=west] at (-2.5,-9 ) {$ v_5 = \pgfmathprintnumber[precision=1]{\realvectorb} ~ \% $};
- \draw
- % DC sources
- (origoPE1) to[C, l=C, v^>=$ $] ++(0,4) coordinate (Vcc)
- -- ++(1,0) coordinate (LegA) -- ++(4,0)
- (LegA) ++ (2,0) coordinate (LegB)
- (LegB) ++ (2,0) coordinate (LegC)
- (origoPE1) to (\PEbx+1,\PEby) coordinate (LegAs)
- (origoPE1) to (\PEbx+3,\PEby) coordinate (LegBs)
- (origoPE1) to (\PEbx+5,\PEby) coordinate (LegCs)
- (LegA) node[above,red]{\Large $ 1 $} ++(1.18,-3) node [spdt, rotate=180, color=red, anchor=in, yscale=-1](SwA) {}
- (SwA.out 1) to[short, -*,color=red, i<=$i_w$, current/distance=0.5,] (LegA)
- (SwA.out 2) to[short, -*, color=black] (LegAs)
- (LegB) node[above]{\Large $ 0 $} ++(1.18,-2) node [spdt, rotate=180, anchor=in, yscale=1](SwB) {}
- (SwB.out 2) to[short, -*] (LegB)
- (SwB.out 1) to[short, -*,i>=$i_v$, current/distance=0.68] (LegBs)
- (LegC) node[above,red]{\Large $ 1 $} ++(1.18,-1) node [spdt, rotate=180, color=red, anchor=in, yscale=-1](SwC) {}
- (SwC.out 1) to[short, -, i<=$i_u$,current/distance=0.5, color=red] (LegC)
- (SwC.out 2) to[short, -] (LegCs)
- % Motor
- (SwA.in) -- ++(4.5,0)
- to[short, o-,color=red, i>=$i_w$, current/distance=0.7] ++(1,0)
- to[L,v^<=\raisebox{1.0ex}{$v_w$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- ++(0,-2) coordinate (motorend)
- (SwB.in) -- ++(2.5,0)
- to[short, o-,i<=$i_v$, current/distance=0.5] ++(1,0)
- to[L,v^>=\raisebox{1.0ex}{$v_v$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short, -*] ++(0.5,0)
- ++(0,-2)
- (SwC.in) -- ++(0.5,0)
- to[short, o-,color=red, i>=$i_u$, current/distance=0.7] ++(1,0)
- to[L,v^<=\raisebox{1.0ex}{$v_u$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- to[short] ++(0,-2);
- }
- {}
- %SECTOR 6
- \ifboolexpr{
- test {\ifnumless{\Angle}{361}} and test{\ifnumgreater{\Angle}{300}} or test{\ifnumequal{\Angle}{300}}
- }
- {
- \ifthenelse{\Angle = 330}
- {
- \pgfmathsetmacro{\totaly}{(0.5)};
- \pgfmathsetmacro{\totalx}{(0.5)};
- }
- {
- \pgfmathsetmacro{\totaly}{(\zvalue - \yvalue) / (\xvalue - \yvalue+0.0001)};
- \pgfmathsetmacro{\totalx}{(1-\totaly)};
- }
- \draw[-latex,blue, very thick] (OrigoSV) --++ (300:2.25*\totaly cm);
- \draw[-latex,red, very thick] (OrigoSV) --++ (360:2.25*\totalx cm);
- \node[anchor=west] at (-2.5,-3) {$ s = 6 $};
- \node[right, yshift=-0.2cm,red] at (u) {\small $ v_1 $};
- \node[right, yshift=-0.2cm, blue] at (w) {\small $ v_5 $};
- %POWER electronics A
- \def \PEax {-10};
- \def \PEay {-14.5};
- \coordinate (origoPE1) at (\PEax,\PEay);
- \def \DClink {4 cm};
- %PROGRESS bar
- \pgfmathsetmacro{\xpercent}{\totalx*100}
- \draw[white, fill=red!50] (origoPE1) ++ (0,4.6) rectangle++ (5*\totalx,0.15);
- \draw[black!80, very thin] (origoPE1) ++ (0,4.6) node[left]{\large $ v_1 $} rectangle++ (5,0.15) node[color=black!100,right]{\large $ \pgfmathprintnumber[precision=1]{\xpercent} ~ \% $};
- \pgfmathsetmacro{\realvectora}{(100-\zerovectora-\zerovectorb)*\xpercent/100}
- \node[anchor=west] at (-2.5,-8.5 ) {$ v_1 = \pgfmathprintnumber[precision=1]{\realvectora} ~ \% $};
- \draw
- % DC sources
- (origoPE1) to[C, l=C, v^>=$ $] ++(0,4) coordinate (Vcc)
- -- ++(1,0) coordinate (LegA) -- ++(4,0)
- (LegA) ++ (2,0) coordinate (LegB)
- (LegB) ++ (2,0) coordinate (LegC)
- (origoPE1) to (\PEax+1,\PEay) coordinate (LegAs)
- (origoPE1) to (\PEax+3,\PEay) coordinate (LegBs)
- (origoPE1) to (\PEax+5,\PEay) coordinate (LegCs)
- (LegA) node[above]{\Large $ 0 $} ++(1.18,-3) node [spdt, rotate=180, anchor=in, yscale=1](SwA) {}
- (SwA.out 2) to[short, -*] (LegA)
- (SwA.out 1) to[short, -*, i>=$i_w$] (LegAs)
- (LegB) node[above]{\Large $ 0 $} ++(1.18,-2) node [spdt, rotate=180, anchor=in, yscale=1](SwB) {}
- (SwB.out 2) to[short, -*,] (LegB)
- (SwB.out 1) to[short, -*, i>=$i_v$,current/distance=0.68 ] (LegBs)
- (LegC) node[above,red]{\Large $ 1 $} ++(1.18,-1) node [spdt, rotate=180, color=red, anchor=in, yscale=-1](SwC) {}
- (SwC.out 1) to[short, -, i<=$i_u$, current/distance=0.5, color=red] (LegC)
- (SwC.out 2) to[short, -] (LegCs)
- % Motor
- (SwA.in) -- ++(4.5,0)
- to[short, o-, i<=$i_w$, current/distance=0.5] ++(1,0)
- to[L,v^>=\raisebox{1.0ex}{$v_w$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- ++(0,-2) coordinate (motorend)
- (SwB.in) -- ++(2.5,0)
- to[short, o-, i<=$i_v$, current/distance=0.5] ++(1,0)
- to[L,v^>=\raisebox{1.0ex}{$v_v$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short, -*] ++(0.5,0)
- ++(0,-2)
- (SwC.in) -- ++(0.5,0)
- to[short, o-,color=red, i>=$i_u$, current/distance=0.7] ++(1,0)
- to[L,v^<=\raisebox{1.0ex}{$v_u$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- to[short] ++(0,-2);
- %POWER electronics B
- \def \PEbx {2};
- \def \PEby {-14.5};
- \coordinate (origoPE1) at (\PEbx,\PEby);
- \def \DClink {4 cm};
- %PROGRESS bar
- \pgfmathsetmacro{\ypercent}{\totaly*100}
- \draw[white, fill=blue!50] (origoPE1) ++ (0,4.6) rectangle++ (5*\totaly,0.15);
- \draw[black!80, very thin] (origoPE1) ++ (0,4.6) node[left]{\large $ v_5 $} rectangle++ (5,0.15) node[color=black!100,right]{\large $ \pgfmathprintnumber[precision=1]{\ypercent} ~ \% $};
- \pgfmathsetmacro{\realvectorb}{(100-\zerovectora-\zerovectorb)*\ypercent/100}
- \node[anchor=west] at (-2.5,-9 ) {$ v_5 = \pgfmathprintnumber[precision=1]{\realvectorb} ~ \% $};
- \draw
- % DC sources
- (origoPE1) to[C, l=C, v^>=$ $] ++(0,4) coordinate (Vcc)
- -- ++(1,0) coordinate (LegA) -- ++(4,0)
- (LegA) ++ (2,0) coordinate (LegB)
- (LegB) ++ (2,0) coordinate (LegC)
- (origoPE1) to (\PEbx+1,\PEby) coordinate (LegAs)
- (origoPE1) to (\PEbx+3,\PEby) coordinate (LegBs)
- (origoPE1) to (\PEbx+5,\PEby) coordinate (LegCs)
- (LegA) node[above,red]{\Large $ 1 $} ++(1.18,-3) node [spdt, rotate=180, color=red, anchor=in, yscale=-1](SwA) {}
- (SwA.out 1) to[short, -*,color=red, i<=$i_w$, current/distance=0.5,] (LegA)
- (SwA.out 2) to[short, -*, color=black] (LegAs)
- (LegB) node[above]{\Large $ 0 $} ++(1.18,-2) node [spdt, rotate=180, anchor=in, yscale=1](SwB) {}
- (SwB.out 2) to[short, -*] (LegB)
- (SwB.out 1) to[short, -*,i>=$i_v$, current/distance=0.68] (LegBs)
- (LegC) node[above,red]{\Large $ 1 $} ++(1.18,-1) node [spdt, rotate=180, color=red, anchor=in, yscale=-1](SwC) {}
- (SwC.out 1) to[short, -, i<=$i_u$,current/distance=0.5, color=red] (LegC)
- (SwC.out 2) to[short, -] (LegCs)
- % Motor
- (SwA.in) -- ++(4.5,0)
- to[short, o-,color=red, i>=$i_w$, current/distance=0.7] ++(1,0)
- to[L,v^<=\raisebox{1.0ex}{$v_w$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- ++(0,-2) coordinate (motorend)
- (SwB.in) -- ++(2.5,0)
- to[short, o-,i<=$i_v$, current/distance=0.5] ++(1,0)
- to[L,v^>=\raisebox{1.0ex}{$v_v$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short, -*] ++(0.5,0)
- ++(0,-2)
- (SwC.in) -- ++(0.5,0)
- to[short, o-,color=red, i>=$i_u$, current/distance=0.7] ++(1,0)
- to[L,v^<=\raisebox{1.0ex}{$v_u$}] ++(1.2,0)
- to[R] ++(1.2,0) coordinate (Lright)
- to[short] ++(0.5,0)
- to[short] ++(0,-2);
- }
- {}
- \node[anchor=west] at (-2.5,-3.4) {$ \phi = \Angle^{\circ} $};
- \node[anchor=west] at (-2.5,-3.8) {$ x = \totalx $};
- \node[anchor=west] at (-2.5,-4.2) {$ y = \totaly $};
- % Axes - Static axes for triangular wave and the three bridge legs
- %================================================================================================================================================
- \pgfmathsetmacro \gridx {\sizex - 0.1}; % Subtract a bit to avoid having a grid with a frame
- \pgfmathsetmacro \gridy {\sizey - 0.1}; % Subtract a bit to avoid having a grid with a frame
- % Axis for triangular wave
- %\draw[help lines, color=gray!30, dashed, very thin] (0,-\gridy) grid++ (\gridx,\gridy*2);
- \draw[->, color = gray!50] (0,0) node[left, color=black]{$ 0 $} --++(\sizex*0.95,0);
- \draw[->] (0,-\sizey)--++(0,\sizey*2) node[above]{$ m $};
- %Axis for leg U
- \draw[->] (0,-\vertspace*2) node[left]{} --++(\sizex,0) node[right]{$t$};
- \draw[->] (0,-\vertspace*2)--++(0,\sizey/2) node[above]{$ U $};
- %Axis for leg V
- \draw[->] (0,-\vertspace*3) node[left]{} --++(\sizex,0) node[right]{$t$};
- \draw[->] (0,-\vertspace*3)--++(0,\sizey/2) node[above]{$ V $};
- %Axis for leg W
- \draw[->] (0,-\vertspace*4) node[below, xshift=0.25cm]{$ v_0 $} node[left, below, xshift=2.25cm]{$ v_7 $} --++(\sizex,0) node[right]{$t$};
- \draw[->] (0,-\vertspace*4)--++(0,\sizey/2) node[above]{$ W $};
- \end{tikzpicture}}
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement