|
|
|
|
@ -15,7 +15,7 @@ header_src = """&ACCESS RVP
@@ -15,7 +15,7 @@ header_src = """&ACCESS RVP
|
|
|
|
|
&PARAM EDITMASK = * |
|
|
|
|
""" |
|
|
|
|
|
|
|
|
|
z_up_pose = """{X 0.0, Y 0.0, Z 50.0, A 0.0, B 0.0, C 0.0, E1 0.0, E2 0.0}""" |
|
|
|
|
z_up_pose = """{X 0.0, Y 0.0, Z 30.0, A 0.0, B 0.0, C 0.0, E1 0.0, E2 0.0}""" |
|
|
|
|
|
|
|
|
|
class Kuka_Layer: |
|
|
|
|
def __init__(self): |
|
|
|
|
@ -168,28 +168,34 @@ class Kuka_Prog:
@@ -168,28 +168,34 @@ class Kuka_Prog:
|
|
|
|
|
if len(layer.hatchlines): |
|
|
|
|
print("Number Hatchlines: ", len(layer.hatchlines)) |
|
|
|
|
f.write(";- Hatchlines\n") |
|
|
|
|
f.write("$VEL.CP = %f ; m/s ; m/s \n" % self.vmax) |
|
|
|
|
f.write("$VEL.CP = TRAVELSPEED ; m/s (vmax)\n") |
|
|
|
|
f.write("LIN_REL {Z 90.0} C_VEL; just move up \n") |
|
|
|
|
# to first point on part |
|
|
|
|
(first_hatch_line, _) = layer.hatchlines[0] |
|
|
|
|
segment = first_hatch_line[0] |
|
|
|
|
f.write("LIN refpose:{}:{} C_VEL; move to first hatch point but with z_up\n".format(segment.translate_with(self.baseorigin).to_string(), z_up_pose)) |
|
|
|
|
|
|
|
|
|
for (line, seg_type) in layer.hatchlines: |
|
|
|
|
# a line has many segments |
|
|
|
|
# start laser at first segment |
|
|
|
|
# stop with last |
|
|
|
|
f.write(";- Hatchline\n") |
|
|
|
|
segment = line[0] |
|
|
|
|
f.write("$VEL.CP = %f ; m/s ; m/s \n" % self.vmax) |
|
|
|
|
f.write("LIN refpose:{}:{} C_VEL; move to first hatch point but with z_up\n".format(segment.translate_with(self.baseorigin).to_string(), z_up_pose)) |
|
|
|
|
# One Hatchline |
|
|
|
|
f.write(";- First Point in line \n") |
|
|
|
|
segment = line[0] |
|
|
|
|
f.write("$VEL.CP = TRAVELSPEED ; m/s (vproc)\n") |
|
|
|
|
f.write("LIN refpose:{} C_VEL; GENERATED\n".format(segment.translate_with(self.baseorigin).to_string())) |
|
|
|
|
f.write("TRIGGER WHEN DISTANCE=0 DELAY=0 DO $OUT[%d]=True; Turn on Laser at point \n" % self.use_laser_out) |
|
|
|
|
f.write("$VEL.CP = WELDSPEED ; m/s (vproc)\n") |
|
|
|
|
# each segment |
|
|
|
|
for segment in line[1:-1]: |
|
|
|
|
f.write("$VEL.CP = %f ; m/s ; m/s \n" % self.vproc) |
|
|
|
|
f.write("LIN refpose:{} C_VEL; GENERATED\n".format(segment.translate_with(self.baseorigin).to_string())) |
|
|
|
|
segment = line[-1] |
|
|
|
|
f.write(";- Last Point in line \n") |
|
|
|
|
f.write("LIN refpose:{} C_VEL; GENERATED\n".format(segment.translate_with(self.baseorigin).to_string())) |
|
|
|
|
f.write("TRIGGER WHEN DISTANCE=0 DELAY=0 DO $OUT[%d]=FALSE; Turn off Laser at point\n" % self.use_laser_out) |
|
|
|
|
# if z height difference between this and next point, we should move up, else it's faster to just go on. |
|
|
|
|
#f.write("$VEL.CP = %f ; m/s ; m/s \n" % self.vmax) |
|
|
|
|
#f.write("LIN refpose:{}:{} C_VEL; move up from last hatch point \n".format(segment.translate_with(self.baseorigin).to_string(), z_up_pose)) |
|
|
|
|
f.write(";- End line \n") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|