Consider the MWE of a PWM signal generation based on this question.
\documentclass[tikz, border=6mm]{standalone}
\usetikzlibrary{intersections}
\begin{document}
\newcommand{\step}{.25}
\begin{tikzpicture}[>=latex]
\draw [->] (0,-1.4) -- ++(8,0) node [right] {$t$};
\draw [->] (0,-1.4) node [left] {$0$} -- ++(0,3) ;
\draw [name path=sawtooth, line width=0.1pt,line join=miter]
\foreach \x in {0,\step,...,6} {
% (\x,1.0) -- ++(0,-2.0) -- ++(\step,2.0) % y domain = -1.0 -- 1.0
(\x,1.4) -- ++(0,-2.8) -- ++(\step,2.8) % y domain = -1.4 -- 1.4
};
\draw [red,smooth, domain=0:2*pi, name path global=wave-1,line width=0.1pt] plot ({\x},{sin((\x+0) r)}) node [below right, font=\scriptsize] {$sig_1$};
\draw [blue,name intersections={of={wave-1} and sawtooth, total=\n}]
\foreach \i [remember=\i as \lasti (initially 1)] in {2,...,\n} {
\ifodd\i {}
\else
(intersection-\lasti |- 0,-2*1) rectangle (intersection-\i |- 0,-3)
\fi
};
\draw [->] (0,-3) -- ++(8,0) node [right] {$t$};
\draw [->] (0,-3) node [left] {0} -- ++(0,1.2) ;
\end{tikzpicture}
\end{document}
This MWE compiles correct and the generated PWM signal is also correct. Of course, I want the sawtooth signal to be in the y domain (-1.0,1.0) so that the PWM signal is maximal and minimal. But if I compile the MWE with that y domain, Tikz fails to determine the intersections correctly. I made the sawtooth and sine wave with ultra thin lines but no success. Can someone shed a light on the capabilities of the determination of the intersections in this particular case?

samples=301in the plot? Line width doesn't matter for intersection computations. You are trying to intersect with the miter of the line, intersections are not that sensitive. – percusse May 15 '18 at 14:24\newcommand{\step}{.5}then I can decrease the y domain to (-1.2 -- 1.2) – Jesse op den Brouw May 15 '18 at 14:33\paththat is not drawn for the intersections. – percusse May 15 '18 at 14:48