Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I load velocity real time?

Solved!
Go to solution

If you see a lot of noise in a velocity plot, this is typically not caused by real physical oscillations of the axis' velocity but by the way the board measures the velocity. To measure the velocity basically the board counts the encoder counts per PID cycle and divides the value through the PID cycle time. As the PID cycle is pretty fast, especially at low velocity values you might see significant noise caused by this math.

 

E. g. if your axis travels with 4.5 counts/PID cycle period, the value jumps between 4 and 5, which looks like a 25% velocity oscillation in a velocity plot even though the axis moves perfectly smooth.

 

With this said, the real velocity measurement algorithm on NI motion control boards is a bit more sophisticated and it provides a filter to improve the accuracy of the velocity measurements. In LabVIEW you can use "Load Velocity Filter Parameter" to adjust the operation of this filter to your needs. The filter should help you to get better results, but due to the discrete nature of the position feedback it won't resolve the issue completely.

 

Kind regards,

Jochen Klier

National Instruments

Message 11 of 20
(2,095 Views)

Jochen,

I'm going to try "Load Velocity Filter Parameter". And see what it happens.

One more question, how can we caculate the time elapsed in motion loop?

Thank you!

Guangli

0 Kudos
Message 12 of 20
(2,072 Views)

Hi, Jochen,

One more question again. I also want to feedback the velocity of braiding point to motion loop. As it was shown in previous screenshot, I will use (previous position minus current position) divid by elapsed time. Shall I use for loop and formula? I'm not sure how to use it in LV. Can you give me some clue or example?

Thank you very much!

Guangli

0 Kudos
Message 13 of 20
(2,069 Views)

Also, velocity feedback is like position feedback before in realtime. So, it will output one value every time.

Thank you!

0 Kudos
Message 14 of 20
(2,067 Views)

Guangli,

 

unfortunately I have some problems in understanding your questions, but I'll do my best to answer them:

 

How can we caculate the time elapsed in motion loop?

The onboard timing of the PID loop is always stable and you can set the cycle time in MAX. If you are referrring to the timing of the LabVIEW loop, you could use a timed loop, which provides more advanced timing features and information about loop cycle times.

 

As it was shown in previous screenshot, I will use (previous position minus current position) divid by elapsed time. Shall I use for loop and formula? I'm not sure how to use it in LV. Can you give me some clue or example?

As I don't know your application, I can't give you detailed advice here. The usage of formula nodes is always recommended if your math involves more than 2 or 3 calculations. In such cases formula nodes make the code more readable.

 

Also, velocity feedback is like position feedback before in realtime. So, it will output one value every time. 

Is this a question?

 

Regards,

Jochen

 

0 Kudos
Message 15 of 20
(2,055 Views)

Jochen wrote:

Guangli,

 

unfortunately I have some problems in understanding your questions, but I'll do my best to answer them:

 

How can we caculate the time elapsed in motion loop?

The onboard timing of the PID loop is always stable and you can set the cycle time in MAX. If you are referrring to the timing of the LabVIEW loop, you could use a timed loop, which provides more advanced timing features and information about loop cycle times.

A: I mean the time code running costed. Can I set some vis to get the time?  I will check the cycle time in MAX, too.

As it was shown in previous screenshot, I will use (previous position minus current position) divid by elapsed time. Shall I use for loop and formula? I'm not sure how to use it in LV. Can you give me some clue or example?

As I don't know your application, I can't give you detailed advice here. The usage of formula nodes is always recommended if your math involves more than 2 or 3 calculations. In such cases formula nodes make the code more readable.

A: Don't worry about this one.

Also, velocity feedback is like position feedback before in realtime. So, it will output one value every time. 

Is this a question?

A: That's the condition of code running.

 

Just help me first question. 

Thank you very much!

 

 

0 Kudos
Message 16 of 20
(2,052 Views)

Hi Guangli,

 

I'm sorry but we have a little communication issue here. I really don't understand exactly what you are looking for. Do you want to measure the execution time of your code inside a loop? This can be done by taking a time stamp (e. g. with "Tick Count (ms)") before and after the execution of the code in your loop and substract the values. As already said, the timed loop provides this information by itself. By the way, timing loops is mandatory. Loops without timing typically consume100% of CPU power and may result in unwanted behavior.

 

The cycle time in MAX is the onboard cycle time of the PID loop. There is no link between this cycle time and the code execution time in LabVIEW.

 

Jochen

0 Kudos
Message 17 of 20
(2,041 Views)

Hey, Jochen,

I truly want to execution time of my code inside a loop. I will try time stamp.

For my code, I also have image processing loop, which is faster than Motion loop. So I want execute my code as soon as possible. That's why I want to fine what's the execution time exactly.

Thank you!

Guangli

0 Kudos
Message 18 of 20
(2,035 Views)

Hey, Jochen,

 

One more question. Do I need to add the electronic gear in my code if I have gear train in my experiment?

Thks!

Guangli

0 Kudos
Message 19 of 20
(2,030 Views)

Hi Guangli

 

with electronic gearing you can synchronize multiple axes or you can synchronize axes to moving parts that are equipped with a quadrature encoder. Electronic gearing has nothing to do with a physical gear train. You can find more information about electronic in the NI-Motion manual.

 

Regards,

Jochen

0 Kudos
Message 20 of 20
(2,008 Views)