Continuous movement in a loop

  • I am trying to move the robot based on external inputs, which updates a POS, P_offset, which is polled using a timer and updated in an interrupt. Timing of when P_offset gets updated is not critical.

    The main part of the code that moves the robot resides in a REPEAT loop. The robot follows the external input without problems, however it stops between each movement. I initially had:

    However this didn't work. I then tried to add a second pos in there hoping that it'll give the robot enough 'look ahead' to make the movement continuous, but this didn't work either:

    Software is v5.4. Any suggestions would be much appreciated :)

  • Thank you for the suggestion. I tried C_DIS but had an error (can't remember what it is off the top of my head). I will give this a try tomorrow :)

  • Quote

    You can use c_ptp aproximation - c_dis is for LIN moves.

    Since KRC2 V5.5 this no longer is the case. You can use C_DIS in CP (LIN,CIRC) and PTP. Since KRC4 V8.x C_DIS is also the Default for PTP.


  • Fubin,
    in my controler KRC4 I have en error using c_dis in PTP moves.
    I remember that I used it only when I change move (PTP, and next LIN - or vice versa, I.m not sure), but when I used only PTP moves I have error with c_dis aproximation...
    Do You now why?

  • before you can use approximation, you must specify approximation distance.
    $APO.CDIS=100; used with C_DIS
    $APO.CPTP=100; used with C_PTP

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • Have updated the code and unfortunately still doesn't move the way I want it - continuously. I have tried different values of $APO.CPTP (5-100) and nothing worked ???

    Perhaps I am going about this the wrong way?

  • Sensor_Offset is updated in an interrupt that is set to run every 50ms, it's data over DeviceNet. Every interrupt Sensor_Offset is updated:

    DECL POS Sensor_Offset
    Sensor_Offset.X = dir*const

    Where dir is a direction (1 or -1), and const is how much to move by, e.g. 10.

    I have just looked up advance run stop in the KSS 5.2 manual, this is what it says:


    In applications where this advance run stop should be prevented, the command CONTINUE
    must be programmed immediately before the relevant instruction.

    So I'll try that soon and report back. Otherwise is there anything else I might be doing wrong?

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