move_periodic()
Features
This function performs the cyclic motion based on the sine function of each axis (parallel and rotation) of the reference coordinate (ref) input as a relative motion that begins at the current position. The attributes of the motion on each axis are determined by the amplitude and period, and the acceleration/deceleration time and the total motion time are set by the interval and repetition count.
Parameters
Parameter Name | Data Type | Default Value | Range | Description |
amp | list (float[6]) | - | 0≤amp | Amplitude(motion between -amp and +amp) [mm] or [deg] |
period | float or list (float[6]) | 0≤period | period(time for 1 cycle)[sec] | |
atime | float | 0.0 | 0≤atime | Acc-, dec- time [sec] |
repeat | int | 1 | > 0 | Repetition count |
ref | int | DR_TOOL | - | reference coordinate
|
Note
- Amp refers to the amplitude. The input is a list of 6 elements which are the amp values for the axes (x, y, z, rx, ry, and rz). The amp input on the axis that does not have a motion must be 0.
- Period refers to the time needed to complete a motion in the direction, the amplitude. The input is a list of 6 elements which are the periods for the axes (x, y, z, rx, ry, and rz).
- Atime refers to the acceleration and deceleration time at the beginning and end of the periodic motion. The largest of the inputted acceleration/deceleration times and maximum period*1/4 is applied. An error is generated when the inputted acceleration/deceleration time exceeds 1/2 of the total motion time.
- Repeat refers to the number of repetitions of the axis (reference axis) that has the largest period value and determines the total motion time. The number of repetitions for each of the remaining axes is determined automatically according to the motion time.
- If the motion terminates normally, the motions for the remaining axes can be terminated before the reference axis's motion terminates so that the end position matches the starting position. The deceleration section will deviate from the previous path if the motions of all axes are not terminated at the same time. Refer to the following image for more information.
- Ref refers to the reference coordinate system of the repeated motion.
- If a maximum velocity error is generated during a motion, adjust the amplification and period using the following formula.
Max. velocity = Amplification(amp)*2*pi(3.14)/Period(period) (i.e., Max. velocity=62.83mm/sec if amp=10mm and period=1 sec) - This function does not support online blending of previous and subsequent motions.
Return
Value | Description |
---|---|
0 | Success |
Negative value | Error |
Exception
Exception | Description |
---|---|
DR_Error (DR_ERROR_TYPE) | Parameter data type error occurred |
DR_Error (DR_ERROR_VALUE) | Parameter value is invalid |
DR_Error (DR_ERROR_RUNTIME) | C extension module error occurred |
DR_Error (DR_ERROR_STOP) | Program terminated forcefully |
Example
P0 = posj(0,0,90,0,90,0)
movej(P0)
#1
move_periodic(amp =[10,0,0,0,30,0], period=1.0, atime=0.2, repeat=5, ref=DR_TOOL)
# Repeats the x-axis (10mm amp and 1 sec. period) motion and rotating y-axis (30deg amp and 1 sec. period) motion in the tool coordinate system
# totally, repeat the motion 5 times.
#2
move_periodic(amp =[10,0,20,0,0.5,0], period=[1,0,1.5,0,0,0], atime=0.5, repeat=3, ref=DR_BASE)
# Repeats the x-axis (10mm amp and 1 sec. period) motion and z-axis (20mm amp and 1.5 sec. period) motion in the base coordinate system
# 3 times. The rotating y-axis motion is not performed since its period is "0".
# The total motion time is about 5.5 sec. (1.5 sec. * 3 times + 1 sec. for acceleration/deceleration) since the period of the x-axis motion is greater.
# The x-axis motion is repeated 4.5 times.