# MToolTCPCalib - 4 Axis robot?

**URL:** <https://tech-community.robotics.abb.com/t/mtooltcpcalib-4-axis-robot/9762>\
**Category:** RAPID Programming\
**Tags:** tcp-calibration, tcp, tool-center-point\
**Created:** [October 21, 2020, 11:56am UTC](https://tech-community.robotics.abb.com/t/mtooltcpcalib-4-axis-robot/9762 "2020-10-21T11:56:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![JacquesTheAutomater](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@JacquesTheAutomater](https://tech-community.robotics.abb.com/u/JacquesTheAutomater)\
**Post date:** [October 21, 2020, 11:56am UTC](https://tech-community.robotics.abb.com/t/mtooltcpcalib-4-axis-robot/9762/1 "2020-10-21T11:56:59Z")

</div>

Good day,

I have used the ABB RAPID function **MToolTCPCalib** in the past to teach the TCP offset of a calibration pin tool with a 6 axis robot.  
However attempting to repeat the same with a virtual IRB 660 4 axis robot I keep getting the error below, regardless of actual passed joint targets:

40801: Calculation error  
Description  
Task: MAINTASK  
Cannot calculate the tool frame.  
Program Ref. /Teach/rCalculateAndDisplayTCP/MToolTCPCalib/87

Causes  
It is not possible to calculate the tool frame with the selected approach points.  
Actions  
Select new approach points as accurate as possible.

Does anyone know if it is actually possible to use **MToolTCPCalib** to get the x,y,z TCP offset of a tool with a 4 axis robot?

Thanks in advance,

# 

#

---

<div class="post-metadata">

**Author:** ![xerim](https://avatars.discourse-cdn.com/v4/letter/x/2bfe46/32.png) [@xerim](https://tech-community.robotics.abb.com/u/xerim)\
**Post date:** [October 21, 2020, 12:17pm UTC](https://tech-community.robotics.abb.com/t/mtooltcpcalib-4-axis-robot/9762/2 "2020-10-21T12:17:28Z")

</div>

Are you sure you are assigning the points as jointtargets and not robtargets?

---

<div class="post-metadata">

**Author:** ![JacquesTheAutomater](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@JacquesTheAutomater](https://tech-community.robotics.abb.com/u/JacquesTheAutomater)\
**Post date:** [October 21, 2020, 12:36pm UTC](https://tech-community.robotics.abb.com/t/mtooltcpcalib-4-axis-robot/9762/3 "2020-10-21T12:36:32Z")

</div>

Hi xerim,

Thanks for the feedback, yes indeed MToolTCPCalibis being passed 4 joint targets:

```auto
MToolTCPCalib jp1,jp2,jp3,jp4,tCalPin,nMaxErr,nMeanErr;

```

where jp1 - jp4 are joint targets:

```auto
TASK VAR jointtarget jp1:=[[157.47,-16.2178,36.1094,0,0,85.735],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

TASK VAR jointtarget jp2:=[[146.052,4.97363,38.7396,0,0,-206.682],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

TASK VAR jointtarget jp3:=[[152.539,-25.0653,32.5315,0,0,-299.196],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

TASK VAR jointtarget jp4:=[[132.324,-34.0644,27.6696,0,0,-27.4108],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

```

---

<div class="post-metadata">

**Author:** ![xerim](https://avatars.discourse-cdn.com/v4/letter/x/2bfe46/32.png) [@xerim](https://tech-community.robotics.abb.com/u/xerim)\
**Post date:** [October 21, 2020, 2:02pm UTC](https://tech-community.robotics.abb.com/t/mtooltcpcalib-4-axis-robot/9762/4 "2020-10-21T14:02:13Z")

</div>

According to the technical reference manual, there are a list of conditions that must be fulfilled before using the instruction MToolTCPCalib. See below

 ![image.png](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/2X/d/d4323743f2335097247119a90cb43a4a4c1eb76f.png)

---

<div class="post-metadata">

**Author:** ![innebandy](https://avatars.discourse-cdn.com/v4/letter/i/67e7ee/32.png) [@innebandy](https://tech-community.robotics.abb.com/u/innebandy)\
**Post date:** [October 22, 2020, 1:15am UTC](https://tech-community.robotics.abb.com/t/mtooltcpcalib-4-axis-robot/9762/5 "2020-10-22T01:15:05Z")

</div>

The orientation of 4 targets should be different each other as the picture attached. Otherwise, you will get the error because the calculation result is infinite. And of course this is the limitation of 4 axis robot.

---

<div class="post-metadata">

**Author:** ![JacquesTheAutomater](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@JacquesTheAutomater](https://tech-community.robotics.abb.com/u/JacquesTheAutomater)\
**Post date:** [October 22, 2020, 6:00pm UTC](https://tech-community.robotics.abb.com/t/mtooltcpcalib-4-axis-robot/9762/6 "2020-10-22T18:00:37Z")

</div>

Thanks innebandy, so it seems that a difference in orientation via rotation around world z axis alone is not enough, and MToolTCPCalib therefore does not work on 4 axis robots.#

---

<div class="post-metadata">

**Author:** ![innebandy](https://avatars.discourse-cdn.com/v4/letter/i/67e7ee/32.png) [@innebandy](https://tech-community.robotics.abb.com/u/innebandy)\
**Post date:** [October 24, 2020, 12:23am UTC](https://tech-community.robotics.abb.com/t/mtooltcpcalib-4-axis-robot/9762/7 "2020-10-24T00:23:43Z")

</div>

You’ve got a point there.
