It still does it. 3rd attempt
$tool = tool_data[3]
lin_rel {A 3} #tool
and
ecl real a_rot
a_rot = 3
$tool = tool_data[3]
lin_rel {A a_rot} #tool
It still does it. 3rd attempt
$tool = tool_data[3]
lin_rel {A 3} #tool
and
ecl real a_rot
a_rot = 3
$tool = tool_data[3]
lin_rel {A a_rot} #tool
Sorry, I don't know why the forum is doing this, but it is breaking up my code weirdly. Here is a 2nd attempt without the huge page breaks
"$tool = tool_data[x]"
lin_rel {A 3} #tool
and
ecl real a_rot
a_rot = 3
"$tool = tool_data[x]"
lin_rel {A a_rot} #tool
Is KRL capable of doing lin_rel movements with a variable assigned to the distance moved?
I am programming in work visual. When I do the following:
$tool = tool_data[x]
lin_rel {A 3} #tool
work visual handles this with no problems. The robot (KRC4) executes this with no problems and rotates 3 degrees in axis A bout the TCP. Easy stuff. If I try to assign a variable where the "3" is
example:
decl real a_rot
a_rot = 3
$tool = tool_data[x]
lin_rel {A a_rot} #tool
work visual doesn't like this and throws out error messages because of the a_rot.
Ultimately, I want to be able to take user input, and rotate a number of degrees which is not hard coded. I want this to be user-definable. In my particular case, I could do absolute rotations, but relative rotations would be much easier. Any ideas?
Thanks for your help.
Fubini Wrote:"Most common error here is letting the subprograms begin with a INI-FOLD, which includes advance run breaking instructions. "
This did the trick. I deleted the default initialization from the sub program. It initializes interrupt 3 when $stopmess = true. I don't know what interrupt 3 was programmed to do, but it seems to be causing issues in this case for me. If I had to guess it looks like $stopmess = true is being satisfied by one of the errors being sent to the front panel.
Update: I am now seeing notification messages which I didn't realize were there earlier.
Notification messages to the front panel when I try to execute this:
KSS01442
Sequence of instructions that cannot be approximated (module "main program", block 36)
KSS01123
Approximate positioning not possible (module "sub program", block 53) (=> 1442)
Even though the motion is continuous, I still get these error messages. I can live with the messages, but it would be nice to "fix" them properly.
When I look up these codes on google, this source (http://alarmcodes.com/kuka-error-mes…r-instructions/) claims that if a $tool command is programmed between two motions it will cause the 1442 error. The 1442 error seems to be what is stopping motion. My confusion here is that if I do all of this code within the main program, it works. Even if I redefine $tool in between the motions, the robot will execute the motion without stopping (maintaining constant speed).
If I execute this code all within the main program it does not stop motion. The main program contains the same init fold as the sub programs. I still even get the same error messages, but I do get constant motion. Why does interrupt 3 stop motion in the sub program but not in the main program?
If I try to look at what line the error message refers to (block 36): the line doesn't make sense with what the error message claims - it will call out what is an empty line. For example, in the error above, block 36 is an empty line. This is one beef I have wtih Kuka. Even from my experience back in programming 1 and 2 at Kuka college, the teachers there knew about this issue and had to known fix for it. The issue as far as I can tell is the way KRL counts the lines within the folds. Even if I open all of the folds, the lines still don't match up with what the error message is telling me.
Anyway, it works for now. It would be nice to get rid of the error messages all together.
Thanks for the help Fubini!!
I have code which is calling sub programs. The motion takes place in the sub programs. I have two motions which I want to sync up as a constant move (no stopping). Is there a good way to ensure this? Is KRL with KRC4 even capable of this? I have not been able to do this yet. I can easily do it if all of the code is in the same sub program.
example of code:
def sub-program1()
decl e6pos myposition
initialize mypsoition
base = base_data[x]
tool = tool_data[x]
lin myposition c_vel
end
def sub-program 2()
decl e6pos myposition2
initialize mypsoition2
base = base_data[x]
tool = tool_data[x]
lin myposition2 c_vel
end
There is of course other code in those sub programs. The main program would call sub program 1, then call sub program 2. I realize the obvious answer is to do this motion back in the main program that way I can get the constant velocity (no stopping between points) to work. I do not want to do it this way, however. This motion is a straight line. My code does work if I do all of the motion in the main program. The robot is capable of doing a c_vel here: the commanded speed is not too fast to get a way with a c_vel.
I am using manually programmed positions, not taught positions. Could this work if I used taught positions instead?
Any ideas or thoughts?
$ACT_BASE=X, worked. So it looks like it was still moving in the correct base, but the display was showing base 0, and tool 1. Do I have that correct?
Thanks for the help.
On a KRC4, I am using the following to try and move in base[2], but when i execute the movement, the controller switches back to T1, B0 during this movement.
$base = base_data[2]
lin_rel {y 500} C_VEL #base
I would like to execute this move as a Lin_Rel, and would like to do so in whichever base I assign. I thought this was the best way to do this. I am aware this may be easier to do with an SLin_Rel, but I have looked closely at the SLin movments, and they don't handle C_VEL the same way a lin_rel does. I much prefer the C_VEL with a good old fashioned Lin_Rel. Any help?
Thank you! This was the original reason why I wanted to tie 2 lin_rel moves together (from my post just before this). My way around this issue is to program 1 line as many differnet points, then I can have 8 triggers per point. If anyone has a better way to approach this altogether, please let me know.
Hello all,
I would like to tie 2 relative movements together with a smooth transition between points. If I am using lin_rel to travel in a straight line, but I want to break up the movement into 2 sections... is there a good way to do this without the robot stopping at the midpoint? Example code below:
...
lin_rel {y 100}
lin_rel {y 100}
...
I tried the above code, but the robot stops at the 100mm mark before continuing on to the next 100mm end point. I realize that I could just use lin_rel {200} instead, but I want to see if there is a way to do this. I know that in Robot Programming book 1 from KUKA College, if you teach 3 SLIN points in a straight line, it will pass right through the midpoint without decelerating. Is there a way to do this with relative movement as well? Would I need to use a constant velocity command? Can you use constant velocity with lin_rel? Could I use point approximation to do this?
Thanks for your help!
Hello all,
After going back to the programming 1 and 2 books from KUKA College, Book 1 (on page 179) says that only 8 triggers can be used per motion. This section is for the inline form for triggers. In book 2, where it discusses triggers for hard coding via work visual with KRL (page 203) it says nothing about maximum number of triggers. Does the maximum only apply to the inline form? If I hard code the triggers via workvisual, is there a limit to the number of triggers I can have per movement?
This is KRC 4.
Thanks for your help!