# Programming

The programming syntax is based on the axis-specific programming of independent axes [PROG].

After the axis identifier, the parameters of the oscillating motion are defined by keywords and, if applicable, an associated value:

X[<keyword1> <(value1)>, [<keyword2> <(value2) >,...]

The characteristic of the oscillating motion is determined by the locations of the reversal positions and the axis feedrate. The reversal positions can be either specified directly or alternatively they are determined automatically via the zero position and the excursion.

Alternatively, the oscillating velocity can be defined by:

• Feedrate
• Frequency
• period

If no restriction occurs due to the dynamic axis characteristics, the frequency and the period are maintained exactly when the linear slope is used and maintained approximately when the non-linear slope is used.

Properties of keywords that are programmable in the oscillating command:

 Keyword Function/Meaning Unit OSC Oscillation identifier. Must be the first keyword in the command sequence. - ON Oscillation on - OFF Oscillation off - 1ST_POS First reversal position [mm] 1ST_DELT Waiting time at first reversal position [s] 2ND_POS Second reversal position [mm] 2ND_DELT Waiting time at second reversal position [s] ZERO_POS Zero point [mm] EXCUR Excursion [mm] FEED Feedrate [mm/min] FREQ Frequency [Hz] TIME period [s] NBR_OSC Number of oscillations -

## Programing Example Programming the oscillating axis

The equals signs between the keyword and the value are optional.

Specifying the oscillating motion path via reversal positions:

`N10 X[OSC ON 1ST_POS=-100 2ND_POS=100 FEED=1000]`

Specifying the oscillating motion path via the zero position and the excursion:

`N20 X[OSC ON ZERO_POS=0 EXCUR=100 FEED=1000]`

Specifying oscillation frequency 1 Hertz, 10 oscillations:

`N30 X[OSC ON ZERO_POS=0 EXCUR=100 FREQ=1 NBR_OSC=10]`

Specifying a 4s oscillating period:

`N40 X[OSC ON ZERO_POS=0 EXCUR=100 TIME=4]`

Oscillating motion with feed motion of a path axis:

`N50 X[OSC ON 1ST_POS=111 2ND_POS=222 FREQ=1] `

`N60 G01 G90 Y500 F200`

Oscillating with waiting times of 0.5 s each at reversal positions

`N70 X[OSC ON 1ST_POS=-100 1ST_DELT=0.5 2ND_POS=200      2ND_DELT=0.5 FEED=1000]`

Deselecting oscillation:

Oscillation is stopped when reversal position 2 is reached:

`N80 X[OSC OFF]`

Fast oscillation stop:

If a feedrate is programmed with FEED in combination with OFF, the oscillating motion is stopped immediately (feedhold of oscillating axis) and the reversal position 2 is directly approached at the new feed rate.

`N90 X[OSC OFF FEED=5000]`

## Notice Restrictions of kinematic transformations

When kinematic transformation (#TRAFO ON) is active, an oscillating motion is only permitted if the kinematics have a basic Cartesian structure and the oscillation direction vector lies in the Z axis direction of the machine.