Overview
This tutorial will introduce myDAQ and the tools a student will need to further identify and characterize elements of his system. The tutorial will show how you can use myDAQ to do system identification on a first order system and to resolve capacitance or inductance values, a feature not enabled in the DMM soft panel for myDAQ. The system identification of the RC circuit is done using NI ELVISmx BODE Analyzer or with NI ELVISmx FGEN and SCOPE.
Table of Contents
- Introduction
- Introducing the RC Circuit
- NI ELVISmx and the Soft Panel Instruments
- Measuring Resistances Using the NI ELVISmx DMM Instrument
- Checking for the Cut-off Frequency Using NI ELVISmx Bode Analyzer Instrument
- Function Generator and Scope Instrument
- LAB Assignment
- Solution
- Additional Resources
This document is the first part of "System Identification of a 1st Order System Using myDAQ" and will introduce the RC circuit setup. The result of this document is to be able to get the capacitance value using either the NI ELVISmx SCOPE or BODE Analyzer.
The RC circuit represents a 1st order system that can be modeled. The following figure represents the setup using Multisim.

Figure 1: Circuit Capture in Multisim
The Resistor: The resistor transforms the energy flowing through it into unavailable forms by entropy generation, its constitutive equation will relate voltage and current in the following manner: V=R*i
The Capacitor: The capacitor is a potential energy storage element. Its constitutive equation will relate voltage to charge. The charge of the capacitor builds up with time and its time rate of change is equal to the current: V=q/C, q'=i.
The setup is detailed in the following figures, go ahead and build the circuit on the myProtoboard as shown.

Figure 2: RC Circuit on myDAQ protoboard
The capacitance voltage is being measured using a Referenced-Single-Ended (RSE) measurement with AI1+, while the AI0+ is connected to the A0 line to measure the outputted signal.
Place the capacitor and resistor in series, then wire the AI0- and AI1- to AGND. Wire one end of the capacitor to AGND, and the other to AI1+. Wire A00 to AI0+ and to the Resistor end.
Kirchhoff's voltage law (KVL) states that the algebraic sum of voltages around a closed loop is equal to zero, which infers the following equation: V=VC+VR
Solving for the single state equation in the system, and using the previously stated constitutive equations, rate relations, and laws, we can relate the capacitance voltage as a function of the input voltage as such:

The resulting transfer function of the voltage output of the capacitor can be expressed by either taking the Laplace transform of the previous equation, or by using the impedance method, where ZR=R, and ZC=1/Cs,

![]()
The NI ELVISmx Instruments allow for easy and fast diagnostics of circuits. To learn more about these instruments, please refer to this devzone “Using NI myDAQ with NI ELVISmx Software Instruments”
As soon as you plug myDAQ in your USB, the ELVISmx soft panel instruments will pop up automatically.

Figure 3: NI ELVISmx Instrument Launcher
Go ahead, and double click on the DMM icon, and measure the resistance values that you have and record them.
For further help on the DMM, refer to the following devzone.
» Learn more about using the NI ELVISmx DMM with NI myDAQ

Figure 4: NI ELVISmx DMM Instrument
You will notice that in the DMM instrument, measuring the capacitance and inductance is not a feature enabled in myDAQ and can only be done using NI ELVIS or NI ELVISII. However, the aim of our lab is to be able to identify the inductance or capacitance values so that we could characterize future models easily.
To find the cutoff frequency of the system, replace s with jω, and then resolve the magnitude and angle to draw the bode plot of the system.

