How to deal with "Joint Out of Range" errors.
pollux
✭
in RobotStudio
Dear reader,
I'm new with ABB/RAPID/etc.. and trying some code in RobotStudio. One of the
errors I get are "Joint out of range" errors. I created a simple test application to
get me going with RAPID. I'm using a IRB 140 but the code below gives an
"Joint out of range" on the secons `MoveJ`
MODULE ServerFUNC robtarget create_robtarget(num x, num y, num z)RETURN [ [x, y, z], [1,0,0,0], [1,0,0,0], [9E9, 9E9, 9E9, 9E9, 9E9, 9E9] ];ENDFUNCPROC main()MoveJ create_robtarget(600,0,600), vmax, z0, tool0;MoveJ create_robtarget(600,0,500), vmax, z0, tool0;Stop;ENDPROCENDMODULE
Thanks,
pollux
0
Comments
-
It's probably because you have the default orientation. Obviously, the robot has problems to reach it. To try your code out why not teach some points in RobotStudio, generate the RAPID by syncing and checking out the robtarget coordinates and quaternions. Then you can use these values to 'debug' your program and get a feeling for what is working.
If you need to convert between angles and quaternions you can use try the an Excel addin I posted on RobotApps a while ago.
Kind regards,
Henrik
Henrik Berlin
ABB0 -
If you don't care about configuration you could also turn of configuration ConfJ\Off for joint motion. But at some point you need to take care of configuration depending on your robot motion.Per Svensson
Robotics and Vision Specialist
Consat Engineering0 -
Hi Henrik and PerSvensson,Thanks for the quick reply! Because I'm using `tool0` and the Z-axis was pointing upwards I guess the joints could't figure out how to get into that position using the current configurations. For my final application I will only have a single tiny point (LED, light) mounted on the TCP. I want this LED to point into the X-axis of the robot base. Then move it around in the Y-Z plane (maybe later I want to change the X a bit too, but not a lot). I want to be flexible and therefore use `wobj0` as the base orientation (from what I understood this is the base orientation of the robot).What would be the best way that allows me to move the 'LED' in the Y-Z plane (relative to wobj0/base of robot) where the tcp X-axis always points forwards (or aligns with the X-axis of the base). I don't mind what kind of movement the other joints make as long as the LED.And as a side question I was wondering if there are functions that can return the min/max reach in a specific axis based on the current position of the tcp?Thankspollux0
-
There are 2 ways you could either move in the wobj coordinate using Offs on the move instruction or you can move in the tool coordinate system using RelTool.And ofcourse you can define your own wobj/tool that has the orientation you want instead of using the predefined wobj0 and tool0Regarding checking if you can reach a certain position you can use CalcJointT on a robtarget and implement an error handler that checks for ERR_ROBLIMIT, look in rapid manual on CalcJointTPer Svensson
Robotics and Vision Specialist
Consat Engineering0 -
Hi PerSvensson,Thanks! I have to get my hands dirty a bit and start trying out some of the things you mention. I'm learning as I'm going with this project.I think, that when I can reorientate the tcp in such a way that it aligns as in the attached screenshot. I can move it in the XY plane which is good for now.Can someone maybe give me a head start and show me in code how I can orientate the tool0 like shown in the screenshot below and then e.g. move it a bit from left, right?I just tried using the code below which I copied for a big part from the manual though I'm getting a semantic error (which I don't understand as I'm following the manual).MODULE ServerPERS tooldata pen:=[TRUE,[[1,0,0],[1,0,0,0]],[0.001,[0,0,0.001],[1,0,0,0],0,0,0]];FUNC robtarget create_robtarget(num x,num y,num z)RETURN [[x,y,z],[1,0,0,0],[1,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];ENDFUNCPROC main()VAR robtarget p0 := create_robtarget(0,0,0);MoveL RelTool(p0, 10, 0, 0),vmax,z0,tool0;MoveL RelTool(p0, -10, 0, 0),vmax,z0,tool0;ENDPROCENDMODULEThanks!0
-
Here are some code that may help you understand a little bit. A robtarget's position is the position relative to the wobj you are using in the move instruction.Instead of adding the orientation in the offs (\RY) you can rotate the target from the beginning by setting the quartinions rightMODULE ServerPERS tooldata pen:=[TRUE,[[1,0,0],[1,0,0,0]],[0.001,[0,0,0.001],[1,0,0,0],0,0,0]];PERS wobjdata myWobj:=[FALSE,TRUE,"",[[400,0,400],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];CONST robtarget myRobtarget:=[[0,0,0],[1,0,0,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];PROC main()MoveAbsJ [[0,0,0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]],vmax,fine,tool0;ConfJ\Off;ConfL\Off;MoveJ RelTool(myRobtarget,0,0,0\Ry:=90),vmax,z0,tool0\WObj:=myWobj;MoveL RelTool(myRobtarget,100,0,0\Ry:=90),vmax,z0,tool0\WObj:=myWobj;ENDPROCENDMODULEPer Svensson
Robotics and Vision Specialist
Consat Engineering0 -
Hey PerSvensson, you're the best!Good to see some code, that makes understanding RAPID a lot easier.I'm moving the tcp around now and I made quite some progress. Though, to make it a bit more complicated I just thought that in my situation where I'm going to attach a LED/light bulb onto the tcp, the tcp doesn't need to be pointing into the exact same location when I move the arm around because the light will be still visible, even when the tcp is rotated around all axis a little bit. Would it be possible to move the tcp to an arbitrary position on a plane where I allow the abb to move/re-orientate the tcp in a field where I define the angle of freedom? I've attached a screenshot where I drew the angle in which the tcp is allowed to rotate. I'm not sure if this all makes sense but I hope it does.Maybe I can clarify this a bit by describing where I'm working towards. I'm going to position a camera in front of the abb and capture the video frames using an application I developed. In this application I'm blending all the frames on top of each other so that when the abb moves I'll see a bright stroke from the light bulb/led that is attached to the tcp. Because I'll still capture some light of the bulb when the tcp is not 100% orientated towards the camera the abb has more freedom to move around. Currently I notice that the area in which I can move the tcp around is a bit limited because it tries to keep the position/orientation of the tcp stable. So, what I'm after is a way that I can tell the abb that it can move freely around and orientate the tcp in a way it wants as long as the X (relative to the wobj0) stays the same. Or, if possible I tell that abb that it can move in a plane and has N-degrees of freedom as shown in the image below.Thanks so much!pollux0
-
HiI'm not quite sure what you mean. So do you just want the tcp to rotate around it self at a fixed position in space? that is possibleA robot always reach the programmed position.Per Svensson
Robotics and Vision Specialist
Consat Engineering0 -
Sorry, I think I didn't really explained it correctly.But in short it, I want to move the x/y/z of the tcp in a plane and I don't really care what the orientation of the tcp is when it reaches the x/y/z point.0
-
I see, but the robot always match the tcp coordinate system with the target coordinate system.Here are some more code, was a little bit confusing the first I gave you regarding reltool. I have oriented the target (quartinions) so it's rotated rightMODULE ServerPERS tooldata myTool:=[TRUE,[[0,0,1],[1,0,0,0]],[1,[0,0,0.1],[1,0,0,0],0,0,0]];TASK PERS wobjdata myWobj:=[FALSE,TRUE,"",[[400,0,400],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];CONST robtarget myRobtarget:=[[0,0,0],[0.707107,0,0.707107,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];PROC main()MoveAbsJ [[0,0,0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]],vmax,fine,myTool;ConfJ\Off;ConfL\Off;MoveJ myRobtarget,vmax,fine,tool0\WObj:=myWobj;MoveL Offs(myRobtarget,200,0,0),vmax,z0,tool0\WObj:=myWobj;MoveL RelTool(Offs(myRobtarget,200,0,0),0,0,0\Rx:=-45),vmax,z0,tool0\WObj:=myWobj;MoveL RelTool(Offs(myRobtarget,200,0,0),0,0,0\Rx:=0),vmax,z0,tool0\WObj:=myWobj;MoveL RelTool(Offs(myRobtarget,200,0,0),0,0,0\Rx:=45),vmax,z0,tool0\WObj:=myWobj;ENDPROCENDMODULEPer Svensson
Robotics and Vision Specialist
Consat Engineering1 -
UPDATE:Answering my own question here. In the code below the RelTool() is not used as I'm still only changing the x/y/z values inside the Offs() call. When I use somethinglike the code below I'm moving along the axis of the tool.MoveL RelTool(myRobtarget, 0, -100, 0), vmax, z0, tool0, \WObj:=myWobj;-------------------------
Hi,I would have expected that the robot would move into the Z-axis of the tool when using the code below. Though when I use this it's moving into the Z-axis of the "world"/robot.MODULE ServerPERS tooldata myTool:=[TRUE,[[0,0,1],[1,0,0,0]],[1,[0,0,0.1],[1,0,0,0],0,0,0]];TASK PERS wobjdata myWobj:=[FALSE,TRUE,"",[[400,0,400],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];VAR robtarget myRobtarget:=[[0,0,0],[1,0,0,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];PROC main()MoveAbsJ [[0,0,0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]],vmax,fine,tool0;ConfJ\Off;ConfL\Off;myRobtarget.rot := OrientZYX(0, 90, 0);MoveJ myRobtarget,vmax,fine,tool0\WObj:=myWobj;MoveL RelTool(Offs(myRobtarget, 0, 0, 0), 0, 0, 0),vmax,z0,tool0,\WObj:=myWobj;MoveL RelTool(Offs(myRobtarget, 0, 0, 100), 0, 0, 0),vmax,z0,tool0,\WObj:=myWobj;MoveL RelTool(Offs(myRobtarget, 0, 0, 0), 0, 0, 0),vmax,z0,tool0,\WObj:=myWobj;MoveL RelTool(Offs(myRobtarget, 0, 0, 100), 0, 0, 0),vmax,z0,tool0,\WObj:=myWobj;WaitTime 1;ENDPROCENDMODULEWhen I look into the reference for RelTool, I see:RelTool (Relative Tool) is used to add a displacement and/or a rotation, expressed in the active tool coordinate system, to a robot position.Which is why I would expect a movement into Z (100mm above), to result in a movement along the x-axis of the robot. I've attached a screenshot of how the `tcp` is oriented.ThankspolluxPost edited by pollux on0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings