CheckDone() not returning true after move completion
Posted: Wed Feb 07, 2018 9:59 am
Tom,
This is a weird scenario that might be causing some freezing issues we’ve been chasing for some time now on our current KFLOP system.
There are many Move() commands as well as coordinated motion move commands that execute absolute moves and immediately followed by a while loop that waits for the move to complete.
For example:
Move(axis_x,5000);
while(!CheckDone(axis_x))
{ //wait for motion completion}
Using Kmotion to observe the Axis status, we noticed that after a motion command has been executed, the Done flag on the respective axis does not get checked. And since the loop condition never gets met, we’re clearly stuck in the while loop forever. To manually get out of the loop, simply disabling the axis from within Kmotion’s Axis window and re-enabling it allows it to end the while loop since it triggers the Done flag.
In our observation, we’ve finally narrowed it down to points AFTER a motion completes its move (it physically gets to the desired position successfully).
Are there any known cases that might cause the CheckDone() function to not return a value when in fact it is done with the intended motion?
Is the method of the while loop condition the proper way to check for the case?
As a redundant or alternative option to the CheckDone() function, are there any other suggestions to break the loop? Perhaps using absolute position of the encoder feedback to confirm and break? Additionally there are instances of COORDINATED MOTION, and using position checks might be difficult as all 3 axes positions need to constantly be polled and fall between a range.
We’re running 4.34i
Thanks in advance Tom.
This is a weird scenario that might be causing some freezing issues we’ve been chasing for some time now on our current KFLOP system.
There are many Move() commands as well as coordinated motion move commands that execute absolute moves and immediately followed by a while loop that waits for the move to complete.
For example:
Move(axis_x,5000);
while(!CheckDone(axis_x))
{ //wait for motion completion}
Using Kmotion to observe the Axis status, we noticed that after a motion command has been executed, the Done flag on the respective axis does not get checked. And since the loop condition never gets met, we’re clearly stuck in the while loop forever. To manually get out of the loop, simply disabling the axis from within Kmotion’s Axis window and re-enabling it allows it to end the while loop since it triggers the Done flag.
In our observation, we’ve finally narrowed it down to points AFTER a motion completes its move (it physically gets to the desired position successfully).
Are there any known cases that might cause the CheckDone() function to not return a value when in fact it is done with the intended motion?
Is the method of the while loop condition the proper way to check for the case?
As a redundant or alternative option to the CheckDone() function, are there any other suggestions to break the loop? Perhaps using absolute position of the encoder feedback to confirm and break? Additionally there are instances of COORDINATED MOTION, and using position checks might be difficult as all 3 axes positions need to constantly be polled and fall between a range.
We’re running 4.34i
Thanks in advance Tom.