Frequency and duty cycle measuremen​t

Hi Friends,
Its been very helping from the day 1 i started psoting my questions to this forum...
Now again its time to seek ur help...
My req is something like i  have a sound waveform (say a tone) saved as a .wav file.
Say suppose 1.wav.................
I need to evaluate this wave at a particular interval and should be able to calculate duty cycle, dB level, output frequency and peak to peak voltage similar to a CRO.
I already tried with the below VI but its showing for the entire .wav, so need to do some modifications which attains my req, but i am not sure where to kick off....
So anybody who have worked or developed similar VI in past ,please share your exp's
Thanking you in advance.
Cheers,
Suneel.V
Attachments:
Duty_Cycle.JPG ‏91 KB

Joe/Jeremey,
I am facing some new issue with the VI,
Frequency and Duty cycle are coming but the problem is something like the JPG attached.
Its not frequent and only coming for a particular part of the waveform
Is it waveform (.wav) dependent, if so let me know how to debug this.
Attached the VI (modified), snapshot of error and also wavefile (.wav)
P.S: error coming only when the yellow lines selected to the first quarter of the wave.
Cheers,
Suneel.V
Attachments:
delete_b.zip ‏12 KB
Waveform_Extractor_With_Duty-Cycle_July11.vi ‏151 KB
error_midlevel1.JPG ‏133 KB

