Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Continous paths with joint movements and no stopping

#1
I am new to robodk and struggling with how to make a KUKA robot move in a continuous pattern. I am using the Python API. I am going to test some instruments, and I need to be able to move them continuously along different patterns without the robot taking sudden turns or stopping at each point. And I do also need to change the angles (roll/pitch) along these patterns.

I have checked out addMillingProject / add MachiningProject. But it seems to me they can only take a list of xyz points, and no joint angles?

If I use MoveJ the robot does not take the shortest path, but might suddenly turn to get a better angle, and it stops for every position. The latter might be solved by lots of points and slow speed, but it does not prevent it from suddenly taking a large turn to change the angles.

I read about and tried using the setRounding or setZoneData to smooth the  curves, but it seems it does not prevent it from stopping at each position.
Do you have any other suggestions on how to achieve this?
#2
Do you have a list of joint values or Cartesian points? This example shows 5 different ways you can convert a list of points or joint values to a robot program using the RoboDK API:
https://robodk.com/doc/en/PythonAPI/exam...to-program

setRounding with a rounding value greater than 0 is the right instruction to use at the top of your program if you want to have a smooth movement. For example:
Code:
prog = RDK.AddProgram('MyProgramAPI')
prog.setRounding(10)

# Iterate through your list of joints
for i in range(len(joints)):
   ti = RDK.AddTarget('Auto Target %i' % (i + 1))
   ti.setJoints(joints[i])
   ti.setAsJointTarget()
   prog.MoveL(ti)

For a KUKA robot, this will output the correct C_DIS and C_PTP flags in the linear and joint movements. This will also set the ADVANCE variable to 5 (maximum allowed).
#3
Hi Albert, I checked the documentation you shared: https://robodk.com/doc/en/PythonAPI/exam...to-program

Is it possible to include the setRounding function in a Post-processor? Additionaly, can I generate the program in both Cartesian and Joint coordinate system?
#4
The setRounding function of the API is controlled by the setZoneData function of the post processor. You can find more information abou the setZoneData function of the post processor here:
https://robodk.com/doc/en/PythonAPI/post...etZoneData
#5
(02-28-2025, 03:03 PM)Albert Wrote: The setRounding function of the API is controlled by the setZoneData function of the post processor. You can find more information abou the setZoneData function of the post processor here:
https://robodk.com/doc/en/PythonAPI/post...etZoneData
Hi Albert, I read through the link you shared and tried to modified the value of setZoneData and used setRounding as well. My program worked fine, however, everytime it had a LOG said that setZoneData not defined(10.0mm). I can change the value of it in both post processor and in instructions of the program for example as 1, and then the LOG said setZoneData not defined (1.0mm), but this change has no effect on my NC code. 
This is the code relating to the setZoneData function in my postprocessor (GCode_NCP), it seems like the setZoneData function is not working here.
Code:
def setZoneData(self, zone_mm):
        """Changes the rounding radius (aka CNT, APO or zone data) to make the movement smoother"""
        self.addlog('setZoneData not defined (%.1f mm)' % zone_mm)
So I make a few more lines like this in my postprocessor.
Code:
    def setZoneData(self, zone_mm):
        """Changes the rounding radius (aka CNT, APO or zone data) to make the movement         smoother"""
        self.setRounding(zone_mm)
        self.addlog('setZoneData not defined (%.1f mm)' % zone_mm)       
   
    def setRounding(self, rounding_mm):
        self.rounding_mm = rounding_mm
        self.addlog("Rounding set to %.3f mm" % rounding_mm)
Sadly, there is no bug when I run my postprocessor, but nothing is different in my output NC Code.
Do you know how to make the setZoneData or setRounding work effectively?
Thanks very much for the help.


Attached Files Thumbnail(s)
SetZoneData.jpg   
#6
You should modify the setZoneData function to generate the corresponding code needed for your robot controller. For example:
Code:
    def setZoneData(self, zone_mm):
        """Changes the rounding radius (aka CNT, APO or zone data) to make the movement smoother"""
        self.addline('ROUNDING = %.1f' % zone_mm)
#7
Okay, thanks very much for the reply. It's really helpful!
#8
Thank you for letting us know this worked.
  




Users browsing this thread:
1 Guest(s)