Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Don't unserstand this motion control program

I had a motor control program as attached. I just don't understand how it stops the motor. Once the motor reached the relative position set in the front panel, the motor stop running, but the program still running in the while loop and the item "move complete" of read per axis status.flx, limit switch, motor off and follow error all are still False. Why does the motor stop running?
0 Kudos
Message 1 of 4
(3,441 Views)
To whom it may concern:

I just wanted to let you know that I've gone ahead and run your snippet of code and it appears to be running just fine. The "move complete" status goes true as soon as the destination is reached. The only thing I could suggest for you to try would be to check which version of the Motion driver you have. The most recent version of the driver that we have available on the web is 6.1.2. These are available at http://digital.ni.com/softlib.nsf/webcategories/85256410006C055586256BB9002C16DF?opendocument&node=132070_US.

Best of luck in getting this up and going...

Jim Laudie
Applications Engineer, National Instruments
0 Kudos
Message 2 of 4
(3,441 Views)
Thanks Jim.

The version of the driver which I am using is the latest one. And the motor works fine. But I just don't understand how it works.

Once the position reached the given one, the motor stopped, but I debugged the "Move Complete" status was still False, and if the program running in while loop, it doesn't flow to "stop" function, how does the motor stop?

Thanks
0 Kudos
Message 3 of 4
(3,441 Views)
Hello,

As Jim mentioned, the program does behave as expected with the current driver version. When I run the VI, the motor stops when the position is reached. This is expected behavior. Also, I noted that the "Move Complete" status does become True on my system, causing the while-loop to exit.

The "stop" function after the while-loop will only stop the motor if the loop exits while the motor is still running (for example, if an error occurs or the stop button is pressed before the position is reached). Otherwise, the stop is more-or-less ignored (since the motor has already stopped).

If the while-loop still does not exit on your system ("Move Complete" never becomes True), then you might want to look at the move complete criteria that you
have set up in Measurement and Automation Explorer (MAX). These settings can be found in the "Trajectory Settings" folder on the "Move Complete Criteria" tab. For my system, none of the criteria are checked. This means that "Move Complete" will only be True if the profile is complete. This is the default setting, and I would recommend testing it this way.

If this still does not work, let me know the versions of the software you are using (FlexMotion and LabVIEW) as well as the axis settings you are using, and I will investigate the issue further.

Best Regards,

Jesse D.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,441 Views)