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

KUKA program error with BAS ex_BASE

#1
I have created a very simple Program in roboDK to test it on our Kuka robot mounted on a custom Linear track but the robot throws an error when reading instruction BAS(#ex_BASE,1) 
Error KSS01444: Array index inadmissible
  Screenshot 2025-10-24 082539.png   
I have already checked and both MACHINE_DEF and BASE_DATA are properly defined
 
Code:
INT MAX_BASE=32
DECL FRAME BASE_DATA[32]
BASE_DATA[1]={X 703.357605,Y -2062.17334,Z -305.790497,A 0.0919634551,B -0.398787886,C -0.0776457191}
BASE_DATA[2]={X 0.0,Y 0.0,Z 0.0,A 0.0,B 0.0,C 0.0}
BASE_DATA[3]={X 0.0,Y 0.0,Z 0.0,A 0.0,B 0.0,C 0.0}
...

INT MAX_MACHINES=16
DECL MACHINE_DEF_T MACHINE_DEF[16]
MACHINE_DEF[1]={NAME[] "KR 210 R3100-2",COOP_KRC_INDEX 1,PARENT[] "WORLD",ROOT {X 0.0,Y 0.0,Z 0.0,A 0.0,B 0.0,C 0.0},MECH_TYPE #ROBOT,GEOMETRY[] "ObjectId = 686633033"}
MACHINE_DEF[2]={NAME[] "MG_ME_260_KSP40",COOP_KRC_INDEX 1,PARENT[] "WORLD",ROOT {X 0.0,Y 0.0,Z 0.0,A 0.0,B 0.0,C 0.0},MECH_TYPE #ERSYS,GEOMETRY[] "ObjectId = 531816951"}
MACHINE_DEF[3]={NAME[] " ",COOP_KRC_INDEX 0,PARENT[] " ",ROOT {X 0.0,Y 0.0,Z 0.0,A 0.0,B 0.0,C 0.0},MECH_TYPE #NONE,GEOMETRY[] " "}
...

DEF  BAS (COMMAND :IN,REAL_PAR :IN )
;FOLD BAS ()
  DECL BAS_COMMAND COMMAND
  REAL REAL_PAR

  SWITCH  COMMAND
  ...
    CASE #EX_BASE
    EX_BASE (REAL_PAR, 0 )
  ENDSWITCH
END

Do i need to change anything in  EX_BASE (REAL_PAR, 0 )? I see that the second argument (0) is is hardcoded

Looking at the generated code, i don't find anything wrong with it and the Cell seems to be properly configured as i am able to jog the external axis with the teaching pendant. 
The zip file contains bas.src, machine.dat, config.dat and the generated .src
 
Code:
&ACCESS RVP
&REL 1
&PARAM TEMPLATE = C:\KRC\Roboter\Template\vorgabe
&PARAM EDITMASK = *
DEF _2_1_2_Axis_Prof ( )


; GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
; INTERRUPT ON 3

;FOLD Initialise and set default speed
BAS (#INITMOV,0)
BAS (#VEL_PTP,100)
BAS (#ACC_PTP,20)
$VEL.CP=0.2
BAS (#TOOL,0)
BAS (#BASE,0)
;ENDFOLD

;;FOLD STARTPOS
;$BWDSTART = FALSE
;PDAT_ACT = PDEFAULT
;BAS(#PTP_DAT)
;FDAT_ACT = {TOOL_NO 0,BASE_NO 0,IPO_FRAME #BASE}
;BAS(#FRAMES)
;;ENDFOLD

$ADVANCE = 5

;FOLD ---- Quickly skip BCO ----
; PTP $AXIS_ACT
;ENDFOLD

;FOLD ---- GO HOME ----
; PTP {A1 0.000, A2 -90.000, A3 90.000, A4 0.000, A5 0.000, A6 0.000, E1 0, E2 0, E3 0, E4 0, E5 0, E6 0}
;ENDFOLD


; Program generated by RoboDK v5.9.3 for KUKA KR 210-2 3100 on 24/10/2025 08:36:41
; Using nominal kinematics.
$APO.CPTP = 1
$APO.CDIS = 1.000
Wait for StrClear($LOOP_MSG[])
$LOOP_CONT = TRUE
$LOOP_MSG[] = "Operation name: 2 1/2 Axis Profiling"
Wait for StrClear($LOOP_MSG[])
$LOOP_CONT = TRUE
$LOOP_MSG[] = "Operation name: 2 1/2 Axis Profiling"
SetRPM(8000.0)
$VEL.CP = 1.00000
; ---- Setting reference (Base) ----
; BASE_DATA[1] = {FRAME: X 722.860,Y 2431.830,Z 246.206,A -0.081,B -0.400,C 0.091}
BAS(#ex_BASE,1)
; --------------------------
; ---- Setting tool (TCP) ----
; TOOL_DATA[1] = {FRAME: X 83.420,Y -2.020,Z 467.440,A 0.000,B 45.000,C 0.000}
$TOOL = {FRAME: X 83.420,Y -2.020,Z 467.440,A 0.000,B 45.000,C 0.000}
; $TOOL = TOOL_DATA[1]
; --------------------------
; Hide cutters
; Show Tool 1
PTP {A1 -16.86340,A2 -32.89350,A3 109.20600,A4 -109.03200,A5 39.15480,A6 162.13200,E1 2810.55000} C_PTP
LIN {X 1047.300,Y 166.530,Z 56.000,A -105.420,B 0.000,C -180.000,E1 2810.60000} C_DIS
$VEL.CP = 0.07000
LIN {X 1047.300,Y 166.530,Z 50.000,A -105.420,B 0.000,C 180.000,E1 2810.60000} C_DIS
LIN {X 1053.650,Y 166.530,Z 50.000,A -105.420,B 0.000,C -180.000,E1 2812.54000} C_DIS
CIRC {X 1058.140,Y 168.390,Z 50.000,A -105.420,B 0.000,C 180.000,E1 2812.05000},{X 1060.000,Y 172.880,Z 50.000,A -105.420,B 0.000,C 180.000,E1 2808.13000} C_DIS
$VEL.CP = 0.13333
LIN {X 1060.000,Y 1239.750,Z 50.000,A -105.420,B 0.000,C -180.000,E1 1741.71000} C_DIS
$VEL.CP = 0.07000
CIRC {X 1058.690,Y 1243.610,Z 50.000,A -105.420,B 0.000,C 180.000,E1 1737.50000},{X 1053.650,Y 1246.100,Z 50.000,A -105.420,B 0.000,C 180.000,E1 1733.43000} C_DIS
LIN {X 1047.300,Y 1246.100,Z 50.000,A -105.420,B 0.000,C 180.000,E1 1731.49000} C_DIS
$VEL.CP = 1.00000
LIN {X 1047.300,Y 1246.100,Z 56.000,A -105.420,B 0.000,C 180.000,E1 1731.49000} C_DIS
LIN {X 1047.300,Y 1246.100,Z 156.000,A -105.420,B 0.000,C -180.000,E1 1731.44000} C_DIS
$VEL.CP = 0.07000
END



Also, when going the direct method
Code:
$BASE = EK(MACHINE_DEF[2].ROOT, MACHINE_DEF[2].MECH_TYPE, BASE_DATA[1])
I get Error KSS 1582: Kinematic instruction inadmissible

Linear track motor:  MG_260_180_30_S0
Robot : KR210 R3100-2
Controller: KR C4
OS: KSS 8.6.13 HFI


Attached Files
.zip   Files.zip (Size: 24.74 KB / Downloads: 7)
#2
The hardcoded index 0 in the BAS function call is probably the issue. You can try changing it to 1 or 2 in the BAS.src file. You can see that the EX_BASE function points the second parameter of the BAS function to the MACHINE_DEF array.

Your MACHINE_DEF array in the config.dat file has nothing at index 0 but it has the following definitions for index 1 and 2:
Code:
MACHINE_DEF[1]={NAME[] "KR 210 R3100-2",COOP_KRC_INDEX 1,PARENT[] "WORLD",ROOT {X 0.0,Y 0.0,Z 0.0,A 0.0,B 0.0,C 0.0},MECH_TYPE #ROBOT,GEOMETRY[] "ObjectId = 686633033"}
MACHINE_DEF[2]={NAME[] "MG_ME_260_KSP40",COOP_KRC_INDEX 1,PARENT[] "WORLD",ROOT {X 0.0,Y 0.0,Z 0.0,A 0.0,B 0.0,C 0.0},MECH_TYPE #ERSYS,GEOMETRY[] "ObjectId = 531816951"}

Alsso, for your information, you can find the EX_BASE function code in the BAS.src file:
Code:
DEF  EX_BASE (BASE_NO :IN , MACH_IDX : IN)
  INT BASE_NO, MACH_IDX

  IF BASE_NO > 0 THEN
    IF BASE_CORR_ON AND M_BAS_COR_ON THEN
      $BASE=EK(MACHINE_DEF[MACH_IDX].ROOT,MACHINE_DEF[MACH_IDX].MECH_TYPE,BASE_CORR:BASE_DATA[BASE_NO]:M_BASE_CORR)
    ELSE
      IF M_BAS_COR_ON THEN
        $BASE=EK(MACHINE_DEF[MACH_IDX].ROOT,MACHINE_DEF[MACH_IDX].MECH_TYPE,BASE_DATA[BASE_NO]:M_BASE_CORR)
      ELSE
        IF BASE_CORR_ON THEN 
          $BASE=EK(MACHINE_DEF[MACH_IDX].ROOT,MACHINE_DEF[MACH_IDX].MECH_TYPE,BASE_CORR:BASE_DATA[BASE_NO])
        ELSE
          $BASE=EK(MACHINE_DEF[MACH_IDX].ROOT,MACHINE_DEF[MACH_IDX].MECH_TYPE,BASE_DATA[BASE_NO])
        ENDIF
      ENDIF
    ENDIF   
  ENDIF
   
    CONTINUE
    $ACT_BASE=BASE_NO
END
Has anyone successfully used this cell before?
#3
We are able to move the external axis (linear track) with the teaching pendant (jog) but it is the first time we try running a program with synchornized axes.
The robot controller came preconfigured from the factory with the Linear track
#4
Great, what did you end up changing to make it work?
#5
We are unable to run the program generated from RoboDK when we have synchronized axes as it includes the BAS(#ex_BASE,1) instruction. When we deactivate it we can move the robot but no the track.

I also noticed that the generated file does not set the proper frame/tool so i have to change the .src manually to include BAS(#TOOL,#) and BAS(#BASE,#)
#6
Do you use the BAS function?
Did you change the hard coded index of the call to EX_BASE?

You can find some examples to customize your post processor for KUKA robots (specially when setting the coordinate system) here:
https://robodk.com/doc/en/Post-Processor...amesFilter
#7
I have tried running $BASE = EK(MACHINE_DEF[2].ROOT, MACHINE_DEF[2].MECH_TYPE, BASE_DATA[1]) witch is basically the same thing as EX_BASE (2, 1 ) and ran into KSS 1582: Kinematic instruction inadmissible so i dont think it would solve the issue. Besides, for what i have seen in other forums and from kuka support itself, it is never a good idea to temper with bas.src. Correct me if i am wrong
#8
I was able to run it when manually changing BAS(#ex_BASE,1) to BAS(#BASE,1). From the kuka documentation, BAS(#ex_BASE,1) is used for assigning a referece frame linked to a mechanism (rotary table for example). in my case, BASE[1] is linked to the world (fixed).

I am trying to edit the KRC4 postprocessor so that it automatically uses BAS(#base,#) instead but i dont see any conditional to when it should be #BASE and when #ext_BASE. On the original post you can see that the frame is not linked to the mechanism at all so i would have expected the post processor to use Bas(#Base)
#9
You can check the number of axes using the nAxes variable in your post processor and decide if you want to export one type of base or another.

Example:
Code:
from KUKA_KRC2 import RobotPost as MainPost
class RobotPost(MainPost):
    def setFrame(self, pose, frame_id, frame_name):
        """Change the robot reference frame"""
        if self.nAxes <= 6:
            # We only have a robot arm
            self.addline('; BASE_DATA[8] = {FRAME: %s}' % (self.pose_2_str(pose)))     
            self.addline('BAS (#BASE,8)')
        else:
            # We have a robot arm and external axes
            self.addline('BAS (#ex_BASE,8)')
  




Users browsing this thread:
1 Guest(s)