You are right sorry. I found the Warm-up sequence on the manual of my kr150-2 with KRc2 ed05, but I do not get what I should do. I checked the variables in the $machine.dat but then what? I imagine I must run a program with some movements to be repeated in a loop right? Sorry, I'm not an integrator so I'm doing my best to learn.
Posts by Marco
-
-
Hi there,
I did some research but I could not find any useful information here in the forum. Do you have any sample program to share here to warm-up the robot before starting a job?
Best,
Marco -
Sorry for the late reply, a very busy period. Well the remote seems to work fine ! I'm very happy I could make it because it is absolutely useful!!! Thank for all your support!
The next step is going to be a tool changer with sensors
Cheers,
Marco -
hi there, no sprutcam postprocessor only generates a .src file
-
Yes, the singularity was the problem. And how should I edit the code to fix the issue you mentioned about the interrupt? I don't get it. Sorry, my knowledge is still a bit rough.
Best,
Marco -
HI there,
I managed to fix all things (even if I need this main program loading the milling files to process). I only have a last problem. When I press the stop button robot starts moving away, but almost immediately I get an error saying that speed for axis 4 has been exceeded. Here is what I coded trying to slow down speed during this displacement (which is good also to prevent loosing the path with too fast moves). But it doesn't solve the problem. Any suggestion?Code
Display MoreDEF alo_processing_v1( ) ; --- DECLARATIONS DECL INT s,a s = 15 a = 70 ; --- INITIALIZATION $base = $world $tool = TOOL_DATA[1] $vel_axis[1]=s $vel_axis[2]=s $vel_axis[3]=s $vel_axis[4]=s $vel_axis[5]=s $vel_axis[6]=s $acc_axis[1]=a $acc_axis[2]=a $acc_axis[3]=a $acc_axis[4]=a $acc_axis[5]=a $acc_axis[6]=a $OUT[6] = TRUE $OUT[7] = FALSE ; --- MAIN $OUT[9] = TRUE ;COM LED ON IF HSD_SPEED_IN < 50 THEN PTP $POS_ACT PTP XHOME ; tool is if vertical A2+A3+A5=0 $OUT[9]=FALSE ENDIF ; specify interrupt level and program name to call ; when PAUSE button is pressed... wired to $IN[7] INTERRUPT DECL 10 WHEN $OUT[7] DO MoveAway() ;activate interrupt INTERRUPT ON 10 ; call program doing some milling job alo_pt0101() ; finished, deactivate interrupt INTERRUPT OFF 10 IF HSD_SPEED_IN < 50 THEN $OUT[9] = TRUE PTP XHOME $OUT[9] = FALSE $OUT[6] = FALSE ENDIF END DEF MoveAway() BRAKE ; need to pause current robot motion $VEL.CP = 0.005 $ACC.CP = 0.01 LIN_REL {Z 100} ; move robot 100mm up WAIT FOR NOT $OUT[7] ; wait until PAUSE is released LIN $POS_RET ; return to last position to resume work END
-
Ok, so I cannot do this way basically. So, I really need to have a main program with this functions (as suggested in the beginning) that I also use to call the milling program I actually want to process, or there is a way to have this sub running in parallel like the other sub? I'm asking this because every time I will have programs with different names and I do not want to edit every time the main program to tell what program to call.
-
Hi there,
I'm almost done with my remote pendant finally. Going back to the first posts of this thread
maybe something like this:Code
Display MoreDEF Michelangelo() INI PTP HOME Vel=100% .... ; specify interrupt level and program name to call ; when PAUSE button is pressed... wired to $IN[301] INTERRUPT DECL 10 WHEN $IN[301] DO MoveAway() ;activate interrupt INTERRUPT ON 10 ; call program doing some milling job for example... SomeNudeSculpture() ; finished, deactivate interrupt INTERRUPT OFF 10 PTP HOME Vel=100% ... END DEF MoveAway() BREAK ; need to pause current robot motion $OUT[422]=false ; turn off spindle LIN_REL {Z 200} ; move robot 200mm up WAIT FOR NOT $IN[301] ; wait until PAUSE is released $OUT[422]=true ; turn on spindle LIN $POS_RET ; return to last position to resume work END
I'm now ready to implement the code for the pause and resume commands to be used during a milling if necessary. Starting from your suggestion and the latest developments, I tried to create a new sub called ALO_INPROCESS where I have this code:
Code
Display More;FOLD DECLARATIONS ;FOLD USER DECL ; Please insert user defined declarations INT HSD_SPEED_CURRENT INT HSD_LOGIC_CURRENT INTERRUPT DECL 10 WHEN $IN[9] DO StopAndMoveAway() ;ENDFOLD (USER DECL) ;ENDFOLD (DECLARATIONS) ;FOLD INI ;FOLD USER INIT ; Please insert user defined initialization commands HSD_SPEED_CURRENT = HSD_SPEED ;stores current assigned speed (HSD_SPEED is the speed value set in the .src milling program via sprutcam) HSD_LOGIC_CURRENT = HSD_LOGIC ;stores current assigned TDE STATE (HSD_LOGIC is the TDE STATE value set in the .src milling via sprutcam) INTERRUPT ON 10 ;activate interrupt ;ENDFOLD (USER INIT) ;ENDFOLD (INI) ;FOLD USER PLC ;Make your modifikations here ;ENDFOLD (USER PLC) ;FOLD ;%{H}; END ;ENDFOLD ;FOLD USER SUBROUTINE ;Integrate your user defined subroutines DEF StopAndMoveAway() BREAK ; need to pause current robot motion PULSE($OUT[2], TRUE, 1) ; Turn on E-Stop LED PULSE($OUT[2], FALSE, 1) ; Turn off E-Stop LED HSD_SPEED_CURRENT = 0 ; turn off spindle HSD_LOGIC_CURRENT = 0 ; turn off spindle LIN_REL {Z 200} ; move robot 200mm up WAIT FOR $IN[10] ; wait until PAUSE is released HSD_SPEED_CURRENT = HSD_SPEED ; turn on spindle restoring old speed HSD_LOGIC_CURRENT = HSD_LOGIC ; turn on spindle restoring old state LIN $POS_RET ; return to last position to resume work $OUT[2] = FALSE ; Turn off E-Stop LED END
end then I edited my SPS in this manner to call also the new sub ALO_INPROCESS:
Code
Display MoreDEF SPS ( ) ;FOLD DECLARATIONS ;FOLD BASISTECH DECL ;Automatik extern DECL STATE_T STAT DECL MODUS_T MODE ;ENDFOLD (BASISTECH DECL) ;FOLD USER DECL ; Please insert user defined declarations ;ENDFOLD (USER DECL) ;ENDFOLD (DECLARATIONS); Check if spindle is running DECL BOOL HSD_ALBERO_FERMO DECL INT HSD_SPEED_CURRENT DECL INT HSD_LOGIC_CURRENT ;FOLD INI ;FOLD DEFAULT MSG_T $MSG_T={MSG_T: VALID FALSE,RELEASE FALSE,TYP #NOTIFY,MODUL[] " ",KEY[] " ",PARAM_TYP #VALUE,PARAM[] " ",DLG_FORMAT[] " ",ANSWER 0} ;ENDFOLD (DEFAULT MSG_T) ;FOLD AUTOEXT INIT INTERRUPT DECL 91 WHEN $PRO_STATE1==#P_FREE DO RESET_OUT () INTERRUPT ON 91 $LOOP_MSG[]=" " MODE=#SYNC $H_POS=$H_POS ;Automatik extern IF $MODE_OP==#EX THEN CWRITE($CMD,STAT,MODE,"RUN /R1/CELL()") ENDIF ;ENDFOLD (AUTOEXT INIT) ;FOLD USER INIT ; Please insert user defined initialization commands ;ENDFOLD (USER INIT) ;ENDFOLD (INI) ;REMOTE PENDANT INITIALIZATION $OUT[5] = TRUE ;+24V to pendant $OUT[6] = FALSE ;Resume Pendant LED (white) $OUT[7] = FALSE ;Stop Pendant LED (white) $OUT[8] = FALSE ;Reset Pendant LED (white) $OUT[9] = FALSE ;Communication LED (blue) LOOP WAIT FOR NOT($POWER_FAIL) TORQUE_MONITORING() ;FOLD USER PLC ;Make your modifications here ALO_CONTROLLI() ;call custom subprogram ALO_PROCESSING() ;call custom subprogram $OV_PRO = 100-(99*$ANIN[1]) ;Set robot override by potentiometer ;ENDFOLD (USER PLC) ENDLOOP
but "of course" it gives me several errors:
on SPS:
Name not declared as subroutine
ALO_PROCESSING()
on the ALO_PROCESSING sub:
illegal or unknown block ----referring to break
runtime data of the main program cannot be used----referring to HSD_SPEED_CURRENT = 0
runtime data of the main program cannot be used----referring to HSD_LOGIC_CURRENT = 0
runtime data of the main program cannot be used----referring to HSD_SPEED_CURRENT =HSD_SPEED
runtime data of the main program cannot be used----referring to HSD_LOGIC_CURRENT =HSD_LOGIC -
Thanks a lot! I got it working now
Just a detail, how can I replace the wait commands? I need to blink a LED when something happens.
should I place something like a counter? I tried this but the led blinks off course only if I keep the button pressed
IF $IN[11] == TRUE THEN ;RESET BUTTON PRESSED
FOR I=1 to 10
$OUT[8] = TRUE ;LED ON
ENDFOR
FOR I=1 to 10
$OUT[8] = FALSE ;LED OFF
ENDFOR
ENDIF -
Here is the code (it was warking at this stage but it is under construction)
Code
Display More;FOLD DECLARATIONS ;FOLD USER DECL ; Please insert user defined declarations ;ENDFOLD (USER DECL) ;ENDFOLD (DECLARATIONS) ; Declare the variables ;FOLD INI ;FOLD USER INIT ; Please insert user defined initialization commands ;ENDFOLD (USER INIT) ;ENDFOLD (INI) ; Check if spindle is running DECL BOOL HSD_ALBERO_FERMO DECL INT HSD_SPEED_CURRENT DECL INT HSD_LOGIC_CURRENT ;HSD_SPEED_CURRENT=HSD_SPEED ;HSD_LOGIC_CURRENT=HSD_LOGIC ;REMOTE PENDANT INITIALIZATION $OUT[5] = TRUE ; +24V $OUT[6] = FALSE $OUT[7] = FALSE $OUT[8] = FALSE LOOP ;HSD_ALBERO_FERMO=$IN[3] ;-- Check if Spindle is running ; RELEASE CONE WHEN HSD_BUTTON IS PRESSED WHILE $IN[4] == TRUE $OUT[1] = TRUE WAIT SEC 0.5 $OUT[1] = FALSE ENDWHILE ; REMOTE PENDANT FUNCTIONS WHILE $IN[9] == TRUE ;PAUSE BUTTON $OUT[7] = TRUE $OUT[6] = FALSE ENDWHILE WHILE $IN[10] == TRUE ;RESUME BUTTON $OUT[7] = FALSE $OUT[6] = TRUE ENDWHILE WHILE $IN[11] == TRUE ;RESET BUTTON $OUT[8] = TRUE WAIT SEC 0.6 $OUT[8] = FALSE WAIT SEC 0.6 $OUT[8] = TRUE WAIT SEC 0.6 $OUT[8] = FALSE WAIT SEC 0.6 $OUT[8] = TRUE WAIT SEC 0.6 $OUT [8] = FALSE ENDWHILE ;-- CHECK IF EMERGENCY BUTTONS ARE HIGH OR LOW AND TAKE ACTIONS $OUT[2] = NOT $ALARM_STOP ;Switch on E-Stop Led $OUT[3] = NOT $ALARM_STOP ;Switch on E-Stop Led (pendant) IF ($ALARM_STOP==FALSE) THEN ;!!!When it is false there is an emergency stop breaking the circuit!!! HSD_SPEED=0 HSD_LOGIC=0 ELSE HSD_SPEED_CURRENT=HSD_SPEED HSD_LOGIC_CURRENT=HSD_LOGIC ENDIF ;FOLD USER PLC ;Make your modifications here ;ENDFOLD (USER PLC) ENDLOOP ;FOLD ;%{H}; END ;ENDFOLD ;FOLD USER SUBROUTINE ;Integrate your user defined subroutines ;ENDFOLD (USER SUBROUTINE)
Thanks for your help
Best,
Marco -
Hi there,
I've got the problem finally. I have a sub program running all the time for my custom controls. This prevents the SPS to run. I found that only one sub at the time can run. Then I stopped my sub and enabled the SPS and the $OV_PRO started working.Now, I found this https://www.robot-forum.com/robotforum/kuk…on-the-sps-sub/ and made a call to my sub inside the SPS. In my sub there is no reference to $OV_PRO or the variables involved in the calculation. But as soon I saved the SPS with the call the $OV_PRO stopped working again and it stay frozen if I change the potentiometer. The call seems working as my sub has got enabled as soon I saved the SPS but maybe I made the call in the wrong manner.
This is my code inside the SPS and ALO-CONTROLLI is my sub (which now I placed inside the same folder of the SPS)
;FOLD USER PLC
;Make your modifications here
ALO_CONTROLLI() ;Call ALO custom subprogram
$OV_PRO = 100-(99*$ANIN[1]) ;Set robot override by potentiometer
;ENDFOLD (USER PLC)ENDLOOP
Also my sub doesn't work with this call from the SPS.
How can I fix this?
-
Still no result.
My SPS SUB is running.
My monitor shows the R_OVERRIDE_IN.
I also did a cold reboot.
I attached a screen shot. -
This extensive explanation is gonna be useful, but I'm worried we are taking the tangent...
My R_OVERRIDE IN is a signal coming form a potentiometer as an $ANIN and it works fine; I already see proper values in the variable monitor ranging from 0.000 to 1.000. I need to transform this value into an input for the $OV_PRO value to control speed during a program from the potentiometer.
-First, as suggested earlier, I wrote in the SPS a line of code with $OV_PRO = 100 * R_OVERRIDE_IN but it didn't work.
-Then, I created a new variable in a SUB file in my program folder (where there are all other controls running all the time): DECL INT R_OVERRIDE_OUT = 100 * R_OVERRIDE_IN; it didn't work either, the variable monitor do not show any value at all.
-Now, still in my SUB, I tried DECL REAL R_OVERRIDE_OUT = 100*R_OVERRIDE_IN, to see if ,at least, I can see the result of the multiplication, but still nothing.As OV_PRO value goes from 0 to 100, I only need to understand how to map the value of the potentiometer to the necessary input range for the $OV_PRO.
It is this step that is causing troubles. There must be a step in-between that I'm missing.Hopefully you still have energies to hellp me
-
So what do you suggest? I have no idea where to put my hands now.
-
The R_OVERRIDE_IN works fine showing values 0.000 to 1.000, but If I monitor the R_OVERRIDE_OUT, which is declared as INT in my sub in order to get rid of the last decimal when I do the operation 100 * R_OVERRIDE IN I (i.e. 0.275 * 100 = 27), I do not see any value in the variable monitor. So I guess the operation has something wrong and this is way it is also not working when I set $OV_PRO = 100*R_OVERRIDE_IN in the SPS
But I do not understand what is wrong. -
Yes it is working. I see values changing from 0.000 to 1.000.
-
Hi there,
it has been a very busy period and finally I have some hours to get back to my project. So I did what you suggested and I solved the errors I was getting. However, I tested to potentiometer with a simple program and it did not affect robot speed at all.In my config I have: Signal R_OVERRIDE_IN $ANIN [1]
In my SPS (under user plc fold) I have: $OV_PRO = 100*R_OVERRIDE_IN
In my SUB inside program files with all security loops etc I have: DECL INT R_OVERRIDE_OUT and R_OVERRIDE_OUT = 100*R_OVERRIDE_IN, which I'm actually not using.I suppose it is a variables issue
Any Idea of what I'm doing wrong?
Best,
Marco -
Hi there,
I'm still working on the secondary remote pendant. I now have my $config file with a R_OVERRIDE_IN variable showing the potentiometer value from 0.000 to 1.000 in the Variable Monitor Display correctly. I also have a main SUB file in my program folder with all variables and stuff to check (like emergency buttons state, spindle state etc..) and in there I declared a new variable R_OVERRIDE_OUT = 100*R_OVERRIDE_IN to get the new value from 1 to 100 for the $OV_PRO. So now I'm trying to link it to the $OV_PRO to be able to control robot speed in auto mode form the potentiometer, but I did not succeed yet. I found another post on the forum about robotoverride suggesting to edit the SPS, I placed in there my R_OVERRIDE_OUT formula but I get an error.
Any suggestion? I also see that $OV_PRO is an INT while I have a value with 3 decimals? Is this also a problem?
Very Best,
Marco -
I there,
finally I made it. First, I had to install the analogue module after all digital in and out modules. Second I finally got that the analogue module occupies the first 2 bytes of the Devicnet memory, so I had to change all bytes offset of all digital inputs I had already wrote in my IOsys, but, and this is what I was totally missing, the index of the digital input do not change even if I change the offset due to the presence of the analogue inputs. Last time I changed both offsets and indexes; this is why I had a mess. So $IN[4] is still $IN[4] even if I have the analogue modules connected. What changes is that INB0 is not INB0=5,0 anymore but INB0=5,4 (the 2 analogue occupy the first two 16 bit slots). I don't know if my description is totally correct but it works! Now I can go ahead with the programming of my secondary remote pendant for milling control.
Thank you guys once more.
Best,
Marco -
Hi there,
I'm sorry for being still in troubles despite your help. I fixed the problems mentioned above, I remapped all inputs, revised all IOSYS, config and my global variable mapping etc files that had variables and actions related to my IOs but I ended up with all stuff not working at all. Finally, I had to go back to my initial software and hardware set up to get the robot working again. Now I have to start again from scratch.
So my first question is if I can physically install my analog module anywhere between my other IO modules replacing one of them or if it has to be installed in a specific position (i.e. before my digital input module, last of input modules but befor the digital outpus, after all input and output modules.
Second, the signal coming from the potentiometer goes in the VIN of the module, but do I have to connect the GND IN of the module together with the ground going to the potentiometer?
Thanks,
Marco