Using DASYLab to measure a pulse peak as well as pulse width.

Minimum Requirements DASYLab 2016 FULL

This article discusses a DASYLab program that is a attached as a download link at the bottom. It measures an RC circuit response to a 5-volt signal using the USB-1608G data acquisition device (DAQ) that was configured for board number zero and 16 single ended inputs. To run the example, first run InstaCal and make these changes.

The example measures the time it takes to reach 98% of the applied voltage. This works out to be four RC time constants. The circuit used a 47uF capacitor in series with a 10k ohm resistor. The free end of the capacitor was connected to the AGND ground. The free end of the resistor to digital output D0. The capacitor-resistor junction was connected to analog input CH0H. The t=RC time constant works out to 0.47 seconds and four time constants works out to be 1.88 seconds.

The program uses global variables some of which are merely to display information in the Info Window. To view all the global variables, use the menu selection Options-->Global Variable and Strings-->Define Global Variables.

TIME_CONSTANT and VOLTAGE_ON_TIME both use a calculation. To view their setup, select each one and press Advanced.

Below is the worksheet interface. To operate, press the APPLY VOLTAGE button. The chart recorder will graph the RC network response along with a square pulse signal who's width is the time to 98%. 

Above is a Switch, Combi Trigger, Action and Digital Output modules. When the switch is pressed,  a 5 volt signal is applied to the RC network. The Combi Trigger is used to produce a pulse that is six time constants long. The action module turns the switch off when it detects the falling edge of the Combi Trigger pulse. The Combi Trigger pulse is passed through the action module to the digital output and the voltage is applied to the RC network. 

Below is the Combi Trigger setup. The trigger output gets set to 5 volts when the rising edge of the Switch signal is detected. The trigger output stops using the Directly condition, which is a duration. The duration is the Post Trigger time, which is defined as VOLTAGE_ON_TIME.

Main worksheet description:

Starting on the left, the first module is the Analog Input that measures the voltage at the capacitor. After are two Scaling modules, the first one removes minor offset voltages and the second one is merely a place holder to scale the input voltage to units - for future use. The output is then sent to the Min/Max module, that determines the maximum value of the input signal. Using this maximum value, the percent to peak value is calculated and both are written to global variables as PEAK_VALUE and PCT_VALUE.

Below the Min/Max module is a Combi Trigger module that closes the relay when the input voltage increases above 0.1v and opens the relay when it falls below 0.1v. This allows only the pulse signal to pass to the Circular buffer, which is used to replay the data to the modules that determine the pulse width. Above the Arithmetic module, there is an Action module that will release the Circular Buffer data. It uses the event Always that fires the event any time data is received. Output from the Min/Max happens only after a maximum value has been determined so the event fires once per pulse.  Simultaneous with the occurrence of the maximum value, the circular buffer is released. This data is fed to a Combi Trigger set to trigger at zero volts and to stop at the percentage to peak value. 

The Combi Trigger output is a square pulse who's width is the time to reach the percentage to peak value. The time is measured using the Pulse Analysis (PWM) module and the output is written to a global variable as PCT_TIME. 

Posted 12/26/2019 9:35:21 AM by Administrator