I don't know about you, but I hate the BCO move. So, with these 3 lines of code, it's no longer as annoying as it once was.
It's super simple, hardly worth mentioning but for me, it's made a huge difference in my sanity. LOL
;FOLD BCO KILLER
BAS(#INITMOV);SET SPEED
CURRENT_POS = $AXIS_ACT_MEAS
PTP CURRENT_POS; EXPECT NO MOTION
;ENDFOLD BCO KILLER
It actually has a couple of nice functions,
1. You get your BCO without even moving the robot. Select a program, hit start without even looking with confidence, then block select wherever you like...
2. You can get back to the same point that you started with at the start of your program, pretty much anytime. Which is usually the last point of the previous program, so this lets you not have to copy the same point, or use a global point.
3. I have used it as a temporary position while programming a path.
4. You can have a program full of nothing but LIN's and still get to them...
5. Since I used $AXIS_ACT or $AXIS_ACT_MEAS, the robot can get to this point no matter how twisted up you can get it. I originally used $POS_ACT but found some situations that would cause the robot to fault with pulse limits, axis type move fixed the issue.
*Note- make sure to declare CURRENT_POS as an E6AXIS Global position.
I put this code at the top of every program. Where it's been most useful is while running in Auto, the start of our program goes through an initialization for our SMC servo grippers to send them home. Without the BCO killer, you have to hold the Start button until the robot make it's first move, now, you can tap start twice and walk away!
Of course, use this at your own risk, know where your robot is and where it's going to go, i.e. know your program...
Enjoy!