1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. KUKA Robot Forum
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

Stop Spindle at Robot Stop for program error

  • Marco
  • August 4, 2016 at 6:10 PM
  • Thread is Resolved
  • Marco
    Reactions Received
    3
    Trophies
    3
    Posts
    116
    • August 4, 2016 at 6:10 PM
    • #1

    Hi there,
    I generate my milling programs from Sprutcam and sometimes it generates duplicated points or circles with middle point equal to start point (I found how to fix this last). I'm actually developing a little code to check the .src file before loading it to the KRC, however I would like to develop a safety function that stops the spindle whenever to KRC stops the program for an error within the code. At the moment, like in the cases I mentioned before, I get the KRC stopping the motion and enabling brakes, but the spindle keeps running, which is really dangerous. How and where can I set an instruction that switches off the spindle as well if the KRC stops the program? Any help is really welcome.

    This is my SPS:

    Code
    DEF sps( )
      ;FOLD DECLARATIONS
      ;FOLD BASISTECH DECL
      ;Automatik extern
      DECL STATE_T STAT
      DECL MODUS_T MODE
      ;ENDFOLD (BASISTECH DECL)
      ;FOLD USER DECL
      ; Please insert user defined declarations
    
    
    
      ;ENDFOLD (USER DECL)
      ;ENDFOLD (DECLARATIONS)
      ;FOLD INI
      ;FOLD DEFAULT MSG_T 
      $MSG_T={MSG_T: VALID FALSE,RELEASE FALSE,TYP #NOTIFY,MODUL[] " ",KEY[] " ",PARAM_TYP #VALUE,PARAM[] " ",DLG_FORMAT[] " ",ANSWER 0}
      ;ENDFOLD (DEFAULT MSG_T)
      ;FOLD AUTOEXT INIT
      INTERRUPT DECL 91 WHEN $PRO_STATE1==#P_FREE DO RESET_OUT ()
      INTERRUPT ON 91
      $LOOP_MSG[]="                                                            "
      MODE=#SYNC
      $H_POS=$H_POS
      ;Automatik extern
      IF $MODE_OP==#EX THEN
        CWRITE($CMD,STAT,MODE,"RUN /R1/CELL()")
      ENDIF
      ;ENDFOLD (AUTOEXT INIT)
      ;FOLD USER INIT
      ; Please insert user defined initialization commands
      ;REMOTE PENDANT INITIALIZATION
      $OUT[5] = TRUE                ;+24V to pendant
      $OUT[6] = FALSE               ;Resume Pendant LED (white)
      $OUT[7] = FALSE               ;Stop Pendant LED (white)
      $OUT[8] = FALSE               ;Reset Pendant LED (white)
      $OUT[9] = FALSE               ;Communication LED (blue)
      $OUT[17] = TRUE               ;TOOLCHANGER EV A (LOCK)
      $OUT[18] = FALSE              ;TOOLCHANGER EV B (UNLOCK)
    
      ;ENDFOLD (USER INIT)
      ;ENDFOLD (INI)
    
    
      LOOP
         WAIT FOR NOT($POWER_FAIL)
         TORQUE_MONITORING()
    
    
        ;FOLD USER PLC
        ;Make your modifications here
        SC()              ;call custom subprogram
        $OV_PRO = 100-(99*$ANIN[1])  ;Robot override (pot)
    
    
        ;ENDFOLD (USER PLC)
      ENDLOOP
      ;FOLD ;%{H}
      ;FOLD
    END
      ;ENDFOLD
    
    
    
    
    DEF  RESET_OUT ( )
      INT N
      $LOOP_MSG[]="                                                            "
      IF REFLECT_PROG_NR == 1 THEN
        FOR N = 0 TO PGNO_LENGTH - 1
          $OUT[PGNO_FBIT_REFL + N] = FALSE
        ENDFOR
      ENDIF
      IF (PGNO_REQ>0) THEN
        $OUT[PGNO_REQ]=FALSE
      ELSE
        IF (PGNO_REQ<0) THEN
          $OUT[-PGNO_REQ]=TRUE
        ENDIF
      ENDIF
    END
    
    
    ;FOLD USER SUBROUTINE
    ; Integrate your user defined subroutines
    Display More

    and this is my security check sub:

    Code
    DEF SC( ) ; -- This Subrutine is ment to start running from system startup and check all security systems and external sensorsSC
      ;FOLD DECLARATIONS
      ;FOLD USER DECL
      ; Please insert user defined declarations
    
      ;ENDFOLD (USER DECL)
      ;ENDFOLD (DECLARATIONS) ; Declare the variables
    
      ;FOLD INI
      ;FOLD USER INIT
      ; Please insert user defined initialization commands
    
      ;ENDFOLD (USER INIT)
      ;ENDFOLD (INI)
    ;HSD_ALBERO_FERMO=$IN[3]    ;Check if Spindle is running
    
    
    ; RELEASE CONE WHEN HSD_BUTTON IS PRESSED
      IF $IN[4] == TRUE THEN
        PULSE($OUT[1], TRUE, 1)         ;OPEN VALVE
        PULSE($OUT[9], TRUE, 1)         ;COM LED ON
      ENDIF
    
    ; REMOTE PENDANT FUNCTIONS
      IF $IN[9] == TRUE THEN   ;PAUSE BUTTON
        $OUT[7] = TRUE         ;PAUSE LED (RED)
        $OUT[6] = FALSE        ;RESUME LED (GREEN)
        $OUT[10] = FALSE       ;FILEDBUS REFERENCE VALUE ENABLE
      ENDIF
    
      IF $IN[10] == TRUE THEN  ;RESUME BUTTON
        $OUT[7] = FALSE
        $OUT[6] = TRUE
        $OUT[10] = TRUE        ;FIELDBUS REFERENCE VALUE ENABLE
      ENDIF
    
      IF $IN[11] == TRUE THEN            ;RESET BUTTON PRESSED
          PULSE ($OUT[8], TRUE, 3)       ;LED ON
          PULSE ($OUT[11], TRUE, 1)
      ENDIF
    
    ;--TOOLCHANGER CONTROL    
    ;$OUT[17] = TRUE     ;EV A STAY LOCK AT START UP
    ;$OUT[18] = FALSE    ;EV B RELEASE WHEN TRUE
    
    ;-- CHECK IF EMERGENCY BUTTONS ARE HIGH OR LOW AND TAKE ACTIONS
        $OUT[2] = NOT $ALARM_STOP        ;Switch on E-Stop Led
        $OUT[3] = NOT $ALARM_STOP        ;Switch on E-Stop Led (pendant)
    
        IF ($ALARM_STOP==FALSE) THEN ;   !!!When it is false there is an emergency stop breaking the circuit!!!
           HSD_LOGIC_SET = 5
           HSD_SPEED_SET = 0
           WAIT FOR HSD_SPEED_IN < ABS(50)
           HSD_LOGIC_SET = 0
        ENDIF
    
      ;FOLD USER PLC
      ;Make your modifications here
    
        ;ENDFOLD (USER PLC)
      ;FOLD ;%{H};
    END
      ;ENDFOLD
    ;FOLD USER SUBROUTINE
    ;Integrate your user defined subroutines
    
    
      ;ENDFOLD (USER SUBROUTINE)
    Display More

    Kuka KR150-2 KRC2 ed05 V5.6.11<br />VFD TDE Macno<br />Spindle HSD ES915 with Automatic tool changer<br />Sprutcam 11

  • SkyeFire
    Reactions Received
    1,044
    Trophies
    12
    Posts
    9,391
    • August 4, 2016 at 10:47 PM
    • #2

    $PRO_ACT is the system variable that should give you what you want. You could also look at $STOPMESS, $ALARM_STOP, and $PRO_MOVE. But I suspect $PRO_ACT will be what you want.

  • Marco
    Reactions Received
    3
    Trophies
    3
    Posts
    116
    • August 5, 2016 at 9:42 AM
    • #3

    Thanks, I will need a combination of these variables to address several cases actually.

    BTW, scrolling the pages of the System Variables manual I found this $MSG_T.ANSWER and I was hoping it would show the number of the STOP softkey button on the KCP. I could also use this with something like

    Code
    IF ($MSG_T.ANSWER == thenumberoftheKCPstopsoftkey) then
      stop spindle
      bla bla
      bla bla
    endif

    but setting the variable in the single variable monitor it did not show anything while pressing the stop softkey. I tried while a program was running. Did I do something wrong?

    Kuka KR150-2 KRC2 ed05 V5.6.11<br />VFD TDE Macno<br />Spindle HSD ES915 with Automatic tool changer<br />Sprutcam 11

  • SkyeFire
    Reactions Received
    1,044
    Trophies
    12
    Posts
    9,391
    • August 5, 2016 at 2:40 PM
    • #4

    No, that variable only comes into play when your program posts a Dialog Message to the pendant -- the message type that puts a number of option buttons along the bottom row (max 7). $MSG_T.ANSWER just provides the number of the button that the operator pressed.

  • Marco
    Reactions Received
    3
    Trophies
    3
    Posts
    116
    • August 5, 2016 at 6:03 PM
    • #5

    Got it. As the $PRO_ACT shifts from TRUE to FALSE when you press the RUN or STOP softkeys it solves this aspect. That's very useful to link actions to this softkeys.
    :beerchug:

    Kuka KR150-2 KRC2 ed05 V5.6.11<br />VFD TDE Macno<br />Spindle HSD ES915 with Automatic tool changer<br />Sprutcam 11

  • robot-cnc
    Reactions Received
    10
    Trophies
    4
    Posts
    414
    • July 8, 2017 at 2:52 PM
    • #6

    Hi Marco !

    I am interested how you solved error in program code when middle point equal to start point.
    I met same issue and the robot stop at that error.

    Thank you.

  • Marco
    Reactions Received
    3
    Trophies
    3
    Posts
    116
    • July 8, 2017 at 3:13 PM
    • #7

    If you program your paths with Sprutcam you have to tune the tolerance setting. Very little values (i.e. 0.001) produce this problem. I solved the issue with 0.025. Otherwise you can avoid arcs, but then your programs files might become too large and you could run into memory issues.

    Kuka KR150-2 KRC2 ed05 V5.6.11<br />VFD TDE Macno<br />Spindle HSD ES915 with Automatic tool changer<br />Sprutcam 11

  • robot-cnc
    Reactions Received
    10
    Trophies
    4
    Posts
    414
    • July 9, 2017 at 6:17 AM
    • #8

    Thank you. I will try that.

  • Marco
    Reactions Received
    3
    Trophies
    3
    Posts
    116
    • July 9, 2017 at 12:31 PM
    • #9

    Actually, my last setting is 0.05. This completely solved the issue.

    Kuka KR150-2 KRC2 ed05 V5.6.11<br />VFD TDE Macno<br />Spindle HSD ES915 with Automatic tool changer<br />Sprutcam 11

  • Wall-E
    Reactions Received
    3
    Trophies
    3
    Posts
    245
    • June 10, 2018 at 12:14 PM
    • #10

    Hi Marco,

    Could you post the code where you use the $PRO_ACT variable to shut down your spindle and explain where it should be located ?

    Thanks ?

  • SkyeFire
    Reactions Received
    1,044
    Trophies
    12
    Posts
    9,391
    • June 12, 2018 at 2:55 PM
    • #11

    Simplest place to put it would be the User section of the main SPS loop. Something like

    Code
    IF O_SpindleOuput AND NOT $PRO_ACT THEN
      O_SpindleOutput = FALSE
    ENDIF
  • Marco
    Reactions Received
    3
    Trophies
    3
    Posts
    116
    • June 14, 2018 at 11:41 AM
    • #12

    Hi Wall-E,

    In my system folder I customised the SPS as to load a sub that performs several checks. Among these I have:

    Code
    ;-- CHECK IF THERE IS A "STOP MESSAGE" DURING EXECUTION 
     IF ($OUT[1010] == TRUE) THEN ; CHECK $STOPMESS STATE
       HSD_LOGIC_SET = 5
       HSD_SPEED_SET = 0
       WAIT FOR HSD_SPEED_IN < ABS(50)
       HSD_LOGIC_SET = 0
     ENDIF

    This stops the spindle in the case of the mentioned errors (the specific lines depend on your spindle I/O setup) and if I press the stop softkey.
    Best,
    Marco

    Kuka KR150-2 KRC2 ed05 V5.6.11<br />VFD TDE Macno<br />Spindle HSD ES915 with Automatic tool changer<br />Sprutcam 11

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Users Viewing This Thread

  • 1 Guest
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download