Similar Messages

  • Generate and synchronize 6 digital channels with differents phases/frequencies/duty cycles/...

    Hello,
    For some kind of tests we need to generate, with a 6534 card, 6 signals.
    The 6534 has 32 digital E/S and can go up to 20MB/s !
    Each channel must be independant so that it can have it's own frequency and duty cycle. But for exemple the second channel can be delayed in reference at first channel. I put an image so that you can understand better what i try to do (3 signals are shown but six are needed).
    I see a lot of things on forum that are close to my probleme, but none seems to be as advanced as mine.
    http://sine.ni.com/devzone/cda/epd/p/id/4683 -> 6534 doesn't have timers
    http://forums.ni.com/ni/board/message?board.id=40&message.id=5167 -> Just a phase probleme
    http://forums.ni.com/ni/board/message?board.id=170&message.id=261289 -> Another board
    http://forums.ni.com/ni/board/message?board.id=40&message.id=5090 -> Another probleme
    I contacted NI support, they send me an exemple on "patterns" but it generates frequencies that are multiple of one with no phase consideration or duty cycle.
    Any idea ?
    Thanks in advance for your advice and help.
    Eric.
    Message Edité par Eric31 le 08-10-2007 06:52 AM
    Message Edité par Eric31 le 08-10-2007 06:55 AM
    Attachments:
    Sans titre.PNG ‏8 KB

    At best, that's gonna be a pain in the neck with that board.  If you need very precise timing for freqs, duty cycles and offsets, it gets worse.  If they need to change on-the-fly, it'll be near-impossible.
    1. You can only operate 1 hw-timed digital output task at a time.  So all 6 signals must be part of that 1 task.
    2. Thus, you need to define an output buffer representing the states of those 6 bits throughout your entire generation.
    3. There's a bunch of greatest common factor and least common multiple stuff needed to figure out the right output rate and buffer size, assuming you'll want to regenerate repetitively.  You first need the gcf of all the transition times to come up with the right output rate since all the transitions need to occur on some integer multiple of the output period.   You'll then need the lcm of the 6 signals' periods, combined with the output rate, to size up a buffer that can be regenerated.
    4. Forming the output data array may be quite complex.   Personally, I always do my stuff with raw arrays and I know that interleaving all those signals can be quite tricky, especially if there may be an occasional simultaneous transition.   However, I suppose there's a chance that some of the digital waveform functions *might* make this step a bit simpler.  I just haven't played around with that format much.
    Editorial opinion: Buy a 6602.  You can trigger 6 counters to start with different initial phasing, and will be able to change freq & duty cycle on-the-fly for each one independently.
    Editorial opinion #2: For higher channel count apps, I'd also recommend checking out the DIO-64 board put out by Viewpoint Systems, an NI Alliance partner.  It gives you much smarter hardware-timed DIO.  With the NI board, there can be huge amounts of redundant info in the DO buffer.  If you find that your GCF is 10 microsec, but the time between consecutive transitions is 10 millisec, you'll have to stuff 1000 identical values into your output buffer.   With Viewpoint's board, your data acq buffer *only* contains data at the transition times.  Timing is controlled by delivering a separate array defining the timestamps that correspond to those transitions.
    -Kevin P.

  • Problem to measure 0% and 100% duty cycle of a PWM.

    Hi,
    I am using counters of USB-6341 to measure duty cycle of PWM just by following the example 'Meas Duty Cycle-Buffered-Finite.vi'. It works almost all the time. However, when the duty cycle of a input pwm is 0 or 100%, the DAQ can't read anything, in another word, it can't measure 0 or 100% duty cycle.
    How to modify that?
    Thank you very much :-)
    Nan

    That's the thing about PWMs, you never really know if the PWM is 0% or 100%.
    Let's say we have a 50% duty cycle, at 1/2Hz.  So low for 1 second, high for one second right?  What if we run at 1/20Hz, so low for 10 seconds high for 10 seconds.  Or is this a 0% duty cycle for 10 seconds, and a 100% for 10 seconds?
    A true PWM read will never be 0% or 100% it will just keep waiting until the trigger is seen, and recalculate the frequency and duty cycle of it.  The solution to your problem is for you to define a duration to watch for a change, and if one isn't seen, then you can define 0% or 100% appropriatly.
    So I would recommend taking your duty cycle like you normally are, and then at the same time watch the digital signal for however long you want, if the digital line does not change state, then output 0% if it is low and 100% if it is high and ignore what ever duty cycle you read.  But if the digital line does change state, then use the read duty cycle as the actual value.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Frquency & Duty cycle Value changes- every time

    Hello all
     im using pcie 6320 to measure the frequency and the duty cycle of a signal.i have attached my vi & the data measured for reference.The values highlighted in red ,is my actual frequency and duty cycle but values changes for every 1 sec.Please correct me if i have any mistake.
    Solved!
    Go to Solution.
    Attachments:
    measure frquency-duty.vi ‏54 KB
    HZ-DUTY.JPG ‏37 KB

    You'll need to enable digital filtering--insert the following property node into your code (call the property node before starting the task):
    Try a "Min Pulse Width" of a few us and increase it if you still are picking up incorrect readings.
    The errant numbers are coming from false edges being picked up during transitions, enabling digital filtering will cause the DAQ device to ignore any transitions with a pulse width of less than the set value.  Your 475 Hz 72% duty cycle signal should have a high time of about 1.52 ms and a low time of about .59 ms):
    656 Hz = ~1/(high time)
    1718 Hz = ~1/(low time)
    MHz values = multiple edges picked up during a single transition.
    Best Regards,
    John Passiak

  • Burst output at maximum duty cycle

    Hi,
           I have been working on a C program that was used in a welding machine. Now, I would like to change a part of code to make the burst output at full duty cycle and user maximum time. I just want to test any method in labVIEW before implementing it in C. I am quiet good in understanding labVIEW code and therefore using it to figure it out somehow.
          The details of the machine are 400Hz, 2-4 KAmps and the AC mains are at 50Hz. What exactly I want is to produce a burst current according to the user input current and mind it that duty cycle is always at maximum. So, I don't care about duty cycle settings. I have no idea to find a way. Can any one have suggestions for me?
    Help me.

    I have done some search around and come to a conclusion. I would like to give three settings to user and those are current, set time and duty cycle. The duty cycle should not be changed ever and it should be at maximum i.e.. 50% all the time of a periodic pulse train. User can change the current value and set time according to his interest but duty cycle not. If the set time is passed and the rest of duty cycle should blanked automatically in order to stop the current and it should follow the same rhythm for every set time and current value. The frequency is 400Hz and AC mains are at 50Hz.
    Can any have some suggestions to me?    

  • Analog signal duty cycle incorrect

    I am using an NI PCIe 6535 board to send digital timing signals to a custom PCB.
    The signals are digital square wave signals with various duty cycles and phase shifts.
    I also need to send a 12 bit ramp signal to the board.
    I am having issues with the frequency.
    I need the timing signals to run at 833.33333 khz.
    I need the lsb of the ramp to run at 416.666666khz.
    To create the timing signals I am using "Create Analog signal", so that I can set up the square wave with the appropriate phase shift and duty cycle.
    Then I conver from analog to digital.
    I am using a DAQmx generate to output the signal to the PCB. I have noticed that the DAQmx gen frequency directly controls the ramps frequency.
    However for the digital timing signals there is some scaling factor. The frequency of the digital timing signals can be set in the timing signals them selves. The sample rate in the analog signal also effects the frequency.
    To get the frequencies that I need. I had to set the"create analog signal" sample rate at 2.778G S/s, the "create analog signal" frequency to 1.2889GHZ, and the DAQmx generate frequency to 1.66666 MHZ. At those numbers, I get the timing signals to output at 833.333KHZ and the second bit of the ramp at 416.6666HZ (for the ramp I upped it to 13 bit and I don't use bit 0, as it outputs at 833KHZ).
    However at these settings all of my timing signals have the same phase, and the same duty cycle, even though I have them set differently.
    Can someone please help? I think the issue is that I have the sample rate and frequency of the "create analog signal" block set too high, but if I set them lower my signals will not be at the right frequency.
    Attachments:
    timing signal 1.JPG ‏44 KB
    timing signal 2.JPG ‏47 KB
    daqmx gen.JPG ‏55 KB

    Hi David,
    We found that there seems to be a weird divider between the sampling rate of the analog signal module, the analog signal sample rate, and the f daqmx gen.
    After various tests we made a chart of what we observed. Fsignal and sample rate are values set in the "create analog signal" module, Fdaqmxgen is set in the "DAQmx generate" module. We used a "create anaolg signal" module to create the square wave, then convert analog to digital convert the square wave to digital.
    We have "repeated signal" and "N periods" checked.
    Fsignal
    Fdaqmxgen
    Sample rate
    Frequency   measured on the scope
    1GHZ
    10MHZ
    100G s/s
    100KHz
    100MHZ
    10MHZ
    100G s/s
    10KHZ
    1GHZ
    1MHZ
    100G s/s
    10KHZ
    10GHZ
    10MHZ
    100G s/s
    1MHZ
    100GHZ
    10MHZ
    100G s/s
    10MHZ
    100GHZ
    10MHZ
    100G s/s
    5MHZ
    The equation we came up with is Feff = (Fsginal/FDaqmxgen)*1000.
    To meaure the frequencies were using an HP 54600A oscilloscope, and probing standoff pins on our custom pcb.
    We have several versions of the project, attached is the latest one.
    Kyle,
    How do I set the compression to false?
    The picture below looks like labview? We are using signal express.
    I can't change the frequency on the DAQ mx gen because I need the ramp to run at a set frequency.
    There is a divider between the daqmx gen and the f signal. I have to set the Fsginal in the GHZ to get it to out at the right frequency. The equation we came up with is Feff = (Fsginal/FDaqmxgen)*1000.
    Thanks,
    Devin

  • How to generate a pwm whose duty cycle has to be varied depending on the frequency of the input trigger??

    Sir/madam,
    I am quite new to the Labview FPGA module. 
    I am currently working on an application where i have to generate a pwm to control the ON time duration . The pwm ON time depends on the frequency of an input signal.I want to retrieve the ON time value from a lookup table which contain the duty cycle values for the pwm at different frequencies of the input.This input also has to work as a trigger. The input is pulsed and the trigger has to generate the pwm at every rising edge. I am using a PCI 7831R-  RIO series. I am urgently in need of some help and i have hardly a  couple of weeks before i meet the deadline.
    I am trying hard to learn the basics from the shipping examples but not able to quite make my vi work. 
    Kindly lend a helping hand and i would be very grateful to anybody who can help. Thanks a lot in advance.
    Do ask in case of any clarifications required. I  think i have explained my problem quite well. 

    Hello Manu,
    You can refer 
    Developing a PWM Interface using LabVIEW FPGA or PWM Output with LabVIEW FPGA
    How this helps.
    Best Regards, 
    Hardik Asawa
    AE
    National Instruments  
    Message Edited by Hardik Asawa on 05-05-2010 12:46 AM

  • How the duty cycle is calculated by Timing and Measurement.vi

    I am using the Timing and Measurement express vi(LabView8.0 is used) to measure the Duty cycle and frequency. I want to know how the same is calculated by the Timing and Measurement express vi. Please reply.

     The Timing and Measurement Express VI uses \vi.lib\measure\mascope.llb\Pulse Measurements N chan.vi to do the Duty Cycle and Frequency measurements. 
    Help says the following about this VI:
    Accepts a periodic waveform or an
    array of periodic waveforms and returns the period,
    pulse duration (pulse width), duty cycle (duty
    factor), and pulse center of a selected pulse and period.
    Refer to the Pulse and Transition Measurements VI in the labview\examples\measure\maxmpl.llb for an example of
    using the Pulse Measurements VI.Maybe NI can explain the algorithm.
    Hope that this helps,
    Bob Young
    Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
    DISTek Integration, Inc. - NI Alliance Member
    mailto:[email protected]

  • Control frequency and number of cycles

    I am trying to use a stepper motor and a motion controller to control a push rod. The push rod will fatigue sutures that are attached to a valve. My question is if there are any sample codes in labview that will help me control the frequency and the number of cycles. I will also have a load cell to give me a force profile.

    Hello,
    Have you looked at the Motion shipping examples for LabVIEW? There is a particular example, One-Axis Move (Accel - Max Velocity - Decel).vi, which is located at:
    C:\Program Files\National Instruments\LabVIEW 7.1\examples\Motion\FlexMotion\One Axis.llb
    This example allows you to control the acceleration, deceleration, velocity, and target position (in counts) of the movement. There are a number of other shipping examples located in the C:\Program Files\National Instruments\LabVIEW 7.1\examples\Motion\FlexMotion directory that may be of additional assistance in developing your code. I would suggest starting with the One-Axis Move example first, though.
    Take a look at that example and let me know if you have any additional questions on this issue.
    Regards,
    Scott R.
    Applications Engineering
    National Instruments

  • I want to store the data form the PWM and the value of the changing duty cycle into a file simultaneously and continually

    i want to store the data form the PWM and the value of the changing duty cycle into a file simultaneously and continually but having problem.Please can anyone help out.
    Attachments:
    data.vi ‏60 KB

    Hello,
    Have you looked at the "Write Binary File.vi" and "Read Binary File.vi" examples?
    They give you a good clue as how to write and read arrays to and from binary files.
    For your data it means that you could put the two data items to write in an array and write the array to file, for the read its important to in what sequence the number were written to file.
    Kind regards,
    André
    Regards,
    André
    Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

  • Wrong duty cycle (pci 6014 and bnc2110)

    Hello,
    I want to generate a square signal with labview 7.0, pci 6014 and bnc 2110. I attached my VI . The duty cycle works properly for instance for 10%, 20%, 30% (I suppose that it works because when I anlyse the signal: some pulse seams to not appear ) . BUT when I change the duty cycle constant to 15%: the output is again 20% and not 15%. It's the same case for 17%, 18%....
    I really need to create square signal with a perfect duty cycle.
    Do you know where is the problem?
    Thank you 
    labview 7.0
    Attachments:
    Untitled41.vi ‏310 KB

    I found the problem for missing pulse: it's the while loop. I delete it and add more samples.
    The duty cycle works now due to the precision of the "simulate signal"
    labview 7.0

  • How can I vary a PWM´s duty cycle inside a while loop?

    Hi,
    I'm using the "Generate Pulse Train.vi" to generate pwm signals in counters 0 and 1 in order to drive a DC motor both ways.
    The problem is, I need to control the movement of the dc motor with my PI controller which is inside a while loop. I've tried letting the "generate pulse train.vi" outside the while loop, but the problem is, it only changes the value of the duty cycle when the loop is stopped. I also tried putting it inside the loop, but then it doesn't even work.
    So, how can I vary a PWM´s duty cycle inside a while loop?
    I'm attaching the VI with the PI controller.
    Thanks for your help!
    Guilherme
    Attachments:
    controleValvula.vi ‏332 KB

    Here's some code I threw together a while back to change a duty cycle on the fly. It generates a fixed 5KHz or 25KHz frequency depending on laser selection, then allows duty cycle to be changed continously. Maybe you can use the premise of it for your application.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    "It’s the questions that drive us.”
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    Attachments:
    Pulse_Width_Modulator.llb ‏197 KB

  • Sine, Square & Sawtooth sweep generation with variable duty cycle/rise time & fall time

    Dear All !
    I request and need some candid advices on the subject issue keeping in view the following notes:
    1) I am a novice in LabView.
    2) I was an average Electronics Engineering graduate who graduated about 9 years ago and since then I have not been involved in Electronics Engineering.
    I have undertaken a task or generation of Sine, Square and Saw Tooth wave forms. All these waveforms are to be frequency swept form 1 Hz to 100 kHz. The amplitude of all these waveforms should be able to be adjusted. The duty cycle of Square Wave should also be adjustable (or better be able to be swept). Likewise the rise time and fall time of sawtooth wave should also be adjustable (or better be able to be swept).
    I am considering  other options as well but wanna try it on LabView.
    I wish to ask that is it possible to execute this task in Labview 7.0? If possible then considering the para 1 & 2 above, is it possible for me to finish this task in 15-20 days if I work on this for about 3 hours a day? If not then what can be reasonable estimate?
    I will be extremely grateful if you people can offer advice on whole project or part(s) of it.
    Thanking you in advance and requesting urgent response(s).
    Solved!
    Go to Solution.

    Check this thread.
    I did some similar coding, it might be usefull to you.
    http://forums.ni.com/ni/board/message?board.id=170​&thread.id=493477&view=by_date_ascending&page=1
    I am using ver 9.0 though.
    If you work 3hr /day for 2 weeks you might as well finish book basics 1& 2 and than can do whan you need in a breeze, couple of hours.
    Good luck

  • Duty Cycle - Calculations

    Hello,
    I have spent the most of the day trying to figure out why my duty cycle calculations were not going any faster then .1 sec.
    I am aquire data from 13 accelerometers at a frequency of 20000 Hz. When I put this through the Express VI to calculate the duty cycle, the time step always goes to .1 sec.
    My question really is it possible to make this faster? The duty cycle of my accels are around 10ms.
    I tried to dive into the express vi's front panels, but that didn't seem to have any good answer.
    Thanks,
    Royce

    I think that you mis-understood what I was getting at. I get excellent readings in terms of the duty cycle output. The accels duty cycle ranges from around .25 -> .75 in my case. I even setup a nice little config block to get everything to around .5 to adujust easily to gravity readout for all 13. The problem that I am having is that the duty cycle conversion doesn't seem to read out all values of the input. The duty cycle will readout only 1 sample every .1 secs. That readout I believe should really be less then .01 secs depending on the resistor values that I have set up for my accels etc. What is even more interesting is that with the dynamic data readout, if I were to probe the data. Since I am reading at 20000 Hz, it is telling me that my dt should be .00005 secs. Which was fine for sampling of my input duty cycle wave, but afterwards that dt value should be scaled down to the actual frequncy. Now, if the program was written to take an average of duty cycles over .1 secs to fix the output period to a standard amount instead of having all sorts of strange step sizes since each reading (accel) generally has a different output frequncy the program forces that conversion to .1 sec period then fine or that is just takes a sample of 10, I guess I will have to deal. But, I did have the option to have a lot higher sampling rate for my accels, and if the .vi forces everything to .1 sec period for duty cycle output or if it takes an average of 10 readings and then rounds to the nearest sig digits this should be documented in the .vi for the duty cycle so that it is clear. If I am way off base and I shoudln't be getting a reading resulting from the duty cycle every .1 secs then I guess I am really lost. But, I do understand where the duty cycle readout comes from, that part is simple enough.
    Thanks!
    Royce

  • Read duty cycle of a PWM with DAQ

    Hi,
    I am doing a test system and I have several signals that control motors. They use PWM with a max frequency of 5 kHz.
    I would like to know if with a USB DAQ or a PCI DAQ for example PCI-DIO96 could I meassure the duty cycle of these PWM signals. I mean I need to meassure with 10kHz at least.
    Which are the read frequency of these systems?
    Due to the high number of I/O to test I am also thinking of using Compact-RIO with different I/O modules. What do you think?
    Thanks in advance

    If your PWM frequency is 5 kHz and you want to measure duty cycle to 1%, then you need timing resolution of 2 microseconds or faster.
    The USB-6343 has hardware timed DIO at up to 1MHz, so it might be suitable.  There are other devices with hardware timed DIO at rates of 10 MHz or faster as well.
    Before you buy, determine how often you need to measure the duty cycle to make sure the data transfer can keep up.  USB can sometimes be a bottleneck.
    Lynn

