Hi,
I'm working on a depalletizing application with a BX200 robot using an E-controller. I'm getting offset data from a plc which consists of x,y,z offsets and rotation around z. I'm having an issue where when I have a z-rotation, the offsets are incorrect. I set up a base on the pallet where I'm depalletizing from which corresponds to the vision system coordinate system.
my vision program is:
.PROGRAM vision() #0; #0; #0; #0
10
BITS 40,4 = 0 ; Reset fault codes
SWAIT 1081 ; vision system ready
PULSE 81,1 ; initiate camera
SWAIT 1082 ; Vision Offsets Ready
;Reset offsets
offsetx = 0
offsety = 0
offsetz = 0
rotz = 0
POINT vis_offset = TRANS(offsetx,offsety,offsetz,0,0,rotz)
BREAK
;Check for negative values
offsetx = BITS(1097,16)
IF offsetx>=32768 THEN
offsetx = -(65536-offsetx)
END
offsety = BITS(1113,16)
IF offsety>=32768 THEN
offsety = -(65536-offsety)
END
offsetz = BITS(1129,16)
IF offsetz>=32768 THEN
offsetz = -(65536-offsetz)
END
rotz = BITS(1145,16)
IF rotz>=32768 THEN
rotz = -(65536-rotz)
END
IF offsetx>100 OR offsety>600 OR offsetz>6000 OR rotz>10 THEN
BITS 40,4 = 4 ; Set fault code 4 (Vision Offsets out of range)
GOTO 10
END
POINT vis_offset = TRANS(offsetx,offsety,offsetz,0,0,rotz)
.END
I then add the vis_offset to my master pick.
POINT pickblock = vis_offset+mstr_pickblock
Anyone have any ideas what I'm doing wrong?
Thank you.