Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Complex logic for Fanuc

#1
I am hoping to use RoboDK as a substitute for my applied robotics class (due to COVID-19), but I need to be able to let students generate programs that internally loop a controlled number of times. I use older Fanuc robots (R30iA controller) and am wondering if there is a way to get the simulation to a) allow the students to program in variables and looping or b) feed a program that was run through the Fanuc post processor back into the simulation.

My "real" program would look something like this...

/PROG  myfirstpro
/ATTR
OWNER = MNEDITOR;
COMMENT = "RoboDK sequence";
PROG_SIZE = 0;
CREATE = DATE 31-12-14  TIME 12:00:00;
MODIFIED = DATE 31-12-14  TIME 12:00:00;
FILE_NAME = myfirstpro;
VERSION = 0;
LINE_COUNT = 18;
MEMORY_SIZE = 0;
PROTECT = READ_WRITE;
TCD:  STACK_SIZE = 0,
      TASK_PRIORITY = 50,
      TIME_SLICE = 0,
      BUSY_LAMP_OFF = 0,
      ABORT_REQUEST = 0,
      PAUSE_REQUEST = 0;
DEFAULT_GROUP = 1,*,*,*,*;
CONTROL_CODE = 00000000 00000000;
/MN
   1:  ! Program generated by ;
   2:  !  RoboDK v4.2.3 for F ;
   3:  ! anuc LR Mate 200iC o ;
   4:  ! n 21/04/2020 16:04:3 ;
   5:  ! 6 ;
   6:  ! Using nominal kinema ;
   7:  ! tics. ;
   8:  PR[9,1]=0.000 ;
   9:  PR[9,2]=0.000 ;
  10:  PR[9,3]=0.000 ;
  11:  PR[9,4]=0.000 ;
  12:  PR[9,5]=0.000 ;
  13:  PR[9,6]=0.000 ;
  14:  R[1] = 0;
  15:  UFRAME[9]=PR[9] ;
  16:  UFRAME_NUM=9 ;
  16:  LBL[1] ;
  17:J P[1] 20% FINE ;
  18:L P[2] 200mm/sec FINE ;
  19:J P[3] 20% FINE ;
  20:  R[1] = R[1] + 1;
  21:  IF R[1] = 5, JMP LBL[2];
  22: JMP[1] ;
  23: LBL[2];
/POS
P[1]{
   GP1:
    UF : 9, UT : 9,    
J1=    0.000 deg, J2=    -15.447 deg, J3=    -12.559 deg,
J4=    -0.000 deg, J5=    -21.223 deg, J6=    0.000 deg
};
P[2]{
   GP1:
    UF : 9, UT : 9,        CONFIG : 'N U T, 0, 0, 0',
X =   266.244  mm, Y =  -260.276  mm, Z =   107.970  mm,
W =  -180.000 deg, P =   -48.536 deg, R =    -0.000 deg
};
P[3]{
   GP1:
    UF : 9, UT : 9,    
J1=    30.281 deg, J2=    11.570 deg, J3=    -37.053 deg,
J4=    69.869 deg, J5=    -23.732 deg, J6=    -89.317 deg
};
/END




Thanks

Kevin
#2
Hi Kevin,

To create complex logic inside the simulation environment, you need to use the Python API.
More details here: https://robodk.com/doc/en/PythonAPI/intro.html

Exporting that kind of complex logic to the controller is another situation in itself.
That would require you to modify the post-processor for the Fanuc controller.
More details post-processor modifications here: https://robodk.com/doc/en/Post-Processor...tProcessor
If you feel like trying, I can help you point in the right direction.

RoboDK does not support importing Fanuc programs as far as I know. Generally speaking, importing programs is not an officially supported feature in RoboDK. It works for a few robot brands, but not all. You can take a look at this thread, it's for UR robots, but the steps are the same for all robots. https://robodk.com/forum/Thread-How-to-i...import+URP

Jeremy
#3
I've made some tests importing FANUC programs inside RoboDK some time ago, using the drag and drop program method mentioned by @Jeremy, and my notes follow below.

- Before doing this, You need to create UTOOLS and UFRAMES used on the program inside RoboDK, and name them in a way RoboDK understands. In this case, UTOOL 1 becomes UT 1 (with a space between UT and 1), and UFRAME 0 becomes UF 0 (with the space), for example.
- In the tests I performed, joint angles inside RoboDK became slightly different from the original ones.
- RoboDK doesn't understand PR point instructions.
- You may have problems if using programs with Remote TCP.
  




Users browsing this thread:
1 Guest(s)