Changing PTP Velocity in Interrupt routine

  • Hello, I have this simple interrupt routine in which I would like to change robot's velocity.

    I've tried BAS #VEL_PTP or even $VEL.CP variables (which normally work fine for me in PTP/LIN movement) but somehow during interrupt robot ignores this and uses last "remembered" velocity (from movement which was interrupted - for example if it was LIN motion with 0.1 m/s speed robot will move quite slow but if the interrupt was triggered during 100% PTP robot will move with his full speed).


    Tech details:

    Rob: KR60 L45-3, KRC4, KSS 8.3.38


    Here is my code, any idea what I am doing wrong?

  • AD
  • You need to keep in mind the Advance Run Pointer -- it is usually three full motion steps ahead of the Main Run Pointer. This is how the robot is able to perform approximated motions. If you have three points P1, P2, P3, executed consecutively, the BAS call for P3's motion parameters is being carried out while P1's motion is still executing, but P1 is not affected.


    Basically, each motion between the MRP and ARP is "buffered" in the motion planner, with its own specific velocity/accel/frames/approximation/etc. And once buffered, those values cannot be changed.


    Using an interrupt doesn't clear those parameters from the buffer, merely suspends them for the duration of the Interrupt Service Routine.


    You could use RESUME in your ISR, but that would effectively "cancel" the active subroutine, and jump the pointers back to the stack level where the Interrupt was DECL'd.


    You could, perhaps, try manipulating $OV_PRO from the ISR or SPS. Or, in the routine that the RESUME command would jump the pointers back to, use branching logic to detect that the ISR was triggered and "repeat" the interrupted motion, but with different motion parameters.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now