Square wave generation phase offset problems using PXI6602

Hi,
I am generating 2 signals to use for simunlating an Incremental AB encoder using a PXI6602.
The signals need to be square wave, 34.133Khz, offset by 90degrees which I am setting by dividing (1/frequency) by 4 and putting the result into the DAQmx Create Channel (CO-Pulse Generation-Frequency).vi initial delay node.
The resulting signals phase difference however does not consistantly measure 90degrees. At least 1 in 5 runs of the vi has a phase angle issue resulting in a failed test.
Can anyone suggest a stable fix for this.
Thanks,
David

Thanks John_P1,
that seems logical and as for the frequency, it's not really critical that it's exactly 34.133Khz as long as it's there abouts.
I've had a little play with the trigger suggestion using the examples in LabVIEW as reference (Hardware Input and Output>DAQmx>Counter Output) but I'm getting an error as seen in the attached image no matter what I select the trigger source as.
I am relatively new to LabVIEW program building and have had no formal training as yet so could you possibly look at the attached vi and suggest or impliment the required changes to get this vi working please.
Thanks.
David.
 

Similar Messages

  • I have transefer function like (1/(s^2+s+​5)) and i have a square wave input , i want to use this transfer function with this input to see the output , how can i do that , with example please.

    i need to know also how to represent this transfer function in labview, try to send me example. answer me at my mail

    "st" wrote:
    > answer me at my mail
    give a valid e-mail first, and your name, we don't like to help anonymous
    people
    > try to send me example.
    how much do you pay ?
    > i have transefer function like (1/(s^2+s+5)) and i have a square wave
    > input , i want to use this transfer function with this input to see
    > the output , how can i do that
    First you have to know what you are doing, like an engineer : you have a
    Laplace, continuous time transfer function but LabView handles discrete
    signals only. Use matlab/simulink if you want to simulate continuous time
    systems easily...
    If you definitely want to use LabView, the first step is to discretize your
    continuous-time transfer function, i.e. decide a sampling rate and convert
    it to a "z transfor
    m". Then you can directly use the "IIR Filter.vi" as I
    said earlier.
    Philippe Guglielmetti - www.dynabits.com me at my mail

  • How to avoid jitter in analog output(square wave) generation

    Hi all,
    Iam working with PCI-6723 32 channels analog output,iam generating a square wave,sampling at 100ks/s.
    ican able to generate upto 10kHz square wave.The wave form appears clean when it is below 1000Hz if i crossed 5KHz to 7KHz, iam getting jitter in the output square wave form,i have experimented with the digital filter but still the jitter is persisting,
    since iam using 12 channels for such similar generations so i have fixed the sampling rate.100Ks/s.
    kindly suggest me how to avoid this jitter in high frequency generation.
    OS::WINDOWS 2000
    HARDWARE PCI-6723.
    I/O CB 68
    NIDAQ:7.3
    LABVIEW 7.1
    kindly find the attached file.
    Thanks and Regards
    RAJESH
    Attachments:
    Untitled.vi ‏73 KB

    Hi ALAN,
    Thanks for your reply, well the square appears to be overlapped ie one ON/OFF period another waveform tries to overlap, actually i planned to take a snapshot of my oscilloscope (tetronix) but since its not advanced one ,i have attached the file kindly look into it,you can observe the at some higher frequencies there is lot of difference between rise time and fall time.
    Thanks and Regards
    rajesh
    alan actually iam decorating my front pannel do u have any sample layouts for coloring ,buttons kindy forward me .
    Attachments:
    Doc1.doc ‏56 KB

  • Generating square wave with variable duty cycle

    We like to generate a square wave with variable duty cycle using LabView 6.1 and SCB-68 and this duty cycle comes from some PID controller programmed by LabView by reading a voltage and feeding back this square wave

    the story begins with some one called separately excited DC motor
    this thing sometimes changes its speed
    so we are trying to keep a constant speed
    irrespective of the load no matter how it changes
    this comes by reading the voltage out from
    the tackometer which represents the speed as voltage
    then comparing this with a reference set by the labview program
    the labview program will send a control signal to some chopper circuit
    which is connected to the field of the motor which controls the speed
    we are tending to make the labview program as pid controller
    that will generate our beatiful square wave with some duty cycle
    which will vary to increase or decrease the voltage across the field
    we tried "Real-Time PID Control.vi" example and other examples
    and we are discussing different solutions for this duty cycle thing
    but till now no output
    this is our whole story with this DC motor thing

  • TWO independent square wave generators on sbrio9632 fpga

    I am using sbrio9632, I need to generate 2 different PWM signals for driving 2 different motors in the same time. I`ve put 2 square wave generators but when I change the parameters (frequency, duty cycle) of the first generator, the parameters of the second generator are automatically changed. So i supose that there is only one square wave generator that can be used. Any solution ? Is it possible to use 2 different square generators on the same board ?
    Thank you !

    The Square Wave Generator is a little quirky when operating outside of a Single-Cycle Timed Loop, because it needs to ensure that it is called at a rate that will produce the edges of the square wave with precise timing. So it operates similar to a loop timer, in that it blocks execution until it is ready to output a high-low or low-high transition. See the example at examples\R Series\FPGA Fundamentals\Analysis and Control\Square Wave Generator\Square Wave Generator (FPGA).vi for more information.

  • I need help adding two signal waveforms from a square wave generator using an or gate

    Hey Im working on a square wave pulse signal that can be displayed using an FPGA board. I have two different pulses (signal 1 and 2)  generated from square wave generators on LabVIEW each with equal duty ratios but different phase offsets. I need to add the two pulse signals together to get another signal (signal 3) showing two pulses (from signal 1 and 2). I have tried using an Or gate but that wouldnt work as expected. Please I need some guidance on how to implement this boolean logic, P.S. Im open to any other solutions. Thanks.
    For clarity: Imagine signal 1 = 00001000
                                       signal 2 = 00100000
    I need signal 3 to be             =  00101000, I hope this emphasizes my point.

    The problem is with the third function from the left.  Oops, I forgot, I'm not clairvoyant.  Maybe if you posted your code, we could really tell you if the problem is the third function from the left ...
    Bob Schor

  • How to calculate the phase difference between two square wave (acquired from two channel in one DAQ)

    Hello everyone ,
     I need a quickly help that as below :
    I am trying use PCI-6220 to acquired six signals from one rotation encoder (channel A, channel B,channel Z ,and their non-signals) .The encoder out signals will be square wave and 4000pulses per revolution. I set it rotation at 300rpm speed. I need show every square wave of six out channels in waveform and measure the A-B phase difference to check if the value is correct (designed value should be 90deg) .
    I have no idea how to measure or calculate the phase difference of two square wave base on synchronizate to acquire these two square wave from two channel on the PCI-6620....
    Anyone can give a idea how to calculate the phase difference with two square wave ?
    Thank a lot and Thanks again...
    Tim

    Tim,
    Here is a simple rising edge detector for one channel.
    Lynn
    Attachments:
    Rising edge.vi ‏15 KB

  • I have generated two square wave forms using NI-9221. These two Square waveforms are suppose to be 90 degrees electrical from one another.

     I have two square wave forms from an encoder wheel. I can not seem to generate or calculate the phase of the waveforms. I have tried to extract the data but it is not accurate? I can not use a true false statement with the extracted data either. I have to have the one waveform 90 degrees electrical from the other waveform. Any Suggestions?

    Fist thank you both for responding so quickly. I am using a half encoder wheel and the waveforms are certainly show the phases correctly.  The operator of this program will not have access to the graph only the data and measurements collected. The reason I am trying to get the phase is because that is going to be a major factor in if the board passes or fails. I extracted the phases from the waveforms but it’s not accurate at all. I think I may try to trigger when to measure the wave and when to stop measuring. Is that Possible?
    J. Powell

  • Phase shift of a sine wave and a square wave

    Hi,
    I would like to simply compute the phase shift between a sinusoidal waveform and a square one. Between two sin-s I can compute, but I have no idea how to do that with a square waveform.
    Thanks,
    Ussr123

    Hi there,
    the easiest way is to use the ExpressVIs.
    But you are only allowed to use the ExpressVI "Tone Measurements" if you have enough periods of the square wave, because it computes the phase with FFT.
    An other possibility is to use the spectrum analyser VI as used in the attached exsample.
    Greetz
    Branni
    Attachments:
    Phaseshift_Sqr_Sin.vi ‏89 KB

  • Problem with USRPs (phase offset)?

    Hi                        I used this configuration (2 receivers (USRPs) and 1 transmitter (generator of sin wave)):
    I did time and phase synchronisation .
    the problem:
    The received signals by the 2 USRPs are not superposed !??  
    how can I do to supperpose the signals received by the two USRPs??
    please help me
    Best regards

    first of all, thanks for your answer.
    unfortunally i didn't understand it in total.
    do you mean, it is NOT possible to use any timezone setting, which is not based on a "standrad one" ?
    as far as i know, there are countries using daylight saving time periods, which are not fixed to the "same start- and endtime for every year" (like israel for example).
    i thought i can handle this "problem" using the posix string method to set the TZ environement.
    so, is it not possible to use this linux feature (to use the export TZ=XST-1XDT..... command) combined with java ????
    thanks for your help again.
    regards
    alex

  • 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

  • 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

  • Can I input a square wave using 6534 DIO card?

    Can I input a square wave using 6534 DIO card?
    I'm trying to read in a square wave using the
    6534 DIO card. It seems like a easy enough task.
    But I not having any luck yet. Any helpful hint
    from experienced user? I'm using an HP square wave
    generator.
    Thank you,
    Van

    what you need is the example for digital input.
    at high enough speed and enough samples to see the voltage swing.
    the output of the waveformgen should be between 0 and 0.4 volt to see a zero and above 1.8 volt to see a 1.
    normally on a scope you see plus and minus but here you have ttl like inputs.
    greetings from the Netherlands

  • Measuring Amplitudes of 3 Mixed/Staggered Phase Square Waves

    I'm writing a vi intended to measure the amplitudes of three mixed signals.  These signals are generated by the DAQ already to drive 3 LEDs at 9kHz/ 50% DC combined. 
    I was able to modify an existing example vi to create the LED drive.  I was hoping to find a similar example for the data capture and analysis.  I haven't been successful thus far. 
    Could someone please suggest a good example to get me started?  Please forgive my inexperience as I have been teaching myself Lab View and thus have a very ignorant instructor.
    -Thanks in advance.

    Bad,
    Have you tried the analog data acquisition examples? The sample rate would need to be >18 kHz to meet the Nyquist criterion, but that assumes sinusoidal signals. Since you are talking square waves, you will need to sample quite a bit faster to recover the waveforms. 100 kHz or 250 kHz are probably good starting points if your device will sample that fast.
    Tell us what you have tried and specifically what does not work. Do you get error messages? Does the result look wrong?
    Posting you code with the data you have collected is very useful.
    Lynn

  • Why do i get ringing when i am generating Square Wave using PCI 4461 DSA Card

    Hi,
    when i generate square wave form DSA card PCI 4461 i am getting ringing effect as per my observation of waveform generated in CRO.Can anybody tell me why is this effect seen and how can it be rectified and removed from the signal in LabVIEW.
    Regards,
    Sneha

    The analog outputs on the 4461 (and the analog inputs, for that matter) are band-limited by digital lowpass filters. These low-pass filters have a brick-wall response in the frequency domain, which results in Gibbs-phenomenon ringing in the time domain. See this discussion, among others:
    http://en.wikipedia.org/wiki/Gibbs_phenomenon
    The ringing will be excited whenever there is significant signal power near the abrupt band edge, because the abrupt cutoff will result in signal power being located just below an absence of power in the spectrum. Whenever signal power appears in spectral isolation like that, you can expect ringing in the time domain response. Your square wave consists of a series of harmonics at frequencies below, near, and well beyond the digital filter's cutoff. When the digital filter cuts off the higher harmonics, the ringing is created.
    To prevent the ringing, you must create a waveform mathematically that is bandlimited already. The result will be a square wave with slower rise and fall times, but no ringing.
    Hope this helps,
    Ed

Maybe you are looking for