NI 5105 - Measure PWM Waveform Duty Cycle

Will the Positive Duty Cycle scalar measurement in the NI-SCOPE software calculate duty cycle correctly on a PWM (pulse-width modulated) waveform?  I have a 400Hz signal that is pulse-width modulated with a 40Hz signal that I need to measure the duty cycle for.  Since this is not a normal, continuous waveform (like a sine wave or square wave) I don't know if the NI-SCOPE software will correctly calculate the Duty Cycle.  Has anyone tried this with success?  I am looking at using the NI-5105 because it has 8 channels, but am open to using other hardware and just multiplex my signals to the digitizer.

The positive duty cycle scalar measurement should correctly calculate duty cycle on your pulse.  By default, the measurement finds the base and top of your waveform using a histogram of the Y values (there will be peaks in the histogram at the base and top values).  Duty cycle is calculated from the 50% level crossings between these two values.  You must have at least one complete cycle and only the first cycle is measured.
If that doesn't work for you, there are a plethora of parameters you can change (except for which pulse you measure - it is always the first).  For example, you can set the upper, lower, and level crossing values to specific % or voltage levels.  See the documentation and examples for details.
If you need to measure the duty cycle of multiple pulses in the same pulse train, there is a LabVIEW function (Pulse Measurements.vi) which allows you to do this.  It uses the same algorithms as the internal NI-SCOPE routines.
In either case, the measurement is independent of the hardware.  Any NI-SCOPE device will work.  If you have any other questions, let us know.
This account is no longer active. Contact ShadesOfGray for current posts and information.

