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

Submit interpreter to stop 3D printer extruder

  • akaaschool
  • October 31, 2024 at 6:48 PM
  • Thread is Resolved
  • akaaschool
    Trophies
    2
    Posts
    17
    • October 31, 2024 at 6:48 PM
    • #1

    Using KRC4 and KSS 8.3.

    I have a plastic pellet extruder working as a 3D printer on a KR30-3 and the setup I have is that the motor for the pellet extruder is controlled by one analogue output to control the speed of the motor, and one digital output controls whether the motor is on or off. Ideally the motor would be configured as an external axis but this isn't possible at this time for us.

    The analogue/digital output control is working fine but one issue is that currently if the robot is stopped by an E-stop or even if the program is paused or whatever, the extruder will keep on pumping out molten plastic which is not ideal.

    I understand from SkyeFire's responses in these threads (Re: Submit interpreter help and RE: Submit interpreter.) that I could set up a pulse train to essentially have the submit interpreter keep an digital output high, so then if the program is stopped or the robot is stopped then the digital output would change to low.

    What I am struggling with is then how to implement this on the actual program side. The 3D printing scripts that we have often look like this:

    Code
    LIN {X 787.049,Y -1205.541,Z 519.727,A 0,B -0,C 0} C_DIS
    $ANOUT[1] = 0.07
    $OUT[2] = TRUE
    WAIT SEC 0.03
    $APO.CDIS = Zone002
    $VEL.CP = Speed002
    LIN {X 786.718,Y -1203.577,Z 519.727,A 0,B -0,C 0} C_DIS
    LIN {X 786.073,Y -1201.692,Z 519.727,A 0,B -0,C 0} C_DIS
    .......
    LIN {X 703.115,Y -1195.76,Z 519.727,A 0,B -0,C 0} C_DIS
    LIN {X 702.406,Y -1197.623,Z 519.727,A 0,B -0,C 0} C_DIS
    LIN {X 701.886,Y -1199.547,Z 519.727,A 0,B -0,C 0} C_DIS
    $OUT[2] = FALSE
    LIN {X 698.055,Y -1217.492,Z 519.727,A 0,B -0,C 0} C_DIS
    $ANOUT[1] = 0.07
    $OUT[2] = TRUE
    WAIT SEC 0.03
    Display More

    The issue there would be that even if the command checked if the digital output was low before turning on, it obviously wouldn't be able to turn the the digital output for the motor off. So then from my understanding, the submit interpreter would need to set the digital output for the motor to be off, but I'm not really sure how I could implement that, so any pointers would be helpful.

    I am aware a physical solution to this would be to have the digital output from the submit interpreter connected to a physical AND gate with the other input being the motor digital input, so that the motor would only be on if both the SPS signal and the program signal were coming through, but am trying to see if there's a software solution first.

    Many thanks!

    Edited once, last by akaaschool (November 1, 2024 at 2:56 PM).

  • Go to Best Answer
  • work_BR
    Reactions Received
    11
    Trophies
    1
    Posts
    95
    • October 31, 2024 at 8:12 PM
    • #2

    Why not tie $ANOUT[1] to $ROB_STOPPED (This output is set when the robot is at a standstill. In the event of a WAIT statement, this output is set during the wait. The signal is thus the inverse of $PRO_MOVE.)


    Or better yet $ALARM_STOP (FALSE: The safety controller has triggered a safety STOP 0 or safety STOP 1, e.g. due to an EMERGENCY STOP. • TRUE: The safety controller has possibly triggered a safety stop. No EMERGENCY STOP is active.)


    Or both.


    I feel like the SPS is the place to do this for sure, the issue is restarting $ANOUT[1] to its original number after resuming operation. I would tie that value to a global variable, and do the following in the SPS


    Code
    ;in the SPS 
    
      If ($ALARM_STOP == false) or ($ROB_STOPPED) then	
      	$ANOUT[1] = 0
      else	
      	$ANOUT[1] = Global_Var
      endif	
  • hermann
    Reactions Received
    412
    Trophies
    9
    Posts
    2,624
    • November 1, 2024 at 10:22 AM
    • Best Answer
    • #3

    The thread you mentioned is intended to react on an external signal that's not under control of the robot.

    You have a different task. You want to react on a situation that's coming from inside robot controller, you don't need that pulse thing. Like work_BR showed you can simply use internal states to switch off the extruder.

    Wouldn't use $alarm_stop but $pro_act, depends on when exactly you want to stop extruder.

    And you also can just switch it off by setting output to false. In Sps.sub:

    Code
    If not $pro_act then
     $out[2] = false
    endif
  • akaaschool
    Trophies
    2
    Posts
    17
    • November 1, 2024 at 4:37 PM
    • #4

    Ah, wonderful, okay that makes sense. I hadn't considered that the submit interpreter would be able to turn off something even when a program wasn't running, but on reflection that is the entire point of it really...

    So yes I will try the code that hermann suggested, but the additional functionality that work_BR suggests of being able to resume the program and the extruder would turn back on would also be really nice.

    One thing that would be important there that it should only turn the extruder back on once the robot is back on its path and reaches the next programmed position. Could $PRO_IP be useful for this?

  • work_BR
    Reactions Received
    11
    Trophies
    1
    Posts
    95
    • November 1, 2024 at 4:42 PM
    • #5

    Turning on your extruder when it's "On path" to me is easier with the Global_variable, so it would look something like this:

    Code
    LIN {X 787.049,Y -1205.541,Z 519.727,A 0,B -0,C 0} C_DIS
    Global_Variable = 0.07;$ANOUT[1] = 0.07
    $OUT[2] = TRUE
    WAIT SEC 0.03
    $APO.CDIS = Zone002
    $VEL.CP = Speed002
    LIN {X 786.718,Y -1203.577,Z 519.727,A 0,B -0,C 0} C_DIS
    LIN {X 786.073,Y -1201.692,Z 519.727,A 0,B -0,C 0} C_DIS
    .......
    LIN {X 703.115,Y -1195.76,Z 519.727,A 0,B -0,C 0} C_DIS
    LIN {X 702.406,Y -1197.623,Z 519.727,A 0,B -0,C 0} C_DIS
    LIN {X 701.886,Y -1199.547,Z 519.727,A 0,B -0,C 0} C_DIS
    $OUT[2] = FALSE
    Global_Variable = 0 ;this is the point i assume you want to get to and have it turned off
    LIN {X 698.055,Y -1217.492,Z 519.727,A 0,B -0,C 0} C_DIS
    Global_Variable = 0.07 ;$ANOUT[1] = 0.07
    $OUT[2] = TRUE
    WAIT SEC 0.03
    Display More

    And yes, SPS in German translates to PLC. It constantly runs whether you have a .SRC file / program running or not.

  • akaaschool
    Trophies
    2
    Posts
    17
    • November 1, 2024 at 5:20 PM
    • #6

    Mmm, so what you have suggested would be okay for a short print section with only a few LIN commands between turning on/off the extruder, but there is also the case where there could be a few thousand LIN commands. So for example if the program was stopped on line 300, the extruder would stop, but then not turn back on until line 5000 which is where the next $OUT[2] = TRUE would be. I could just have a TRIGGER WHEN DISTANCE=0 DELAY=0 DO $OUT[2]=TRUE attached to every movement command that is required to be printing, but then I think I might run into memory problems where if my print is super long, it could already have over 250,000+ movement commands, and if each one of those then had an extra line of code attached to them then it would hit the memory limit of R1.

  • work_BR
    Reactions Received
    11
    Trophies
    1
    Posts
    95
    • November 1, 2024 at 5:32 PM
    • #7

    I feel like you're right there and if you take a nap, the solution will come to you. There's definitely a simple way to toggle your extruder without making huge program over halls.

    Your example of i assume e-stop on line 300, then not turning on till 5000 i don't think makes sense...

    When you e-stop, $ALARM_STOP in the SPS should write FALSE to your $OUT[2]. (sorry in my previous writing i thought it was being controlled by $ANOUT[1])

    So when you restart, it changes what it reads in the IF, and Turns it back on because your global_var = true, and the SPS does not change that value.

  • akaaschool
    Trophies
    2
    Posts
    17
    • November 7, 2024 at 6:13 PM
    • #8

    So I've solved the initial question as you both recommended with a simple bit of code:

    Code
        IF $PRO_ACT == FALSE THEN
          $OUT[2] = FALSE
    
        ENDIF

    Thank you both for that. The AND is for the case where I need to manually run the extruder, so then I can just unload the program and control the extruder.

    After a few naps, I have the full functionality for pausing the extruder and then turning it back on once the program is running, but avoiding the extruder output just being permanently high.

    Code
        USER DECL
        DECL BOOL ext_paused
        
        INIT
        ext_paused = FALSE
        
        ;Turn off plastic extruder if program stops
        IF ($PRO_ACT == FALSE) AND ($PRO_STATE1 <> #P_FREE) THEN
            IF $OUT[2] == TRUE THEN
                ext_paused = TRUE
            ENDIF
            $OUT[2] = FALSE
        ENDIF
        
        ;Turn on plastic extruder if extruder had been paused
        IF (ext_paused == TRUE) AND ($PRO_STATE1 == #P_ACTIVE) THEN
          $OUT[2] = TRUE
          ext_paused = FALSE
        ENDIF
    Display More
  • akaaschool November 7, 2024 at 6:14 PM

    Selected a post as the best answer.

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
  • krc5
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • 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
  • krc5
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000
  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