A. In order to turn an IO on during a spline move you must use the NEXT option with the spline command (Move S). This is can be used for turning on a device such as a dispense head as the robot is in motion as the robot needs some time and distance to reach its programmed velocity. 

You can refer to the link below for more commands relating to spline motions. This type of motion is also known as path or free curve interpolation. 

https://www.fa-manuals.denso-wave.com/en/usermanuals/005756/

This can be handled in multiple ways. If you want to monitor the spline motion using the same program that executes the motion, you can use the NEXT option. If you want to handle this in separate programs, you can create a monitoring program that runs in parallel to your motion. For this example, we will look into performing this within the same program.

Here is the spline we will refer to for this example.



Each number represents a point taught along the spline. Spline motions occur sequentially through these points. We will call this motion spline 1. In our program we can use the MOVE S, 1 command.


'!TITLE "Robot program"

Sub Main

                TakeArm Keep = 0

                Move S, 1

End Sub

This program will simply execute spline 1’s motion. It does not monitor once the robot passes through a particular position.

For this test, we will assume the IO needs to be turned on once the robot reach point 5 on spline 1. We will incorporate the NEXT option as well as add in the CURPATHPOINT command to monitor the robot’s current point location on spline 1. The program will look as follows.

'!TITLE "Robot program"

Sub Main

                TakeArm Keep = 0

                Move S, 1, Next

                Wait Curpathpoint = 5                                    ‘wait for robot to reach point 5 on the spline

                Set IO128

End Sub

The WAIT condition waits for the spline to reach point 5 and then turns on IO128. In addition, you can use the same command to have the IO turn off at a specified point.

'!TITLE "Robot program"

Sub Main

                TakeArm Keep = 0

                Move S, 1, Next

                Wait Curpathpoint = 5                                    ‘wait for robot to reach point 5 on the spline

                Set IO128

                Wait Curpathpoint = 26                                  ‘wait for robot to reach point 26 on the spline

                Reset IO128

End Sub

If you want the motion to overlap at the end you can simply add more points to your spline and have the last few points overlap the initial points.



Sub Main

                TakeArm Keep = 0

                Move S, 1, Next

                Wait Curpathpoint = 5                                    ‘wait for robot to reach point 5 on the spline

                Set IO128

                Wait Curpathpoint = 31                                  ‘wait for robot to reach point 31 on the spline

                Reset IO128

End Sub

If you want the IO to turn on after the spline has completed a certain percentage of its movement, you can exchange the WAIT CURPATHPOINT for the ARRIVE command. ARRIVE simply commands the controller to wait until the robot has completed a percentage of the current move before it processes the next command.

Sub Main

                TakeArm Keep = 0

                Move S, 1, Next

                Arrive 50                                                              ‘wait for robot to reach 50% of the spline motion

                Set IO128

End Sub