Considering the Bode magnitude equation from above:
![]()
If ωτ«1 , then ω«1/τ and the result of the 20log|H(jω)| will near 0 dB.
If ωτ»1, then ω»1/τ and the result of the 20log|H(jω)| will be equal to -10log(ωτ).
At ωτ=1, then ω=1/τ and the Bode magnitude is -10log(2)=-3dB.
The results of the Bode plot can easily obtained using the NI ELVIS Bode Analyzer instrument. However, the Bode plot in NI ELVISmx represents the frequency in Hz, which means that the cutoff frequency f3dB=ω3dB/2∏=1/2∏τ
For further help on the use of the BODE instrument, please refer to this following devzone.
» Learn more about using the NI ELVISmx Bode analyzer with NI myDAQ
You can access the Bode Analyzer instrument from the NI ELVISmx instrument launcher, and you can also access from within Multisim to run diagnostics on the circuit. Open the attached file in NI Multisim 11.0 and refer back to this devzone to use the NI ELVISmx instruments.
Using myDAQ with NI Multisim Circuit Design Software
Select the Function Generator from the NI ELVISmx Instrument Launcher and apply a 10 Vpp square wave as input voltage. Also, open the SCOPE instrument, enable the second channel and choose AI1 as channel source.
The FGEN will ouput to AO0 channel and since this is wired back to AI0+, this means that the oscilloscope should show both the input voltage and output voltage from the circuit.
For further help on the use of the FGEN and SCOPE instrument, please refer to the following devzones.
» Learn more about using the NI ELVISmx FGEN with NI myDAQ
» Learn more about using the NI ELVISmx oscilloscope with NI myDAQ
The solution of the 1st order equation in the time domain given a step function will result in VC=V*(1-e-t/τ)
Observe the behavior of the capacitance voltage when you set the input frequency to f=5*f3dB, this allows the capacitor to settle to VC=Vin*(1-e-5)=.99*Vin. Set the input frequency to f»f3dB, notice that the voltage at the capacitor becomes zero, at which point the capacitor is acting as a short circuit. Set the input frequency to f«f3dB, notice that the voltage of the capacitor is almost identical to the input voltage, which means that the capacitor acts as an open circuit at these low frequencies.
Using the cursors in the SCOPE Instrument, set the first cursor to initialize the start of the rising edge of the input voltage. Set the second cursor at the value that corresponds to 63.23% of the step value of the input voltage. The cursor dT will correspond to the time constant of the system.
You get the 63.23% at t=τ, then VC=Vin*(1-e-1)=.6323*Vin
- Use the NI ELVIS DMM instrument to measure the resistances, and tabulate them vs. their nominal values.
- Run the NI ELVIS BODE Analyzer instrument, and given the measured resistance, solve for the time constant of the system and the capacitance value of the capacitor, by resolving the breakout frequency f3dB.
- Run the NI ELVIS FGEN and SCOPE, and given the measured resistance, resolve the time constant of the system and the capacitance value of the capacitor, by using the cursors in NI ELVISmx SCOPE.
1. The resistance value measured in the DMM probe is 99.6 Kohms which is within .4% of its nominal value.
Figure 5: Measuring Resistance with NI ELVISmx DMM Instrument
2. Using cursors in the BODE instrument, the plot shows that the cutoff frequency f3dB=1995 Hz. Knowing that τ=1/2∏f and C=τ/R, this results in the following:
τ= 7.98 × 10^-5 sec
C= τ/R = 8.01 × 10^-10 Faraday
Figure 6: Enabling Cursors in NI ELVISmx BODE Instrument
Zooming into the area of interest by reducing the frequency band. Set the start frequency at 1 khz, and stop frequency at 10 khz with 50 steps/decade. This will allow a more accurate identification of the cutoff frequency
Figure 7: Finding Cutoff Frequency using BODE Analyzer
3. Open the FGEN function, and set the frequency at 300 Hz with a square wave using a DC offset of 5.0 V and amplitude of 10.0 V.
.
Figure 8: Generating the Input Square Wave in NI ELVISmx FGEN
Setting the first cursor to the start of the charging process, and the second cursor to 6.35V (~63.23% of 10V), dT which is the time constant becomes:
τ= 8.0 × 10^-5 sec
C= τ/R = 8.03 × 10^-10 Faraday which is very close to the previous estimated value using the BODE Analyzer.
Figure 9: NI ELVISmx SCOPE shown resolving the time constant of the RC system.
Table 1: The Results of the System Identification with Rmeasured=99.6 Kohms
| SysID using BODE | SysID using SCOPE | |
| τ (sec) | 7.98 × 10^-5 | 8.0 × 10^-5 |
| C (Faraday) | 8.01 × 10^-10 | 8.03 × 10^-10 |
Table 2: Nominal vs. Real Values
| Nominal Value | Real Values | %Difference | |
| R (Kohms) | 100 Kohms | 99.6 Kohms | .4% |
| C (Faraday) | 1 nF (102 code) | 0.80 nF | 20% |
Notice the high percentage of difference between the nominal and measured value of the capacitance.
» System Identification of a 1st Order System using myDAQ
» System Identification of a 1st Order System using myDAQ with System Identification Toolkit
» Using myDAQ with NI LabVIEW Graphical Programming Software
Reader Comments | Submit a comment »
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
