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

Similar Messages

  • 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 convert a number to duty cycle (FPGA)

    Hi
    I want to convert a numerical number to a duty cycle value in FPGA module so I could use it to generate a PWM signal for the numerical value.
    I tried dividing it but it shows an error in FPGA as it would produce a float value. I tried even the example of scaled division but the quotient is rounded of to 0 (I wanted to convert an output by multiplying 10/36).
    In my project the 100% duty cycle is 360 degrees and 0% is 0 degrees of the motor shaft rotation.
    Please help me I need to use it for my project.
    Thank you
    Dinesh

      I am not exactly sure how your duty cycle is setup, but here is a way we have used a number to create a PWM in our FPGA.
         If you have 360 deg. then I would guess you want to create a PWM duty cycle that is some fraction of 360, say "number"/360.  You could use a for loop where 360 is wired to the "N" and then your "number" can be compared to the current loop count.  That comparison would be true/false which could triger a DIO to be high or low.  Therefor, if   (loop count) < "number"  then DIO is HIGH,  if (loop count) >= "number then DIO is LOW.   This would send out a PWM that has a duty cycle of "number"/360, (multiply by 100 to get in %)  
         I hope this helps.
     --Alex--

  • How to measure the frequency of the data plotted on the waveform chart

    i have made a virtual instrument in labview that acquire data (say sine wave) into a spreadsheet file and also on the chart from the function generator. I measured the frequency of the data from the chart but it is coming out to be very less. How can i calculate the frequency of the plotted sine wave and also from the spreadsheet file.

    If you want to get an idea of the base-frequency of an periodic signal, you can measure the number of samples in between two maxima or in between two minima of the periodic signal.
    Multiply the number of samples by the sample-interval (1/Fsample in [sec]) gives you a rough estimate.
    FFT, I mentioned is one of the more advanced calculation-methods.
    The method calculates the spectrum from a waveform.
    Hope this helps,
    Patrick

  • How to calculate the frequency of the search string in a row

    Hi,
    I would like to find the frequency of the number of the occurences of a search string in a row which is of type of xmltype content.
    For ex: I would like to find the frequency of the word "oracle" in a row which is of type xmltype content.
    Is there any fuction called frequency or freq...
    Thanks in advance....

    Oh!
    Then How to calculate the frequency of occurences in a row ?
    I hope the Score formula is S=3f(1+log(N/n))
    I want to calculate the f value alone, how is it possible.
    Thanks in advance.....

  • How to reactivate my old apple ID that has a security issues?   I can't remember the password of my yahoo that was used to create that apple ID...  any help please?

    how to reactivate an old apple ID that has some security issues?   I can't acces the yahoo that was used to create that account because it was already recycled by yahoo.
    So when I restore my iPad 2, it is asking me for my old apple ID that was no longer working.....
    ANY HELP PLEASE

    Hi marcpople,
    If you have had an Apple ID disabled due to a security issue, you may find the following articles helpful:
    Apple ID: 'This Apple ID has been disabled for security reasons' alert appears
    http://support.apple.com/kb/ts2446
    Apple ID: If you forget your password
    http://support.apple.com/kb/ht5787
    Regards,
    - Brenden

  • I have a 4th gen 20G ipod whose hard drive has died.  Are replacement hard drives available through the apple store?

    I have a 4th gen 20G ipod whose hard drive has died.  Are replacement hard drives available through the apple store?

    I don't think Apple will do that repair for you, because the iPod is too old.  I believe the hard drive type used in 4th gen and older iPods is no longer produced.  There may be non-Apple shops who can do the repair, but they may be using a working part salvaged from a used iPod.
    If you want to do the repair work yourself, and you are good at such things, this web site has repair guides
    http://www.ifixit.com/Device/iPod_Original
    (There are probably also YouTube videos on the topic.)
    NOTE:  There are two hard drive physical sizes.  The thick version has two platters, and corresponds to the "thick" iPods (with double storage capacity).  A 4th gen 20GB model should be the thin version.  The hard drive used in iPods up to 4th gen should work interchangeably, but 5th gen and later iPods use a different type.
    I have a 4th gen iPod that started out as a 20GB.  The hard drive failed, so I put a compact flash card on an adapter in there.  The adapter is like this one (I bought it a few years ago so it's probably not the same seller)
    http://www.ebay.com/itm/NEW-Compact-Flash-CF-SSD-To-Toshiba-IPod-1-8-inch-Adapte r-Black-/121174875639
    The compact flash card is standard; I bought the cheapest one.  I currently have an 8GB card in there, but prices have come down, so I may get a 64GB card soon.  It works great with the 8GB card.  No more hard drive spin-up delay.  Battery lasts longer.  It's lighter.  And it should be more shock resistant.
    The only mod I needed to make on the adapter was to bend over two pins 90º, where you place a jumper to set the drive to "master."  The adapter plus CF card is actually smaller and thinner than just original 1.8-inch Toshiba hard drive; I used some thin foam packing material (cut to the right shape) to take up the excess space and ensure the adapter and card did not become disconnected.
    The 4th gen iPod has excellent sound, compared to some later iPods.

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

  • How do I download I books after it has been interrupted.? I can't get the I books app to load, How do I download I books after it has been interrupted.? I can't get the I books app to load

    How do I download iBooks after the app was interrupted? I can't get the iBooks app to download

    Sorry, but there is no built-in option to autosplit an exiting project.
    Other than
    writing a custom Automator Workflow or AppleScript to do that programmatically
    or define smart albums or searches for each day, then create a project from each album or search result,
    there is little you can do within Aperture once the project has been imported.
    For an Aperture Newbie I think the easiest solution (uless you already have invested a lot of work into adjusting and tagging the images) would be to
    reexport the gigantic project "Export masters"
    and reimport the exported folder with proper import settings.
    The Autosplit should be turned on
    in the Aperture Preferences -> Import,  Autosplit into Projects
    and during imort in the Import Panel -> Import settings -> Aperture Library Brick -> Automatically split Projects
    Regards
    Léonie

  • How can I tell if an RSS Feed has been updated? In Safari I can see the total number of feed updates in the menu bar. Can't figure out how to do that in Firefox.

    See question.

    You will find that the number of audiobook titles available without DRM is much smaller than the number of titles available with it. eMusic probably has the largest collection of MP3 format audiobooks, which are not wrapped in DRM, but their catalog is a pale shadow of Audible's collection.
    The source of your ire is the publishers. They are the ones who insist on DRM, rather than Apple or Audible. (Though there are also policies at those vendors, which make it difficult or impossible for authors who choose to go without DRM (such as Cory Doctorow) to offer their titles without DRM. I suspect that it’s the fault of the publication system, but who knows for sure.)
    Personally, I don't care about the DRM. Audible titles play just fine on my iPhone, and that's the only place I play them, so I never notice it. Someday that might change, and then maybe I'll be angry. But that seems low probability.

  • TO change the Duty Cycle(DAQmxSetCOPulseDutyCyc)

    I have an application that uses Pulse Width Modulation (PWM) to control the speed of a motor. Thus, it requires that I change the duty cycle of my square wave. My continuous pulse is being generated on the output of my counter. When I use the function "DAQmxSetCOPulseDutyCyc" to update the duty cycle when the task is run, the changes aren't reflected. What is the problem? thanks in advances!
    cinzia

    Masa-
    Kevin is correct. Unfortunately, there is little we can do to change this behavior in DAQmx. There are only two options:
    1) change which property updates the pulse train value, which would leave you with the same issue you are currently having if you have a situation where the frequency needs to change but not the duty cycle, or
    2) add a third property that would be a "switch" command. This option would add more work for users, as a third property would have to be called.
    One other thing you might trying using instead of the properties (assuming you are using DAQmx 7.2 or later) is the DAQmxWriteCtrFreqScalar() method. This write method added in DAQmx 7.2 allows you to update the frequency on-the-fly without having to use the properties.
    I
    hope this helps!
    gus....

  • Duty Cycle

    how to generate a waveform with the duty cycle?
    Pls reply soon
    Thanks,
     Jinal

    Hi Jinal,
    Look in the examples folder, there is a function generator example with a square wave function that allows you to change the duty cycle.
    labview\examples\measure\maxmpl.llb - Function Waveform Generator.vi
    ssk

  • 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 chirp(linear FM) signal using dds theory in LabVIEW FPGA.

    how to generate a chirp(linear FM) signal using dds theory in LabVIEW FPGA.
    attachment:a sine signal using dds theory. Hope to get some help. Thanks!
    Attachments:
    FPGA DDS SineGen IP.vi ‏42 KB

    you need to increment the "accumulator increment" during the duration of the chirp.  the "accumulator increment" controls the frequency of the DDS cycle.  by increasing it's value, you are increasing the frequency.  the math for increment values follows the same math as determining the frequency to increment value.
    Stu McFarlane
    Viewpoint Systems, Inc.

  • How to generate all index creation scripts without it's storage clause?

    How to generate all index creation scripts without it's storage clause?

    Execute this before running the actual dbms_metadata.get_ddl
    exec dbms_metadata.set_transform_param(dbms_metadata.session_transform, 'STORAGE', FALSE);
    SELECT DBMS_METADATA.GET_DDL('INDEX',a.index_name) FROM USER_INDEXES A;-Anantha
    Edited by: Anantha R on Sep 30, 2009 11:40 AM

