diff --git a/Lab1.tex b/Lab1.tex index c3ac237..cd7dbf9 100644 --- a/Lab1.tex +++ b/Lab1.tex @@ -179,6 +179,53 @@ We will reference these three derivations in our ``Experimental Results'' sectio \section{Numerical Modeling Results} +For the numerical modeling, I opted to simulate signals types +~\ref{type:ac} (sinusoidal AC about 0V) and ~\ref{type:squarewave} +(square wave). + +In LTSpice, I assembled the circuit shown in Figure +~\ref{fig:ac_2v_100hz_diag}; for the first signal, I specified a +transient simulation from 0.1s to 0.2s: + +\begin{figure}[h] + \caption{Our first sinusoidal signal circuit, simulated in LTSpice} + \label{fig:ac_2v_100hz_diag} + \centering + \includegraphics[width=0.6\textwidth]{lab1_ac_2v_100hz_diag} +\end{figure} + +I then used Ctrl+click on the signal label \texttt{V(n001)} to pull up +the Waveform dialog shown in Figure ~\ref{fig:ac_2v_100hz_num}, +yielding a numerically-derived RMS voltage: + +\begin{figure}[h!] + \caption{This LTSpice dialog shows us measurements of our interval; of most interest is RMS} + \label{fig:ac_2v_100hz_num} + \centering + \includegraphics[width=0.3\textwidth]{lab1_ac_2v_100hz_num} +\end{figure} + +I had to adjust the size length of the transient simulation to get an +easily-viewable result. + +For the square-wave values: I switched from the \texttt{SINE} command +to \texttt{PULSE}; this command requires a rise-time and fall-time, +which are set as low as possible to mimic a true square-wave; in +addition, we specify the duty cycle and frequency indirectly, instead +by specifying the on time and period, as seen in Figure +~\ref{fig:pulse_ltspice}. + + +\begin{figure}[h] + \caption{The LTSpice \texttt{PULSE} command menu} + \label{fig:pulse_ltspice} + \centering + \includegraphics[width=\textwidth]{lab1_ltspice_pulse} +\end{figure} + +The results of the numerical modeling are compiled below, in Tables +~\ref{table:comparison_ac} and ~\ref{table:comparison_squarewave}. + \section{Experimental Results} \begin{figure}[h] @@ -217,15 +264,31 @@ Equation ~\ref{deriv:ac}: \end{equation*} \begin{longtable}[]{@{}lllllllll@{}} -\toprule -\endhead -\bottomrule -\endlastfoot -Set Mag. & Set Freq. & Read Mag. & Read Period & Calc. Freq. & Calc. RMS & Meas. RMS \\ -2V & 100 Hz & 2.10 V & 9.994 ms & 100.1 Hz & 1.48 V & 1.4236 V \\ -2V & 50 kHz & 2.05 V & 19.95 us & 50.13 kHz & 1.45 V & 1.4112 V \\ -5V & 100 Hz & 5.11 V & 10.01 ms & 99.90 Hz & 3.61 V & 3.5522 V \\ -5V & 50 kHz & 5.11 V & 20.01 us & 49.98 kHz & 3.61 V & 3.5451 V \\ + \toprule + \caption {Voltage measurements and period for ~\ref{type:ac} (sinusoidal AC)} + \endhead + \bottomrule + \endlastfoot + Set Mag. & Set Freq. & Read Mag. & Read Period & Calc. Freq. & Calc. RMS & Meas. RMS \\ + 2V & 100 Hz & 2.10 V & 9.994 ms & 100.1 Hz & 1.48 V & 1.4236 V \\ + 2V & 50 kHz & 2.05 V & 19.95 us & 50.13 kHz & 1.45 V & 1.4112 V \\ + 5V & 100 Hz & 5.11 V & 10.01 ms & 99.90 Hz & 3.61 V & 3.5522 V \\ + 5V & 50 kHz & 5.11 V & 20.01 us & 49.98 kHz & 3.61 V & 3.5451 V \\ +\end{longtable} + +Comparing the calculated and measured RMS values: + +\begin{longtable}[]{@{}llll@{}} + \toprule\noalign{} + \caption {RMS Error for ~\ref{type:ac} (sinusoidal AC)} + \endhead + \bottomrule\noalign{} + \endlastfoot + & Calc. RMS & Meas. RMS & Error \% \\ + Case 1 & 1.48 V & 1.4236 V & 3.81 \% \\ + Case 2 & 1.45 V & 1.4112 V & 2.68 \% \\ + Case 3 & 3.61 V & 3.5522 V & 1.60 \% \\ + Case 4 & 3.61 V & 3.5451 V & 1.80 \% \\ \end{longtable} \subsection{Experiment ~\ref{type:acoffset} (sinusoidal AC with DC offset)} @@ -238,10 +301,9 @@ Equation ~\ref{deriv:acoffset}: V_{\ref{type:acoffset}RMS} = \sqrt{\frac{V_{m}^{2}}{2} + V_{b}^{2}} \end{equation*} -TODO NOTE ERROR could not check dc offset voltage bias - \begin{longtable}[]{@{}lllllllll@{}} \toprule + \caption {Voltage measurements and period for ~\ref{type:acoffset} (sinusoidal AC with DC offset)} \endhead \bottomrule \endlastfoot @@ -252,6 +314,21 @@ TODO NOTE ERROR could not check dc offset voltage bias 5V & 100 Hz & -5V & 5.20 V & 9.997 ms & 100.0 Hz & 6.21 V & 6.16 V \\ \end{longtable} +Comparing the calculated and measured RMS values: + +\begin{longtable}[]{@{}llll@{}} + \toprule\noalign{} + \caption {RMS Error for ~\ref{type:acoffset} (sinusoidal AC with DC offset)} + \endhead + \bottomrule\noalign{} + \endlastfoot + & Calc. RMS & Meas. RMS & Error \% \\ + Case 1 & 2.50 V & 2.44 V & 2.40 \% \\ + Case 2 & 5.22 V & 5.19 V & 0.57 \% \\ + Case 3 & 4.15 V & 4.05 V & 2.41 \% \\ + Case 4 & 6.21 V & 6.16 V & 0.81 \% \\ +\end{longtable} + \subsection{Experiment ~\ref{type:squarewave} (square wave)} Given a read period of $T$ seconds, we calculate the frequency as @@ -261,6 +338,7 @@ magnitude. \begin{longtable}[]{@{}lllllllll@{}} \toprule + \caption {Voltage measurements and period for ~\ref{type:squarewave} (square wave)} \endhead \bottomrule \endlastfoot @@ -271,9 +349,124 @@ magnitude. 5V & 100 Hz & 50\% & 5.20 V & 9.999ms & 100.0 Hz & 5.20 V & 5.01 V \\ \end{longtable} +Comparing the calculated and measured RMS values: + +\begin{longtable}[]{@{}llll@{}} + \toprule\noalign{} + \caption {RMS Error for ~\ref{type:squarewave} (square wave)} + \endhead + \bottomrule\noalign{} + \endlastfoot + & Calc. RMS & Meas. RMS & Error \% \\ + Case 1 & 2.11 V & 2.02 V & 4.27 \% \\ + Case 2 & 2.13 V & 2.01 V & 5.63 \% \\ + Case 3 & 5.20 V & 5.04 V & 3.08 \% \\ + Case 4 & 5.20 V & 5.01 V & 3.65 \% \\ +\end{longtable} + +Notably, this is the first time we have a >5\% error value; we will +review this item in TODO WHERE? + \section{Data Comparison} + +Here, I publish the modeling results for ~\ref{type:ac} (sinusoidal AC +about 0V). + +\begin{longtable}[]{@{}lllll@{}} + \toprule\noalign{} + \caption {RMS Voltage comparison for ~\ref{type:ac} (sinusoidal AC)} + \label {table:comparison_ac} + \endhead + \bottomrule\noalign{} + \endlastfoot + RMS & Case 1 & Case 2 & Case 3 & Case 4 \\ + Analytic (A) & 1.48 V & 1.45 V & 3.61 V & 3.61 V \\ + Numerical (N) & 1.4125 V & 1.4124 V & 3.5311 V & 3.5311 V \\ + Experimental (E) & 1.4236 V & 1.4112 V & 3.5522 V & 3.5451 V \\ + A-N error & 4.78 \% & 2.66 \% & 2.23 \% & 2.23 \% \\ + A-E error & 3.96 \% & 2.75 \% & 1.63 \% & 1.83 \% \\ + N-E error & 0.78 \% & 0.09 \% & 0.59 \% & 0.39 \% \\ +\end{longtable} + +Next, I publish the modeling results for ~\ref{type:squarewave} +(square-wave AC). + +\begin{longtable}[]{@{}lllll@{}} + \toprule\noalign{} + \caption {RMS Voltage comparison for ~\ref{type:squarewave} (square-wave AC)} + \label {table:comparison_squarewave} + \endhead + \bottomrule\noalign{} + \endlastfoot + RMS & Case 1 & Case 2 & Case 3 & Case 4 \\ + Analytic (A) & 2.11 V & 2.13 V & 5.20 V & 5.01 V \\ + Numerical (N) & 1.9999 V & 1.9999 V & 4.9997 V & 4.9997 V \\ + Experimental (E) & 2.02 V & 2.01 V & 5.04 V & 5.01 V \\ + A-N error & 5.51 \% & 6.50 \% & 4.01 \% & 4.01 \% \\ + A-E error & 4.46 \% & 5.97 \% & 3.17 \% & 1.96 \% \\ + N-E error & 1.00 \% & 0.50 \% & 0.80 \% & 1.97 \% \\ +\end{longtable} + \section{Conclusions} +Before completing the lab report out and making firm conclusions, I'd +like to address our two analysis questions: + +\begin{quote} + PSpice: In the transient simulation profile: what is the role of + ``Maximum Step Size''? Create an example and include waveform images + to illustrate your point. +\end{quote} + +Returning to our simulation of a 5V sinusoidal waveform with no DC +bias at 50kHz: the larger we allow the ``Step Size'' to go, the fewer +timesteps LTSpice will take when performing its numerical simulation, +and thus the less precise our RMS value is / the less close it is to +$\frac{5}{\sqrt{2}} \approx 3.53553 ...$. In Figures +~\ref{fig:ltspice_large_timestep}, +~\ref{fig:ltspice_large_timestep_num}, +~\ref{fig:ltspice_small_timestep}, and +~\ref{fig:ltspice_small_timestep_num}, we can see that restricting the +timestep size down to $\SI{1}{\ns}$ brings our RMS voltage much closer +to $\frac{5}{\sqrt{2}} \approx 3.53553$. + +\begin{figure}[h] + \caption{The LTSpice simulation with no defined ``Maximum Step Size''} + \label{fig:ltspice_large_timestep} + \centering + \includegraphics[width=0.6\textwidth]{lab1_ltspice_large_timestep} +\end{figure} + +\begin{figure}[h] + \caption{The RMS value of the simulation with no defined ``Maximum Step Size''} + \label{fig:ltspice_large_timestep_num} + \centering + \includegraphics[width=0.3\textwidth]{lab1_ltspice_large_timestep_num} +\end{figure} + +\begin{figure}[h] + \caption{The LTSpice simulation with a ``Maximum Step Size'' of $\SI{1}{\ns}$} + \label{fig:ltspice_small_timestep} + \centering + \includegraphics[width=0.6\textwidth]{lab1_ltspice_small_timestep} +\end{figure} + +\begin{figure}[h] + \caption{The RMS value of the simulation under a ``Maximum Step Size'' of $\SI{1}{\ns}$} + \label{fig:ltspice_small_timestep_num} + \centering + \includegraphics[width=0.3\textwidth]{lab1_ltspice_small_timestep_num} +\end{figure} + +As for the second question: + +\begin{quote} + Considering your experimental data, explain why we can conclude that + the DMM is showing the true RMS regardless of the waveform. +\end{quote} + + + \nocite{*} \printbibliography diff --git a/lab1_ac_2v_100hz_diag.png b/lab1_ac_2v_100hz_diag.png new file mode 100644 index 0000000..e49be9b Binary files /dev/null and b/lab1_ac_2v_100hz_diag.png differ diff --git a/lab1_ac_2v_100hz_num.png b/lab1_ac_2v_100hz_num.png new file mode 100644 index 0000000..e5bf209 Binary files /dev/null and b/lab1_ac_2v_100hz_num.png differ diff --git a/lab1_ltspice_large_timestep.png b/lab1_ltspice_large_timestep.png new file mode 100644 index 0000000..0583ccd Binary files /dev/null and b/lab1_ltspice_large_timestep.png differ diff --git a/lab1_ltspice_large_timestep_num.png b/lab1_ltspice_large_timestep_num.png new file mode 100644 index 0000000..b80f048 Binary files /dev/null and b/lab1_ltspice_large_timestep_num.png differ diff --git a/lab1_ltspice_pulse.png b/lab1_ltspice_pulse.png new file mode 100644 index 0000000..f1a5911 Binary files /dev/null and b/lab1_ltspice_pulse.png differ diff --git a/lab1_ltspice_small_timestep.png b/lab1_ltspice_small_timestep.png new file mode 100644 index 0000000..7414aa0 Binary files /dev/null and b/lab1_ltspice_small_timestep.png differ diff --git a/lab1_ltspice_small_timestep_num.png b/lab1_ltspice_small_timestep_num.png new file mode 100644 index 0000000..7f2bb0c Binary files /dev/null and b/lab1_ltspice_small_timestep_num.png differ