Controller Secondary Development - Creating Job Programs Using Configured Palletizing Process Packages

2022-01-20

  • NexDroid-Controller function library provides palletizing process packages. After configuring the parameters of the palletizing process package, you can create job files to use the palletizing process package.
  • In this example, we will use process number 1 to realize the function of picking up materials from a fixed point for palletizing and releasing.

  • First, create a job file using NRC_CreateJobfile("PALLET");

    • In this example, we use PALLET as the job file name
    • int NRC_CreateJobfile(std::string jobname);
      • jobname is the name of the job file to be created
  • Open the job file using NRC_OpenJobfile("PALLET");

    • int NRC_OpenJobfile(std::string jobname);
      • jobname is the name of the job file to be opened
  • Insert motion instructions to move the robot to the fixed pickup point

    • Example: NRC_Position pickPos; NRC_JobfileInsertMOVJ(1, 100, 100, 100, pickPos, 5);
    • If obstacle avoidance is required during picking, you can insert additional motion instructions as needed. This example only shows one for illustration purposes
    • int NRC_JobfileInsertMOVJ(int line, int vel, int acc, int dec, const NRC_Position& target, int pl=0,int tm = 0);
      • line: The line number where the instruction will be inserted
      • vel: The running speed of the robot, as the percentage of the maximum speed of the robot. Parameter range: 0 < vel <= 100
      • acc: Robot running acceleration, as a percentage of the maximum acceleration of each joint of the robot. Parameter range: 0 < acc <= 100
      • Robot running deceleration, as a percentage of the maximum deceleration of each joint of the robot. Parameter range: 0 < dec <= 100
      • target: Robot motion target position
      • pl: Smoothness, which refers to the smooth transition between the current and the next movement instructions. The higher the value of pl, the smoother the transition, but the greater the trajectory deviation. Parameter range: 0 <= pl <= 5
  • Insert DOUT instruction to output high level through IO port, so as to facilitate the gripper or suction cup to grab the workpiece

    • NRC_JobfileInsertDOUT(2, 1, 1);: In this example, IO port 1 is used to control the gripper or suction cup
    • int NRC_JobfileInsertDOUT(int line, int port, int value);
      • line: The line number where the instruction will be inserted
      • port: The number of the digital output port to be used for output, parameter range: port > 0
      • value: The state of the output on the port, 0: low level, 1: high level
  • Insert TIMER instruction to wait for the gripper or suction cup to grab the workpiece

    • NRC_JobfileInsertTIMER(3, 0.5);: In this example, a delay of 0.5 seconds is used for illustration
    • int NRC_JobfileInsertTIMER(int line, double timeSec);
      • line: The line number where the instruction will be inserted
      • timeSec: Delay time, in seconds, parameter range: timeSec > 0
  • Insert PALON instruction: NRC_JobfileInsertPALON(4, 1, 0);, in this example, process number 1 is used for palletizing

    • int NRC_JobfileInsertPALON(int line, int id, int type, int var1=0, int var2=0, int var3=0);
      • line: The line number where the instruction will be inserted
      • id: The process number of the palletizing process to be used
      • type: Palletizing type, 0: palletizing, 1: depalletizing
  • Insert PALENTER instruction: NRC_JobfileInsertPALENTER(5, 1, 1, 100, 100, 100, 5);

    • int NRC_JobfileInsertPALENTER(int line, int id, int moveType, int vel, int acc, int dec, int pl);
      • line: The line number where the instruction will be inserted
      • id: The process number of the palletizing process to be used
      • moveType: Interpolation method used by this instruction; 1: Joint interpolation; 2: Linear interpolation; 3: Circular interpolation
      • vel: The running speed of the robot
        • When the interpolation method is joint interpolation, it is the percentage of the maximum speed of the robot, parameter range: 0 < vel <= 100
        • When the interpolation method is linear interpolation or circular interpolation, it is the absolute running speed of the robot TCP, the unit is mm/s, parameter range: vel > 1
      • acc: Robot running acceleration, parameter range: 0 < acc <= 100
        • When the interpolation method is joint interpolation, it is the percentage of the maximum acceleration of each joint of the robot
        • When the interpolation method is linear interpolation or circular interpolation, it is the percentage of the robot's maximum Cartesian acceleration
      • dec: Robot running deceleration, same as acc
      • pl: Smoothness, which refers to the smooth transition between the current and the next movement instructions. The higher the value of pl, the smoother the transition, but the greater the trajectory deviation. Parameter range: 0 <= pl <= 5
  • Insert PALSHIFT instruction: NRC_JobfileInsertPALSHIFT(6, 1, 1, 100, 100, 100, 5);

    • NRC_JobfileInsertPALSHIFT(int line, int id, int moveType, int acc, int dec, int vel, int pl=0);
      • All parameters are the same as "Insert PALENTER instruction"
  • Insert PALREAL instruction: NRC_JobfileInsertPALREAL(7, 1, 2, 100, 100, 100, 5);

    • NRC_JobfileInsertPALREAL(int line, int id, int moveType, int acc, int dec, int vel, int pl=0);
      • All parameters are the same as "Insert PALENTER instruction"
  • Insert DOUT instruction to output low level through IO port, so as to facilitate the gripper or suction cup to release the workpiece

    • NRC_JobfileInsertDOUT(8, 1, 0);
  • Insert TIMER instruction to wait for the gripper or suction cup to release the workpiece

    • NRC_JobfileInsertTIMER(9, 0.5);
  • Insert PALSHIFT instruction

    • NRC_JobfileInsertPALSHIFT(10, 1, 1, 100, 100, 100, 5);
  • Insert PALENTER instruction

    • NRC_JobfileInsertPALENTER(11, 1, 1, 100, 100, 100, 5);
  • Insert PALOFF instruction: NRC_JobfileInsertPALOFF(12, 1);

    • int NRC_JobfileInsertPALOFF(int line, int id, int var=0);
      • line: The line number where the instruction will be inserted
      • id: The process number of the palletizing process to be used

The job file using the palletizing process package has been successfully created.

Appendix:

NRC_CreateJobfile("PALLET");
NRC_OpenJobfile("PALLET");
NRC_Position pickPos;
NRC_JobfileInsertMOVJ(1, 100, 100, 100, pickPos, 5);
NRC_JobfileInsertDOUT(2, 1, 1);
NRC_JobfileInsertTIMER(3, 0.5);
NRC_JobfileInsertPALON(4, 1, 0);
NRC_JobfileInsertPALENTER(5, 1, 1, 100, 100, 100, 5);
NRC_JobfileInsertPALSHIFT(6, 1, 1, 100, 100, 100, 5);
NRC_JobfileInsertPALREAL(7, 1, 2, 100, 100, 100, 5);
NRC_JobfileInsertDOUT(8, 1, 0);
NRC_JobfileInsertTIMER(9, 0.5);
NRC_JobfileInsertPALSHIFT(10, 1, 1, 100, 100, 100, 5);
NRC_JobfileInsertPALENTER(11, 1, 1, 100, 100, 100, 5);
NRC_JobfileInsertPALOFF(12, 1);
If there are errors in this article please give us feedback, we value your comments or suggestions.