Building delays in pulse width modulation

HI there I am trying to build a vi to control a speed controller for a motor.
The specification that the technician gave me is to produce a pulse width modulation waveform with constant gap time and variable "on" time.
This will give the motor a variable speed that can be manipulate.
I already build a pulse width modulation vi but I don't understand how can I make the gap time constant eg 20ms while varying the on time 1-3ms.
Is there a method that I could use or an example that I can look at? Any help will do thanks in advance.
 ill attach my current vi.
Solved!
Go to Solution.
Attachments:
pulse.vi ‏20 KB

You want to vary the ON time between 1 to 3ms? 
Did you do a search using the keyword "pwm"?  There are many posts that have examples.
The idea is that you want to preserve the same frequency and change your duty cycle.
(Example)
Let say you want a waveform at every 20ms, which translates to 50 Hz.
2 ms is 10% duty cycle, 1ms is 5% duty cycle, and 3ms is 15% duty cycle.
Did I understand your question correctly?  Somehow, I feel like I missed something..

Similar Messages

  • Can I change the delay or pulse width on a trigered pulse on the fly in DAQmx

    In the old DAQ driver you could not change the a triggered pulse delay or pulse width on the fly of a as there was a problem in the DAQ driver or was this a hardware problem?
    Is this now possible with DAQmx , if not why not as you could do this with the old 16 bit cards in dos by updating the registers.
    This has been a major problem with NI counters timers and one would have thought that by now this problem would be fixed.We need to do this with out stopping and restarting a task.
    Any help here.
    Ta
    Colin

    Hi Colin,
    Please can you try the suggestion in this KB. hopefully it should still work with what you are doing. I can not find any information specifically on what you want to do with a triggered pulse. However this example program might give you some hints as well.
    Regards
    JamesC
    NIUK and Ireland

  • Pulse width modulation on sbRIO 9631

    need to control 150 RPM DC motor with help of pulse width modulation from sbRIO 9631. need a simple VI in which i can take some DIO's and with help of a slider i can increase or decrease speed of motor simultaneously. 

    A 12V geared DC motor is hard time figuring out how to control or maintain it.Torque in from speed 0 to 150 RPM.

  • Throttle body PID control using pulse width modulation

    Hello all,
    I am trying to do a PID control for a throttle body (using pulse width modulation) for a set value of feedback voltage. The process variable is the pulse width duty cycle. The throttle body is expected to be fully open at a feedback voltage of 5V and pulse width duty cycle of 42.5%.  When I use the highlight execution using the attached file, I can see the throttle body fully open (the values observed are: PID output 42.5 %, feedback voltage approximately 4.7V). However, when the highlight execution is unclicked, the throttle body flutters in the closed condition (still PID output 42.5%, feedback voltage approximately 0.9 V). Can any one please help by suggesting any modification to this attached file to make this throttle body respond to the set value of feedback voltage.
    Many thanks 
    Ajith
    Attachments:
    Throttle body control using PWM technique - PID.vi ‏525 KB

    How did you determine your P, I, and D gains? If you have not tuned your controller, you'll get poor performance. Running with execution highlighting will slow down the execution, which will change the effect of the gains. I would start with pure proportional control (I and D = 0) with a small proportional gain, and see if it responds in approximately the way you want. If so, then your code is probably correct, and you just need to do a full tuning to get good performance. There are many resources available on the web, on this forum and elsewhere, for PID tuning. Note that since your code uses a simple PID example, and not the one from the PID toolkit, the gains do not have the units that are used in many tutorials so you'll have to correct the calculations to compensate.

  • Cannot Find Pulse Width Modulation(FPGA, Use in SCTL)

    Hello All,
    Can someone tell me where I can find Pulse Width Modulation (FPGA, Use in SCTL).vi? I couldn't find it in LabVIEW Example Finder.
    Thanks
    Message Edited by John Edwards on 02-01-2009 09:30 PM
    Solved!
    Go to Solution.

    Here it is...
    Attachments:
    Pulse Width Modulation (FPGA, Use in SCTL).vi ‏43 KB

  • Pulse width modulated signals

    Is it possible to generate a fixed frequency with variable duty cycle signals using counter/timer channels of my DAQ 700?
    If yes, is there any example I could download?
    If no, I am looking for a DAQ card that can handle
    the job, I'd appreciate any recommendation.
    Another part of my project is to read in a analog signal while generating this pulse width modulated
    signal. So far I am not very lucky with one DAQ,
    I am thinking of getting two. Does it sound overkill?
    Please help.
    Thanks

    Could you provide a timing diagram for your digital signal?
    I am a firm believer that a digital output device such as an NI timer can create any signal, given the proper software or hardware. I once did a high speed, gated, triggered data acquisition with only a single NI timer chip on the AT MIO 16E-1. It required about 75 feet of BNC cable, more PFI wires than you can imagine, four external logic devices (AND and OR, NAND and NOR boxes) all interconnected and basically tangled. I don't think I could repeat that setup without my documentation, but the point is, it worked.
    The most important thing from that example is that I used a timing diagram. These are so vital in digital IO and timer applications that its not funny.
    If you can't determine ho
    w to do what you need from a timing diagram, just send me a copy, let me know what the basic specs are of the DAQ 700 (how many counters, interconnect capabilities, etc) and I can try to help.
    Good luck.
    As far as reading the analog signal at the same time...well, look at my example. I generated the trigger/gate signal with the card, and then read in the analog data (on several channels simultaneously.)

  • Using pulse width modulated signal (square wave) to control when a signal is turned on or off

    Using pulse width modulated signal (square wave) to control when a signal is turned on or off
    Greetings All
    I'm trying to use a labview created pulse width modulated signal (square wave) to control when a signal is turned on or off.
    Here's my logic and graphic example:
    1) The source wave signal is continuous
    2) Use a PWM (square wave) created in labview to control when the signal is turned on or off
    3) If PWM signal (amplitude) is greater than 0 play signal if PWM is not greater than 0 don't play signal.
    I'm actually using this to step sequence / pulse several separate magnetic coils using my audio card (which has several audio output channels), I have a signal in labview played constantly.  Than compare it to the PWM (square wave) which controls if the signal gets played on each separate channel or not.  That way I can control which coil is on and off and in what sequence they are activated. 
    I couldn't find an edge detection for a square wave created in labview so I tried Limits but that doesn't seem to work unless I change the phase manually and that only goes from 1 to -1.  I'm just trying to compare the PWM (square wave edges) already created by labview / play a signal if the pulse is greater than 0 and it turns off the signal if it's less than 0.
    Should I be doing this another way
    Tia
    Message Edited by sal22 on 08-16-2009 06:09 PM
    Message Edited by sal22 on 08-16-2009 06:10 PM
    Solved!
    Go to Solution.
    Attachments:
    PWM control signal block.png ‏23 KB
    PWM control signal front.png ‏48 KB
    pwm test.vi ‏36 KB

    Greetings,
    I tried it two ways using amplitude and levels and fft spectrum.  The values don't seem to update the way I need them to (basiclly showing a 0 or a 1).   I compare the Y values like you recommended but they don't ever seem to update.
    tia
    Message Edited by sal22 on 08-19-2009 10:05 AM
    Attachments:
    pwm magnitude not updating.png ‏29 KB
    pwm test.vi ‏41 KB

  • Pulse width modulation with daq mx

    Im trying to change the pulse width modulation on the fly with daq mx. All I have found so far are examples useing traditional DAQ, but not DaqMX. It would be a lot easier if I were to use DaqMX since I will be useing other daq applications in my program and would rather use mx.

    Does this help?
    Attachments:
    PWM-Counter_Output_Folder.zip ‏63 KB

  • Lenovo x240 and PWM (Pulse Width Modulation)

    Hello everyone!
    Does Lenevo Thinkpad x240 use PWM (Pulse Width Modulation) to control screen brightness?
    If so, is there a flickering effect like in this video?
    https://www.youtube.com/watch?v=SpDdy9jSx7Y

    There is an analog modulation with which there is no pulsation at low brightness levels. For example, HP Elitebook 8740w. Watch video: http://www.youtube.com/watch?v=Dk4ckdQ9rvE
    How poor the implementation of PWM (if x230 has PWM) is in this model?

  • Does the new ipad use pulse width modulation to control the brightness of the display?

    Does the new ipad use pulse width modulation to control the brightness of the display? I have photophobia and migraines and am unable to use displays that use this technology due to it triggering a headache.

    You'll have to go to an Apple Store and view the screen to see if it's OK for you.  If a store is not convenient, buy one from Apple online and check it out.  You have 14 days to return it for a full refund, no questions asked.

  • Pulse width modulation with a PCI 1200 board

    Hello,
    I Have a PCI 1200 board and I try to generate a pulse train with a period
    of 500 ms and a variable duty cycle between 10% and 100% by step of 10%.
    Does anyone know how to do this.
    Thanks in advance
    Michel Kocher

    Does this help?
    Attachments:
    PWM-Counter_Output_Folder.zip ‏63 KB

  • Harmonics analysis with Pulse Width Modulation

    I stuck in how to show the harmonics contents of the PWM Inverter.
    Which is the right input connect to the  signal in port of FFT power spectrum component? and then that can show the PWM inverter harmonics contents.
    Please help me , this is my final year project
    Attachments:
    1.jpg ‏31 KB
    PWM_2013_10_16.vi ‏30 KB

    Dear Lynn,
    Thanks for your useful information. I was successful to obtain the power spectrum from the FFT component, But I would like to know how can I get the power spectrum exactly same as my attached picture?
     ( In my VI, all the parameters and type of  control and carrier signal are same as the picture, but the power specturm is not the same. )
    Which is show the x axis and y axis  is modulation frequency ratio and modulation amplitude respectively, and the modulation amplitude will be changed in different harmonics frequencies.
    The formula also is attached. I have no idea how to apply those equation in the FFT power spectrum analyzer. 
    In the other hand, I would like to know how to use harmonics analyzer to get the THD, since I connected the wire from modulation output to singal input of harmonics analysis and then show error.
    Thank You!!'
    Jason 
    Attachments:
    1.jpg ‏31 KB
    formula.jpg ‏14 KB
    PWM_2013_10_30.vi ‏156 KB

  • Pulse width modulation signal generation for ULx

    Hello,
    I am trying to produce an analogue waveform (i.e square wave) with an option to control the duty cycle.
    I am outputting through a Measurement Computing card, which uses the ULx user libaries.
    There are many examples to do what I want using DAQmx, but all those using ULx have no option to control the duty cycle.
    Can anyone help?
    Thanks in advance.
    Solved!
    Go to Solution.

    Hi ben,
    does your ULx hardware even support PWM outputs? Does it support counter output tasks?
    It's not only the software, also the hardware needs to support your requirements!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Level Control with PID Control & Pulse-Width Modulation

    Hi all,
          I have attached my program which I'm having trouble wiring up in the block diagram.... I'm fairly new to labview, but basically I have a level control project with an analog input cistern arm turning a pot for my test tank (configured as DAQ assistant voltage analog i/p) and a pump working off a reservoir (configured as DAQ assistant voltage digital o/p). My electrical side of things is working correctly and I have tested both DAQ assistants I/O's successfully off a basic program, minus the PID & PWM... I found a simple PID control subvi which I think I have wired up correctly, apart from the output variable... I also found a bit of code for PWM using the square waveform vi (far right side of the program) which I have tried to include in the program, but I've been unsuccessful with that. The ideal operation i'm looking for with this project is to be able to enter different values for the setpoint, for the PID to kick in to find that setpoint each time using the PWM to drive the pump, which has a flow rate of 13L/min. I have a manual valve to release water from my test tank which I can set accordingly.
    My questions are;
    - How do I connect the 'output variable' of the PID subvi to my DAQ assistant digital output(both DAQ assistants are set at 1 sample on demand)?
    I have a 'number to boolean array' function, but this gives an error saying that the number of tasks generated are not the same...
    - How do I wire up the PWM bit of code? Do I need to include the 'error in & out' tabs?
    -Am I on the right track with this program or am I way off the mark?!
    Any feedback on this would be greatly appreciated. Thanks for your time,
    Richie
    Attachments:
    PID-RichLevelControl.vi ‏91 KB

    Rich-MechatronicsStudent wrote:My questions are;
    - How do I connect the 'output variable' of the PID subvi to my DAQ assistant digital output(both DAQ assistants are set at 1 sample on demand)?
    I have a 'number to boolean array' function, but this gives an error saying that the number of tasks generated are not the same...
    - How do I wire up the PWM bit of code? Do I need to include the 'error in & out' tabs?
    -Am I on the right track with this program or am I way off the mark?!
    You're a bit off track.  You need the output of the PID to go into the PWM generator, and the output of the PWM to be written to the digital output.  Right now you have the output of the PID connected directly to the Digital Output in a way that won't work, and the PWM generator hanging off the side not really connected to anything.  Also, the PWM generator isn't really going to work since you're generating it at the same frequency as your PID loop runs.  Try a simpler algorithm such as on/off control first and see if that works for your system.

  • Need Help on How to Generate Pulse Width Modulation signals

    Hi,
    I am New in using NI board and programming using LabView. I have no idea on how to start to generate, use what function in order to create a PWM signals.
    My project needs:
    -PWM signals with 15kHz frequency.
    -Duty cycle varrying from 0%, 25%, 50%, 75%, 100%.
    -By using the generated PWM signals to control the half-bridge (MOSFETs) of boost converter and buck converter to varying the voltage of 24V battery to feed in my DC motor.
    The NI board that I use is (NI - sbRIO-9642).
    Can I have a clear view on what to use, how to generate, and by using what functions to generate the PWM signals.
    Sorry for the inconvienient, but I really desperate for help in this. Thanks a lot. I am appreaciate it.
    The attached is the circuit the half-bridge motor controller that I will used.
    Attachments:
    half bridge.jpg ‏13 KB

    Hi Ronald,
    in this thread a very similar question came up. You can use the same approach on your sbRIO.
    For the frequency you gave you should use the FPGA present on the sbRIO - as is shown/discussed in that other thread! I also suggest that other thread because of the "deadtime" feature used to prevent shortcut problems when switching your MOSFETS simultanuously...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

Maybe you are looking for

  • Mini hooked to a tv.. oops with resolution

    Hello I hooked my mini to my tv using the dvi to video adapter available on apple.com... I used the svideo output and everything seemed to be fine.. I think I was getting 800 x 600 not the best.. but workable form where I was sitting.. I tried to see

  • Encrypting A Single File in a Shared Folder

    Hello all. I would like to encrypt a single file to place in my shared folder for my wife to access. Is there a way to do this? Thanks in advance!

  • Reader will not open in Mac OS10.6.7

    I have Intel IMac running Snow Leopard.  I have never had a problem with Reader before.  Several weeks ago, Updater asked if I wanted to update my Reader, which I think was version 9.something, but I do not remember exactly.  I accepted the update. 

  • Add Days to a Date field

    Hi all, I have the following requirement: I have a date field 0calday and the user would like to add a specific no.of days to it, like for example 10 or 15 days. Then we use this computed date field in calculations in the query. Could you please help

  • Localize the display attributes like title, alt in UI Component

    Is there is any way to Localize the display attributes like title, alt etc in UI Component ? <fmt:setBundle basename="Res" scope="application" var="resource" /> <fmt:message key='Title' bundle='${resource}' /> <c:use_faces> <h:form formName="frmTest"