Discussion

Left ArrowBack to discussions page
VT_340VT_340 Posts: 17 Apprentice
edited June 15 in Programming
Hi!

I want to make the UR5 make draw random lines, arcs and circles on a piece of paper. My approach for that so far was to generate the geometry in Processing (Java for creatives..) and send points via TCP as moveP commands. The problem is that for example I was not able to make a smooth motion, even with a small blend radius and high "solution" up to 50 points per arc. Any idea how this problem is solved?  Would also use ROS or other solutions asI am in a early project-phase and just want to collect potential ways how to do it.

Thanks in advance.

Comments

  • BeachChEBeachChE Posts: 17Founding Pro Handy
    Look at using a MoveP command.
  • matthewd92matthewd92 Posts: 491Founding Pro, Tactile Sensor Beta Testers Handy
    If you are sending the points from off robot use a servoj command, it is designed to have a point sent every 8ms so you will need to calculate at a high resolution the motion but you can make very smooth moves this way. 
  • VT_340VT_340 Posts: 17 Apprentice
    edited May 30
    Hi! Thanks for your reply. According to the documentation servoJ is not working with the inverskinematic as you should provide joint positions? I now have another approach in mind. Maybe I do not need to send data quiet often but send a whole program that consist of several points and making the arcs with a predefined blend radius? Can I send a whole programm  via TCP and then just start it? This doesn't allow me to draw complex forms but maybe this is not a must.


  • matthewd92matthewd92 Posts: 491Founding Pro, Tactile Sensor Beta Testers Handy
    I have never tried to send a whole program but there is a way to do it.  You would send the program to one of the client interface ports and I believe that it then starts running as soon as it's received, if not you could send the play command to the dashboard server after you sent the program.

    You could also place the get_inverse_kin() function inside the servoj function to use TCP coordinates and calculate the required joint positions.  I have done that before successfully.
  • VT_340VT_340 Posts: 17 Apprentice
    Are there any more informations about how to load a SCRIPT program via TCP and how to play it? 
  • matthewd92matthewd92 Posts: 491Founding Pro, Tactile Sensor Beta Testers Handy
    I know how to load a program, that is rather straightforward via the dashboard server but I think you mean you want to transmit the program and then have it run if I am following you correctly. Your best resource for that would be the UR Support website.  Have you looked out there yet?
  • VT_340VT_340 Posts: 17 Apprentice
    edited May 30
    Hi Matthew

    Well documentation is a bit poor sometimes but I figured it out myself. 

    You can just send s.th like this via TCP:

    def primaryProgram():
      while (True):
        movep(p[-0.20000000, -0.10000000, 0.40000001, -3.14159274, 0.00000000, 0.00000000], a=0.10000000, v=0.30000001)
        movep(p[-0.20000000, -0.10000000, 0.10000001, -3.14159274, 0.00000000, 0.00000000], a=0.10000000, v=0.30000001)
      end
    end

    This must be sent as one string while the spaces for the blocks must be included. Once code is sent to port 30002 the program starts automatically. Don't forget to add a line feed (10) at the end of your string, otherwise it won't work properly.

    Thanks and greetings from germany.
  • VT_340VT_340 Posts: 17 Apprentice
    I have another question! Can somebody tell me whats a good point-to-point distance when calculating the  interpolation of a trajectory? I need to do some programming but cannot use the robot right now ( Holiday..)

    Thanks in advance!
  • VT_340VT_340 Posts: 17 Apprentice
    edited June 26

    Can you help me with the syntax a bit? I tried the following:

    servoj(get_inverse_kin(-0.028682, -0.467049, 0.05000001, -3.14159274, 0.00000000, 0.00000000), t = 0.05)

    This lines results in a a popup-error claiming this:

    "TypeError: get_inverse_kin() takes at most 4 arguments (6given)"

    Seems lik a bug or something, a pose consists of 6 floats .. no?

    Thanks in advance!


    VT

  • matthewd92matthewd92 Posts: 491Founding Pro, Tactile Sensor Beta Testers Handy
    edited June 26
    But a pose is in this format p[-0.028682, -0.467049, 0.05000001, -3.14159274, 0.00000000, 0.00000000]

    Change your line to read:

    servoj(get_inverse_kin(p [-0.028682, -0.467049, 0.0500, -3.14159, 0, 0], t=0.05)


    Let me know if you have any issues with that.
  • VT_340VT_340 Posts: 17 Apprentice
    edited June 26
    HA!  now the TCP  follows a line that I generated before in python. Thanks a lot.
  • matthewd92matthewd92 Posts: 491Founding Pro, Tactile Sensor Beta Testers Handy
    Anytime, glad it's working.  Post up a video when you get it all working, curious to see it in action
  • VT_340VT_340 Posts: 17 Apprentice
    Another question: How can I rotate for a example the last axis only to use it as a rotational-device? When I get it right I need to do some Euler-Angel maths to make the "Object" rotate around one axis only?


Sign In or Register to comment.
Left ArrowBack to discussions page