Skip to content
Bas Janssen edited this page May 5, 2017 · 16 revisions

Writing with the ABB IRB120

A video of this demo can be found on Youtube.

The writing

In this demo application, the IRB120 arm writes text on a sheet of A4 paper. The text can be arbitrary, and is drawn using the alphabet described below. To compute the motion plan for the arm, this path is fed to the Descartes planner. Descartes allows planning a semi-constrained path (5DOF) for a 6DOF arm. In this application the path is limited around the writing tip of the end effector. The arm is allowed to rotate the tool around the Z-axis, but not around the X or Y axis.

A guide to install this demo, and the dependencies for the demo see the Installation page.

The alphabet

To be able to write all words with the ABB IRB120 all of the letters had to be programmed in the code. For every letter there is an xOffset, yOffset, safeOffset and a step.

The xOffset is for the space between the bottom of the letter and the horizontal axis of the robot. The same goes for the yOffset but this is the space between the the left part of the letter and the vertical axis of the robot.

The safeOffset is the space the pencil has to be lifted when it has to chance location and doesn't want to write on the paper.

The parameter step is used to make the letter bigger or smaller, the max dimensions of a letter are (10xstep) x (10xstep). The parameters yOffset is also used to write all the letters next to each other.

After every letter the yOffset will be lowered with 10xstep and a litle space so the next letter can be written next to the letter.

At the beginning, when the word has been given, the program will check how many letters are in the word and will than set a proper yOffset for the first letter to make sure the text is centered in relation to the base of the robot.

As an example of the code: The letter T

//T
EigenSTL::vector_Affine3d createT(EigenSTL::vector_Affine3d points, float safeOffset, float xOffset, float yOffset, float step) // You'll get a vector with the parameters point, safeOffset, xOffset, yOffset en step.
{
//Offset
  for (unsigned int i = 0; i < 1; i++) // This step only requires 1 step, when this step is compleet it will go to the next for loop.
  {
    Eigen::Affine3d pose;
    pose = Eigen::Translation3d((xOffset + step *10), yOffset, safeOffset); // the pencil will start in the top right corner.
    points.push_back(pose);// It adds a point to the vector.
  } 	
  //Part 1/2
  for (unsigned int i = 0; i < 11; i++)// This part of the letter will be done in 11 steps.
  {
    Eigen::Affine3d pose;
    pose = Eigen::Translation3d((xOffset + step * 10), yOffset - step * i, 0.0);//The pencil will move to the right without chancing the x coordinate to create a horizontal line.
    points.push_back(pose);// It adds a point to the vector.
  }  
  //Move the tool from the worksurface
  for (unsigned int i = 0; i<1; i++) // The pencil will be lifted of the paper.
  {
    Eigen::Affine3d pose;
    pose = Eigen::Translation3d((xOffset + step * 10) , (yOffset - step * 10), safeOffset);// The z coordinate will be changed so the pencil is lifted of the paper. 
    points.push_back(pose);// It adds a point to the vector.
  } 
  //Move the tool to part 2/2
  for (unsigned int i = 0; i<1; i++)// Move to the next coordinate in one step.
  {
    Eigen::Affine3d pose;
    pose = Eigen::Translation3d((xOffset + step * 10), (yOffset - step * 5) , safeOffset);// The height will be the same and the pencil will move to the middle of the previous line.
    points.push_back(pose);// It adds a point to the vector.
  } 
  //Part 2/2
  for (unsigned int i = 0; i < 11; i++)// This part of the T will be done in 11 steps.
  {
    Eigen::Affine3d pose;
    pose = Eigen::Translation3d((xOffset + step * 10) - step * i, (yOffset - step * 5), 0.0);// The yOffset will remain the same and the xOffset will go from xOffset + step * 10 to xOffset to create a vertical line.
    points.push_back(pose);// It adds a point to the vector.
  }   
  //Move the tool from the worksurface
  for (unsigned int i = 0; i<1; i++)// The pencil will be lifted of the paper so the next letter van be written.
  {
    Eigen::Affine3d pose;
    pose = Eigen::Translation3d(xOffset , (yOffset - step * 5), safeOffset);//  The z coordinate will be changed so the pencil is lifted of the paper. 
    points.push_back(pose);// It adds a point to the vector.
  }   
  return points; // It returns the vector to where it was called from.
}
Clone this wiki locally