LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Polar Plot: Enquiry on Degree/Magnitude

polar plot.png

 

 

polar plot2.png

 

Hello, I'm currently using the polar plot.vi to create an polarization ellipse on my acquisiton analysis.

 

My team and I are now stuck on the part where the 'Degree and Magnitude' connection is concerned.

 

As you can see from the screenshot, we're not connected to anything to the element, because we don't know what is to be connected.

 

What we want to get is the maximum value from our acquisition, and maximum value will also be reflected on the ellipse, and to get a certain angle.

 

With the maximum value for e.g Tmax, i should get an angle for e.g ANGLEmax.

 

However, it is not what we're getting and we really need help in this approach.

 

Your response/tips/advice are greatly appreciated.

 

P.S: I did not upload my VI, as this is a school project, and I'd think I rather have tips than direct answers.

 

Cheers,

 

Potato ~

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0 Kudos
Message 1 of 12
(5,644 Views)
hi
0 Kudos
Message 2 of 12
(5,637 Views)

Also, we want to figure out how to get the X value from the XY graph, when the Y value is for example, 5.

0 Kudos
Message 3 of 12
(5,627 Views)

@ThePotatoMan wrote:

 

As you can see from the screenshot, we're not connected to anything to the element, because we don't know what is to be connected.

 

 


Not wishing to sound awkward, but if you don't know what is to be connected the rest of us don't have much chance! Smiley Wink

 

From what you're saying, you want the angle that corresponds to the Maximum value.

So... take a step back and think what that means... you're keeping track of the maximum value by looking at how the most recent value compares with a previous max value. With me so far?

If the value is greater than the previous max you keep it. So, all you need to do is pop in another shift register which keeps the most recent angle IF the new value is greater than previous max values. IF it isn't, then keep the angle associated with the previous max value. The code will not look a million miles away from what you already have.

(not sure how clear that explanation is... ask if it doesn't make sense)

 

Now, this still won't solve your problem - what you will get out at the end is a single 'maxiumum value' and a single angle. This will give you a graph with one data point, which isn't going to be the polarisation ellipse you're after (referencing previous threads) as one data point is just that... one data point. Are you trying to plot an ellipse, then highlight a single data point on it? Or are you trying to make the graph update continuously such that you can watch the single data point rotate about the origin?

So again, try and write yourself a simple set of steps that breakdown your end-goal into simple steps - pretend I'm a total idiot (not hard!) that is trying to do your work for you (I'm not!) and write me instructions. If any one instruction is more than a line or two, break it down even further.  That ought to help you work out how to get where you're aiming.

 

It would also help you to spend a bit of time tidying your code

1) Try to make sure wires only run from left to right

2) Minimise how often wires cross each other and try to minimise unnecessary kinks and wiggles.

 

You'll find that doing this makes it easier to understand your code, it'll help you keep your thoughts in order as to what you're doing and will also save time when you want to modify the code.

 

Sorry - overly long post! Smiley Sad

Ian

0 Kudos
Message 4 of 12
(5,626 Views)

1. "Or are you trying to make the graph update continuously such that you can watch the single data point rotate about the origin?"

 

ellipse.png

 

It should be like a rotation of 360 degrees, similar to the red circular.

 

2. From the XY graph, I want to get the value of X, at this specific value of Y.

 

Because now, I want to get the maximum value of Y, at the specific angle.

 

 

0 Kudos
Message 5 of 12
(5,622 Views)

You mean like this (also see attached) ? (I simply simulated your data, as you didn't attach any at my previous suggestion, so it looks a bit wobbly!). Either way, you probably won't get a tidy ellipse becuase your xy graph data is not consistent with an ellipse.

polar_FP.png

 

As far as selecting a value of x and getting y - use the arrays of data and look at using index array (possibly combined with search 1D array).

 

Its starting to feel like you're asking the same question over and over in different threads.... is this the same question again? If it is, keep it in one thread this time!

 

 

0 Kudos
Message 6 of 12
(5,613 Views)

We tried running your VI and it is working except the plotting of the polar plot. When we changed the values in the array, the XY graph changes accordingly but the polar plot did not show any changes. We tried changing the colour of the grid colour and plot colour and also it did not change.

Here is the screnshot for your reference.

 

 

 

screenshot.png

 

 

 We also tried integrating your VI, with our own VI, but we don't quite understand the array.

 

0 Kudos
Message 7 of 12
(5,600 Views)

Works fine for me!  Not sure whats going on there then. Are you making changes prior to running the code?

polar_FP.png

 

 

As for the array part - as we discussed earlier and in previous threads, you need to understand the distinction between arrays and scalars. A single point won't give you a curve... you need to build up an array of single points which can all be plotted together.

Can you be specific as to what you don't understand?

 

Ian

0 Kudos
Message 8 of 12
(5,584 Views)

polar3.png

 

We tried running the polar.vi that you've attached, but as seen above, the data did not exit out to the Polar Plot Indicator(Blue).

 

What are the possible problems ?

 

 

0 Kudos
Message 9 of 12
(5,579 Views)

Ignore the previous post about the polar plot. The problem has been solved.

 

For the arrays, how do we automatically pass in all the data into the arrays instead of manually entering the data one by one as what you did in your VI?

0 Kudos
Message 10 of 12
(5,573 Views)