Singularity

Also checkout the new CB3 forum

Handling Singularity.

When programming the robot you might experience sometime the robot is stopping with a safety stop called “Joint Limit Violation” or similar error messages. And you can observe the robot was trying to reach a Waypoint you had set, but it was not possible due to mathematically and physical limitations. This can especially happen in MoveL (linear mode) programming. It does not mean that the robot cannot go to the Waypoint you have defined, but it cannot reach there in the way programmed.

Consider you arm and reaching for a coin that is in between your elbow and wrist. If you are not allowed to move you body posture – then it is very difficult to reach and grab the coin. But when you can move you body posture then it is very easy to pick the coin.

Similar situation can occur during programming the robot where it will be impossible for the robot to take a linear move from where it was to reach and grab the coin. The robot will attempt and you will se a rapid increase in speed and very fast thereafter the robot stop with joint error messages in order not to spoil the robot.

Just reposition the robot posture and waypoints and the robot can reach the target.

universal-robots-zacobria-singularity-1

 

Sometimes you will see the robot accelerate and then suddenly stop with a safety stop. This is also Singularity when the robot reaches a point where the mathematic is nearing an illegal calculation e.g. like divide with zero. In the example of dived by zero the robot control might reach values that is only fraction e.g. 0.0000000000x which is virtual a zero and therefore the robot will stop with a Safety stop if the programming reach such value.

Disclaimer: While the Zacobria Pte. Ltd. believes that information and guidance provided is correct, parties must rely upon their skill and judgement when making use of them. Zacobria Pte. Ltd. assumes no liability for loss or damage caused by error or omission, whether such an error or omission is the result of negligence or any other cause. Where reference is made to legislation it is not to be considered as legal advice. Any and all such liability is disclaimed.

If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.

Author:
By Zacobria Lars Skovsgaard
Accredited Universal Robots support Centre and Forum.

Also check out the CB3 forum



