Hello readers in this post I'm gonna tell you about how to program a robotic arm to make a pyramid. This robot is in my school and I do practice in it, so, I'm gonna tell you the code and the video of how it works. This program is in MELFA BASIC IV that is a language used commonly to control robots of this type, this robot that we are talking about is a RV1A a mitsubishi and the enviroment to program is a compiler called COSIMIR, this compiler is made by FESTO, this time I'm not going to talk about this very deep, but in further post I'm going to explain what is MF-IV a RV1A robot, and why not what is COSIMIR and what is FESTO also. Today I will focus on the code to accomplish the task. Here you can see the code with comments.
10 WAIT M_IN(4) = 1 'THIS MEANS THAT THE PROGRAM WILL START IF THE INPUT 4 IS ON
20 SPD 50 'THIS IS THE SPEED OF THE ROBOT IS 50% OF IT'S CAPACITY
30 OVRD 50 'THIS IS THE ACCELERATION OF THE ROBOT IS AT 50% OF IT'S CAPACITY
'IS IMPORTANT TO TELL THAT THE SLOW SPEED IS A SECURITY MEASURE
40 MOV P1 'HOME POSITION
50 '1ST CUBE
60 MOV P2 'THIS IS A SECURE POSITION BEFORE TAKING THE CUBE
70 HOPEN 1 'THIS COMMAND OPENS THE GRIPPER OF THE ARM
80 DLY 1 'THIS COMMAND MAKES THE ROBOT TO WAIT ONE SECOND TO MOVE
90 MVS P3 'THIS POSITION IS FOR TAKING THE CUBE
100 HCLOSE 1 'THIS COMMAND CLOSES THE GRIPPER OF THE ARM
110 DLY 1
120 MVS P2 'THIS IS A SECURE POSITION BEFORE RETURNING TO HOME POSITION
130 MOV P1 'HOME POSITION
140 'LEAVING 1ST CUBE
150 MOV P4 'SECURE POSITION
160 MVS P5 'POSITION FOR LEAVE THE CUBE
170 HOPEN 1
180 DLY 1
190 MVS P4 'SECURE POSITION
200 MOV P1 'HOME POSITION
210 '2ND CUBE
220 MOV P6 'SECURE POSITION
230 HOPEN 1
240 DLY 1
250 MVS P7
260 HCLOSE 1
270 DLY 1
280 MVS P6 'SECURE POSITION
290 MOV P1 'HOME POSITION
300 'LEAVING 2ND CUBE
310 MOV P8 'SECURE POSITION
320 MVS P9
330 HOPEN 1
340 DLY 1
350 MVS P8 'SECURE POSITION
360 MOV P1 'HOME POSITION
370 '3RD CUBE
380 MOV P10 'SECURE POSITION
390 HOPEN 1
400 DLY 1
410 MVS P11
420 MOV P1
430 DLY 1
440 MVS P10 'SECURE POSITION
450 MOV P1 'HOME POSITION
460 'LEAVING 3RD CUBE
470 MOV P12 'SECURE POSITION
480 MVS P13
490 HOPEN 1
500 DLY 1
510 MVS P12 'SECURE POSITION
520 MOV P1 'HOME POSITION
530 '4TH CUBE
540 MOV P14 'SECURE POSITION
550 HOPEN 1
560 DLY 1
570 MVS P15
580 HCLOSE 1
590 DLY 1
600 MVS P14 'SECURE POSITION
610 MOV P1 'HOME POSITION
620 'LEAVING 4TH CUBE
630 MOV P16 'SECURE POSITION
640 MVS P17
650 HOPEN 1
660 DLY 1
670 MVS P16 'SECURE POSITION
680 MOV P1 'HOME POSITION
690 '5TH CUBE
700 MOV P18 'SECURE POSITION
710 HOPEN 1
720 DLY 1
730 MVS P19
740 HCLOSE 1
750 DLY 1
760 MVS P18 'SECURE POSITION
770 MOV P1 'HOME POSITION
780 'LEAVING 5TH CUBE
790 MOV P20 'SECURE POSITION
800 MVS P21
810 HOPEN 1
820 DLY 1
830 MVS P20 'SECURE POSITION
840 MOV P1 'HOME POSITION
850 '6TH CUBE
860 MOV P22 'SECURE POSITION
870 HOPEN 1
880 DLY 1
890 MVS P23
900 HCLOSE 1
910 DLY 1
920 MVS P22 'SECURE POSITION
930 MOV P1 'HOME POSITION
940 'LEAVING 6TH CUBE
950 MOV P24 'SECURE POSITION
960 MVS P25
970 HOPEN 1
980 DLY 1
990 MVS P24 'SECURE POSITION
1000 MOV P1 'HOME POSITION
1010 END 'ENDS THE ROUTINE
And there is the code, you'll ask why security position, that's why because in the industry you have to have all the posible precautions and minimeze the risk to the minimum, so this positions gives to the operators some time to see if there is going to be any collision.
Another doubt that I will surely have would be why to return to the home position everytime I leave or take a cube, well, that's why we have to avoid any risk of collision, so, with that maneuver we take care of that.
Also we add the dly function to delay the movement of the robot, for security, if we don't leave that retardment we can cause an accident, imagine that the gripper did not grab correctly the piece that we are moving and with the movement it throws away the piece and hits someone and that someone dies, so, it's for caution. In further post I will explain the different commands in MF-IV, so stay tuned. I leave here the video of the practice. Please be welcomed to leave any comment or doubts.