3 분 소요

Hits

PLC에서 grip 센서 on, off 보내고, ABB RobotStudio에 적용

Request Write Access 권한 얻어 오고
Configuration > I/O System > 오른쪽 마우스 new signal

20241227_01

20241227_02

Name : di00_grip_on_sen
Type of Signal : Digital Input
Assigned to Device : D378B_10
Device Mapping : 0

Name : di01_grip_off_sen
Type of Signal : Digital Input
Assigned to Device : D378B_10
Device Mapping : 1

껐다 켜야 함 Controller > Restart

20241227_03

WaitDI

PLC에서 grip 센서의 on, off 유무를 받아오는 코드

WaitDI di00_grip_on_sen,1;
WaitDI di01_grip_off_sen,1;

PROC grip_on()
    PulseDO\PLength:=0.2,do00_gripon;			
    WaitDI di00_grip_on_sen,1;
ENDPROC

PROC grip_off()
    PulseDO\PLength:=0.2,do01_gripoff;
    WaitDI di01_grip_off_sen,1;
ENDPROC

6개 플래이트에 공작물 옮기기 RAPID Code

MODULE MainModule
	CONST robtarget pHome:=[[329.55,-26.08,334.47],[0.000108947,-0.556346,-0.830951,-8.14346E-05],[-1,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
	CONST robtarget p10:=[[-10.36,-459.24,17.37],[5.6067E-05,-0.556322,-0.830967,-8.81087E-05],[-2,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
	CONST robtarget p20:=[[476.85,-432.45,413.36],[4.38213E-05,-0.556315,-0.830971,-8.55472E-05],[-1,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
	CONST robtarget p30:=[[614.51,-439.20,345.02],[8.75684E-05,-0.556328,-0.830963,-8.26334E-05],[-1,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

	VAR num x_pos :=0;
	VAR num y_pos :=0;
	
	PROC main()
		AccSet 1, 1;
		MoveL pHome, v200, fine, tool1;
		
		WHILE TRUE DO
			pick_plate;			
		ENDWHILE
	ENDPROC
	
	PROC grip_on()
		PulseDO\PLength:=0.2,do00_gripon;			
		WaitDI di00_grip_on_sen,1;
	ENDPROC

	PROC grip_off()
		PulseDO\PLength:=0.2,do01_gripoff;
		WaitDI di01_grip_off_sen,1;
	ENDPROC
	
	PROC rout1()
		MoveJ P20, v200, z50, tool1;
		MoveJ Offs(p30,0,0,50),v200,z20,tool1;
		MoveL p30, v30, fine, tool1;
		grip_off;
		MoveL Offs(p30,0,0,50), v100, z20, tool1;
		MoveJ P20, v200, z50, tool1;
	ENDPROC
	
	PROC pick_plate()
		x_pos := 0;
		y_pos := 0;
		FOR ct2 FROM 1 TO 2 DO
			FOR ct1 FROM 1 TO 3 DO
				MoveJ Offs(p10,x_pos,y_pos,100),v200,z30,tool1;
				MoveL Offs(p10,x_pos,y_pos,0), v30, fine, tool1;
				grip_on;
				MoveL Offs(p10,x_pos,y_pos,100), v100, z30, tool1;
				rout1;
				x_pos := x_pos+110;
			ENDFOR
			x_pos := 0;
			y_pos := y_pos-110;
		ENDFOR
	ENDPROC

ENDMODULE

매거진에 공작물 없을 때 로봇이 공작물 6개 투입하도록 RAPID 및 PLC 수정

20241227_04

20241227_05

WHILE TRUE DO
            
    IF di02_ma_none = 1 THEN
        pick_plate;
    ENDIF

ENDWHILE

Robot IO 할당

20241227_06

20241227_07

Digital Output은 X1000 ~
Digital Input은 Y1000 ~

문제1

로봇이 6개의 공작물을 매거진에 투입하면 PLC에 시작 신호를 보내
컨베이어로 공작물을 이송하는 PLC 프로그램

이송된 공작물을 센서3개 (용량형, 고주파, 근접포토)를 이용하여
금속인 경우 적색경광,
흰색 플라스틱인 경우 황색경광,
검정 플라스틱인 경우 녹색 경광 등을 점등

MODULE MainModule
	CONST robtarget pHome:=[[329.55,-26.08,334.47],[0.000108947,-0.556346,-0.830951,-8.14346E-05],[-1,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
	CONST robtarget p10:=[[-34.68,-441.11,5.73],[1.84964E-05,-0.650831,-0.759223,-2.51296E-05],[-2,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
	CONST robtarget p20:=[[476.85,-432.45,413.36],[4.38213E-05,-0.556315,-0.830971,-8.55472E-05],[-1,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
	CONST robtarget p30:=[[616.13,-459.90,332.39],[2.28305E-06,-0.326002,-0.945369,-9.10512E-07],[-1,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

	VAR num x_pos :=0;
	VAR num y_pos :=0;
	
	PROC main()
		AccSet 1, 1;
		MoveL pHome, v200, fine, tool2_ej;

		WHILE TRUE DO

			IF di02_ma_none = 1 THEN
				pick_plate;
                PulseDO\PLength:=0.2,do02_plcstart;
			ENDIF

		ENDWHILE
	ENDPROC
	
	PROC grip_on()
		PulseDO\PLength:=0.2,do00_gripon;			
		WaitDI di00_grip_on_sen,1;
	ENDPROC

	PROC grip_off()
		PulseDO\PLength:=0.2,do01_gripoff;
		WaitDI di01_grip_off_sen,1;
	ENDPROC
	
	PROC rout1()
		MoveJ P20, v200, z50, tool2_ej;
		MoveJ Offs(p30,0,0,50),v200,z20,tool2_ej;
		MoveL p30, v30, fine, tool2_ej;
		grip_off;
		MoveL Offs(p30,0,0,50), v100, z20, tool2_ej;
		MoveJ P20, v200, z50, tool2_ej;
	ENDPROC
	
	PROC pick_plate()
		x_pos := 0;
		y_pos := 0;
		FOR ct2 FROM 1 TO 2 DO
			FOR ct1 FROM 1 TO 3 DO
				MoveJ Offs(p10,x_pos,y_pos,100),v200,z30,tool2_ej;
				MoveL Offs(p10,x_pos,y_pos,0), v30, fine, tool2_ej;
				grip_on;
				MoveL Offs(p10,x_pos,y_pos,100), v100, z30, tool2_ej;
				rout1;
				x_pos := x_pos+110;
			ENDFOR
			x_pos := 0;
			y_pos := y_pos-110;
		ENDFOR

	ENDPROC
	
ENDMODULE

20241227_08
20241227_09
20241227_10

20241227_11

문제2

문제1에 이어서 6개 공작물이 매거진에 찼을 때
컨베이어가 구동하여 이송된 공작물을 하나씩 집어서
금속, 흰색 플라스틱, 검정 플라스틱 각각의 통에 넣기

MODULE MainModule
	CONST robtarget pHome:=[[329.55,-26.08,334.47],[0.000108947,-0.556346,-0.830951,-8.14346E-05],[-1,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
	CONST robtarget pHome2:=[[491.93,-26.07,230.36],[0.000135218,-0.556332,-0.83096,-5.93678E-05],[-1,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
	CONST robtarget p10:=[[-34.68,-441.11,5.73],[1.84964E-05,-0.650831,-0.759223,-2.51296E-05],[-2,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
	CONST robtarget p20:=[[476.85,-432.45,413.36],[4.38213E-05,-0.556315,-0.830971,-8.55472E-05],[-1,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
	CONST robtarget p30:=[[616.13,-459.90,332.39],[2.28305E-06,-0.326002,-0.945369,-9.10512E-07],[-1,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
	CONST robtarget con_end:=[[618.31,-14.78,131.03],[7.02875E-06,0.103828,-0.994595,2.62461E-08],[-1,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
	CONST robtarget metal_box:=[[394.80,326.41,102.30],[2.7142E-05,0.103895,-0.994588,-2.8837E-05],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
	CONST robtarget b_p_box:=[[394.84,426.36,102.29],[7.57723E-06,0.103902,-0.994588,-4.6509E-05],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
	CONST robtarget w_p_box:=[[394.86,542.55,102.27],[5.74707E-06,-0.10393,0.994585,6.29787E-05],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

	VAR num x_pos :=0;
	VAR num y_pos :=0;
	
	PROC main()
		AccSet 1, 1;
		MoveL pHome, v200, fine, tool2_ej;

		WHILE TRUE DO

			IF di02_ma_none = 1 AND di07_running=0 THEN
				pick_plate;
				PulseDO\PLength:=0.2,do02_plcstart;
			ENDIF
			
			IF di06_arrive = 1 THEN
				con_end_proc;
				IF di03_metal = 1 THEN
					PulseDO\PLength:=0.2,do03_reset_jedg;
					metal_proc;
				ELSEIF di04_plastic_black = 1 THEN
					PulseDO\PLength:=0.2,do03_reset_jedg;
					b_p_proc;
				ELSEIF di05_plastic_white = 1 THEN
					PulseDO\PLength:=0.2,do03_reset_jedg;
					w_p_proc;
				ENDIF
				MoveJ pHome2, v200, fine, tool2_ej;
			ENDIF
			
		ENDWHILE
	ENDPROC
	
	PROC metal_proc()
		MoveJ Offs(metal_box,0,0,60), v200, z30, tool2_ej;
		MoveL metal_box, v30, fine, tool2_ej;
		grip_off;
		MoveL metal_box, v100, z30, tool2_ej;
	ENDPROC
	
	PROC b_p_proc()
		MoveJ Offs(b_p_box,0,0,60), v200, z30, tool2_ej;
		MoveL b_p_box, v30, fine, tool2_ej;
		grip_off;
		MoveL b_p_box, v100, z30, tool2_ej;
	ENDPROC
	
	PROC w_p_proc()
		MoveJ Offs(w_p_box,0,0,60), v200, z30, tool2_ej;
		MoveL w_p_box, v30, fine, tool2_ej;
		grip_off;
		MoveL w_p_box, v100, z30, tool2_ej;
	ENDPROC	
	
	PROC con_end_proc()
		MoveJ Offs(con_end,0,0,60), v200, z30, tool2_ej;
		MoveL con_end, v30, fine, tool2_ej;
		grip_on;
		MoveL Offs(con_end,0,0,60), v100, z30, tool2_ej;
	ENDPROC	
	
	PROC grip_on()
		PulseDO\PLength:=0.2,do00_gripon;			
		WaitDI di00_grip_on_sen,1;
	ENDPROC

	PROC grip_off()
		PulseDO\PLength:=0.2,do01_gripoff;
		WaitDI di01_grip_off_sen,1;
	ENDPROC
	
	PROC rout1()
		MoveJ P20, v200, z50, tool2_ej;
		MoveJ Offs(p30,0,0,50),v200,z20,tool2_ej;
		MoveL p30, v30, fine, tool2_ej;
		grip_off;
		MoveL Offs(p30,0,0,50), v100, z20, tool2_ej;
		MoveJ P20, v200, z50, tool2_ej;
	ENDPROC
	
	PROC pick_plate()
		x_pos := 0;
		y_pos := 0;
		FOR ct2 FROM 1 TO 2 DO
			FOR ct1 FROM 1 TO 3 DO
				MoveJ Offs(p10,x_pos,y_pos,100),v200,z30,tool2_ej;
				MoveL Offs(p10,x_pos,y_pos,0), v30, fine, tool2_ej;
				grip_on;
				MoveL Offs(p10,x_pos,y_pos,100), v100, z30, tool2_ej;
				rout1;
				x_pos := x_pos+110;
			ENDFOR
			x_pos := 0;
			y_pos := y_pos-110;
		ENDFOR

	ENDPROC
	
ENDMODULE

20250103_01
20250103_02
20250103_03
20250103_04

태그:

카테고리:

업데이트:

Comments