V+ Language Reference Guide, v17.x


DURATION program instruction

Syntax

DURATION time ALWAYS

Function

Set the minimum execution time for subsequent robot motions.

Usage Considerations

Unless the ALWAYS parameter is specified, only the next robot motion is affected.

DURATION 0 ALWAYS is assumed whenever program execution is initiated and when a new execution cycle begins.

The DURATION instruction affects the DRIVE instruction but not the DELAY instruction.

The setting of the monitor SPEED command affects the results of the DURATION setting.

The DURATION instruction can be executed by any program task as long as the robot selected by the task is not attached by any other task. The instruction applies to the robot selected by the task.

If the V+ system is not configured to control a robot, executing the DURATION instruction causes an error.

Parameters

time

Real-valued expression that specifies the minimum length of time (in seconds) that subsequent robot motions take to perform (see below).

If the value is zero, robot motions are performed without consideration of their time duration and use only the applicable values for SPEED and ACCEL.

ALWAYS

Optional keyword that determines how long the new duration will have an effect.

If ALWAYS is included, the specified duration time applies to all subsequent robot motions (until the duration setting is changed by another DURATION instruction). The specified duration applies only to the next robot motion if ALWAYS is not included.

Details

This instruction sets the minimum execution time for subsequent robot motions. For any motion, the time specified by the DURATION instruction has no effect if the duration setting is less than the time computed by the V+ robot-motion trajectory generator (considering the current motion speed and acceleration settings). However, if the duration is longer than the time computed by the trajectory generator, the motion is slowed so that its elapsed time corresponds approximately to the specified duration.

NOTE: Actual motion times may differ slightly from the duration setting due to quantization effects and due to acceleration and deceleration profiling.

The duration instruction does not specify the duration of an entire motion but instead specifies the minimum time of the constant-velocity segment plus one-half the acceleration and deceleration segments. In this way, continuous-path motions (in which individual motions are blended together) get the correct duration, but a single motion takes longer than the specified duration. In other words, the time of motion is primarily defined either by the value of DURATION or SPEED, using whichever value gives the longer time.

This instruction is very useful. Consider, for example, a situation where the value of a periodic, external signal is employed to continuously correct the path of the robot while the robot is moving. The DURATION instruction can be used to match the motion execution time to the sensor sampling rate and processing time. This ensures that the robot is kept in motion while new information is being processed. A sample program of this type is shown later.

Example

The following example reads an external sensor and moves to the computed robot location. This sequence is repeated 20 times at intervals of 96 milliseconds  (6/TPS seconds). This assumes the default period (tick) of 16 milliseconds for the V+ trajectory generator. Note that the motion speed is set to a very large value to make sure the motion is paced by the duration setting.

DURATION 6/TPS ALWAYS          ;Each motion to be 6 ticks long
SPEED 200 ALWAYS               ;Motion time determined primarily
                               ;by DURATION, not SPEED 	
    FOR i = 1 TO 20 		;Repeat 20 times... 	
        CALL read.signal(loc)  ;Get new step from sensor 	
        MOVE loc               ;Move to the location 	
    END 	 	

Related Keywords

ACCEL program instruction

DELAY program instruction

DURATION real-valued function

SELECT program instruction

SELECT real-valued function

SPEED monitor command

SPEED program instruction


Submit comments to: techpubs@adept.com
Last modified on: 3/27/2012
Copyright © 1994 - 2012. Adept Technology, Inc.