Hey guys,
I have been working with KRC4 8.6.6, it is connected to 8 external motors , 3 motors are used as robot motor while 5 are asynchronous external axes.
To make it clear i have attached a picture regarding the connections. All the motors works fine except for one which is E4 motor, E4 motor is endless type and uses degrees for position measurement and this motor is also coupled because its position has to reset(coupling/decoupling method) to zero at certain location. For this motor 1 degrees is 1m.
This motor has 3 different type of motion depending in situation and this motions are under conveyor_auto2ok(). This sub program is called under test( ), as you can see in below code.
Inside conveyor_auto2ok() program, there are 3 stop_points, stop_point 1 and 3 are working perfect, but somehow stop_point 2 doesnt work as it should.
the exact problem is in the external mode stop_point 2 motion is missing in the loop of test(). By the way this skipping of motion does not happen in T2 mode, happens only in external mode.
when the program runs for first time it completes conveyor_auto2ok(1), then moves toward conveyor_auto2ok(2) and conveyor_auto2ok(3), all the motion are completed in first round, but then comes loop where it should repeat conveyor_auto2ok(2) and conveyor_auto2ok(3) but for some unknown reason it skips through conveyor_auto2ok(2) and only completes conveyor_auto2ok(3).
if i do the same program in T2 mode this does not happen it works nice and smooth. but not in external mode. is there any explanation for such behaviour. i have tried to check the position variable that commands motor to move to certain position i.e E4_relative.E4 . E4_relative.E4=1.05 just before motion command and after motion command. but there is no movement from motor at all.
is there anything that i should know about ASYPTP motion command? i dont understand how motion works in T2 mode but not in External mode.
======================= test.SRC ======================
DEF test( ) ; main program for testing the conveyor/E4 motor (Asynchronous)
conveyor_auto2ok(1)
asycancel 4
wait sec 2
loop
conveyor_auto2ok(2)
wait sec 2
conveyor_auto2ok(3)
asycancel 4
endloop
END
======================= test.SRC ======================
==========================conveyor_auto2ok.SRC===================
DEF conveyor_auto2ok(stop_point:in)
INT stop_point
E4_relative=$AXIS_ACT
$OV_ASYNC=50
wait sec 0
if stop_point==1 then
E4_relative.E4 = 5;
wait for $async_state<>#busy
ASYPTP E4_relative ;motion command for conveyor.
wait for $async_state<>#busy
Reset_2()
endif
if stop_point==2 then
if pallet_width_HMI>1200 then ; position according to pallet size.
E4_relative.E4 = E4_relative.E4 + 1.05 ;positions are in degrees.
else
E4_relative.E4 = E4_relative.E4 + 0.78 ;positions are in degrees.
endif
wait sec 3
ASYPTP E4_relative ;motion command
wait for $async_state<>#busy
endif
if stop_point==3 then
N=N+1
if (N<13) then
E4_relative.E4 = + 1.79; back to 0
else
E4_relative.E4 = 1.79-0.01; back to 0
N=0
endif
ASYPTP E4_relative ;motion command
wait for $async_state<>#busy
Reset_2() ;reset subprogram resets to zero after reaching the final position.
asycancel 4 ;just incase to avoid the extra movement
endif
END
==========================conveyor_auto2ok.SRC===================