05-18-2017 12:20 PM
Did I do this correct? It works!
05-18-2017 12:24 PM
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?
05-18-2017 12:41 PM
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!
05-18-2017 12:45 PM
If that is the case with the port. Why is everything else controlling the motor in the loop?
05-18-2017 01:10 PM
This works too, I can see it is faster!
The other two problems here are:
1) The whole thing loops, I get this:
2) I can't clear the graph without restarting it.
05-18-2017 01:41 PM
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.
05-18-2017 02:00 PM
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.
05-19-2017 03:33 AM
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
This is the much improved (with help) .VI
This is a video of the results. The motor is still not as smooth as I would like.
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
05-19-2017 04:10 AM
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
05-19-2017 04:29 AM
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.