LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Smoothing the output .CSV file to Stepper Motor

Did I do this correct? It works!

 

screenshot_1990.jpg

0 Kudos
Message 11 of 33
(1,536 Views)

Yes.  That is fine.  If you close the COM port inside the FOR loop, the connection has to be re-established on the next iteration, which takes time.  Does this smooth out the motion?

aputman
0 Kudos
Message 12 of 33
(1,534 Views)

I can't test it for another three hours.

 

So excited.

 

Quite a few people out there have helped make this better.

 

Very grateful! 

 

Big thanks!

0 Kudos
Message 13 of 33
(1,531 Views)

If that is the case with the port. Why is everything else controlling the motor in the loop?

0 Kudos
Message 14 of 33
(1,528 Views)

This works too, I can see it is faster!

 

The other two problems here are:

 

1) The whole thing loops, I get this:

 

screenshot_1992.jpg

 

2) I can't clear the graph without restarting it.

0 Kudos
Message 15 of 33
(1,521 Views)

I'm not sure what you are wanting to do with your loops.  You have a large, outer while loop that is going to repeat until you press the stop button.  So if you don't want it to execute more than once, remove the while loop. You'll probably benefit greatly by using a state machine architecture.

aputman
0 Kudos
Message 16 of 33
(1,516 Views)

1) Remove your outer loop or place the actions within a case or event structure to avoid re-running.

2) The csv file is read every loop and is then added to your Maya graph.  You probably only want to read the input file once and it should therefore be outside of your loop. 

 

Also, not sure other than hearing the stepper move that you are verifying that the stepper is following your curve.

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 17 of 33
(1,510 Views)

Hello and good morning All,

 

Thank you all for the help yesterday. I rushed home and tested the rig and today I have the results.

 

Here is the info:

 

This was my original .VI

 

screenshot_1981.jpg

 

This is the much improved (with help) .VI

 

screenshot_1995.jpg

 

This is a video of the results. The motor is still not as smooth as I would like.

 

https://youtu.be/FdPWCYA6Sbk

 

I have attached the .VI and .CSV files.

 

Maybe it is the way the motor works? I will attach a doc on the motor, just in case anyone is really interested in this project and could use it.

 

I feel this is possible because other sliders work smoothly.

 

I hope you Guys can help and don't mind my posts.

 

Many thanks,

 

Mike

 

 

 

 

0 Kudos
Message 18 of 33
(1,492 Views)

You have an error in the video, is the Com port correct? You'll probably need a small wait in the Move-loop, or do you want it to control as fast as possible? I'd assume it should be timed with the movie, so 40ms wait (25 fps) or 33ms (~30fps)

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 19 of 33
(1,485 Views)

Hi Yamaeda,

 

Thank you for jumping in again, it is great! 

 

I'm not fully understanding, just yet. That said, the information sounds correct.

 

Your info: 40ms wait (25 fps) or 33ms (~30fps) sounds very good to me and makes sense. I think the problem is all in the timing. Am I missing something here?

 

The answer to your question: I put the Com port where it is, after another suggestion.

 

When you say an error in the video, do you mean the YouTube video or the .VI?

 

I am not yet sure how to do what you suggest I have to learn before doing.

 

Other suggestions from the blog I'm trying to learn/implement and test:

 

1) You'll probably benefit greatly by using a state machine architecture

 

2) Fix this: BTW: your charts are set for only 1 significant digit in the time axis

 

3)  In your final FOR loop, how are you controlling update time for stepping? The number of steps needs to occur at constant intervals.

of steps needs to occur at constant intervals

 

4) It seems the export from Maya is to blame, you get the exact same result if drawn in Excel. Of course, this graph assumes a fixed distance between each Y-value, if it's somehow optimized by dynamic X-size you'll need that exported also.

 

0 Kudos
Message 20 of 33
(1,482 Views)