25 thoughts on “Singularity

  1. Jonathon

    Hello again

    It’s been a while :)

    I wasn’t entirely sure where to post this topic but thought here was probably best.

    So our UR5 is placed on a vertical stand, this is great when we’re working above it. However when we’re lower down it keeps colliding into it. Waypoints are difficult to define as the movements are calculated on the fly based on the object we’re observing. Is there any way to tell the UR5 that there is and always will be an object in this position so the movements should avoid this? Also to note it’s not actually the end that’s hitting the stand its usually one of the other joints, which sort of makes it more difficult as I can’t just monitor where the end is and use this to work it out.

    Thank you

    Jonathon

    Reply
    1. zacopressadmin Post author

      Hi Jonathon

      Thanks for your question.

      With the generation 3.x it is possible to set safety planes and thereby make areas where the robot should not go into. Yes you are right in setting such planes you needs to take into account that it is the tool head that is used for the plane boundary and therefore the planes needs to be created with that in mind if you have a situation like you describe.

      I am not sure how you have made you program, but it should also be possible to use variable waypoints and then make maths inside the program that prevents the robot to beyond a certain X or Y or Z values (or combinations of the axis) for example if the waypoint is p[0.5, 0.2, 0.3, Rx, Ry, Rz], but if the max alowed x is 400mm then make a If statement that makes an Popup or just stop the robot for going beyond x > 0.4. The same consideration for the toolhead vs. the other joints also apply to this method.

      Author:
      By Zacobria Lars Skovsgaard
      Accredited Universal Robots support Centre and Forum.

      Also check out the CB3 forum

      Reply
      1. Jonathon

        Thank you, in part I’ve managed to solve this by defining a bounding box in my program and if the TCP exceeds this then I won’t go there.

        I still have trouble with singularities. Is there a function or a way I can determine whether moving from my current position to another position will result in singularity so that I can plan a different path? I understand this is visible on the GUI (PolyScope) however I need to be able to check without using the visual aids or manually moving the robot to another position.

        Any help would be much appreciated.

        Reply
        1. zacopressadmin Post author

          Hi Jonathon

          Thanks for your contributions to the forum.

          I have not seen a function that can predict if a path will have a singularity issue. Maybe it is possible to construct the program so the robot will always take a safe singularity free path by passing some safe position – although I understand very well that this is a though ask if the positions are based on some input that is not known beforehand, but my experience is that singularities mostly happens if there is a considerable long way from current position to the next position or if joints are near the limit of its 720 deg turn capability. So for example if the robot has to move from one quadrant to another – then construct the program so the robot has to go through a safe position. Also by looking at the angles of the joints might be possible to avoid singularities – for example if a joint is near a limit – then maybe make sure it is turned around for a safe position before making the long move and thereby create more freedom of angle turns on the path to next position.

          I am sure others has good ideas as well.

          Author:
          By Zacobria Lars Skovsgaard
          Accredited Universal Robots support Centre and Forum.

          Also check out the CB3 forum

          Reply
          1. Jonathon

            Thank you for your reply. That is most often the case so it’s possible to restrict some positions or if its going from a positive to negative value on one axis we can also add in some sort of constraints but it occasionally happens in the same quadrant too.

            My idea, for anyone else who might be interested, is to create a script in Polyscope that accepts a position to move to and runs two threads, one to move to that position and the other as long as the robot is moving returns the position to my c# application, from this we can calculate where in world space the robot is and use the jacobian matrix to determine singularity.

            However, is it possible to create a method in polyscope and call it over ethernet passing it a variable? and to also send a variable back? If so, could you advise on this please?

            If this is the case it should then be possible to prevent.

            Thank you
            Jonathon

          2. zacopressadmin Post author

            Hi Jonathon

            Variables can be passed over the Ethernet by using a normal TCP socket connection as described here
            http://www.zacobria.com/universal-robots-knowledge-base-tech-support-forum-hints-tips/knowledge-base/script-client-server/

            Or by using the general purpose MODBUS registers at adress 128-255 at port 502.

            MODBUS registers listed here.
            http://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/modbus-server-16377/

            An example of using MODBUS registers.
            http://www.zacobria.com/universal-robots-knowledge-base-tech-support-forum-hints-tips/knowledge-base/modbus-registers-and-nodes/

            Author:
            By Zacobria Lars Skovsgaard
            Accredited Universal Robots support Centre and Forum.

            Also check out the CB3 forum

          3. Jonathon

            Hello again!

            So I’ve been trying a few tests in the UI to see if I can get something working I’ve found though that

            1. You can’t use movej in a thread
            2. You can’t use textmsg() in a thread.. well at least it won’t output it to the log

            I need a way to write the tcp position every 0.1 seconds while the robot is moving. I tried writing the textmsg() part in a thread but it won’t output to the log as it’s not on the main thread. Is there a way around this?

            Cheers
            Jonathon

          4. Jonathon

            Does that work even when the robot is moving? As sending commands normally just stops what the robot is doing.

            Thank you

          5. zacopressadmin Post author

            Hi Jonathon

            Yes it does – because this is reading registers at port 502 (The MODBUS port).

            When reading register 400-405 they keep updating with the position of the robot as the robot moves – and the robot continues to move.

            Regards
            Lars

        2. Jonathon

          Having looked into this I don’t think this will overcome the problem. If creating this in the program window of the UI it still needs to be created using a thread in order to continuously output the data. If I try to read if from my c# application I believe it’s just like sending a command, such as get_tcp and will cause the robot movement to halt.

          Reply
          1. Jonathon

            Ah great, I just saw your response! I’m just trying to set something up in c# to read from the registers. With difficulty. Ha

          2. zacopressadmin Post author

            Hi Jonathon

            A Python command to read a MODBUS TCP register at address 400 (port 502) can look like this

            s.send (“\x00\x04\x00\x00\x00\x06\x00\x03\x01\x90\x00\x01″)

            Provided that “s” is setup for the correct IP address of the robot and port 502 when setting up the socket workspace – and then listen on the port.

            Some more about the meaning of the MODBUS TCP numbers can be found here

            http://www.zacobria.com/universal-robots-knowledge-base-tech-support-forum-hints-tips/knowledge-base/modbus-registers-and-nodes/

            Regards
            Lars

          3. Jonathon

            Ah thank you!

            So would it work as a textmsg too for example:

            Send(tcpSocket,@”textmsg(\x00\x04\x00\x00\x00\x06\x00\x03\x01\x90\x00\x01)”);

            I tried, but it didn’t but that’s probably because it isn’t setup correctly yet

          4. Jonathon

            Yes, but without stopping the movement of the robot.

            Bascially the end goal is to have the current position sent as a textmsg to the log every 0.1 seconds while the robot is moving without preventing the robot from moving. I’m not having much luck so far!

          5. zacopressadmin Post author

            Hi Jonathon

            Are you sending the text string to port 30001 or 30002 or 30003 ? – that might stop the robot.

            How you tried to read the MODBUS registers 400-405 from within Polyscope then ?

            Regards
            Lars

          6. Jonathon

            I was previously using 30001 yes, which was obviously causing the robot to stop.

            I’ve been trying to connect to port 502 as shown in your example but for some reason I cannot seem to keep the connection. I’m puzzled as to why.

            I haven’t tried reading them from within as I wasn’t sure if this is something I could write out to the log continously while moving the robot.

          7. Jonathon

            I don’t actually have Python setup, though I may have to give it a try. I have however basically copied what you have done which is


            tcpSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            tcpSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.DontLinger | SocketOptionName.ReuseAddress, false);
            tcpSocket.Bind(localIP);
            remoteIP = new System.Net.IPEndPoint(System.Net.IPAddress.Parse(robotIP), 502);
            tcpSocket.BeginConnect(remoteIP, new AsyncCallback(ConnectCallback), tcpSocket);

            The above works fine for connecting/sending to port 30001 but not for 502, even when sending just the request:

            \x00\x04\x00\x00\x00\x06\x00\x03\x01\x90\x00\x01

          8. zacopressadmin Post author

            Hi Jonathon

            Can it be that it is another notation than \x to use in another enviorment than Python ?

            Regards
            Lars

          9. Jonathon

            You’re probably right. Though even then I’m not sure how I would get it to appear on the log?

            I did try your python which appears to be working:

            Starting Program

            Modbus set reg 128 to 01
            Sending: x00 x01 x00 x00 x00 x06 x00 x06 x00 x80 x00 x01

            Modbus set reg 128 to 00
            Sending: x00 x01 x00 x00 x00 x06 x00 x06 x00 x80 x00 x00

            Request reg 129
            Sending: x00 x04 x00 x00 x00 x06 x00 x03 x00 x81 x00 x01
            Modbus command send to read reg 129
            Received
            b’\x00\x04\x00\x00\x00\x05\x00\x03\x02\x00\x00′

  2. Vuk Vujovic

    Hi Lars,

    Is there a way to catch these errors? I am using UR5 to do glue printing and I cannot always reproduce the reasons for getting Joint Limit Violation (or Force sometimes). I would like to at least catch the errors and handle consequences of safety shutdown if possible.

    With best regards,
    Vuk Vujovic

    Reply
    1. zacopressadmin Post author

      Hi Vuk

      Thanks for your question.

      I would think it depends on your movement – pose and speed in the program and how fast the force occurs.

      Maybe you can consider to monitor the force by using the force() command in a thread.

      The force command is described on this page.

      http://www.zacobria.com/universal-robots-zacobria-forum-hints-tips-how-to/force-feedback-function/

      Author:
      By Zacobria Lars Skovsgaard
      Authorised Universal-Robots Distributor.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>