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

Similar Messages

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

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

  • 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

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

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

  • Samples Not Acquired on NI 660x or NI 6624 Devices When using pulse width, semi-period or two-edge separation buffered measurements with the NI 660x and NI 6624 on counters 0 and 1, some samples may not be acquired under certain circumstances.

    In the DAQmx 9.4 Readme the following is stated:
    Samples Not Acquired on NI 660x or NI 6624 Devices When using pulse width, semi-period or two-edge separation buffered measurements with the NI 660x and NI 6624 on counters 0 and 1, some samples may not be acquired under certain circumstances.
    Could anyone elaborate on this? I am particularly interested in knowing under what circumstances this problem arises for the 6602 PCI devices.
    How should I understand 'NI 660x and NI 6624 on counters 0 and 1'. Is it only a problem on counter 0 and 1 for the 660x or does this only apply for the 6624 devices.
    /mola 

    Are there any NI Product Support Engineers out there who has an answer to this question and who are willing to share it with me?

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

  • 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

  • How can I output a square wave to control a stepper motor using 7332 controller?

    I have the following system configuration for testing a linear actuator (LA):
    LabView 7.1
    NI FlexMotion 7332 Motion Controller
    NI Flex DMM 4070
    The LA is a stepper motor with Step and Direction of Rotation inputs, as well as some discrete I/O for Power Enable and other functions.
    The LA specification only requires that I send a 50% Duty Cycle square wave signal with frequency less than 300 Hz to it in order to make it step.  The LA has it's own power source.  I only need the 7332 to generate the drive signal and the DOR signal to the LA.  Using some of the example VI's, I can get the LA to work, but I will need to incorporate the functions in to a custom application. 
    How can I weed through the numerous advanced functions the 7332 offers and only generate a DOR signal and a step command at a user-defined frequency.  How do I set up the controller for this?
    Thanks

    Hello,
    All the VIs that you can use to create a pulse train and digital I/O from your motion controller are found in the "Analog & Digital I/O VIs" sub-palette in the "Flex Motion" palette. Use "Load PWM Duty Cycle" and "Configure PWM Output" VIs to create the square wave. Use the "Set I/O Port Direction", "Set I/O Port MOMO", and "Set I/O Port Polarity" VIs to create digital output. I hope you find this information useful. You can learn about the specifics of these VIs and their inputs/outputs in the NI-Motion VI Help.
    Regards,
    Aaron B.
    National Instruments

  • 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

  • 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

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

Maybe you are looking for

  • Connecting a Smart Card Reader to Intel iMac

    Im using a SCR331 CAC reader on my 2.5ghz MBP, I cant seem to get the system to recognize my CAC in the Keychain access list. Can someone help me out? Ive tried this link http://caconmac.openboxconcepts.com/safari, but you have to have the CAC recogn

  • How to I center a dialog box in the screen?

    Simple question, and I hope a simple answer. I need to center various sized dialog boxes in the screen. I've tried getcenterpoint(), but I don't know EXACTLY how to use it.

  • How to filter certificate templates in Certificate Authority snap-in with the correct values

    How to filter certificate templates in Certificate Authority snap-in with the correct values I have a 2012 R2 server running Microsoft Certificate Authority snap-in. I want to do a filter on a specific Certificate Template which i know exists in the

  • A Cautionary Tale + Question about ibook hard drive

    I made the switch to Mac almost two years ago; I love my ibook G4, but I wish I had purchased AppleCare. Now I've got an odd HD problem and I'm wondering if anyone else has had something similar happen. Right now the HD is OK; obviously, I'm using it

  • VS 2012-2013 Extension, goto definition, reformatting

    Hello, I am in a newbie in the realm of Visual Studio- We have a C++ project , plus some script text files ( referenced by the project, at this time as simple text files). We want to extend Visual Studio to have syntax highlighting, outlining, code c