
 Typically, a robot program is a sequence of positions to which the robot arm must come. Each of these positions are characterized by the position of TCP (Tool Center Point) - the point of the tip of the tool installed on the manipulator. By default, TCP is located in the center of the robot flange, see the figure below, but its position can be reconfigured and most often so that TCP coincides with the tip of the installed tool on the robot arm. Therefore, usually when programming, the TCP position is set in space, and the robot determines the position of the joints of the manipulator itself. Further in the article the term “TCP position” will be used, or in other words the point to which the robot must “come”.
 Typically, a robot program is a sequence of positions to which the robot arm must come. Each of these positions are characterized by the position of TCP (Tool Center Point) - the point of the tip of the tool installed on the manipulator. By default, TCP is located in the center of the robot flange, see the figure below, but its position can be reconfigured and most often so that TCP coincides with the tip of the installed tool on the robot arm. Therefore, usually when programming, the TCP position is set in space, and the robot determines the position of the joints of the manipulator itself. Further in the article the term “TCP position” will be used, or in other words the point to which the robot must “come”.

include "chars.rcml" function main(){ try { //  @fr = robot_fanuc; system.echo("Start move program\n"); //   ,  , ,  @fr->set_real_di("speed", SPEED); @fr->set_real_di("cnt", CNT); @fr->startProgram(UFRAME, UTOOL, PAYLOAD); system.echo("prepare\n"); @fr->prepare(); system.echo("start draw\n"); //,  Python,  @fr->draw_r_P(0, 0); @fr->draw_P(1, 0); @fr->draw_r_I(2, 0); @fr->draw_B(3, 0); @fr->draw_E(4, 0); @fr->draw_T(5, 0); @fr->draw_Comm(6, 0); @fr->draw_r_L(8, 0); @fr->draw_r_Yu(9, 0); @fr->draw_r_D(10, 0); @fr->draw_r_I(11, 0); @fr->draw_Exclamation(12, 0); @fr->draw_H(14, 0); @fr->draw_A(15, 0); @fr->draw_M(16, 0); @fr->draw_H(18, 0); @fr->draw_r_U(19, 0); @fr->draw_r_Je(20, 0); @fr->draw_E(21, 0); @fr->draw_H(22, 0); @fr->draw_P(0, 1); @fr->draw_A(1, 1); @fr->draw_r_Z(2, 1); @fr->draw_P(3, 1); @fr->draw_A(4, 1); @fr->draw_r_B(5, 1); @fr->draw_O(6, 1); @fr->draw_T(7, 1); @fr->draw_r_Che(8, 1); @fr->draw_r_I(9, 1); @fr->draw_K(10, 1); @fr->draw_Dot(11, 1); @fr->draw_r_D(12, 1); @fr->draw_r_L(13, 1); @fr->draw_r_Ya(14, 1); @fr->draw_C(16, 1); @fr->draw_O(17, 1); @fr->draw_r_Z(18, 1); @fr->draw_r_D(19, 1); @fr->draw_A(20, 1); @fr->draw_H(21, 1); @fr->draw_r_I(22, 1); @fr->draw_r_Ya(23, 1); @fr->draw_B(25, 1); @fr->draw_E(26, 1); @fr->draw_r_B(27, 1); @fr->draw_r_I(0, 2); @fr->draw_H(1, 2); @fr->draw_T(2, 2); @fr->draw_E(3, 2); @fr->draw_P(4, 2); @fr->draw_r_F(5, 2); @fr->draw_E(6, 2); @fr->draw_r_Ii(7, 2); @fr->draw_C(8, 2); @fr->draw_A(9, 2); @fr->draw_C(11, 2); @fr->draw_r_I(12, 2); @fr->draw_C(13, 2); @fr->draw_T(14, 2); @fr->draw_E(15, 2); @fr->draw_M(16, 2); @fr->draw_r_y(17, 2); @fr->draw_H(19, 2); @fr->draw_A(20, 2); @fr->draw_r_Sha(21, 2); @fr->draw_r_I(22, 2); @fr->draw_X(23, 2); @fr->draw_r_Z(0, 3); @fr->draw_H(1, 3); @fr->draw_A(2, 3); @fr->draw_H(3, 3); @fr->draw_r_I(4, 3); @fr->draw_r_Ii(5, 3); @fr->draw_Dot(6, 3); @fr->draw_T(8, 3); @fr->draw_A(9, 3); @fr->draw_K(10, 3); @fr->draw_M(12, 3); @fr->draw_r_y(13, 3); @fr->draw_C(15, 3); @fr->draw_M(16, 3); @fr->draw_O(17, 3); @fr->draw_r_Je(18, 3); @fr->draw_E(19, 3); @fr->draw_M(20, 3); @fr->draw_r_P(22, 3); @fr->draw_E(23, 3); @fr->draw_P(24, 3); @fr->draw_E(25, 3); @fr->draw_H(26, 3); @fr->draw_r_Ya(27, 3); @fr->draw_T(28, 3); @fr->draw_soft_sign(29, 3); @fr->draw_O(0, 4); @fr->draw_T(1, 4); @fr->draw_B(3, 4); @fr->draw_A(4, 4); @fr->draw_C(5, 4); @fr->draw_r_Ge(7, 4); @fr->draw_r_U(8, 4); @fr->draw_M(9, 4); @fr->draw_A(10, 4); @fr->draw_H(11, 4); @fr->draw_O(12, 4); @fr->draw_r_Ii(13, 4); @fr->draw_r_D(14, 4); @fr->draw_O(15, 4); @fr->draw_B(16, 4); @fr->draw_r_Z(18, 4); @fr->draw_H(19, 4); @fr->draw_A(20, 4); @fr->draw_H(21, 4); @fr->draw_r_I(22, 4); @fr->draw_r_Ya(23, 4); @fr->draw_Dot(24, 4); //  ,         @fr->set_real_di("speed", 10); @fr->rotateMarker(); @fr->set_real_di("speed", SPEED); @fr->draw_r_I(0, 6); @fr->draw_H(2, 6); @fr->draw_A(3, 6); @fr->draw_K(4, 6); @fr->draw_O(5, 6); @fr->draw_H(6, 6); @fr->draw_E(7, 6); @fr->draw_r_Ce(8, 6); @fr->draw_Minus(9, 6); @fr->draw_T(10, 6); @fr->draw_O(11, 6); @fr->draw_M(13, 6); @fr->draw_r_y(14, 6); @fr->draw_C(16, 6); @fr->draw_M(17, 6); @fr->draw_O(18, 6); @fr->draw_r_Je(19, 6); @fr->draw_E(20, 6); @fr->draw_M(21, 6); @fr->draw_r_Z(0, 7); @fr->draw_A(1, 7); @fr->draw_X(2, 7); @fr->draw_B(3, 7); @fr->draw_A(4, 7); @fr->draw_T(5, 7); @fr->draw_r_I(6, 7); @fr->draw_T(7, 7); @fr->draw_soft_sign(8, 7); @fr->draw_r_U(10, 7); @fr->draw_r_L(11, 7); @fr->draw_r_U(12, 7); @fr->draw_r_Che(13, 7); @fr->draw_r_Sha(14, 7); @fr->draw_r_I(15, 7); @fr->draw_T(16, 7); @fr->draw_soft_sign(17, 7); @fr->draw_r_aE(19, 7); @fr->draw_T(20, 7); @fr->draw_O(21, 7); @fr->draw_T(22, 7); @fr->draw_M(24, 7); @fr->draw_r_I(25, 7); @fr->draw_P(26, 7); @fr->draw_r_P(0, 9); @fr->draw_O(1, 9); @fr->draw_r_D(2, 9); @fr->draw_P(3, 9); @fr->draw_O(4, 9); @fr->draw_r_B(5, 9); @fr->draw_H(6, 9); @fr->draw_E(7, 9); @fr->draw_E(8, 9); @fr->draw_two_dots(9, 9); @fr->draw_H(11, 9); @fr->draw_T(12, 9); @fr->draw_T(13, 9); @fr->draw_P(14, 9); @fr->draw_two_dots(15, 9); @fr->draw_Slash(16, 9); @fr->draw_Slash(17, 9); @fr->draw_R(18, 9); @fr->draw_O(19, 9); @fr->draw_B(20, 9); @fr->draw_O(21, 9); @fr->draw_T(22, 9); @fr->draw_C(23, 9); @fr->draw_T(24, 9); @fr->draw_Dot(25, 9); @fr->draw_C(26, 9); @fr->draw_O(27, 9); @fr->draw_M(28, 9); @fr->draw_Slash(29, 9); @fr->draw_H(30, 9); @fr->draw_I(31, 9); @fr->draw_r_I(2, 10); @fr->draw_C(3, 10); @fr->draw_K(4, 10); @fr->draw_P(5, 10); @fr->draw_E(6, 10); @fr->draw_H(7, 10); @fr->draw_H(8, 10); @fr->draw_E(9, 10); @fr->draw_B(11, 10); @fr->draw_A(12, 10); @fr->draw_r_Sha(13, 10); @fr->draw_S(15, 10); @fr->draw_K(16, 10); @fr->draw_Y(17, 10); @fr->draw_N(18, 10); @fr->draw_E(19, 10); @fr->draw_T(20, 10); @fr->draw_Equal(22, 10); @fr->draw_Roof(23, 10); @fr->draw_Minus(24, 10); @fr->draw_Roof(25, 10); @fr->draw_Equal(26, 10); //    @fr->stopProgram(); @fr->go_home(); } catch(E){ system.echo("Exception catched!"); return E; } return 0; }  function robot_fanuc::draw_A(x_cell,y_cell){ //   ,   5%    95%  Y    robot->setPoint(x_cell, y_cell, 5, 95); //  robot->movePoint(x_cell, y_cell, 50, 5); //   robot->movePoint(x_cell, y_cell, 95, 95); // "" /\ //         robot->setPoint(x_cell, y_cell, 35, 50); //  robot->movePoint(x_cell, y_cell, 65, 50); //         robot->marker_up(); }  //            function robot_fanuc::setPoint(x_cell, y_cell, x_percent, y_precent){ //   x = calculate_absolute_coords_x(x_cell, x_percent); y = calculate_absolute_coords_y(y_cell, y_precent); robot->marker_up(); //     robot->marker_move(x,y); //  robot->marker_down(); //     } //     / function robot_fanuc::movePoint(x_cell, y_cell, x_percent, y_precent){ x = calculate_absolute_coords_x(x_cell, x_percent); y = calculate_absolute_coords_y(y_cell, y_precent); //    :) robot->marker_move(x,y); }  function robot_fanuc::marker_up(){ robot->set_real_di("z", SAFE_Z); er = robot->sendMoveSignal(); if (er != 0){ system.echo("error marker up\n"); throw er; } } function robot_fanuc::marker_down(){ robot->set_real_di("z", START_Z); er = robot->sendMoveSignal(); if (er != 0){ system.echo("error marker down\n"); throw er; } } function robot_fanuc::marker_move(x,y){ robot->set_real_di("x", x); robot->set_real_di("y", y); er = robot->sendMoveSignal(); if (er != 0){ system.echo("error marker move\n"); throw er; } }  define CHAR_HEIGHT_MM 50 //     define CHAR_WIDTH_PERCENT 60 //       define SAFE_Z -20 //       z define START_Z 0 //       z //    define BORDER_Y 120 define BORDER_X 75 //  ON/OFF define ON 1 define OFF 0 //      define _SIGNAL_PAUSE_MILLISEC 50 define _OFF_PAUSE_MILLISEC 200 //      –    define START_W -179.707 //  define START_P -2.500 //  define START_R 103.269 //  //      define SECOND_W -179.704 //  define SECOND_P -2.514 //  define SECOND_R -14.699 //  define CHAR_OFFSET_MM 4 //    define UFRAME 4 //   define UTOOL 2 //   define PAYLOAD 4 //   define SPEED 100 //  define CNT 0 //    define ROTATE_SPEED //    define HOME_PNS 4 //  PNS      
Source: https://habr.com/ru/post/283226/
All Articles