Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

control frequency and number of cycles

I am trying to use a stepper motor and a motion controller to control a push rod. The push rod will fatigue sutures that are attached to a valve. My question is if there are any sample codes in labview that will help me control the frequency and the number of cycles. I will also have a load cell to give me a force profile.
0 Kudos
Message 1 of 4
(3,131 Views)
Hello,

Have you looked at the Motion shipping examples for LabVIEW? There is a particular example, One-Axis Move (Accel - Max Velocity - Decel).vi, which is located at:

C:\Program Files\National Instruments\LabVIEW 7.1\examples\Motion\FlexMotion\One Axis.llb

This example allows you to control the acceleration, deceleration, velocity, and target position (in counts) of the movement. There are a number of other shipping examples located in the C:\Program Files\National Instruments\LabVIEW 7.1\examples\Motion\FlexMotion directory that may be of additional assistance in developing your code. I would suggest starting with the One-Axis Move example first, though.

Take a look at that example and let me know if you have any additional questions on this issue.

Regards,
Scott R.
Applications Engineering
National Instruments
Scott Romine
Course Development Engineer
National Instruments
Message 2 of 4
(3,125 Views)
Thank you very much for the information.

After looking over the sample code (some of which didn't come up since the subVIs were from the flexmotion library which I dont have with my trial version) I was able to understand most of what was going on. One question I still have is how do I make this more of a continuous loop since the sample code would make me pick the target position each time and my goal is to run millions of cycles at a time without stopping.

any help would be greatly appreciated. Thanks,


robert
0 Kudos
Message 3 of 4
(3,109 Views)
Robert,

You could try encapsulating the bulk of the code in a for loop and build an array of target positions that you pass into the loop. If you enable auto-indexing for the loop, then you would be able to iterate through the entire array, passing one value per iteration of the loop. The loop will then execute a number of times equal to the size of your array. This would allow you to develop a large list of positions that you could iterate through.

Try implementing this method in your code and let me know if you have any additional questions.

Regards,
Scott R.
Applications Engineer
National Instruments
Scott Romine
Course Development Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,093 Views)