Considering the grahpics below:

Is it possible to construct something like this automatically in TikZ? The last hour or so, I have played around with a manual drawing - but it is time consuming and difficult to perfect.
The idea is that "v_AN" is creates columns where the "v_control,A" has a higher value than "v_tri". The same applies to "v_control,B". The last phase is not relevant.
I have tried to explain this by placing red and green lines on the above drawing.
I guess the challenge is to create a table or coordinate values where the control voltage exceeds the triangular voltage, and then use those values to construct the actual pulses. (which all have the exact same height)
The final plot shows the two sets of columns (v_A0 and v_B0) subtracted from one another to create a line voltage. (This is the one i have been drawing manually)
After applying the answer from moospit:
(Sorry, I had to dumb it down a little in order to fix that odd/even-issue with the intersections of blue and red curves)
\documentclass[tikz, border=6mm]{standalone}
\usetikzlibrary{intersections}
\begin{document}
\newcommand{\step}{.5}
\begin{tikzpicture}[>=latex]
\draw [->] (0,0) -- ++(8,0) node [right] {$t$};
\draw [->] (0,-1.5) -- ++(0,3) node [midway, left] {$0$};
\draw [name path=zigzag]
\foreach \x in {0,\step,...,6} {
(\x,0) -- ++(\step/4,-1.5) -- ++(\step/2,3) -- ++(\step/4,-1.5)
};
% \foreach \p\l\c in {0/1/red, -0.67pi/2/blue, 0.67pi/3/green}
%RED
\draw [red,smooth, domain=0:2*pi+.5, name path global=wave-1] plot ({\x},{sin((\x+0) r)}) node [below right, font=\scriptsize] {$sig_1$};
\draw [red,name intersections={of={wave-1} and zigzag, total=\n}]
\foreach \i [remember=\i as \lasti (initially 2)] in {1,...,\n} {
\ifodd\i {}
\else
(intersection-\lasti) -- (intersection-\i |- intersection-\lasti)
(intersection-\lasti |- 0,-2*1) rectangle (intersection-\i |- 0,-3)
\fi
};
\draw [->] (0,-3) -- ++(8,0) node [right, font=\scriptsize] {$sig_1$};
\draw [->] (0,-3) node [left] {0} -- ++(0,1.2) node [above] {$v_{1 N}$};
%Blue
\draw [blue,smooth, domain=0:2*pi+.5, name path global=wave-2] plot ({\x},{sin((\x+-0.67*pi) r)}) node [right, font=\scriptsize] {$sig_2$};
\draw [blue,name intersections={of={wave-2} and zigzag, total=\n}]
\foreach \i [remember=\i as \lasti (initially 0.01)] in {1,...,\n} {
\ifodd\i {}
\else
(intersection-\lasti) -- (intersection-\i |- intersection-\lasti)
(intersection-\lasti |- 0,-2*2) rectangle (intersection-\i |- 0,-5)
\fi
};
\draw [->] (0,-5) -- ++(8,0) node [right, font=\scriptsize] {$sig_2$};
\draw [->] (0,-5) node [left] {0} -- ++(0,1.2) node [above] {$v_{2 N}$};
%GREEN
\draw [green,smooth, domain=0:2*pi+.5, name path global=wave-3] plot ({\x},{sin((\x+0.67*pi) r)}) node [above right, font=\scriptsize] {$sig_3$};
\draw [green,name intersections={of={wave-3} and zigzag, total=\n}]
\foreach \i [remember=\i as \lasti (initially 0.5)] in {1,...,\n} {
\ifodd\i
(intersection-\lasti) -- (intersection-\i |- intersection-\lasti)
(intersection-\lasti |- 0,-2*3) rectangle (intersection-\i |- 0,-7)
\fi
};
\draw [->] (0,-7) -- ++(8,0) node [right, font=\scriptsize] {$sig_3$};
\draw [->] (0,-7) node [left] {0} -- ++(0,1.2) node [above] {$v_{3 N}$};
\end{tikzpicture}
\end{document}
Now, I "only" need to implement the bottom curve illustrated in the original grahpics. It may take some trial and error :)


