09-09-2013 03:28 PM
I am attempting to output a continous decaying signal as seen below.
(For the time being, assume that I must leave the sampling rate at Fs: 1000 and #s: 1000.)
In the loop where the signal is generated, I inserted a 'Wait (ms)' block so that the iterations would maintain the correct timing. If not, the speed of the iterations would be too fast. Although, when I measure the output at the BNC connector, the actual output is in discrete steps, which depends on the speed of the iteration. (e.g. for the above signal with freq = 1/4 Hz, the output would remain 1V for two seconds, 0.5V for one second and 0V for one second, then repeat)
Is there any way to fix this?
Before I attempted this method, I had used the DAQ assistant output, which did not require me having to insert the 'Wait (ms)'. But, the problem with this method was that there was a delay between the time the program sent out the signal and when the BNC output connector received the signal.
I assume the second method did not output in discrete steps because of the buffer which is maintained in the assistant. I attempted to have some sort of buffer for the first method, but was unable for lack of experience I assume. If I was able too, it seems that I might introduce a delay once again, which is undesireable.
Any help on this topic would be appreciated. I will attach a copy of the section that is giving me trouble.
Thanks.
Mike
Solved! Go to Solution.
09-09-2013 09:54 PM
The solution is to not try to get Windows to do deterministic timing (it can't). Instead take advantage of the clocking capability of the DAQ hardware. There are numerous example showing how to implement clocking of buffered signals.
Mike...
09-09-2013 09:59 PM
Oh yes, one more thing. The output of a D/A board will be in discrete steps - that's the way they work. If you want to smooth the output you will have to implement a hardware low-pass filter for the output signal.
Mike...
09-09-2013 09:59 PM
Oh yes, one more thing. The output of a D/A board will be in discrete steps - that's the way they work. If you want to smooth the output you will have to implement a hardware low-pass filter for the output signal.
Mike...
09-10-2013 08:25 AM
I have been searching and thus far have been unable to find a similar example. Is there any examples you can recommend that would help with me figuring out how to smooth out the signal, so that the discrete values will not be so excessive, with that same sampling rate?
Thanks.
Mike
09-10-2013 09:14 AM
@Mike310 wrote:
I have been searching and thus far have been unable to find a similar example. Is there any examples you can recommend that would help with me figuring out how to smooth out the signal, so that the discrete values will not be so excessive, with that same sampling rate?
Thanks.
Mike
With the same sampling rate and the same rate of change, you will always get the same steps. A filter was already suggested to take out the high-frequency component of the signal.
09-10-2013 09:26 AM - edited 09-10-2013 09:28 AM
As I said the filter has to be implemented HARDWARE. Just as an anti-aliasing filter on an analog input must get done in hardware, so a reconstruction filter on an analog output must be implemented in hardware.
Occasionally fairly robust filtering is needed, but typically a simple RC circuit works fine. Google "RC filter" or "low-pass filter" to get some examples and design equations. Often the only hard part is coming up with good locations for mounting everything.
Mike...
09-11-2013 08:34 AM
Thanks for the advise Mike.
At the moment, I went back to using the DAQ express, since the signal, while using the same sampling rate, appears nearly continuous on an oscilloscope. Although, as I mentioned previously, this introduced a problem with the signal output at the board being delayed by a few seconds. To compensate, I wired the generated signal to a delay before entering the 'write file to spreadsheet.vi', so that the input signal, which was a result of the generated signal, and the generated signal, would be synchronized on the saved file.
09-11-2013 09:39 AM
@Mike310 wrote:
Thanks for the advise Mike.
At the moment, I went back to using the DAQ express, since the signal, while using the same sampling rate, appears nearly continuous on an oscilloscope. Although, as I mentioned previously, this introduced a problem with the signal output at the board being delayed by a few seconds. To compensate, I wired the generated signal to a delay before entering the 'write file to spreadsheet.vi', so that the input signal, which was a result of the generated signal, and the generated signal, would be synchronized on the saved file.
The fact that the DAQ express is taking a few seconds must mean it is doing something to condition the voltage. Without really wanting to know what goes on inside the express VI, I would guess that it actually samples at a much higher rate than you specified to give it a smooth ramp, but keeps the external clock at what you did specify.