I'm having issues at work with a project that is using a Fanuc S430iW robot to control the motion of a 9in grinder during a test. The system needs to adjust the speed of motion while the grinder is cutting into the material by using the feedback of the blade RPM and amperage draw. The system will need to keep the RPM and amperage within a tolerance band to maintain the highest material removal rate. Blade life and life of grinder is not important for this test, only matters that it cuts fast.
Picture of similar robot
Ive tried using conditional programming, running a second program concurrently to adjust the speed during motion with no luck and finally a program that runs thru a step motion would adjust motion speed before moving small steps. The step motion works but has some stuttering I would like to remove. Not sure how the pendant is able to adjust motion speed while its moving but that would be awesome if I could tie into that variable live. I do have the ability to use a PLC for the feedback loop then just feed a analog or digital system back to the robot.
Cliff notes of program
1. Set registers for info about max speed, RPM range, amperage range, length of motion
1. Reset counters for diag
2. Set PRfinal position as PRinitial position.
3. If loop for seeing if motion has traveled the requested distance if not then its sent inside the speed calc loop
a. Speed calc loop looks at rpm and amperage before adjusting the register location for speed then adding a incremental movement to the PR
b. Loop back to start of motion loop.
Code so far. Needs some cleaning up later
PR[2:FINAL POS]=PR[1:START] //setting position register 2 to start at the home position of the cut
R[10:MOVED]=0 //Reseting total distance moved counter. Mainly for my diag during testing.
J PR[1:START] R[1:CUT_SPEED]% CNT100 //First start position
LBL  //Start of motion loop
IF R[10:MOVED]<R[9:TOTALDISTANCE mm], JMP LBL //If statement to keep moving arm if not in final spot
IF R[10:MOVED]>=R[9:TOTALDISTANCE mm], JMP LBL //Jump to end of program due to completed motion
LBL  //Speed loop to see if robot needs to speed up or down
IF AI[5:RPM]<R[2:RPMLIMIT] OR AI[6:AMPERAGE]<R[3:AMPLIMIT], JMP LBL //If rpm is at max value or below max amp increase movement speed.
IF AI[5:RPM]>R[2:RPMLIMIT] OR AI[6:AMPERAGE]>R[3:AMPLIMIT], JMP LBL //If rpm is bogging down to hard or amperage is about to blow breaker, slow robot down.
!INCREASE MOVEMENT SPEED
IF R[1:CUT_SPEED]>=R[R:MAXSPEED], JMP LBL
R[4:SPEEDUP]=R[4:SPEEDUP]+1 //VERIFICATION TOOL TO SEE HOW MANY TIMES IT ADJUSTED DOWN
!DECREASE MOVEMENT SPEED
R[5:SPEEDDOWN]=R[5:SPEEDDOWN]+1 //VERIFICATION TOOL TO SEE HOW MANY DOWN IT ADJUSTED DOWN
LBL //INCREMENT MOVEMENT WITH UPDATED SPEED DATA
PR[2,2:FINAL POS]=PR[2,2:FINAL POS]+R[11:INCR MOVE]
R[10:MOVED]=R[10:MOVED]+R[11:INCR MOVE] //UNDERSTAND HOW FAR THE ROBOT HAS MOVED.
L PR[2:FINAL POS] R[1:CUT_SPEED]mm/sec FINE
JMP LBL //LOOP BACK TO START OF MOVEMENT ANALYSIS