Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Premature move-complete indication

We are having sporadic problems with Flex-motion software and the 7334 motion board. The problem is that we are unable to reliably determine when a commanded motion is complete.

Currently we use flex_start() to begin a move in a stepper motor. Then we monitor the axis status by calling flex_read_axis_status_rtn() periodically. When the returned axis status has bit 1 set, then we declare the motion to have ended normally. Most of the time this works. But we have found cases where flex_read_axis_status_rtn() indicates bit 1 of the axis status is set, even though the move has barely started. This failure happens with greater frequency when the axis in question has been configured for a lower acceleration. It is my belief that the axi
s status may sometimes remain set at its old value during the acceleration phase of a move, the old value having been set by the completion of the previous move.

What is the correct method to detect the normal completion of a move? I have examined the various bit definitions of axisStatus in the documention of flex_read_axis_status_rtn(), and it is not clear which combination of these bits uniquely defines the time from immediately after flex_start() is called until the move completes normally.
0 Kudos
Message 1 of 2
(2,963 Views)
Thank you for contacting National Instruments. Generally the way most applications will check to see if a move is complete is by calling one of the following check move complete function:

flex_read_mcs_rtn(u8 boardID, u16* moveCompleteStatus);

flex_check_move_complete_status(boardID, axis, 0, &moveComplete);

These functions will check to see if the function is still moving or if it has stopped. These functions should check to see if the motor is moving at all, regardless of what part of the velocity profile it is in, so that you can accurately determine when the motor has stopped. These functions are discussed in much more detail in the NI-Motion Function Help.

Also, if you have not already seen them, then there are a number of examples that are include
d with the NI-Motion driver. These can be found at ..\National Instruments\NI-Motion\FlexMotion\Examples\C\. One basic example that uses one of these functions is the Sequence of Blended One-Axis Moves.c.

If you are still having problems or if these functions result in the same problems, then check the example programs to see if there are any other major differences in how you are writing the code. Also, feel free to let us know what other questions and problems you may have.

Regards,
Michael
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,963 Views)