01-23-2009 03:58 AM
Hello together,
i´m looking for a solution to measure a pulse with ramps with NI 6602 and DAQmx .NET
- i want to know if the ramp is linear or changes in given limits
- Duty cycle starts with 0% and changes over certain time (2000 msec) to 100%.
- Duty cycle starts with 100% and changes over certain time (2000 msec) to 0%.
- Problem is to stop the measurement: at duty cycle 100% and 0% there is no more edge to count (permanent signal) and the buffer runs over in buffered semi-period measurement
Is there a possibiltiy to measure pwm over a certain time (not samples) and do the check in software?
Can anyone give me a solution or a concept to solve this problem?
Thank you in advance
XTrevor
02-05-2009 11:21 AM
Hi XTrevor,
this is quite the tricky problem.
The only option I see would be the following:
- feed the PWM signal to two counter inputs
- use a third counter for generating a high enough frequency to
- do two buffered edge count reads (one for the falling edges, one for the rising), start them synchronously
- now you will get a pulse start (rising edge) and a pulse stop (falling edge) information in counter 1 and 2, respectively
- a low-to high transition occured when the counter 1 is incremented but the counter 2 is not (hi-lo: vice versa)
- if the period is constant you could just evaluate equal-size blocks of the buffers
- the pw value is of course the time difference from unequal counter values to equal values to unequal again
e.g.
1-1-1-1-1-2-2-2-2-2-2
1-1-1-1-1-1-1-1-1-1-2
^ ^ ^
Again, your sampling rate would have to be high enough to guarantee a decent resolution for each cycle. As you can tell, this is a more complicated approach than using the semi-period measurement but it should work for you.
Best regards,
Peter