Maybe you are looking for

  • How do I share movies on a pen drive?

    I had tried earlier to use a 4 GB pendrive for sharing my videos and found that though the movie was copied onto the pendrive, I could not get my mini DVD player to play the same. Being informed that I need to do this on an 8 GB pendrive, I purchased

  • WebDav Repository Manager Disappears???

    Hello, I am seeing some strange behavior with an IIS WebDAV based KM WebDAV repository manager I created. I used the following as a basis for my setup. http://help.sap.com/saphelp_nw04/helpdata/en/4a/217fb6c33c6748a1715a161ac942cd/frameset.htm I crea

  • OBIEE Query: Can I use the "IN" with two or more fields?

    Hi. I'm trying to do a simple query like this: Select "Tempo"."Anno" as anno, "Tempo"."Mese" as mese from "PRE" where ("Tempo"."Anno","Tempo"."Mese") IN (select "Tempo"."Anno", "Tempo"."Mese" from "PRE") but BI Publisher returns this error: java.io.I

  • Do we need two compilers?

    when we use an swf that's AVM1Movie and when its used in flex3 and communicate between them using a local connection, do we need both flex3 and flex2 compilers to run the SWF that's built in flex3 having swf of older version embedded?

  • IM Movement types related to PP

    Hi, can some share with me the IM/WM Movement types related to PP and in which scenario we use that. Thanks, Chakku