04-04-2020 11:05 AM
Hi,
Some good idea how to made virtual digital Q-meter which can view damped oscillations in graph?
I think i need to use input values from this formula: u(t) = A*exp(-gamma*t)*sin*(ω*t+phase).
Thanks
Solved! Go to Solution.
04-04-2020 11:23 AM
Hi Feedy,
what have you tried so far? Where are you stuck?
LabVIEW comes with a lot of math functions, including sin() and exp(). So all you need is to create an array of "t" values and apply your formula with your constants A, gamma, omega and phase). Math is easy as all basic math functions support polymorphism to handle arrays directly: you don't even need a loop to calculate u(t)!
04-04-2020 11:39 AM
I don’t have many favors with this program (this is the biggest problem i think).
I got stuck at the beginning. I don't know how to make a graph out of so many variables.
04-04-2020 12:20 PM
Start with a ramp of times (ID array [t]) and graph it. It should be a straight line that starts at zero and goes up.
Create controls for all parameters (A, gamma, w, phase). Place a graph.
Now modify it with one parameter at a time and graph each internedate result::
First, multiply the time ramp with "-gamma" (no loop needed) and take "e" to the power of it. If gamma is positive (and -gamma thus negative), you'll now get a curve that starts at one and decreases exponentially. Adjust gamma so it goes down smoothly over the graph range,( i.e. not drop instantly or remain nearly constant).
Now add "A" which you use to multiply the resulting array from above. If A=1, nothing would change, but for other A, the data will scale accordingly.
Now multiply the [t] with w, add the phase, and take the sine. Multiply that with the result from above.
Graph it again, and voila! 😄
Now place everything in a while loop, add a small wait, add a stop button and run it again. At this time you can play with the parameters and see in immediately how the output changes.
04-04-2020 12:58 PM
Thanks a lot, but I still dont know how to correctly create a graph for this.
I attached what i created.
04-04-2020 03:11 PM
Please do not maximize the front panel and diagram to the screen! This makes it difficult, because you cannot see both and you cannot see the help windows (which you need!) at the same time.
To create a time ramp, use ramp pattern, not a simple array control. Define start and end times and the number of desired points. There is also a function to negate. No need for anything blue.
04-05-2020 04:30 AM
Thank you,
I think it works. Do you think that's right?
04-05-2020 11:00 AM - edited 04-05-2020 11:13 AM
@Feedy wrote:
I think it works. Do you think that's right?
Congratulations! I am sure you learned a lot.
Yes, it works, but there are a few flaws that have nothing to do with the algorithm, but are good habits to learn.
here's ow it could look like.