Maybe you are looking for

  • Error while determining ref.mov.type for WM via Table 156S: 647/ / / /L/ /

    Guyz, Firstly despite the plant+storage location + warehouse no. assignments are done , my replenishment delivery (delivery for stock transport order between plants under same company code) is not picking up storage location and warehouse no and thus

  • Can't resd iTunesLibrary.itl

    Hi all, Just upgraded to 7.0.2 and when iTunes started an error message popped up saying: "The file iTubesLibrary.itl can't be read because it was created by a new version of iTunes" How can that be if I am running the newest version? I reinstalled a

  • Deploy Modbus I/O server in multiple library.

    I'm using Labview 2009 with DSC. I learn about I/O server with network shared variable by experimenting with Modbus Fundamental project and Modbus Simulator project (LV built in examples). I run both projects in one computer, and the result is OK. Th

  • Plant to Company Code

    Hi Gurus, I am new to SAP MM. I was asked to re-assign a plant to another company code. I know how to assign(OX18).But do i have to delete the previous one and assign it to the new one. Eg: Plant 25 is assigned to CC 34,now they wanted me to assign i

  • Interesting cases about variance analysis report

    hi gurus, I have problem like this, in t-code S_ALR_87013127 i can see variance calculation for each order. But, when i run t-code S_ALR_87013140 system told that no record exist. What is the possible reason for this case? It is confusing me. Because