SWEEP

The SWEEP function returns a constant amplitude sinusoidal function with linearly increasing instantaneous frequency (linear chirp).

Format

SWEEP (x, a, x0, f0, x1, f1, dx)

Arguments

 
x
The independent variable.
a
The amplitude of the sinusoidal function.
x0
The value of the independent variable at which the SWEEP function begins.
f0
The initial instantaneous frequency (in Hz) of the sinusoidal function.
x1
The value of the independent variable value at which the SWEEP function ends
f1
The final instantaneous frequency (in Hz).
dx
The interval in which the SWEEP function becomes fully active.
 
Note:  
Error message will be triggered if .

Extended Definition

Mathematically, SWEEP is calculated as follows:
The SWEEP function is an implementation of a linear chirp function.
See details in section Mathematical background below.
 

Examples

The following example defines motion with a sinusoidal function with a rising frequency from 2 to 6Hz during the time interval 0 to 5.
MOTION/1,JOINT=1
, FUNCTION=SWEEP(TIME, 1.0, 0.0, 2.0, 5.0, 6.0, 0.01)
Figure 9 Example SWEEP function

Mathematical background

Given a waveform of type:
(1)
where t is time. The instantaneous frequency f(t) of this type of signal is defined as:
(2)
If function f(t) is a linear function, the waveform x(t) is called a linear chirp. The SWEEP function implements a linear chirp as shown in Figure 10.
Figure 10 Linear chirp implemented in SWEEP function
For the case we see that function f(t) takes the form:
(3)
Integrating Equation (2) we obtain:
or
Evaluating the integral we get:
Rearranging this expression we obtain:
The last two constants terms can be arbitrarily dropped to obtain:
(4)
Notice that dropping the above constants, the time derivative of Equation (4) still matches Equation (3).
Using Equation (4) at times t0 and t1, the angular function has these values:
(5)
and
(6)
Finally, Equations (4), (5) and (6) are used to define functions h(x) and p(x) presented in the definition of the SWEEP function above.
Notice the first argument to the SWEEP function is not limited to time.
For the case when t0 > 0 you may see a discontinuity in the value of , hence you may want to set a non zero value for dx (last argument of the SWEEP function) in order to ramp up the value of the angular function starting from zero.

References