The video seems to produce the desired result when moving to the same Cartesian target attached to the turntable while changing the 7th axis.
I noticed the way you setup the base with the program that worked is like this:
This should also be the case when programming the robot from RoboDK but I understand this does not work by default. However, this is easy to customize in the post processor. In short you should override the setFrame of your post processor to use the correct BASE and external kinematics system.
You should be using one of these options which you can enable accordingly by simply removing the commented lines:
Code:
def setFrame(self, pose, frame_id, frame_name):
"""Change the robot reference frame"""
self.addline('; ---- Setting reference: %s ----' % frame_name)
if self.nAxes > 6:
# Code to output if the robot has external axes:
self.BASE_ID = frame_id
if self.BASE_ID <= 0:
self.BASE_ID = self.DEFAULT_BASE_ID
# option 1: Build the kinematics based on the MACHINE_DEF array and the provided offset
#self.addline('$BASE = EK (MACHINE_DEF[2].ROOT, MACHINE_DEF[2].MECH_TYPE, { %s })' % self.pose_2_str(pose))
# option 2: Build the kinematics based on the EX_AX_DATA array and the provided offset
#self.addline('$BASE=EK(EX_AX_DATA[1].ROOT,EX_AX_DATA[1].EX_KIN, { %s })' % self.pose_2_str(pose))
# Option 3: Build the kinematics based on the EX_AX_DATA array and the pre-defined offset
#self.addline('; Using external axes')
#self.addline('; $BASE=EK(EX_AX_DATA[1].ROOT,EX_AX_DATA[1].EX_KIN,EX_AX_DATA[1].OFFSET)')
#self.addline('; $ACT_EX_AX= %i' % (self.nAxes - 6))
# Option 4: Use the BAS(#ex_BASE) init function from the BAS.src file
#self.addline('; BASE_DATA[%i] = {FRAME: %s}' % (self.BASE_ID, self.pose_2_str(pose)))
#self.addline('BAS(#ex_BASE,%i)' % self.BASE_ID)
# Option 5: Use the BAS(#BASE) init function from the BAS.src file
self.addline('BAS (#BASE,%i)' % self.BASE_ID)
# Option 6: Directly take the base from the BASE_DATA array (usually what the BAS(#BASE) does)
# self.addline('$BASE=BASE_DATA[%i]' % self.BASE_ID)
In your case, with the file attached which reimplements the setFrame function, you should enable Option 5, which outputs the same BAS (#BASE,id) function.
To use this post processor you should follow these steps:
- Place the KUKA_KRC2_Custom_Base.py file attached here: C:/RoboDK/Posts
- In RoboDK, right click your robot, and select Select Post processor
- Select the KUKA KRC2 Custom Base post
Also, if you want to use ID 3, you should call your coordinate system as Frame 3. The post processor will receive the last index of the name of the reference frame.