Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Starting a new move after an interupted trajectory

During a move, I allow the user to interrupt the motion by issuing a stop motion command upon pressing of a command button (VB6 with Flexmotion and PCI 7340). The motion stops, but of course the target position is not reached because the user has interrupted the trajectory. If the user then initiates a new move, with a new relative target position, the motor goes to the previous target position first as if to finish the interrupted move off, before then going to the new target position. How can I stop a move before the motion is complete, such that the interrupted position is the reference for the next relative move. Any suggestions appreciated.
0 Kudos
Message 1 of 5
(3,687 Views)
If you load a new target position and send the start command, the axis shouldn't go to the old target position. Could you please provide a code snippet with the relevant function calls? Which version of NI-Motion are you using?

Kind regards,

Jochen Klier
National Instruments
0 Kudos
Message 2 of 5
(3,677 Views)
Many thanks for your prompt response. Starting at zero counts, you set a relative target position X1. The stage moves x before a stop motion is called by user. The motor stops short of the target position X1-x (as expected). The intention is now for the user to move a new move Y counts starting from the present position X1-x. But, when user set a second (relative) target Y counts, this is added on to the previous target X1, not the present position X1-x. When a Start Motion is then issued, the motor goes to the addition of X1 + Y instead of going to (X1-x)+Y. By altering the target position to account for this, I am able to work around the problem. Many thanks
0 Kudos
Message 3 of 5
(3,669 Views)

For the benefit of other readers, most of the problems I describe above have arisen because I used a KILL_STOP. A KILL does not clear the following error, and it doesn't clear the previously loaded target position. It appears that a HALT_STOP does clear the target register to zero, and also clears the prevailing following error, but leaves the motor energized and servoing. I thus ended up using a HALT (to clear the target and following error) followed by a KILL since my application requires the motors to be turned off after movement has completed. It sure would be nice if the on line documentation help had more of this type of detail in it, or perhaps I just missed it.

Tony Cripps

0 Kudos
Message 4 of 5
(3,653 Views)
Hi chips100,
It can be easy to get the stopping types mixed up. I've found a few places you can find the differences between a halt, kill, and decelerate so that whichever source is easiest to look it up in, you'll get the information you need:

1) In the NI-Motion VI Help documentation, the differences between the different stop types can be found under NI-Motion VI Help » Start & Stop Motion VIs » Stop Motion.

2) In the more general NI-Motion Help (which also contains the Ni-Motion VI Help), the C-based commands for the axis can be found under NI-Motion Function Help » Start & Stop Motion » flex_stop_motion , though it does not explain the stop types as thoroughly.

3) The same information can be found in the Developer Zone Tutorial called Stopping Modes
0 Kudos
Message 5 of 5
(3,644 Views)