Similar Messages

  • Measuring the changing duty cycle of PWM waveform

    I need to measure the changing duty cycle of PWM waveform.
    conditions:
    1. the period is fixed.
    2. but the duty cycle is changing.
    goal:
    measure the every duty cycle of a period in the waveform.
    Can you please give me a help?
    Thank you in advance.
    the waveform image is attached.

    You need to provide more specific information.
    What is the period? What is the minimum, maximum, and resolution of the PWM signal? What is the time scale in your image?
    How are you measuring or generating the signal you show in the image?
    What should the output look like? An array of duty cycles expressed as percentage? Some kind of plot on a graph?
    How long will this measurement last?
    Lynn

  • 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

  • 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

  • Measure high speed duty cycle in labview

    Hello.
    I'm trying to do semi-period measure for high frequency (up to around 200KHz).
    i need to know an exact duty cycle and frequency of the signal.
    all the examples i could find worked fine for low freq. (up to 50KHz) but dont match for high speed.
    for now i'm using the M series 6259 and the new X series 6353 DAQ.
    is there a solution for high speed measure?

    Hi jackedi
    Have you tried the examples in the Example Finder?  You can find the Example Finder at Help >> Find Examples.  When this opens, double click Hardware Input and Output >> DAQmx >>  Counter Measurements >> Meas Semi-Period.  This should measure your semi period.  On the 6353, the counters run at 100 MHz, so you should be able to get good resolution of a 200 kHz signal.
    Regards,
    Jim Schwartz

  • Duty Cycle measurement

    Hello all,
    I am attempting to Measure and output duty cycle to a device. I don't have the device in my possession so I have my hardware hooked up to each other. I have NI 9472 output card hooked to a NI 9423 input card. I have found these 2 examples of how to adjust duty cycle and how to read duty cycle. They work great, but the reading of the duty cycle is oppesite of the outputing of the duty cycle. For example if I set my output duty cycle to 60% the reading is 40%. If I set my duty cycle to 30% it reads that it is 70%. I looked thru the block diagram to see if the input was looking for the resting signal to be low or hi. Being a new user it might be right in front of me. Can some one take a peak at them and tell me anything? Thank you.
    Attachments:
    Modify Duty Cycle while running.vi ‏31 KB
    Meas%20Duty%20Cycle%20Cont%20LabVIEW%208.2[1].vi ‏31 KB

    Hey greentea2,
    You can try taking your waveform data and adding a replica of itself to the end of the data using the Append Waveform VI, so that you have multiple cycles of data to send into the Timing and Transition Measurements Express VI or the Transition Measurements VI for calculating the rise time.  I've attached a picture that shows a simple example of this using a sine wave.
    If your data does not complete a full cycle that comes back to a similar starting low point, then this example may not work for you or give you the right value.  If that is the case, then please respond with a picture of what your waveform looks like, so we can determine how to manipulate it.
    Hope this helps,
    Attachments:
    Append Replica Wave Form Data.png ‏28 KB

  • 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.

  • Measuring PWM duty cycle with Analog Input

    Hello folks,
    I have a NI 9205 module and was wondering if there was a way to measure the duty cycle of a PWM signal that I am generating with a separate microcontroller?  I have found a lot of examples with Digital inputs but not analog.. Is this possible?
    Thank you,
    Bob

    Hi Robert,
    I'm not sure what that error is, try searching for it.
    If you want to measure a PWM signal you would usually use a counter input.  A counter is a dedicated piece of hardware that is used to measure digital signals.  Since the NI 9205 is an analogue device and it doesn't have any counters onboard, you will not be able to select counter input.
    I would recommend you get the right tools for the job and buy a digital acquisition device with an onboard counter.  It will make reading PWM much easier for you.  The NI 6008 has a counter onboard and is only £99.  It will also offload processing from software to hardware since you don't have to calculate duty cycle.
    If you still want to use analogue post back and we can look into why its not working for you.  Tips to start you off: Voltage is the correct setting and  Look in the manual and make sure you have connected it like you have configured it (differential, RSE, NRSE page 14)
    Lewis Gear CLD
    Check out my LabVIEW UAV

  • 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

  • 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]

  • Is it possible to measure duty cycle of 6 pwn simultaneously using pci6624 board?

    Hi
    in my application i need to measure duty cycle of 6 pwm signal simultaneously  .
    Is it possible to measure duty cycle of 6 pwn simultaneously using pci6624 board?

    Here's what I mean...
    However, it only sends one command at a time. You didn't say if your servo controller requires all 4 commands at once. If so, then you can remove the case structures and concatenate all 4 slider values into one string.
    Message Edited by LabViewGuruWannabe on 11-15-2007 01:05 PM
    Attachments:
    SliderEvents-FP.PNG ‏31 KB
    SliderEvents.vi ‏36 KB
    SliderEvents-BD.PNG ‏63 KB

  • How can I measure a 0% or 100% duty cycle signal ?

    I want to measure the duty cycle of an input signal using a counter of a 6030-E board.
    I work with a PXI Rack under Labwindows/CVI.
    My program already works properly for duty cycle between 1% and 99%, but it is not able to detect 0% duty cycle (ie : signal to ground), nor 100% duty cycle (ie : signal to power supply).
    The problem is I don't understand how the counter works in such a situation (it cannot detect any edge, as long as the signal is continuous 0V or continuous 12V).
    Please have a look on the following code :
    1- First, the counter is configured
    // Reset Compteur
    i_Status = GPCTR_Control(iDevice, iCptID, ND_RESET);
    //Definition du type de mesure du compteur (mesure temps impulsion)
    i_Status = GPCTR_Set_Application (iDevice, iCptID, ND_SIMPLE_PULSE_WIDTH_MSR);
    //Definition de la vitesse d'echantillonage (20 Mhz)
    i_Status = GPCTR_Change_Parameter(iDevice, iCptID, ND_SOURCE, ND_INTERNAL_20_MHZ);
    //Definition du signal a mesurer (defaut)
    i_Status = GPCTR_Change_Parameter (iDevice, iCptID, ND_GATE, ND_DEFAULT_PFI_LINE);
    // initialisation du compteur
    i_Status = GPCTR_Change_Parameter(iDevice, iCptID, ND_INITIAL_COUNT, 0);
    // Preparation du compteur avant de l'armer
    i_Status = GPCTR_Control (iDevice, iCptID, ND_PREPARE);
    2- Then, every 10 ms, the value of the counter is read, so that I can calculate the duty cycle...
    i_Status = GPCTR_Watch(iDevice, iCptID, ND_COUNT, ul_val_cpt);
    3- ...and the counter is armed again for the next reading
    i_Status = GPCTR_Control(iDevice, iCptID, ND_ARM);
    When duty cycle changes from x% to 0% or 100%, the counter always keep the value corresponding to x%.
    Even if I reset the counter between each measurement, it keeps this value ! I don't understand how it is possible.
    How can I know that the counter didn't see any edge, and so that duty cycle is 0% or 100% ?
    Thank you in advance for your help !
    FraB

    Hi,
    Just have a look at this link, it can be interesting for you...
    http://forums.ni.com/ni/board/message?board.id=40&message.id=2161&requireLogin=False
    Regards
    DD

  • Using labview cosimulation, how to control PWM duty cycle in multisim

    I am new to using Multisim with LabVIEW using cosimulation. I want to ask if there is a PWM component in Multisim that can have its duty cycle be controlled using LabVIEW? I have an algorithm in LabVIEW that outputs duty cycle values from 0 to 1, representing duty cycle percentages.
    How do I control the PWM duty cycle in Multisim using LabVIEW cosimulation?
    Many thanks,
    SPECTRE
    Solved!
    Go to Solution.

    Hi Spectre,
    In Multisim, search for the parts base on functionality, there are some PWM models in the database.  Have a look at this knowledge base  if you don't know how to search for parts:
    http://digital.ni.com/public.nsf/allkb/7309A5CABC677296862577ED006EC99E
    Aslo, have a look at this knowledgebase:
    http://digital.ni.com/public.nsf/allkb/EF391C48CF71AE4F862571B900644F84
    This article shows how you can get Mutlisim and LabVIEW to co-simiualte:
    http://www.ni.com/white-paper/13663/en
    I hope this helps
    Tien P.
    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)

  • Pid duty cycle PWM

    I'm trying to find example of pid controlling duty cycle of PWM. Is there any simple example? Help to share if have any.
    I coundn't find any of that topic in the Example Finder
    Solved!
    Go to Solution.

    Refer to the  http://digital.ni.com/public.nsf/allkb/1561D31534F07D608625727900391114
    If make a little change there by inserting a PID block, PID output line go into the duty cyle line (meaning delete the manually key in duty cycle).  How to set the limit there as illustrated in the attached limit.PNG?
    Attachments:
    PWM_output_SW-timed_with_digital_line (vers 8.2).vi ‏39 KB
    limit.PNG ‏33 KB

Maybe you are looking for

  • REG:: Horizontal scroll bar for pdf

    Dear All, I am displaying data in a table in Portal and this table has 13 columns in it. I am writing all this data from the table to a PDF and I am able to generate a PDF.  This generated PDF clips the data on the right side, i.e. it shows few colum

  • Method call overheads, how much do they cost speedwise?

    Hi all, how much of an overhead in terms of speed and effciency (in terms of cpu time) is it to call a method from the same class to do something as opposed to defining what you have to do again in your other method...basically which is better and/or

  • Aggregate Persistence wizard fail to generate script

    I was following the instructions for the aggregate persistence wizard, but at the last step, the screen just shows: The following script has been generated based on your input and will be saved at Create Aggregate Script: D:\script.sql And inside the

  • Spilled lemonade on my macbook keyboard..how do I clean it?

    The child I babysit for spilled quite a bit of watered down lemonade on my macbook pro keyboard. Can I take the keys off and clean underneath?

  • Master Recipe / Production Version

    Hi, I'm looking for FM/BAPI or IDOC's for creating/changing master recipes (C201/C202) and production versions (C223). Can anyone help ? TIA, Rob Makelaar.