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:
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!