LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Realtime graphing

Here's my situation:

I have labview code I am using to control  a stepper motor. I would like to have a realtime graph that shows the position of the stepper motor (whether actual position or calculated position). I will be dealing with very large amounts of data, potentially.  

The motor will be moving in variations of a trapezoidal position profile. Think of it this way: positive slope up to x, hold at x, negative slope down to 0, hold at 0. 



I am thinking that I need to do this in two pieces. I will have a graphing VI that can graph whatever is sent to it in real time, point by point. I will also have a vi that figures out where the next point is based on the user inputs. 

Does anybody have any suggestions as to how I should do this? What kind of graph would be suited best to this application? 

0 Kudos
Message 1 of 8
(2,684 Views)

Hi Arringtonbp,

 

What hardware are you using to control the motor? What kind of position data are you graphing and how are you acquiring that data? Some more details about the specifics of the application will help us to provide you with better suggestions. Thanks!

 

Regards,
Kira T

Message 2 of 8
(2,659 Views)

Hello Kira T,

 

I am using a NI MID 7604 driver to control the motor (with the PCI 7344 card). Right now, the user inputs the relative displacement of the motor (mm) and the rate that the motor will travel (mm/s). I have generated code to move the motor using NI motion assistant, and it works correctly. I am trying to graph the position of the motor in real time alongside the motor. 

It is important to note that this code could be run up to 3 hours at a time. The step size of the motor is 0.00635 mm once you consider that it is doing half steps through the driver.

Please let me know if you need more information! 

0 Kudos
Message 3 of 8
(2,645 Views)
Hi Arringtonbp,

Have you seen the examples that ship with NI Motion?  There are a couple of examples that provide functionality similar to what you are trying to do.  These examples can be found in LabVIEW by selecting Help>>Find Examples... Then from here expanding out Hardware Input and Output>>Motion Control>>NI 73XX.  Two places to look are Application Demo>> Circle Demo.flx and under Capture and Compare  there are many examples such as One-Axis Move with Position Monitor.vi.  Let me know if these get you going in the right direction.

Regards,
Kira T
Message 4 of 8
(2,622 Views)

I will check those examples. Also, is there a way to get position feedback from a stepper motor if you don't have an encoder? Is there such a thing as an internal encoder? If so, how can I tell if I have one of those?

If we could get position feedback, I'm assuming it would be in the form of a waveform, which we could just graph that way. 

0 Kudos
Message 5 of 8
(2,618 Views)

Hi Arringtonbp,

 

You would know if your motor has an encoder because you would see the leads for you to attach the encoder to the drive. The attached VI is an example of 2 different ways that you can read and graph the position with no encoder. The first way is to use the Read Vector Space Position.flx and the second is to use Acquire Trajectory Data.flx and Read Trajectory Data.flx. Both of these are used in the attach example and plotted. They should give the same result. Please let me know if this helps.

 

Regards,
Kira T

Message 6 of 8
(2,593 Views)

Would it be possible to get a version of this file that is compatible with Labview 2010? That is the version that I have available.

0 Kudos
Message 7 of 8
(2,586 Views)

Hi Arringtonbp,

 

I have attached a screenshot of the VI with some notes in it. the basic VI with the Read Vector Space Postion.flx can be found in the example finder under Hardware Input and Output>>Motion Control>>NI 73xx>>Arc Move>>Two-Axis Circle with Position Monitor.vi.

 

Regards,
Kira T

0 Kudos
Message 8 of 8
(2,547 Views)