Comparing sine and triangle waves
hello everyone,
i'm a student from belgium and i have to program an BLDC motor with labview. for this i need a PWM (pulse width modulated) signal. i want to do this by comparing a sine wave with a triangle wave, theoretically this should give me
block wave with different duty cycle. i have added a picture to make my question more clear.
as you can see there are two triangle waves to compare with the sine wave, every time one of the triangle crosses the sine wave a pulse is generated and stays high untill the next cross.
thanx in advance
Hello,
When i tried to reproduce this problem, I couldn't succeed in it.
While looking at you jpeg I noticed that you have connected something to the channel input of your ddt to waveform convertors. You should remove this (except if this was your intention) and then everything should work.
If this doesnt work, then you can always use the file attached to this post.
Kind Regards,
Thierry C - Applications Engineering Specialist Northern European Region - National Instruments
CLD, CTA
If someone helped you, let them know. Mark as solved and/or give a kudo.
Attachments:
testje.vi 420 KB
Similar Messages
-
Can I generate sine and square waves with NI PCI-MIO-16XE-50 card??
Can I generate sine and square waves with NI PCI-MIO-16XE-50 card??
How Do I generate those signals?Hello;
You certainly can do that. The way to go about that is to use one of the Analog Output channels your board have available.
If you are using Labview to program the board, you can find good examples at Search Examples->I/O Interfaces->Data Acquisition->Analog Output->Multiple Point (buffered) Analog Output.
If you are using other Software language to program the board, you can fing examples at C:\Program Files\National Instruments\NI-DAQ\example\VisualC\AO.
Hope this helps.
Filipe -
What is the difference between triangle wave, triangle waveform, and triangle pattern
For generating a triangle waveform, I have 3 vi's that I could use. Signal Processing -> Signal Generation -> Triangle wave.vi, Signal Processing -> Signal Generation -> Triangle Pattern.vi, Programming -> Waveform -> Analog waveform -> Waveform generation -> Triangle waveform.vi.
What is the basic difference between these 3. I understand that all 3 have a different input set and I can use them according to what combination of input data I have. Is there any specific case for which each of them is used?
Solved!
Go to Solution.so, does this mean that I can not use triangle wave and triangle pattern to generate an actual waveform. Why I am asking is because I tried checking the waveform on an oscilloscope. The waveform generated by triangle waveform.vi is visible on the oscilloscope but not the one generated by triangle pattern and triangle wave.
the attached vi CreateWaveformTest.vi does show up correctly on the oscilloscope.
The other vi, createparttern test.vi shows up correct in the waveform graph but I am not abe to see it on the oscilloscope. comes up as a straight line
Attachments:
CreateWaveformTest.vi 58 KB
CreatePatternTest.vi 71 KB -
Why does my ouput signal produce triangle waves when i want sine waves
in labview i use daq assistant to create a output voltage signal to create a sine wave. when i connect it to the opscilloscope it reads triangle waves. can someone please tell me why this is.
Solved!
Go to Solution.9172 is a chassis so I would need to know the module you are using, too. You should try the example:
%PROGRAMFILES%\National Instruments\LabVIEW 2012\examples\DAQmx\Analog Output\Voltage - Continuous Output.vi
It shows you how to create a waveform to generate, you could use that piece and feed it into your daq assistant. -
FFT on triangular and square waves.
Hi,
I have been computing FFTs on a some sinusoidal waves and have been doing fine, gett the right Y axis values in the units Vrms^2. For example a 10V amplitude (20v peak to peak) wave at 100 htz would give a peak at 100 htz and 49Vrms^2 since the RMS value fo 10 is 7 and 7^2 is 49. Now when I input a Square wave with the same characteristics I no longer get the same scaling instead getting a peak at a higher y value. With a triangular wave I get peaks at lower values. Can anyone explain to me why this is happening?
Thanks.
Intern NSWCCD Carderock.Actually RMS (Root Mean Square) value of periodic signal f(t) is defined as a square root of squared signal averaged over the period T, mathematically:
f_rms = sqrt ( aver (f^2) ),
where aver (f^2) = [integral of f^2 over the period T] / T
It is easy to show that for pure sine wave f(t) = A*sin(2*pi*t / T), f_rms = A / sqrt(2) ~ 0.707*A – this is well-known result anyone can find in almost every textbook. It is not difficult to calculate exact value of f_rms for square and triangular waves. Results are as follows:
f_rms (square) = A, where square wave f(t) = A, if 0<t<c*T and f(t) = -A, if c*T<t<T (here 0<c<1 and c=0.5 for 50% duty cycle wave)
and
f_rms (triangle) = A / srqt(3) ~ 0.577*A, where I assumed triangle wave that raises from 0 to +A over 0 < t <T/4, goes down to –A over T/4 < t < 3T/4 and returns to ZERO in the last quarter of the period T
Parseval’s theorem (http://en.wikipedia.org/wiki/Parseval's_theorem) of Fourier analysis states that energy of periodic signal (=integral of f^2 over the period T) must equal to energy of its Fourier transform ( sum of squared amplitude of all harmonics for periodic signal). That’s why Fourier analysis in Labview is capable of producing signal’s RMS value in addition to its spectrum.
Now, main harmonic of square and triangular waves carries majority of signal energy, but not all of it because of presence of other harmonics. That means that amplitude of main harmonic as reported by Labview will be close to but slightly less than signal’s RMS value. This explains the results you reported in your very first post. -
How to measure the slope of a triangle wave
Hi everyone,
I'm looking for a way to measure the slope of a triangle wave, which changes every half cycle of the wave. I have the triangle wave out of phase by 90 degrees so that it models the behavior of a cosine wave, and essentially all I want is a way to measure whether the slope is positive or negative. The idea is to use this information to stop another signal running at the same time at the halfway point of the cycle of the first signal, so the first wave can continue back to it's starting point and the second will start again at the completion of the first wave (as it begins the second cycle)
I'm using LabVEIW 8.2.1 if it makes a difference
Thanks,
Ben
PS. Is there a way to close threads you've previously posted on this forum? I started one yesterday (or possibly the day before) with a fairly vague question in it and it's now redundant after I made some headway on my own, and I don't want to clog the forums upI'm not sure how you're using this data to control anything, so I'm not sure what the best implementation would be. You will not be able to get any data out of the loop until it finishes (gets a True value at the Stop If True terminal (sort of)), so if you want to have the loop running constantly, you need to put your control code in the loop with the generated data. Otherwise, you could generate your boolean array, and then wire it and your control array into a for loop, and do a point by point comparison to see if you should be controlling.
The new example.vi has two examples to give you a rough idea what I'm talking about.
Message Edited by JeffOverton on 06-12-2008 12:19 PM
=============
XP SP2, LV 8.2
CLAD
Attachments:
Example2.vi 18 KB -
How to apply single sine or square wave
Now I used NI-FGEN and NI-Scope for bender element test, I want to now how to generate single sine or square wave (normally in NI-FGEN, I saw only continuous wave generation type).thanks you so much
If I understand your question correctly, it sounds like you would like to output one period of a sine wave or square wave and then just 0V DC. To do this you can use the niFgen_Basic_Arb_Sequence_Example. You will want your first sequence to be a sine (or square) wave and then the second sequence to be DC with an amplitude of 0V. You could replace the while loop in that example with a sequence structure with a wait in the structure to last just a bit longer than your sine wave. This will ensure that your sequence doesn't repeat.
I hope this helps answer your question.
Regards,
Doug K.
Application Engineering
National Instruments -
Creating a customised triangle wave
Hello,
We are using Labview to create a signal to control the motion of a scanning galvo. We would like to create a triangle wave so that the galvo scans back-and-forth uniformly, but to ensure smooth changes in momentum, we need the "corners" of the triangle wave to be slightly rounded. What would be the best function to use to accomplish this?
I am using LabView 8.
Thank you,
MoorHi Moor,
You can create a triangle wave by use the triangle waveform.vi. LabVIEW has a lot of options to create triangle waves. Searching LabVIEW for triangle wave will give you all your options for it. Smoothing out the corners can be done by using a waveform graph property node and selecting the smooth update. Here is a link to a kb that contains information to waveform property nodes. Here is also a link to another discussion forum who discusses on how to smooth waveforms.
I hope this helps!
Warm regards,
Karunya R
National Instruments
Applications Engineer -
How to compare date and time together
Hi,
How to compare Date and Time together?
For example in a database table there are two fields rundate and runtime. I want to compare these two with perticular date and time in the program. Like, I want to pull all the records where the records's date and time are less than a perticular date and time in the program.
Hope the question is clear...
Thanks.
KavitaHi Kavita
There is no as such Date and Time Comparision FM in Standard SAP But You can define your own like this
<b>FUNCTION ZAV4_COMPAREDATETIME.
""Lokale Schnittstelle:
*" IMPORTING
*" REFERENCE(DATE1) TYPE DATS
*" REFERENCE(TIME1) TYPE TIMS
*" REFERENCE(DATE2) TYPE DATS
*" REFERENCE(TIME2) TYPE TIMS
*" EXPORTING
*" VALUE(TWOISMORETOPICAL) TYPE C
twoismoretopical = ''.
if date2 > date1.
twoismoretopical = 'X'.
else.
if date2 = date1 and time2 > time1.
twoismoretopical = 'X'.
endif.
endif.
ENDFUNCTION.</b>
Regards
Mithlesh -
I have IOS 7 5S and using mail. Receiving works great. Sending mail will not work. Using Centurylink. On my IOS 6 Iphone 4 it works great. Compared settings and they are identical. Now what?
Well, this is a recurring issue for many users...a small percentage of users but still a bug. Report the issue here to Apple: www.apple.com/feedback
iOS7.0.3 will be released next week, which as of now, I know is primarily for an iMessage but hopefully it will clear up some of these email issues some are also having. -
How to use base band wave,subcarrier wave and carrier wave to creat the FM wave? When I use the MT Modulate FM VI in USRP,I don't konw how to
use it.https://decibel.ni.com/content/docs/DOC-24206
Let us know if that example doesn't help you
Anthony F.
Product Marketing Engineer
National Instruments -
Function module for comparing dates and times
Hi,
I have a date and time stamp in one filed for example as below:
20070125183045
(the first 8 are date in YYYYMMDD format, the next 6 is time in HHMMSS format). Now I want to compare this value to another such value in terms of date and time. First I want to compare dates and then times. Do you know any function module that can serve this purpose?
Thanks very much!You can compare these using the function module DURATION_DETERMINE. This fuction will give you the difference, and it can be in a view different units, such as the difference in days, months, etc.
Funciton module takes in Start date and time and end date and time.
Regards,
RIch HEilman -
EXS File missing in Logic Pro 9: Unisyncl.wav and Unisynch.wav
Hi to everybody!
I just installed logic pro 9 and this is my first experience with logic.
Using it I noticed that some files are missing. These files are: Unisyncl.wav and Unisynch.wav.
Searching the internet I discovered that those files belong to logic 8 and are located in the folder:
/Library/Application Support/Logic/EXS Factory Samples/05 Synthesizers/04 Sequence Elements/Spectrum Stack 01/UniSyncH.wav
/Library/Application Support/Logic/EXS Factory Samples/Analog Samples/Spectrum SQ/UniSyncH.wav
Please someone can send me them by mail or internet hosting service?
My mail is: [email protected]
Really thanks to allYes, I have them - both samples are in both folders:-
/Library/Application Support/Logic/EXS Factory Samples/05 Synthesizers/04 Sequence Elements/Spectrum Stack 01/UniSyncH.wav
and
/Library/Application Support/Logic/EXS Factory Samples/Analog Samples/Spectrum SQ/UniSyncH.wav
These are on the LP8 content disks but not on the LP9 content disks, strangely enough.
These will be only up for a short time as technically it's Apple content. I'm doing this to help you out as you're probably more than a little frustrated. Please post back when you have downloaded them.
http://dl.dropbox.com/u/4211158/soundies/logic/UniSyncH.wav
http://dl.dropbox.com/u/4211158/soundies/logic/UniSyncL.wav -
Macro to compare CSV and Excel file
Team,
Do we have any macro to compare CSV and Excel file.
1) In Excel we should have two text boxes asking the user to select the files from the path where they have Stored
2) First Text is for CSV file
3) Second Text box is for Excel file
4) We Should have Compare button that should run the Macro and Show the Differences.
Thanks!
KiranHi
Based on my understanding, we need to convert the 2 files into the same format before comparing two different formats files.
Here are the options:
1. Convert the CSV file and Excel file into 2-dim Arrays, then compare them, about how to load a CSV file into VBA array, you can search it from
internet or ask a solution in VBA forum.
VBA forum:
http://social.msdn.microsoft.com/Forums/en-US/home?forum=isvvba
2. Also you can import CSV file to Excel sheet, and then compare them.
Here is the sample code for your reference:
‘import csv file
Sub InputCSV()
Dim Wb As Workbook
Dim Arr
Set Wb = GetObject(Application.GetOpenFilename("csv file,*.csv", , "please choose a csv file", , False))
Arr = Wb.ActiveSheet.Range("A1").CurrentRegion
Wb.Close False
Range("A1").Resize(UBound(Arr), UBound(Arr, 2)) = Arr
End Sub
‘compare sheet
Sub CompareTable()
Dim tem, tem1 As String
Dim text1, text2 As String
Dim i As Integer, hang1 As Long, hang2 As Long, lie As Long, maxhang As Long, maxlie As Long
Sheets("Sheet1").Select
Columns("A:A").Select
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range("A1").Select
Sheets("Sheet2").Select
Rows("1:4").Select
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range("A1").Select
MaxRow = 250
MaxColumn = 40
For hang1 = 2 To maxhang
Dim a As Integer
a = 0
tem = Sheets(1).Cells(hang1, 1)
For hang2 = 1 To maxhang
tem1 = Sheets(2).Cells(hang2, 1)
If tem1 = tem Then
a = 1
Sheets(2).Cells(hang2, 1).Interior.ColorIndex = 6
For lie = 1 To maxlie
text1 = Sheets(1).Cells(hang1, lie)
text2 = Sheets(2).Cells(hang2, lie)
If text1 <> text2 Then
Sheets(2).Cells(hang2, lie).Interior.ColorIndex = 8
End If
Next
End If
Next
If a = 0 Then
Sheets(1).Cells(hang1, 1).Interior.ColorIndex = 5
End If
Next
Hope this will help.
Best Regards
Lan
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Missing uniSyncL.wav and uniSyncL.wav EXS24 "Spectrum Stack 07.exs"
"Spectrum Stack 07.exs"
Missing uniSyncL.wav and uniSyncH.wav EXS24.
I try to reinstall everything two times, but still there missing.
Can any one mail theme to me [email protected]I just found out that ill can find the samples on the early Logic Version 8 content disks. Opened the disk content with "Pacifist" (very nice app) an ripped off the compleet Sample Library and copy it to my HD.
Problem solved.
Maybe you are looking for
-
Hi friends, what is Report Symbols in EHS module? Please help me...
-
My iphone not syncing. the message is "sync failed to start" what do I do?
I'm getting a message that my iphone sync failed to start. what should I do? Thanks
-
Attaching numbers files in an email
I recently switched from PC to iMac and moved all my Excel files. Once I open them, edit, and resave, they become numbers files. When I attempt to attach one of these new numbers files to an email it is grayed out and cannot be attached. Only my old,
-
Note 1023661 doesn't exist in sap service market place
I just configured the SAP discovery server and I am getting the error message mentioned in the Quick Guide (first one under troubleshooting). The solution points me to note 1023661, but it doesn't exist in SAP service market place. Is there another n
-
Hi, I Wish to create a report showing listing all the applications and the departments that use them. I have 2 fields 1 called Departments and the other called Applications. When I generate the report the results show as expected:- Application