From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Polar Plot - Inputting magnitude and phase from sine curve simulation

Hello everyone,

 

I'm plotting sine curves using the simulate signal express VI. It has inputs for various parameters, such as phase and magnitude.    

    

What I would like to do is show the phase+magnitude of multiple curves in vector form on a polar plot, but I don't know how to bundle the phase+magnitude values from the simulation in order to have the vectors display. 

I basically want the same functionality that the polar plot has when you create a control to make multiple vectors with respective magnitude and phase, except I want to be able to give these parameters to the polar plot from the controls that exist for the sine curve simlation.

 

Picture 1 shows how it automatically is, and Picture 2 shows what I want to bundle to give into the polar plot manually. At the moment, no matter which functions I use, the polar plot VI doesn't want to accept anything except the automatically created control. I'd like to know the correct formatting/function to use to do this manually.

 

Thanks in advance!

 

Josip

 

Download All
0 Kudos
Message 1 of 7
(4,944 Views)

Hi Josip,

 

Picture 2 shows what I want to bundle

And why don't you create that "array of cluster of mag/phase" as descripted in the help window?

You need to create a cluster of a mag/phase pair, then create an array of several of those points!

 

Hint as you use the German LabVIEW version: there also is a German LabVIEW-Forum

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 7
(4,938 Views)

Thank you for asking this question -- I've done lots of polar plots, but never using LabVIEW.  I usually plot points in polar coordinates, so I looked at what LabVIEW has to offer.  I was disappointed to see that the Compass Plot (a curious name -- I've never heard this term before) (seems to) only plot arrows from the origin, not individual points.  The VI that you mention is a picture VI (I suppose that's OK, but I found it curious).

 

I guess that if I really wanted a plot in Polar Coordinates, I could always use an X-Y Graph, writing a sub-VI that would take my rho-theta vectors and turn them into X-Y vectors before plotting.  Of course, I wouldn't get the nice Polar coordinate system ...  I wonder if that is what underlies the LabVIEW picture functions you mention.

 

When you figure out how to solve your problem, please post the solution here, as I'm interested in seeing the result.

 

Bob Schor

0 Kudos
Message 3 of 7
(4,913 Views)

Seems quite straightforward, though perhaps not the most efficient graph drawing code.

 

polar bd.pngpolar fp.png

0 Kudos
Message 4 of 7
(4,884 Views)

Hi!

 

@GerdW:    

    

I tried to create something as according to the context help, but for some reason just didn't come to a solution. Your description helped me to achieve what I wanted, thank you! Picture 1. shows the outcome of the simple task I wanted to achieve, for anyone else facing a similar problem.    

Also I know of the german labview forum, and while I am fluent in german, english is my native language. I prefer to use this forum as it's easier to understand concepts, but I might check out the german forum if I need advice specific to something in german there.

Thanks!

      

@Bob_Schor:

 

The polar plot can plot either arrows or points. The thing about it that I've noticed is that if you have vectors right after each other (i.e.: index 1,2,3,4 etc all have values) then the polar plot ADDS all these lines up. This is bad for me because I want to show them as seperate vectors, starting from the origin. You can also choose to plot the points seperately, which avoids this addition problem but doesn't show them as arrows (The thing to look out for here is the dot size, at the default, smallest size, the dots are invisible. The size needs to be increased)    

    

The way I see to get around this vector addition it seems so fond of doing is by leaving every second vector (mag+phase pair) as 0. No amplitude, no phase. Then each vector is shown as a line from the origin, seperately.    

While looking for a solution I found this thread: http://forums.ni.com/t5/LabVIEW/Polar-Plot/m-p/796173/highlight/true#M363383    

The VI in the last comment is about converting the vector data from Re/Im to r/theta.    

I don't quite understand the entire code used, but I would like to integrate my solution into the VI posted there, maybe using a get array size function to determine the iterations, so that im not limited in the amount of vectors I can show.    

     

I hope this helps somewhat!

 

Josip

0 Kudos
Message 5 of 7
(4,878 Views)

@Stuart:

 

Thanks for the reply, I was in the process of making one myself when you replied.    

That's more or less what I was looking for, just a rudimentary solution, I will work from there.

 

Josip

0 Kudos
Message 6 of 7
(4,873 Views)

Josip,

 

     I don't really understand how a Compass Plot works, but if you want arrows from the origin to each of your points, and you are willing to plot the angle in degrees (Why, NI, are you plotting angles in degrees, instead of radians??), this should do it.  I haven't played around with formatting this plot, but here is a snippet that creates 5 vectors of length 0.2, 0.4, .. 1.0, spaced equally (at 72° spacing around the circle).

Compass Plot.png

Incidently, the Plot Helper and 2D Compass both appeared when I put a Compass Plot (from the Graphing Palette) on my Front Panel.

 

Bob Schor

0 Kudos
Message 7 of 7
(4,855 Views)