
Scotty (Customer) asked a question.
I'm trying to get an axis to move back & forth in a sinusoidal motion about a centre point, then after an indeterminate number of cycles when a button is pressed the axis should move smoothly back to the centre point.
I can get relatively smooth sinusoidal motion by looping S-curve position commands, but I can't get a smooth transition to centre. The closest I've come so far is using an axscript with the s-curve moves in a while loop to get the sine motion, then jumping to a second axscript with an s-curve to centre. The problem with this is the axis comes to a stop (albeit instantaneous) while transitioning to the second axscript.
I tried putting the move to centre in the first axscript after the while loop, which resulted in smooth motion but when the button was pressed it only moved to centre at the end of the cycle - it should be immediate.
Another attempt was using a single multi-move trapezoid instruction and procedurally generating a sinusoidal target position but that didn't work - the axis would shudder to a halt and fault out. It's quite possible I wasn't implementing the multi-move properly as I found the instructions a little confusing.
A multi-move S-curve instruction would possibly do the job, but unfortunately there isn't a multi-move option in the S-curve position instruction.
I also tried something akin to the blended move axscript example using velocity instructions, but I couldn't get the axis to reverse direction this way. Again, it's completely possible I was implementing it incorrectly.
Any suggestions would be gratefully received.
Scott.
It took me a while to properly understand the AXCAM approach, but I got it working great on the testbed PLC.
However on the production setup I ended up going back to AXSCRIPT and using velocity commands combined with register matching positions in a WHILE loop to get the job done.