Table of contents |

# Script Commands

## 3PH<N>=<M> <A>

### Description

Sets the assigned PWMs of an axis to the specified magnitude and phase angle for a brushless 3 phase motor.

This command is useful for energizing a coil (or effective coil position). This is often required while initial homing or determining the commutation offset for a 3 phase brushless motor. If an effective coil position is energized, the motor rotor will normally align itself to the coil position. This is similar to the manner in which a stepping motor operates. Since the rotor location is then known, the commutation offset may then be determined. Alternately if an index mark is available, the effective coil position may be rotated by changing the phase angle until the index mark is detected.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Magnitude of output to apply.

Valid Range is -230 ... +230 PWM units.

<A>

Commutation angle to be used.

Units are in Commutation cycles.

Only fractional value will be used .

### Example

3PH0=230 0.5

## 4PH<N>=<M> <A>

Sets the assigned PWMs of an axis to the specified magnitude and phase angle for a brushless 4 phase motor.

This command is useful for energizing a coil (or effective coil position). This is often required while initial homing or determining the commutation offset for a 4 phase brushless motor. If an effective coil position is energized, the motor rotor will normally align itself to the coil position. This is similar to the manner in which a stepping motor operates. Since the rotor location is then known, the commutation offset may then be determined. Alternately if an index mark is available, the effective coil position may be rotated by changing the phase angle until the index mark is detected.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Magnitude of output to apply.

Valid Range is -250 ... +250 PWM units.

<A>

Commutation angle to be used.

Units are in Commutation cycles.

Only fractional value will be used.

### Example

4PH0=250 0.5

## Accel<N>=<A> or Accel <N>

### Description

Get or Set the max acceleration (for independent moves and jogs)

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<A>

The max acceleration. Units are in Position units per sec2.

### Example

Accel0=1000.0

## ADC<N>

### Description

Display current ADC (Analog to Digital Converter). Display range -2048 to 2047.

Kanalog channels 0-7 are ±10V general purpose inputs.

Parameters

<N>

ADC channel.

Valid range 0 ... 7 (Kanalog), 8 ... 11 (Kogna).

### Example

ADC 0

## Arc<XC> <YC> <RX> <RY> <θ0> <dθ> <Z0> <A0> <B0> <C0> <Z1> <A1> <B1> <C1> <a> <b> <c> <d> <tF>

### Description

Place circular (also elliptical or helical) interpolated move into the coordinated motion buffer. See also KMotion Coordinated Motion. A path through space is defined where x and y are changing in an elliptical manner and z, a, b, c are changing in a linear manner forming a portion of a helix. A parametric equation is defined which describes which portion of the path as well as how as a function of time the path is to be traversed. This command can consist of up to 6 axis of coordinated motion. X and Y perform an arc while Z, A, B, and C move linearly.

Although the Arc command may be sent directly, the Arc command is normally generated automatically to perform a planned trajectory by the coordinated motion library or GCode.

(XC,YC) - center of circle

(RX,RY) - x radius and y radius

θ0 - initial angle for the beginning of the path

dθ - amount of angular change for the path

Z0 - initial Z position of path

A0 - initial A position of path

B0 - initial B position of path

C0 - initial C position of path

Z1 - final Z position of path

A1 - final A position of path

B1 - final B position of path

C1 - final C position of path

3rd order parametric equation where
p = a t 3 + b t 2 + c t + d
p is the position along the path as a function of time. When p=0 the (x,y,z) position will be at the beginning of the path (θ= θ0 and z=z0). When p=1 the (x,y,z) position will be at the end of the path (θ= θ0+dθ, and z=z1).

This motion segment will be performed over a time period of tF, where t varies from 0 ... tF. Note that it is not necessary that p vary over the entire range of 0 ... 1. This is often the case when there may be an acceleration, constant velocity, and deceleration phase phase over the path. ie: t might vary from 0.0->0.1 where p might vary from 0.3->0.7.

### Parameters

<XC> - X center of ellipse, units are position units of x axis

<YC> - Y center of ellipse, units are position units of y axis

<RX> - X radius of ellipse, units are position units of x axis

<RY> - Y radius of ellipse, units are position units of y axis

<θ0> - initial theta position on ellipse, radians (0 radians points in the +x direction)

<dθ> - change in theta position on ellipse, radians (+ theta causes CCW motion)

<Z0> - initial Z position on path, units are position units of z axis

<A0> - initial A position on path, units are position units of a axis

<B0> - initial B position on path, units are position units of b axis

<C0> - initial C position on path, units are position units of c axis

<Z1> - final Z position on path, units are position units of z axis

<A1> - final A position on path, units are position units of a axis

<B1> - final B position on path, units are position units of b axis

<C1> - final C position on path, units are position units of c axis

<a> - parametric equation t3 coefficient

<b> - parametric equation t2 coefficient

<c> - parametric equation t coefficient

<d> - parametric equation constant coefficient

<tF> - time for segment

### Example (complete unit circle, centered at 0.5,0.5, no Z, A, B, or C motion, performed in 10 seconds)

Arc 0.5 0.5 1.0 1.0 0.0 6.28 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.0 10.0

## ArcEx<XC> <YC> <RX> <RY> <θ0> <dθ> <Z0> <A0> <B0> <C0> <U0> <V0> <Z1> <A1> <B1> <C1> <U1> <V1> <a> <b> <c> <d> <tF>

### Description

Place circular (also elliptical or helical) interpolated move into the coordinated motion buffer. Same as Arc command except expands the axes from 6 to 8 to include U V axes.

### Example (complete unit circle, centered at 0.5,0.5, no Z, A, B, C, U, V motion, performed in 10 seconds)

ArcEx 0.5 0.5 1.0 1.0 0.0 6.28 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.0 10.0

## ArcP<XC> <YC> <RX> <RY> <θ0> <dθ> <Z0> <A0> <B0> <C0> <U0> <V0> <XP0> <YP0> <Z1> <A1> <B1> <C1> <U1> <V1> <XP1> <YP1> <ZP1> <AP1> <BP1> <CP1> <UP1> <VP1> <a> <b> <c> <d> <tF>
(Kogna only)

### Description

Place circular (also elliptical or helical) interpolated move into the coordinated motion buffer. Same as ArcEx command except expands the axes from 8 to 16 to include the 8 prime axes XP YP ZP AP BP CP UP VP axes.

### Example (complete unit circle, centered at 0.5,0.5, no Z, A, B, C, U, V or Prime axes motion , performed in 10 seconds)

ArcP 0.5 0.5 1.0 1.0 0.0 6.28 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.0 10.0

## ArcZX<ZC> <XC> <RX> <RZ> <θ0> <dθ> <Y0> <A0> <B0> <C0> <Y1> <A1> <B1> <C1> <a> <b> <c> <d><tF>

### Description

Place circular (also elliptical or helical) interpolated move into the coordinated motion buffer. Same as Arc Command except circular motion is performed in the ZX plane rather than the XY plane.

## ArcXZEx<XC> <ZC> <RX> <RY> <θ0> <dθ> <Y0> <A0> <B0> <C0> <U0> <V0> <Y1> <A1> <B1> <C1> <U1> <V1> <a> <b> <c> <d> <tF>

### Description

Place circular (also elliptical or helical) interpolated move into the coordinated motion buffer. Same as ArcEx Command except circular motion is performed in the XZ plane rather than the XY plane.

## ArcXZP<XC> <ZC> <RX> <RY> <θ0> <dθ> <Y0> <A0> <B0> <C0> <U0> <V0> <XP0> <YP0> <Y1> <A1> <B1> <C1> <U1> <V1> <XP1> <YP1> <ZP1> <AP1> <BP1> <CP1> <UP1> <VP1> <a> <b> <c> <d> <tF>
(Kogna only)

### Description

Place circular (also elliptical or helical) interpolated move into the coordinated motion buffer. Same as ArcP Command except circular motion is performed in the XZ plane rather than the XY plane.

## ArcYZ<YC> <ZC> <RY> <RZ> <θ0> <dθ> <X0> <A0> <B0> <C0> <X1> <A1> <B1> <C1> <a> <b> <c><d> <tF>

### Description

Place circular (also elliptical or helical) interpolated move into the coordinated motion buffer. Same as Arc Command except circular motion is performed in the YZ plane rather than the XY plane.

## ArcYZEx<YC> <ZC> <RX> <RY> <θ0> <dθ> <X0> <A0> <B0> <C0> <U0> <V0> <X1> <A1> <B1> <C1> <U1> <V1> <a> <b> <c> <d> <tF>

### Description

Place circular (also elliptical or helical) interpolated move into the coordinated motion buffer. Same as ArcEx Command except circular motion is performed in the YZ plane rather than the XY plane.

## ArcYZP<YC> <ZC> <RX> <RY> <θ0> <dθ> <X0> <A0> <B0> <C0> <U0> <V0> <XP0> <YP0> <X1> <A1> <B1> <C1> <U1> <V1> <XP1> <YP1> <ZP1> <AP1> <BP1> <CP1> <UP1> <VP1> <a> <b> <c> <d> <tF>
(Kogna only)

### Description

Place circular (also elliptical or helical) interpolated move into the coordinated motion buffer. Same as ArcP Command except circular motion is performed in the YZ plane rather than the XY plane.

## ArcHex<XC> <YC> <RX> <RY> <θ0> <dθ> <Z0> <A0> <B0> <C0> <Z1> <A1> <B1> <C1> <a> <b> <c><d> <tF>

### Description

Place circular (also elliptical or helical) interpolated move into the coordinated motion buffer. This command is exactly the same as the Arc command above, except all 19 parameters are specified as 32-bit hexadecimal values which are the binary images of 32-bit floating point values. When generated by a program this is often faster, simpler, and more precise than decimal values. See also KMotion Coordinated Motion.

### Parameters

See above.

### Example (complete unit circle, centered at 0.5,0.5, no Z A B C motion, performed in 10 seconds)

ArcHex 3f000000 3f000000 3f800000 3f800000 0 40c90fdb 0 0 0 0 0 0 0 0 0 0 3dcccccd 0 41200000

## ArcHexEx<XC> <YC> <RX> <RY> <θ0> <dθ> <Z0> <A0> <B0> <C0> <U0> <V0> <Z1> <A1> <B1> <C1> <U1> <V1> <a> <b> <c><d> <tF>

### Description

Place circular (also elliptical or helical) interpolated move into the coordinated motion buffer. Same as ArcHexEx Command except circular motion is performed in the XZ plane rather than the XY plane.

### Parameters

See above.

### Example (complete unit circle, centered at 0.5,0.5, no Z A B C U V motion, performed in 10 seconds)

ArcHex 3f000000 3f000000 3f800000 3f800000 0 40c90fdb 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3dcccccd 0 41200000

## ArcHexP<XC> <YC> <RX> <RY> <θ0> <dθ> <Z0> <A0> <B0> <C0> <Z1> <A1> <B1> <C1> <a> <b> <c><d> <tF>
(Kogna only)

### Description

Place circular (also elliptical or helical) interpolated move into the coordinated motion buffer. This command is exactly the same as the ArcP command above, except all 39 parameters are specified as 32-bit hexadecimal values which are the binary images of 32-bit floating point values. When generated by a program this is often faster, simpler, and more precise than decimal values. See also KMotion Coordinated Motion.

### Parameters

See above.

### Example (complete unit circle, centered at 0.5,0.5, no Z A B C motion, performed in 10 seconds)

ArcHexP 3f000000 3f000000 3f800000 3f800000 0 40c90fdb 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3dcccccd 0 41200000

## ArcHexZX<ZC> <XC> <RX> <RY> <θ0> <dθ> <Y0> <A0> <B0> <C0> <U0> <V0> <Y1> <A1> <B1> <C1> <U1> <V1> <a> <b> <c> <d> <tF>

### Description

Place circular (also elliptical or helical) interpolated move into the coordinated motion buffer. Same as ArcHex Command except circular motion is performed in the ZX plane rather than the XY plane.

## ArcHexZXEx<ZC> <XC> <RX> <RZ> <θ0> <dθ> <Y0> <A0> <B0> <C0> <U0> <V0> <Y1> <A0> <B0> <C0> <U1> <V1> <a> <b> <c> <d> <tF>

### Description

Place circular (also elliptical or helical) interpolated move into the coordinated motion buffer. Same as ArcHexEx Command except circular motion is performed in the ZX plane rather than the XY plane.

## ArcHexZXP<ZC> <XC> <RX> <RY> <θ0> <dθ> <Y0> <A0> <B0> <C0> <U0> <V0> <XP0> <YP0> <Y1> <A1> <B1> <C1> <U1> <V1> <XP1> <YP1> <ZP1> <AP1> <BP1> <CP1> <UP1> <VP1> <a> <b> <c> <d> <tF>
(Kogna only)

### Description

Place circular (also elliptical or helical) interpolated move into the coordinated motion buffer. Same as ArcHexP Command except circular motion is performed in the ZX plane rather than the XY plane.

## ArcHexYZ<YC> <ZC> <RY> <RZ> <θ0> <dθ> <X0> <A0> <B0> <C0> <X1> <A1> <B1> <C1> <a> <b> <c> <d> <tF>

### Description

Place circular (also elliptical or helical) interpolated move into the coordinated motion buffer. Same as ArcHex Command except circular motion is performed in the YZ plane rather than the XY plane.

## ArcHexYZEx<YC> <ZC> <RX> <RY> <θ0> <dθ> <X0> <A0> <B0> <C0> <U0> <V0> <X1> <A1> <B1> <C1> <U1> <V1> <a> <b> <c> <d> <tF>

### Description

Place circular (also elliptical or helical) interpolated move into the coordinated motion buffer. Same as ArcHexEx Command except circular motion is performed in the YZ plane rather than the XY plane.

## ArcHexYZP<YC> <ZC> <RX> <RY> <θ0> <dθ> <X0> <A0> <B0> <C0> <U0> <V0> <XP0> <YP0> <X1> <A1> <B1> <C1> <U1> <V1> <XP1> <YP1> <ZP1> <AP1> <BP1> <CP1> <UP1> <VP1> <a> <b> <c> <d> <tF>
(Kogna only)

### Description

Place circular (also elliptical or helical) interpolated move into the coordinated motion buffer. Same as ArcHexP Command except circular motion is performed in the YZ plane rather than the XY plane.

## BacklashAmount<N>=<A> or BacklashAmount<N>

### Description

Sets or gets the amount of Backlash Compensation Offset to be applied.

See also BacklashMode and BacklashRate.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<A>

Floating point Backlash Compensation Amount in units of Steps or Counts.

### Example

BacklashAmount0=5.5

## BacklashMode<N>=<M> or BacklashMode<N>

### Description

Sets or gets the Backlash Compensation mode from either BACKLASH_OFF (0) to BACKLASH_LINEAR (1). When the backlash mode is set to Linear mode, whenever the commanded destination begins moving in the positive direction, a positive offset of the amount, BacklashAmount, will be applied. The offset will be ramped upward as a linear function of time at the rate specified as the BacklashRate. Whenever the commanded destination begins moving in the negative direction the offset will be removed by ramping downward toward zero at the same rate.

If the the Backlash Compensation mode is set to BACKLASH_OFF (0), no backlash compensation will be applied.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Backlash Compensation Mode setting. Currently 0 or 1.

### Example

BacklashMode0=1

## BacklashRate<N>=<R> or BacklashRate<N>

### Description

Sets or gets the rate at which the amount of Backlash Compensation Offset will be applied.

See also BacklashMode and BacklashAmount.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<A>

Floating point Backlash Compensation Rate in units of Steps or Counts per second.

### Example

BacklashRate=1000.0

## BegRapidBuf

### Description

Inserts into coordinated move buffer a command to indicate Rapid is in progress and to use Rapid FRO.

### Parameters

None

### Example

BegRapidBuf

## CheckDone<N>

### Description

Displays:

1 if axis N has completed its motion

0 if axis N has not completed its motion

-1 if the axis is disabled

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

### Example

CheckDone0

## CheckDoneBuf

### Description

Displays the status of the Coordinated Motion Buffer. KMotion contains a Coordinated Motion Buffer where move segments (linear and arcs) and I/O commands may be downloaded and executed in real time.

Displays:

1 if all coordinated move segments have completed

0 if all coordinated move segments have not completed

-1 if any axis in the defined coordinate system is disabled

### Parameters

None

### Example

CheckDoneBuf

## CheckDoneGather

### Description

Displays the status of a data gather operation. KMotion contains a mechanism for capturing data from a variety of sources in real time. This mechanism is utilized when capturing data for Bode plots and Step response plots. It is also available for general purpose use. See the data gathering example.

Displays:

1 if data gather is completed

0 if data gather has not completed

### Parameters

None

### Example

CheckDoneGather

## CheckDoneXYZABC

### Description

Displays status of a commanded MoveXYZABC command. See also DefineCS6.

Displays:

1 if all axes in the defined coordinate system have completed their motion

0 if any axis in the defined coordinate system has not completed its motion

-1 if any axis in the defined coordinate system is disabled

### Parameters

None

### Example

CheckDoneXYZABC

## CheckThread<N>

### Description

Checks whether a User Program Thread is currently executing. Returns 1 if executing, 0 if not executing.

### Parameters

<N>

Thread number specified as a decimal number. Valid range 1...7.

### Example

CheckThread0

## ClearBit<N>

### Description

Clears an actual I/O bit or virtual I/O bit. Note that actual I/O bits must be previously defined as an output, see SetBitDirection

### Parameters

<N>

Bit number specified as a decimal number. Accepted range 0...2047.

### Example

ClearBit0

## ClearBitBuf<N>

### Description

Inserts into the coordinated move buffer a command to clear an I/O bit (actual I/O bits must be defined as an output, see SetBitDirection).

### Parameters

<N>

Bit Number to clear. Accepted Range 0...2047.

### Example

ClearBitBuf0

## ClearFlashImage

### Description

Prepare to download FLASH firmware image. Sets entire RAM flash image to zero.

### Parameters

None.

### Example

ClearFlashImage

## CommutationOffset<N>=<X> or CommutationOffset<N>

### Description

Get or Set 3 or 4 phase commutation offset. When brushless commutation is performed, the desired Output Magnitude is distributed and applied to the various motor coils as a function of position. The commutation offset shifts the manner in which the Output Magnitude is applied.

For a 3 phase brushless output mode, commutation offset is used in the following manner.

PhaseA = OutputMagnitude * sin((Position+CommutationOffset)*invDistPerCycle*2π)

PhaseB = OutputMagnitude * sin((Position+CommutationOffset)*invDistPerCycle*2π + 2π/3)

PhaseC = OutputMagnitude * sin((Position+CommutationOffset)*invDistPerCycle*2π + 4π/3)

For a 4 phase brushless output mode, commutation offset is used in the following manner.

PhaseA = OutputMagnitude * sin((Position+CommutationOffset)*invDistPerCycle*2π)

PhaseB = OutputMagnitude * cos((Position+CommutationOffset)*invDistPerCycle*2π)

See also invDistPerCycle and Configuration Parameters.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<X>

Offset in units of Position.

### Example

CommutationOffset0=100.0

## ConfigSpindle<T> <A> <U> <W> <C>

### Description

Enables/Disables and configures the firmware to monitor Spindle Speed and Position to allow reporting of Spindle Speed and to perform Threading operations.

See also: TrigThread and GetSpindleRPS

### Parameters

<T>

Spindle Sensor Type. 0 - disables spindle measurement, 1 - defines the sensor type as a quadrature encoder .

<A>

Axis - Defines the Axis Channel that will maintain the Spindle Position. Note this is not a Encoder input channel. Rather it is the Axis Channel that has a Encoder input Channel defined. Valid range 0 ...7.

<U>

Update Time - delta time for measurement. This is the amount of time between Spindle Position samples used to calculate the current speed. Speed = Delta Position/Delta Time. A longer time period will allow for a more accurate speed measurement, especially at low speeds and if a low resolution encoder is used. A shorter Update Time will make the speed measurement to be more responsive as it changes. Units of seconds. Typical value 0.2 seconds

<W>

Tau - low pass filter time constant for threading. Pseudo Time along a time dependent trajectory path is adjusted based on spindle position. The Pseudo Time is smoothed using a low pass filter with a time constant of Tau to avoid making too abrupt changes of position, velocity or acceleration. Units of seconds. Typical value 0.1 seconds

<C>

Counts per Revolution. Number of encoder counts per full revolution of the Spindle.

### Example

ConfigureSpindle 1 0 0.2 0.1 4096.0

## D<N>=<M> or D<N>

### Description

Get or Set PID derivative Gain.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Derivative Gain value. The units of the derivative gain are in Output Units/Position Units x Servo Sample Time.

### Example

D0=10.0

## DAC<N> <M>

### Description

Set DAC to value. Kanalog DACs (0...7) and Kogna DACs (8...15) have ±10 Volt ranges. See also Analog Status Screen.

### Parameters

<N>

DAC channel to set. Valid Range 0...7 (Kanalog) 8...15 Kogna.

<M>

DAC value to set in counts. Valid Range -2048...2047.

### Example

DAC0=2000

## DeadBandGain<N>=<M> or DeadBandGain<N>

### Description

Get or Set gain while error is within the deadband range. See DeadBand Description. See Servo Flow Diagram.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Gain to be applied. A value of 1.0 will have normal gain while within the deadband. A value less than 1.0 will have reduced gain within the deadband.

### Example

DeadBandGain0=0.5

## DeadBandRange<N>=<M> or DeadBandRange<N>

### Description

Get or Set range where deadband gain is to be applied. See DeadBand Description. See Servo Flow Diagram.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

±Range in Position units,

### Example

DeadBandRange0=1.0

## DefineCS<X> <Y> <Z> <A> <B> <C> or DefineCS

### Description

Set or get the defined X Y Z A B C coordinate system axis assignments for up to 6 axes of coordinated motion. Unused axis are assigned an axis channel of -1.

See also Coordinated Motion.

### Parameters

<X>

Assigned Axis channel number for X. Valid range 0...7 (KFLOP) 0..15 (Kogna).

Use -1 if axis is not defined.

<Y>

Assigned Axis channel number for Y. Valid range 0...7 (KFLOP) 0..15 (Kogna).

Use -1 if axis is not defined.

<Z>

Assigned Axis channel number for Z. Valid range 0...7 (KFLOP) 0..15 (Kogna).

Use -1 if axis is not defined.

<A>

Assigned Axis channel number for A. Valid range 0...7 (KFLOP) 0..15 (Kogna).

Use -1 if axis is not defined.

<B>

Assigned Axis channel number for B. Valid range 0...7 (KFLOP) 0..15 (Kogna).

Use -1 if axis is not defined.

<C>

Assigned Axis channel number for C. Valid range 0...7 (KFLOP) 0..15 (Kogna).

Use -1 if axis is not defined.

### Example

DefineCS

DefineCS = 0 1 2 3 4 -1

## DefineCSEX<X> <Y> <Z> <A> <B> <C> <U> <V> or DefineCSEX

### Description

Set or get the defined X Y Z A B C coordinate system axis assignments for up to 8 axes of coordinated motion. Unused axis are assigned an axis channel of -1.

See also Coordinated Motion.

### Parameters

<X>

Assigned Axis channel number for X. Valid range 0...7 (KFLOP) 0..15 (Kogna).

Use -1 if axis is not defined.

<Y>

Assigned Axis channel number for Y. Valid range 0...7 (KFLOP) 0..15 (Kogna).

Use -1 if axis is not defined.

<Z>

Assigned Axis channel number for Z. Valid range 0...7 (KFLOP) 0..15 (Kogna).

Use -1 if axis is not defined.

<A>

Assigned Axis channel number for A. Valid range 0...7 (KFLOP) 0..15 (Kogna).

Use -1 if axis is not defined.

<B>

Assigned Axis channel number for B. Valid range 0...7 (KFLOP) 0..15 (Kogna).

Use -1 if axis is not defined.

<C>

Assigned Axis channel number for C. Valid range -1 ... 7v (Kogna: 0 ... 15).

Use -1 if axis is not defined.

<U>

Assigned Axis channel number for U. Valid range 0...7 (KFLOP) 0..15 (Kogna).

Use -1 if axis is not defined.

<V>

Assigned Axis channel number for V. Valid range 0...7 (KFLOP) 0..15 (Kogna).

Use -1 if axis is not defined.

### Example

DefineCSEX

DefineCSEX = 0 1 2 3 4 5 6 7

## DefineCSP=<XP><YP><ZP><AP><BP><CP><UP><VP> (Kogna only)

### Description

Define the 8 Axes that make up the XP YP ZP AP BP CP UP VP Prime Coordinate System. Set unused Axes to -1.

### Parameters

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

### Example

DefineCSP = 0 1 -1 -1 -1 -1 -1 -1

## Dest<N>=<M> or Dest<N>

### Description

Set or get the last commanded destination for an axis. The Dest (destination) is normally set (or continuously updated) as the result of a motion command (Move, Jog, or Coordinated motion) , but may also be set with this command if no motion is in progress.

### <N>

### Parameters

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Value to set in Position units. Valid range - any.

### Example

Dest0=100

or

Dest0

## DisableAxis<N>

### Description

Kill any motion and disable motor. Any associated output PWM channels for the axis will be set to 0R mode.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

### Example

DisableAxis0

## Echo<S>

### Description

Echo character string back to the Console Screen.

### Parameters

<S>

Any character string < 80 characters

### Example

Echo Hello

## EnableAxis<N>

### Description

Set an Axis' destination to the Current Measured Position and enable the axis. See also EnableAxisDest to explicitly set the desired destination for the axis. Note for a MicroStepper Axis (which normally has no measured position) this command will leave the Axis' destination unchanged. .

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

### Example

Enable0

## EnableAxisDest<N> <M>

### Description

Set an Axis' destination to the specified position and enable the axis. See also EnableAxis to set the desired destination to the current measured position.

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Destination for the axis. Position units. Valid range - any.

### Example

EnableAxisDest0 1000.0

## Enabled<N>

### Description

Display whether the specified axis is enabled, 1 - if currently enabled, 0 - if not enabled.

Note: to enable an axis use EnableAxis or EnableAxisDest.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

### Example

Enabled0

## EndRapidBuf

### Description

Inserts into coordinated move buffer a command to indicate Rapid has been completed and to no longer use Rapid FRO.

### Parameters

None

### Example

EndRapidBuf

## EntryPoint<N> <H>

### Description

Set execution start address of user thread to specified address. This operation if normally performed automatically when downloading a user program.

### Parameters

<N>

User Thread number to set. Decimal number. Valid range 1...7.

<H>

Start address. 32 bit Hex number.

### Example

Entrypoint1 80030000

## ExecBuf

### Description

Execute the contents of the coordinated motion buffer. Use CheckDoneBuf to determine when the buffer has been fully executed. See also Coordinated Motion.

### Parameters

None

### Example

ExecBuf

## ExecTime

### Description

Displays the amount of the Coordinated Motion Buffer that has been already executed in terms of Time. KMotion contains a Coordinated Motion Buffer where move segments (linear and arcs) and I/O commands may be downloaded and executed in real time. This command is useful for determining how long before the Coordinated Motion Buffer will complete. For example, if a number of segments have been downloaded where their total execution time is 10 seconds, and they are currently in progress of being executed, and the ExecTime command reports that 8 seconds worth of segments have been executed, then the remaining time before the queue completes (or starves for data) would be 2 seconds. This command is useful for applications where it is important not to download data too far ahead so changes to the Trajectory may be made. The value returned is a floating point decimal value in Seconds with 3 decimal places. If the Coordinated Motion has already completed the amount of time will be a negative value whose magnitude is the total time that was executed. See also Coordinated Motion.

Displays:

Executed time in seconds as a floating point decimal number with 3 decimal places

ie. 10.123

If the buffer has already completed the value will be negative

ie. -10.123

### Parameters

None

### Example

ExecTime

## Execute<N>

### Description

Begin execution of thread. Execution begins at the previously specified thread entry point.

See also C Program Screen.

### Parameters

<N>

Thread number to begin execution. Decimal number. Valid range 1...7.

### Example

Execute1

## FFAccel<N>=<M> or FFAccel<N>

### Description

Set or get Acceleration feed forward for axis.

See also feed forward tuning.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Feed forward value. units are in Output units per Input Units per sec2.

### Example

FFAccel0=100.0
or
FFAccel0

## FFVel<N>=<M> or FFVel<N>

### Description

Set or get Velocity feed forward for axis.

See also feed forward tuning.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Feed forward value. units are in Output units per Input Units per sec.

### Example

FFVel0=100.0
or
FFVel0

## Flash

### Description

Flash current user programs, persistent memory area, all axes configurations, tuning, and filter parameters to non-volatile memory. The entire state of the KMotion is saved to FLASH memory. Any active user programs will be paused during the flash operation

### Parameters

None

### Example

Flash

## FlushBuf

### Description

Informs KFLOP that the Coordinated Motion Buffer has been Flushed. This permits KFLOP to execute to the end of the buffer without performing protection against buffer starvation which would normally perform Feed Rate reduction in an attempt to avoid buffer underflow.

### Parameters

None

### Example

FlushBuf

## FPGA<N> <M>

### Description

Directly write an 8-bit value to an FPGA register. Should be only used with caution.

### Parameters

<N>

FPGA Register address to write as a decimal number. Valid range 0...1023.

<M>

8-bit value as a decimal number. Valid range 0...255.

### Example

FPGA 261 192

## FPGAW<N> <M>

### Description

Directly write a 16-bit value to an FPGA register. Should be only used with caution.

### Parameters

<N>

FPGA Register address to write as a decimal number. Valid range 0...1023.

<M>

16-bit value as a decimal number. Valid range 0...65536.

### Example

FPGAW 5 263

## GatherMove<N> <M> <L>

### Description

Performs a profiled move on an axis of the specified distance while gathering the specified number of points of data. This command is used while gathering data for the Step Response Screen plots.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Distance to move. Units are Position Units. Valid Range - any.

<L>

Number of servo samples to gather. Valid Range - 1...40000

### Example

GatherMove0 1000.0 2000

## GatherStep<N> <M> <L>

### Description

Performs a step on an axis of the specified distance while gathering the specified number of points of data. This command is used while gathering data for the Step Response Screen plots.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Distance to step. Units are Position Units. Valid Range - any.

<L>

Number of servo samples to gather. Valid Range - 1...40000

### Example

GatherStep0 1000.0 2000

## GetAllDestHex

### Description

Get all 8 Axis Destinations as 64 bit doubles, each as two 32-bit Hexadecimal Values (low|high).

### Example

Axis 0 Destination of 1000.0
GetAllDestHex
00000000 408F4000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

## GetAllDestVelHex

### Description

Get all 8 Axis Destinations and Velocities as 64 bit doubles, each as two 32-bit Hexadecimal Values (low|high).

### Example

GetAllDestVelHex

## GetBitDirection<N>

### Description

Displays whether an IO bit N (0...2047) is defined as input (0) or output (1)

### Parameters

<N>

I/O bit number. Accepted range 0...2047

### Example

GetBitDirection0

## GetGather<N>

### Description

Upload N data points from previous GatherMove or GatherStep command. Captured commanded destination, measured position, and output are uploaded as hex values (that represent binary images of 32-bit floating point values). Eight samples (24 values) per line.

### Parameters

<N>

Number of points to upload. Valid range 1...40000.

### Example

GetGather 1000

## GetGatherDec<N>

### Description

Reads a single word from the Gather Buffer at the specified offset. A single 32-bit value displayed as a signed decimal integer number will be displayed.

### Parameters

<N>

Offset into gather buffer, specified as a decimal offset of 32 bit words. Valid range 0...1999999

### Example

GetGatherDec 1000

## GetGatherHex<N> <M>

### Description

Reads multiple words from the Gather Buffer beginning at the specified offset. Hexadecimal values will be displayed that will represent binary images of the contents of the gather buffer as 32 bit words.

### Parameters

<N>

Offset into gather buffer, specified as a decimal offset of 32 bit words. Valid range 0...1999999

<M>

Number of 32 bit words to display. Decimal integer. Valid range 1...2000000

### Example

GetGatherHex 0 100

## GetInject<N> <M>

### Description

Display results of signalinjection and gathering. Bode Plot measurement involves injecting a signal and measuring the response for each of N_CPLX (2048) samples. This command gets the result from the injection. 3 values per sample are uploaded. Injection value, position response (relative to destination), and servo output. All 3 values are printed as hexadecimal values which represent the image of a 32-bit floating point value. 8 samples (24 hex values) are printed per line.

### Parameters

None

### Example

GetInject

## GetIpAddr (Kogna only)

### Description

Get board's Ethernet IP Address.

### Parameters

None

### Example

GetIpAddr

## GetKognaPWMEne<N>=<N> (Kogna only)

### Description

Get Kogna PWM. Enable channels 0-7. 1=Enable 0=Disable.

### Parameters

<N>

PWM channel number. Valid range 0...7.

### Example

GetKognaPWMEn0

## GetKognaPWMLength<N>=<N> (Kogna only)

### Description

Get Kogna PWM Pulse Length channels 0-7. 0-255 counts.

### Parameters

<N>

PWM channel number. Valid range 0...7.

### Example

GetKognaPWMLength0

## GetPersistDec<N>

### Description

Read a single word from the Persist Array at the specified offset a single 32-bit value displayed as a signed decimal number. The persist array is a general purpose array of N_USER_DATA_VARS (200) 32-bit values that is accessible to the host as well as KMotion C Programs. It may be used to share parameters, commands, or information between programs.

C Programs may access this array as the integer array:

`

persist.UserData[n];

`

It also resides in the KMotion Persist memory structure so that if memory is flashed, the value will be present at power up.

See also GetPersistHex, SetPersistDec, SetPersistHex

### Parameters

<N>

Offset into the integer array. Valid range 0...199.

### Example

GetPersistDec 10

## GetPersistHex<N>

### Description

Read a single word from the Persist Array at the specified offset a single 32-bit value displayed as an unsigned hexadecimal number. The persist array is a general purpose array of N_USER_DATA_VARS (200) 32-bit values that is accessible to the host as well as KMotion C Programs. It may be used to share parameters, commands, or information between programs.

C Programs may access this array as the integer array:

`persist.UserData[n];`

It also resides in the KMotion Persist memory structure so that if memory is flashed, the value will be present at power up.

See also GetPersistDec, SetPersistDec, SetPersistHex

### Parameters

<N>

Offset into the integer array. Valid range 0...199.

### Example

GetPersistHex 10

## GetSpindleRPS

### Description

Reports the current Spindle Speed in revolutions per second.

See also ConfigSpindle and TrigThread

### Parameters

None

### Example

GetSpindleRPS

## GetSerialNumber (Kogna only)

### Description

Get board's Serial Number.

### Parameters

None

### Example

GetSerialNumber

## GetStatus

### Description

Upload Main Status record in hex format. KMotion provides a means of quickly uploading the most commonly used status. This information is defined in the PC-DSP.h header file as the MAIN_STATUS structure. The entire stucture is uploaded as a binary image represented as 32-bit hexadecimal values.

### Parameters

None

### Example

GetStatus

## GetStopState

### Description

Reports the state of any feedhold stop in progress. 0 = not stopping, 1=stopping a coord motion, 2=stopping an independent motion of one or more axes, 3=fully stopped, 4=independent motion of all related axes fully stopped. This returns the KFLOP C program variable - CS0_StoppingState. A feedhold stop can be initiated from C code or from the Console Command StopImmediate.

### Parameters

None

### Example

GetStopState

## GetVirtualBits<N> <O>

### Description

KFLOP supports an extended range of 1024 virtual I/O bits. These bits reside in KFLOP's memory as a table of 32 32-bit words. The command GetVirtualBits is used to upload KFLOP virtual bit words to the PC in bulk. Any consecutive group of words can be uploaded with a single command. The words are uploaded as hexadecimal values.

### Parameters

<N>

Starting word in decimal

<O>

Number of words in decimal

### Example

If the top 4 bits of virtual bit word #1 (the second word, bits 1084, 1085, 1086, 1087) are set with all other bits zero, then the command shown below to display 3 words starting at word #1 would display:

GetVirtualBits 1 3
F0000000 0 0

## HRPWMSetMode<N> = <M> (Kogna only)

### Description

Set HRPWM Pin Mode mux channels 0-3 1=GPIO 0=HRPWM

### Parameters

<N>

HRPWM channel number. Valid range 0...3.

<M>

Mode. Valid range 0...1. 1=GPIO, 0=HRPWM.

### Example

HRPWMSetMode0=1

## I<N>=<M> or I<N>

### Description

Get or Set PID Integral Gain.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Integral Gain value. The units of the derivative gain are in Output Units x Position Units x Servo Sample Time.

### Example

I0=10.0

## IIR<N> <M>=<A1> <A2> <B0> <B1> <B2> or IIR<N> <M>

### Description

Set or get IIR Z domain servo filter.

See also IIR Filter Screen

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Filter number for axis. Valid range 0...2.

<A1> <A2> <B0> <B1> <B2>

Filter coefficients represented as floating point decimal values.

### Example

IIR0 0=1.5 2.5 -3.5 4.5 5.5

## Inject<N> <F> <A>

### Description

A Inject random stimulus into an axis with the specified cutoff frequency and amplitude. Useful for generating Bode plots.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<F>

Cuttoff Frequency in Hz. Valid range - any.

<A>

Amplitude in position units. Valid range - any.

### Example

Inject0 100.0 20.0

## InputChan<M> <N>=<C> or InputChan<M> <N>

### Description

Get or Set the first or second Input Channel of an axis. See description of this parameter on the Configuration Screen.

### Parameters

<M>

Selected input channel. Valid range 0...1.

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<C>

Channel number to assign. Valid range 0...7.

### Example (set first input channel of axis 3 to 3)

InputChan0 3=30
or
InputChan0 3

## InputGain<M> <N>=<G> or InputGain<M> <N>

### Description

Set or get first or second Input Gain of an axis. See description of this parameter on the Configuration Screen.

### Parameters

<M>

Selected input channel. Valid range 0...1.

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<C>

Input Gain. Valid range - any.

### Example

InputGain0 3=1.0

## InputMode<N>=<M> or InputMode<N>

### Description

Set or get the position input mode for an axis. See description of this parameter on the Configuration Screen.

Valid modes are (from PC-DSP.h):

    	#define NO_INPUT_MODE 0
    	#define ENCODER_MODE 1
    	#define ADC_MODE 2
    	#define RESOLVER_MODE 3
    	#define USER_INPUT_MODE 4

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Mode. Valid range 1...4

### Example

SetInputMode0=1

## InputOffset<M> <N>=<O> or InputOffset<M> <N>

### Description

Set or get first or second Input Offset of an axis. See description of this parameter on the Configuration Screen.

### Parameters

<M>

Selected input channel. Valid range 0...1.

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<O>

Input Offset. Valid range - any.

### Example

InputOffset0 3=0.0

## InvDistPerCycle<N>=<X>

### Description

Get or Set distance per cycle (specified as an inverse) of an axis. May specify the cycle of either a Stepper of Brushless Motor.

See description of this parameter on the Configuration Screen.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<X>

Inverse (reciprocal) of distance for a complete cycle. Inverse position units. Should be specified exactly or with very high precision (double precision accuracy ~ 15 digits). Valid range - any.

### Example

InvDistPerCycle0=0.05

## Jerk<N>=<J> or Jerk<N>

### Description

Get or Set the max jerk (for independent moves and jogs)

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<J>

The max Jerk. Units are in Position units per sec3

### Example

Jerk0=10000.0

## Jog<N>=<V>

### Description

Move at constant velocity. Uses Accel and Jerk parameters for the axis to accelerate from the current velocity to the specified velocity. Axis should be already enabled.Specify zero velocity to decelerate to a stop.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<V>

New Velocity in position units/second. Valid range - any.

### Example

Jog0=-200.5

## JogAtAccel<N>=<V><A>

### Description

Move axis N at velocity V using specified Acceleration. Uses Jerk parameter for the axis. Specify zero V to D to stop.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<V>

New Velocity in position units/second. Valid range - any.

<A>

Desired Acceleration for the Motion. Valid range - any.

### Example

JogAtAccel0=-200.5 5000.0

## Kill<N>

### Description

Stop execution of a user thread.

### Parameters

<N>

Thread to halt. Valid range 1..7

### Example

Kill0

## Lead<N>=<M> or Lead<N>

### Description

Set or get Lead Compensation for an axis. Lead Compensation is used to compensate for lag caused by motor inductance.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Lead Compensation. Valid range - any.

### Example

Lead0=10.0

## LED<N>=<B>

### Description

Turn LED number 0 or 1 on or off.

### Parameters

<N>

0 or 1 for the two LEDs.

<B>

1 = on, 0 = off.

### Example

LED=1=1

## LimitSwitch<N>=<H>

### Description

Configures Limit Switch Options. Specify Hex value as described below.

See also Configuration Screen.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<H>

32-bit hexadecimal value:

Bit 0 1=Stop Motor on Neg Limit, 0=Ignore Neg limit

Bit 1 1=Stop Motor on Pos Limit, 0=Ignore Pos limit

Bit 2 Neg Limit Polarity 0=stop on high, 1=stop on low

Bit 3 Pos Limit Polarity 0=stop on high, 1=stop on low

Bits 4-7 Action:
0 Kill Motor Drive
1 Disallow drive in direction of limit
2 Stop movement

Bits 16-23 Neg Limit Bit number

Bits 24-31 Pos Limit Bit number

### Example

LimitSwitch2 0C0D0003

## LimitSwitchNegBit<N>=<B>

### Description

Configure Limit Switch Negative Bit for Axis. Specify Decimal Value.

See also Configuration Screen.

### Parameters

<N>

Axis channel number. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<B>

Bit number. Vaild range 0...2047.

### Example

LimitSwitchNegBit2 1024

## LimitSwitchPOsBit<N>=<B>

### Description

Configure Limit Switch Positive Bit for Axis. Specify Decimal Value.

See also Configuration Screen.

### Parameters

<N>

Axis channel number. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<B>

Bit number. Vaild range 0...2047.

### Example

LimitSwitchPosBit2 1024

## Linear<X0> <Y0> <Z0> <A0> <B0> <C0> <X1> <Y1> <Z1> <A1> <B1> <C1> <a> <b> <c> <d> <tF>

### Description

Place linear (in 6 dimensions) interpolated move into the coordinated motion buffer. See also KMotion Coordinated Motion. A path through space is defined where x, y, z, a, b, and c are changing in a linear manner. A parametric equation is defined which describes which portion of the path as well as how as a function of time the path is to be traversed.

Although the Linear command may be sent directly, the Linear command is normally generated automatically to perform a planned trajectory by the coordinated motion library or GCode.

(X0,Y0,Z0,A0,B0,C0) - beginning of path

(X1,Y1,Z1,A1,B1,C1) - end of path

3rd order parametric equation where
p = a t 3 + b t 2 + c t + d
p is the position along the path as a function of time. When p=0 the (x,y,z,A) position will be at the beginning of the path. When p=1 the (x,y,z,A) position will be at the end of the path.

This motion segment will be performed over a time period of tF, where t varies from 0 ... tF. Note that it is not necessary that p vary over the entire range of 0 ... 1. This is often the case when there may be an acceleration, constant velocity, and deceleration phase over the path. ie: t might vary from 0.0->0.1 where p might vary from 0.3->0.7.

### Parameters

<X0> - X begin point

<Y0> - Y begin point

<Z0> - Z begin point

<A0> - A begin point

<B0> - B begin point

<C0> - C begin point

<X1> - X end point

<Y1> - Y end point

<Z1> - Z end point

<A1> - A end point

<B1> - B end point

<C1> - C end point

<a> - parametric equation t3 coefficient

<b> -parametric equation t2 coefficient

<c> -parametric equation t coefficient

<d> -parametric equation constant coefficient

<tF> - time for segment

### Example

Linear 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 1.0 1.0 0.0 0.0 1.0 0.0 1.0

## LinearEx<X0> <Y0> <Z0> <A0> <B0> <C0> <U0> <V0> <X1> <Y1> <Z1> <A1> <B1> <C1> <U1> <V1> <a> <b> <c> <d> <tF>

### Description

Place linear (in 8 dimensions) interpolated move into the coordinated motion buffer. See also KMotion Coordinated Motion. A path through space is defined where x, y, z, a, b, c, u and v are changing in a linear manner. A parametric equation is defined which describes which portion of the path as well as how as a function of time the path is to be traversed.

Although the LinearEx command may be sent directly, the LinearEx command is normally generated automatically to perform a planned trajectory by the coordinated motion library or GCode.

(X0,Y0,Z0,A0,B0,C 0,U0,V0) - beginning of path

(X1,Y1,Z1,A1,B1,C1,U1,V1) - end of path

3rd order parametric equation where
p = a t 3 + b t 2 + c t + d
p is the position along the path as a function of time. When p=0 the (x,y,z,A) position will be at the beginning of the path. When p=1 the (x,y,z,A) position will be at the end of the path.

This motion segment will be performed over a time period of tF, where t varies from 0 ... tF. Note that it is not necessary that p vary over the entire range of 0 ... 1. This is often the case when there may be an acceleration, constant velocity, and deceleration phase over the path. ie: t might vary from 0.0->0.1 where p might vary from 0.3->0.7.

### Parameters

<X0> - X begin point

<Y0> - Y begin point

<Z0> - Z begin point

<A0> - A begin point

<B0> - B begin point

<C0> - C begin point

<U0> - U begin point

<V0> - V begin point

<X1> - X end point

<Y1> - Y end point

<Z1> - Z end point

<A1> - A end point

<B1> - B end point

<C1> - C end point

<U1> - U end point

<V1> - V end point

<a> - parametric equation t3 coefficient

<b> - parametric equation t2 coefficient

<c> - parametric equation t coefficient

<d> - parametric equation constant coefficient

<tF> - time for segment

### Example

LinearEx 0.0 0.0 0.0 0.0 0.00.0 0.00.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 0.0 0.0 1.0 0.0 1.0

## LinearP<X0> <Y0> <Z0> <A0> <B0> <C0> <U0> <V0> <XP0> <YP0> <ZP0> <AP0> <BP0> <CP0> <UP0> <VP0> <X1> <Y1> <Z1> <A1> <B1> <C1> <U1> <V1> <XP1> <YP1> <ZP1> <AP1> <BP1> <CP1> <UP1> <VP1> <a> <b> <c> <d> <tF>

### Description

Place linear (in 16 dimensions) interpolated move into the coordinated motion buffer. See also KMotion Coordinated Motion. A path through space is defined where x, y, z, a, b, c, u, v and prime axes xp, yp, zp, ap, bp, cp, up, vp are changing in a linear manner. A parametric equation is defined which describes which portion of the path as well as how as a function of time the path is to be traversed.

Although the LinearEx command may be sent directly, the LinearEx command is normally generated automatically to perform a planned trajectory by the coordinated motion library or GCode, however currently the GCode Interpreter only supports 8 axes of simultaneous motion.

(X0,Y0,Z0,A0,B0,C 0,U0,V0,XP0,YP0,ZP0,AP0,BP0,CP 0,UP0,VP0) - beginning of path

(X1,Y1,Z1,A1,B1,C1,U1,V1,XP1,YP1,ZP1,AP1,BP1,CP1,UP1,VP1) - end of path

3rd order parametric equation where
p = a t 3 + b t 2 + c t + d
p is the position along the path as a function of time. When p=0 the (x,y,z,A) position will be at the beginning of the path. When p=1 the (x,y,z,A) position will be at the end of the path.

This motion segment will be performed over a time period of tF, where t varies from 0 ... tF. Note that it is not necessary that p vary over the entire range of 0 ... 1. This is often the case when there may be an acceleration, constant velocity, and deceleration phase over the path. ie: t might vary from 0.0->0.1 where p might vary from 0.3->0.7.

### Parameters

<X0> - X begin point

<Y0> - Y begin point

<Z0> - Z begin point

<A0> - A begin point

<B0> - B begin point

<C0> - C begin point

<U0> - U begin point

<V0> - V begin point

<XP0> - XP begin point

<YP0> - YP begin point

<ZP0> - ZP begin point

<AP0> - AP begin point

<BP0> - BP begin point

<CP0> - CP begin point

<UP0> - UP begin point

<VP0> - VP begin point

<X1> - X end point

<Y1> - Y end point

<Z1> - Z end point

<A1> - A end point

<B1> - B end point

<C1> - C end point

<U1> - U end point

<V1> - V end point

<XP1> - XP end point

<YP1> - YP end point

<ZP1> - ZP end point

<AP1> - AP end point

<BP1> - BP end point

<CP1> - CP end point

<UP1> - UP end point

<VP1> - VP end point

<a> - parametric equation t3 coefficient

<b> - parametric equation t2 coefficient

<c> - parametric equation t coefficient

<d> - parametric equation constant coefficient

<tF> - time for segment

### Example -Move all 16 axes from 0 to 1 over 1 second

LinearP 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 0.0 0.0 1.0 0.0 1.0

## LinearHex<X0> <Y0> <Z0> <A0> <B0> <C0> <X1> <Y1> <Z1> <A1> <B1> <C1> <a> <b> <c> <d> <tF>

### Description

Place linear (in 6 dimensions) interpolated move into the coordinated motion buffer. This command is exactly the same as the Linear command above, except all 17 parameters are specified as 32-bit hexadecimal values which are the binary images of 32-bit floating point values. When generated by a program this is often faster, simpler, and more precise than decimal values. See also KMotion Coordinated Motion.

### Parameters

See above.

### Example -Move all 6 axes from 0 to 1 over 1 second

LinearHex 0 0 0 0 0 0 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 0 0 3F800000 0 3F800000

## LinearHexEx<X0> <Y0> <Z0> <A0> <B0> <C0> <U0> <V0> <X1> <Y1> <Z1> <A1> <B1> <C1> <U1> <V1> <a> <b> <c> <d> <tF>

### Description

Place linear (in 8 dimensions) interpolated move into the coordinated motion buffer. This command is exactly the same as the LinearEx command above, except all 21 parameters are specified as 32-bit hexadecimal values which are the binary images of 32-bit floating point values. When generated by a program this is often faster, simpler, and more precise than decimal values. See also KMotion Coordinated Motion.

### Parameters

See above.

### Example -Move all 8 axes from 0 to 1 over 1 second

LinearHexEx 0 0 0 0 0 0 0 0 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 0 0 3F800000 0 3F800000

## LinearHexP<X0> <Y0> <Z0> <A0> <B0> <C0> <U0> <V0> <XP0> <YP0> <ZP0> <AP0> <BP0> <CP0> <UP0> <VP0> <X1> <Y1> <Z1> <A1> <B1> <C1> <U1> <V1> <XP1> <YP1> <ZP1> <AP1> <BP1> <CP1> <UP1> <VP1> <a> <b> <c> <d> <tF>

### Description

Place linear (in 16 dimensions) interpolated move into the coordinated motion buffer. This command is exactly the same as the LinearP command above, except all 37 parameters are specified as 32-bit hexadecimal values which are the binary images of 32-bit floating point values. When generated by a program this is often faster, simpler, and more precise than decimal values. See also KMotion Coordinated Motion.

### Parameters

See above.

### Example -Move all 16 axes from 0 to 1 over 1 second

LinearHexP 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 0 0 3F800000 0 3F800000

## LHex1<X1> <Y1> <Z1> <A1> <B1> <C1> <a> <b> <c> <d> <tF>

### Description

Place linear (in 6 dimensions) interpolated move into the coordinated motion buffer. This command is exactly the same as the LinearHex command above, except the beginning point is not specified and is assumed to be the endpoint of the previous LinearHex or LinHex1 command. See also KMotion Coordinated Motion.

### Parameters

See above.

### Example - Move from previous point to 1 on all 6 axes over 1 second

LinHex1 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 0 0 3F800000 0 3F800000

## LHexEx1<X1> <Y1> <Z1> <A1> <B1> <C1> <U1> <V1> <a> <b> <c> <d> <tF>

### Description

Place linear (in 8 dimensions) interpolated move into the coordinated motion buffer. This command is exactly the same as the LinearHexEx command above, except the beginning point is not specified and is assumed to be the endpoint of the previous LinearHexEx or LHexEx1 command. See also KMotion Coordinated Motion.

### Parameters

See above.

### Example - Move from previous point to 1 on all 8 axes over 1 second

LinHexEx1 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 0 0 3F800000 0 3F800000

## LHexP1<X1> <Y1> <Z1> <A1> <B1> <C1> <U1> <V1> <XP1> <YP1> <ZP1> <AP1> <BP1> <CP1> <UP1> <VP1> <a> <b> <c> <d> <tF>

### Description

Place linear (in 16 dimensions) interpolated move into the coordinated motion buffer. This command is exactly the same as the LinearHexP command above, except the beginning point is not specified and is assumed to be the endpoint of the previous LinearHexP or LHexP1 command. See also KMotion Coordinated Motion.

### Parameters

See above.

### Example - Move from previous point to 1 on all 16 axes over 1 second

LinHexP1 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 0 0 3F800000 0 3F800000

## LHex2<a> <b> <c> <d> <tF>

### Description

Place linear (in 6 or 8 dimensions) interpolated move into the coordinated motion buffer. This command is exactly the same as the LinearHex or LinearHexEx command above, except neither the beginning or ending point is specified and is assumed to be the same as the most recent LinearHex, LinearHexEx, or LHex1. This command can be used when there are more than one phases (ie Jerk, acceleration, constant velocity, etc. that occur along a single linear segment). See also KMotion Coordinated Motion.

### Parameters

See above.

### Example - move from beginning to end over 1 second

LinHex2 0 0 3F800000 0 3F800000

## LHexP2<a> <b> <c> <d> <tF>

### Description

Place linear (in 16 dimensions) interpolated move into the coordinated motion buffer. This command is exactly the same as the LinearHexP command above, except neither the beginning or ending point is specified and is assumed to be the same as the most recent LinearHexP or LHexP1. This command can be used when there are more than one phases (ie Jerk, acceleration, constant velocity, etc. that occur along a single linear segment). See also KMotion Coordinated Motion.

### Parameters

See above.

### Example - move from beginning to end over 1 second

LinHexP2 0 0 3F800000 0 3F800000

## LoadData<H> <N>

<B> <B> <B> <B> <B> ...

### Description

Store data bytes into memory beginning at specified address for N bytes. The data must follow with up to N_BYTES_PER_LINE (64) bytes per line. This command is normally only used by the COFF loader. Since this command spans several lines, it may only be used programatically in conjunction with a KMotionLock or WaitToken command so that it is not interrupted.

### Parameters

<H>

32-bit hexadecimal address

<N>

Number of bytes to follow and to be stored

<B> <B> <B> <B> <B> ...

Bytes to store. 2 hexadecimal digits per byte, separated with a space.

### Example

LoadData 80030000 4

FF FF FF FF

## LoadFlash<H> <N>

<B> <B> <B> <B> <B> ...

### Description

Store data into FLASH image. Only by KMotion for downloading a new firmware version. Store data bytes into memory beginning at specified address for N bytes. The data must follow with up to N_BYTES_PER_LINE (64) bytes per line. This command is normally only used by the COFF loader. Since this command spans several lines, it may only be used programmatically in conjunction with a KMotionLock or WaitToken command so that it is not interrupted.

### Parameters

<H>

32-bit hexadecimal address

<N>

Number of bytes to follow and to be stored

<B> <B> <B> <B> <B> ...

Bytes to store. 2 hexadecimal digits per byte, separated with a space.

### Example

LoadFlash FF00 4

FF FF FF FF

## MasterAxis<N>=<M> or MasterAxis<N>

### Description

Sets or gets the axis <M> to which the current axis <N> is to be slaved. The current axis becomes a slave and will follow the motion of the specified Master Axis. More than one axis can be slaved to a single master axis if desired. When slaved, changes in the commanded destination of the master axis will be mirrored as changes in the slaved axis's destination however scaled by the SlaveGain (as specified in the Slave Axis). The SlaveGain my be negative if opposing motion is desired.

Setting the Master Axis value to -1 disables the Slave mode.

### Parameters

<N>

Selected Axis for command. Valid range 0 ... 7.

<M>

Master Axis or -1 to disable. Valid range -1 ... 7.

### Example (set axis 1 to follow axis 0)

MasterAxis1=0
or
MasterAxis

## MaxErr<N>=<M> or MaxErr<N>

### Description

Set or get Maximum Error for axis (Limits magnitude of error entering PID).

See Servo Flow Diagram and Step Response Screen for more information.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Maximum Error. Valid range - any positive value. Set to a large value to disable.

### Example

MaxErr0=100.0
or
MaxErr0

## MaxFollowingError<N>=<M> or MaxFollowingError<N>

### Description

Set or get the maximum allowed following error before disabling the axis.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Maximum Following Error. Valid range - any positive value. Set to a large value to disable.

### Example

MaxFollowingError0=100.0
or
MaxFollowingError0

## MaxI<N> <M>

### Description

Set or get Maximum Integrator "wind up" for axis. Integrator saturates at the specified value.

See also Servo Flow Diagram and Step Response Screen for further information.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Maximum Integrator value. Valid range - any positive value. Set to a large value to disable.

### Example

MaxI0=100.0

## MaxOutput<N>=<M> or MaxOutput<N>

### Description

Set or get Maximum Output for an axis. Limits magnitude of servo output. Output saturates at the specified value.

See also Servo Flow Diagram and Step Response Screen for further information.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Maximum output value. Valid range - any positive value. Set to a large value to disable.

### Example

MaxOutput0=100.0

## Move<N>=<M>

### Description

Move axis to absolute position. Axis should be already enabled. Uses Vel, Accel and Jerk parameters for the axis to profile a motion from the current state to the specified position.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

new position in position units. Valid range - any.

### Example

Move0=100.1

## MoveAtVel<N>=<M> <V>

### Description

Move axis to absolute position at the specified Velocity. Axis should be already enabled. Uses Accel and Jerk parameters for the axis to profile a motion from the current state to the specified position.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

new position in position units. Valid range - any.

<V>

Desired Velocity for the Motion. Valid range - any.

Example

MoveAtVel0=100.1 30.0

## MoveAtVelAccel<N>=<D> <V><A>

### Description

Move axis to absolute position at the specified Velocity. Axis should be already enabled. Uses Accel and Jerk parameters for the axis to profile a motion from the current state to the specified position.

Parameters

<N>
Selected Axis for command. Valid range 0...7.

<M>
new position in position units. Valid range - any.

<V>
Desired Velocity for the Motion. Valid range - any.

Example
MoveAtVel0=100.1 30.0

## MoveExp<N>=<D> <T>

### Description

Moves axis in an exponential manner toward the Destination using Time Constant T. The velocity of motion will be proportional to the distance from the Destination. The distance to the Destination will be reduced by 63% (1/e) every Time Constant, T. The Axis should be already enabled. Honors the Vel and Accel axis parameters.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<D>

Destination in position units. Valid range - any.

<T>

Time Constant Tau in seconde. Valid range - any positive number.

### Example

MoveExp0=1000 0.1

## MoveRel<N>=<M>

### Description

Move axis relative to current destination. Same as Move command except specified motion is relative to current destination.

Axis should be already enabled. Uses Vel, Accel and Jerk parameters for the axis to profile a motion from the current state to the specified position.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Distance to move in position units. Valid range - any.

### Example

MoveRel0=100.1

## MoveRelAtVel<N>=<M> <V>

### Description

Move axis relative to current destination at the specified Velocity. Same as MoveAtVel command except specified motion is relative to current destination. Axis should be already enabled. Uses Accel and Jerk parameters for the axis to profile a motion from the current state to the specified position.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

New position in position units. Valid range - any.

<V>

Desired Velocity for the Motion. Valid range - any.

### Example

MoveRelAtVel0=100.1 30.0

## MoveRelAtVelAcc<N>=<D><V><A>

### Description

Move axis N relative to current destination D at the specified Velocity and Acceleration.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<D>

Relative amount to move in counts or steps. Valid Range - any.

<V>

Desired Velocity for the Motion. Valid range - any.

<A>

Desired Acceleration for the Motion. Valid range - any. In counts or steps/sec2.

### Example

MoveRelAtVelAccel0=100.1 30.0 2000.0

## MoveRelAtVelAccSoft<N>=<D><V><A>

### Description

Move axis N relative to current destination D at the specified Velocity and Acceleration. Limit to Soft Limit range

Parameters

<N>
Selected Axis for command. Valid range 0...7.

<D>
New destination in position units. Valid range - any.

<V>
Desired Velocity for the Motion. Valid range - any.

<A>
Desired Acceleration for the Motion. Valid range - any.

Example

MoveRelAtVelAccelSoft0=100.1 30.0 2000.0

## MoveXYZABC<X> <Y> <Z> <A> <B> <C>

### Description

Move the 6 axes defined to be X, Y, Z, A, B, C (each axis moves independently). The defined coordinate system determines which axes channels are commanded to move.

### Parameters

<X>

Position to move x axis. Valid range - any.

<Y>

Position to move y axis. Valid range - any.

<Z>

Position to move z axis. Valid range - any.

<A>

Position to move a axis. Valid range - any.

<B>

Position to move b axis. Valid range - any.

<C>

Position to move c axis. Valid range - any.

### Example

MoveXYZABC 100.1 200.2 300.3 400.4 500.5 600.6

## OpenBuf

### Description

Clear and open the buffer for coordinated motion.

### Parameters

None

### Example

OpenBuf

## OutputChan<M> <N>=<C> or OutputChan<M> <N>

### Description

Get or Set the first or second Output Channel of an axis. For Step/Dir and CL Step/Dir Output Mode Types the Pin Drive Mode is also encoded in this value. For example adding 8 to the device channel number will drive in TTL mode instead of Open Collector mode. See description of this parameter on the Configuration Screen and for Step/Dir and CL Step/Dir Output Mode see here.

### Parameters

<M>

Selected input channel. Valid range 0...1.

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<C>

Channel number to assign. Valid range depends on Output Mode Type. Max Range for all Types 0...63.

### Example (set first output channel of axis 3 to 3)

OutputChan03=3

## OutputGain<N>=<G> or OutputGain<N>

### Description

Get or Set the Output Gain of an axis. For Axes of Step/Dir, CL Step Dir, or MicroStep output mode, the output motion can be scaled or reversed. Normally there is no need to use a value other than -1.0 or +1.0. For DAC Servo output mode the output signal (DAC) can be scaled or reversed. Again, normally there is no need to use a value other than -1.0 or +1.0. In other output modes the OutputGain value will have no effect.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<G>

Gain value. Valid range any floating point value.

### Example

OutputGain0=-1.0 or OutputGain0

## OutputOffset<N>=<O> or OutputOffset<N>

### Description

Get or Set the Output Offset of an axis. For DAC Servo output mode the output (DAC) signal can be offset. The Output Offset is applied after any Output Gain value. The Output Offset can be used to reduce any DAC output offset or Amplifier input offset that may cause motor axis drift occurs when the DAC is commanded to zero (disabled). In other output modes the OutputGain value will have no effect.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<G>

Gain value. Valid range any floating point value.

### Example

OutputGain0=-1.0 or OutputGain0

## OutputMode<N>=<M> or OutputMode<N>

### Description

Set or get the position output mode for an axis. See description of this parameter on the Configuration Screen.

Valid modes are (from PC_DSP.h):

    		#define NO_OUTPUT_MODE 0
    		#define MICROSTEP_MODE 1
    		#define DC_SERVO_MODE 2
    		#define BRUSHLESS_3PH_MODE 3
    		#define BRUSHLESS_4PH_MODE 4
    		#define DAC_SERVO_MODE 5
    		#define STEP_DIR_MODE 6
    		#define CL_STEP_DIR_MODE 7
    		#define CL_MICROSTEP_MODE 8

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Mode. Valid range 1...4

### Example

SetOutputMode0=1

## P<N>=<M> or P<N>

### Description

Get or SetPID Proportional Gain.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Proportional Gain value. The units of the derivative gain are in Output Units/Position Units.

### Example

P0=10.0

## Pos<N>=<P> or Pos<N>

### Description

Set or get the measured position of an axis. Note setting the current position may effect the commutation of any motors based on the position (an adjustment in the commutation offset may be required).

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<P>

Value to be stored into the current position. units are position units. Valid range - any.

### Example

Pos0=100.0

## ProgFlashImage

### Description

Program entire FLASH image, downloaded using LoadFlash commands, to FLASH Memory.

### Parameters

None

### Example

ProgFlashImage

## PWM<N>=<M>

### Description

Set PWM channel to locked anti-phase mode and to specified value.

See PWM Description and Analog Status Screen.

### Parameters

<N>

PWM channel number. Valid range 0...7

<M>

PWM value. Valid range -255...255.

### Example

PWM0=-99

## PWMC<N>=<M>

### Description

Set PWM channel to Current Mode and to specified value. PWM Channel will operate in closed loop current mode.

See Analog Status Screen.

### Parameters

<N>

PWM channel number. Valid range 0...7

<M>

PWM value. Valid range -1000...1000. 1 count = 35 Amps/1024 = 34.2ma

### Example

PWM0=-99

## PWMR<N>=<M>

### Description

Set PWM channel to recirculate mode and to specified value.

See PWM Description and Analog Status Screen.

### Parameters

<N>

PWM channel number. Valid range 0...7

<M>

PWM value. Valid range -511...511.

### Example

PWMR0=-99

## ReadBit<N>

### Description

Displays whether an actual hardware I/O bit N or Virtual IO bit is high (1) or low (0) . A bit defined as an output (See SetBitDirection) may also be read back.

### Parameters

<N>

Bit number to read. Accepted range - 0...2047

### Example

ReadBit0

## ReadDiskData<S><N>

### Description

Set Disk Read Data in KFLOP/Kogna (as 8 bit Hex words)/into the ReadDisk Buffer. Used internally in conjunction with fgets()/for decimal N words.

### Parameters

<S>

Status of ReadDisk Buffer. 1=line available, 2=error, 3=en of file.

<N>

Bit number to read. Accepted range - 0...1024

### Example

ReadDiskData 1 3 /41 42 43

## Reboot!

### Description

Causes complete power up reset and re-boot from flash memory.

### Parameters

None

### Example

Reboot!

## RS232 D9600 115200

### Description

Commands from RS232 Baud.

### Parameters

None

### Example

RS232 57600

## SetBit<N>

### Description

Sets an actual hardware I/O bit N or Virtual I/O bit to high (1) .

### Parameters

Bit number to set. Accepted range 0...2047

### Example

SetBit0

## SetBitBuf<N>

### Description

Inserts into the coordinated move buffer a command to set an I/O bit (actual I/O bits must be defined as an output, see SetBitDirection).

### Parameters

<N>

Bit number to set. Accepted range 0...2047

### Example

SetBitBuf0

## SetBitDirection<N>=<M>

### Description

Defines the direction of an I/O bit to be an input or output. See also Digital I/O Screen. Depending on the type of I/O, it may not be possible to change direction as some I/O bits are strictly inputs, and some are strictly outputs.

### Parameters

<N>

Bit number to assign. Accepted range 0...2047

<M>

Direction 0 = input, 1 = output

### Example

SetBitDirection0=1

## SetFRO<F>

### Description

Sets Hardware FRO (Feed Rate Override) in KFLOP which is the rate that the Coordinated Motion Buffer is executed. A value of 1.0 = Normal Feed Rate = real time = an advance of 90us of time every 90us Servo Sample Period.

A negative FRO value will cause the Coordinated Motion Buffer to execute in reverse up until the beginning or until the point where Coordinated Motion Buffer data has been lost due to buffer wrapping (MAX_SEGMENTS is currently ~35,000 segments). When approaching the point where previous data was lost, the FRO will be automatically reduced to zero in order to avoid an abrupt stop. This will not occur (and should not be necessary) when approaching the actual beginning of the buffer because normal acceleration from a stop should exist. In this case Time will stop abruptly when the beginning of the buffer is reached.

In order to avoid an instantaneous change in velocity the FRO will be ramped from the current rate to the specified rate. This command uses a default ramp rate that has been determined based on the Max Allowed Velocities, Accelerations, and Jerks of all the currently defined Coordinate Motion System Axes Channels. In order to specify a different rate the SetFROwRate command may be used.

This command will not alter the rate of execution if the FeedHold mechanism is currently in effect. See StopImmediate. However the specified speed will be saved so that if FeedHold is eventually released, the rate will resume to this specified speed. To change the FRO while in FeedHold use the SetFROTemp or SetFROwRateTemp commands instead. Those commands were intended to be used while in Feed Hold and will not alter the rate that will be resumed after Feed Hold is released.

### Parameters

<F>

Desired FRO Value. 1.0 corresponds to normal Real Time, 0.0 corresponds to fully stopped, negative values drive time in reverse. Valid range -100...+100

### Example

SetFRO 1.2

## SetFROTemp<F>

### Description

Sets Hardware FRO (Feed Rate Override) in KFLOP which is the rate that the Coordinated Motion Buffer is executed. A value of 1.0 = Normal Feed Rate = real time = an advance of 90us of time every 90us Servo Sample Period.

This command is intended for temporary FRO changes while in Feed Hold.

See SetFRO for additional Information.

### Parameters

<F>

Desired FRO Value. 1.0 corresponds to normal Real Time, 0.0 corresponds to fully stopped, negative values drive time in reverse. Valid range -100...+100

### Example

SetFROTemp -0.2

## SetFROwRate<F> <R>

### Description

Sets Hardware FRO (Feed Rate Override) in KFLOP which is the rate that the Coordinated Motion Buffer is executed. A value of 1.0 = Normal Feed Rate = real time = an advance of 90us of time every 90us Servo Sample Period. This command functions the same as the command SetFRO with the exception that the rate at which the FRO will be ramped to the new FRO may be controlled. The ramp rate (rate-of-change-of-rate-of-time) to be used is determined from a user supplied Time Parameter. The Time to ramp from FRO=0. to FRO=1.0. See SetFRO for more information.

### Parameters

<F>

Desired FRO Value. 1.0 corresponds to normal Real Time, 0.0 corresponds to fully stopped, negative values drive time in reverse. Valid range -100...+100

<R>

Time to ramp from FRO=0.0 to FRO=1.0 Valid range any positive number.

### Example

SetFROwRate 1.2 0.5

## SetFROwRateTemp<F> <R>

### Description

Sets Hardware FRO (Feed Rate Override) in KFLOP which is the rate that the Coordinated Motion Buffer is executed. A value of 1.0 = Normal Feed Rate = real time = an advance of 90us of time every 90us Servo Sample Period. This command functions the same as the command SetFROTemp with the exception that the rate at which the FRO will be ramped to the new FRO may be controlled. The ramp rate (rate-of-change-of-rate-of-time) to be used is determined from a user supplied Time Parameter. The Time to ramp from FRO=0. to FRO=1.0.

This command is intended for temporary FRO changes while in Feed Hold.

See SetFRO for additional Information.

### Parameters

<F>

Desired FRO Value. 1.0 corresponds to normal Real Time, 0.0 corresponds to fully stopped, negative values drive time in reverse. Valid range -100...+100

<R>

Time to ramp from FRO=0.0 to FRO=1.0 Valid range any positive number.

### Example

SetFROwRateTemp -0.2 0.5

## SetGatherDec<N> <M>

### Description

Writes a single word to the Gather Buffer at the specified offset. A single 32-bit value specified as a signed decimal integer number will be stored.

The corresponding value may be accessed by a KMotion user program using the pointer : gather_buffer. This pointer should be cast as an integer pointer in order to reference values as integers and to use the same index.

See also GetGatherDec, GetGatherHex, SetGatherHex

### Parameters

<N>

Offset into gather buffer, specified as a decimal offset of 32 bit words. Valid range 0...1999999

<M>

Value to be stored. Valid range -2147483648...2147483647

### Example

SetGatherDec 1000 32767

## SetGatherHex<N> <M> <H> <H> <H> . . .

### Description

Writes a multiple words to the Gather Buffer beginning at the specified offset. 32-bit values specified as a unsigned hexadecimal numbers must follow with 8 words per line separated with spaces. Since this command spans several lines, it may only be used programmatically in conjunction with a KMotionLock or WaitToken command so that it is not interrupted.

The corresponding values may be accessed by a KMotion user program using the pointer : gather_buffer. This pointer should be cast as an integer pointer in order to reference values as integers and to use the same index.

See also GetGatherDec, GetGatherHex, SetGatherDec

### Parameters

<N>

Offset into gather buffer, specified as a decimal offset of 32 bit words. Valid range 0...1999999

<M>

Number of value to be stored, specified as a decimal number. Valid range 0...19999999

<H> <H> <H> . . .

Values to be stored. Specified as unsigned Hexadecimal values. Valid range 0...FFFFFFFF.

### Example

SetGatherHex 0 3
FFFFFFFF FFFFFFFF FFFFFFFF

## SetIpAddr<D> <D> <D> <D> (Kogna only)

### Description

Set board's Ethernet IP Address.

### Parameters

<D>

Each D is 0..255.

### Example

SetSerialNumber 192.168.10.9

## SetKognaPWMEne<N>=<N> (Kogna only)

### Description

Set Kogna PWM. Enable channels 0-7. 1=Enable 0=Disable.

### Parameters

<N>

PWM channel number. Valid range 0...7.

### Example

SetKognaPWMEn0=1

## SetKognaPWMLength<N>=<N> (Kogna only)

### Description

Set Kogna PWM Pulse Length channels 0-7. 0-255 counts.

### Parameters

<N>

PWM channel number. Valid range 0...7.

### Example

SetKognaPWMLength0=128

## SetPersistDec<O> <D>

### Description

Write a single word into the Persistent UserData Array. Persistent UserData Array is a general purpose array of 200 32-bit words that may be used as commands, parameters, or flags between any host applications or KMotion user programs. The array resides in a persistent memory area, so that if a value is set as a parameter and the User Programs are flashed, the value will persist permanently.

The corresponding value may be accessed by a KMotion user program as the integer variable : persist.UserData[offset].

See also GetPersistDec, GetPersistHex, SetPersistHex

### Parameters

<O>

Offset into the user data array specified as a decimal number. Valid Range 0 ... 199.

<D>

Value to be written to the array. Specified a signed decimal number. Valid Range -2147483648 ... 2147483647

### Example

SetPersistDec 10 32767

## SetPersistHex<O> <H>

### Description

Write a single word into the Persistent UserData Array. Persistent UserData Array is a general purpose array of 200 32-bit words that may be used as commands, parameters, or flags between any host applications or KMotion user programs. The array resides in a persistent memory area, so that if a value is set as a parameter and the User Programs are flashed, the value will persist permanently.

The corresponding value may be accessed by a KMotion user program as the integer variable : persist.UserData[offset].

See also GetPersistDec, GetPersistHex, SetPersistDec.

### Parameters

<O>

Offset into the user data array specified as a decimal number. Valid range 0 ... 199.

<H>

Value to be written to the array. Specified an unsigned hexadecimal number. Valid range 0...FFFFFFFF

### Example

SetPersistHex 10 FFFFFFFF

## SetRapidFRO<F>

### Description

Sets Hardware RFRO (Rapid Feed Rate Override) in KFLOP which is the rate that the Coordinated Motion Buffer is executed. A value of 1.0 = Normal Feed Rate = real time = an advance of 90us of time every 90us Servo Sample Period.

Note: KFLOP Maintain separate Rate Overides for Rapid motion vs normal Feed Motion. Commands (BegRapidBuf and EndRapidBuf) inserted into the Coordinated Motion Buffer determine what type of motion is currently in progress and which Override is to be used.

A negative RFRO value will cause the Coordinated Motion Buffer to execute in reverse up until the beginning or until the point where Coordinated Motion Buffer data has been lost due to buffer wrapping (MAX_SEGMENTS is currently ~35,000 segments). When approaching the point where previous data was lost, the RFRO will be automatically reduced to zero in order to avoid an abrupt stop. This will not occur (and should not be necessary) when approaching the actual beginning of the buffer because normal acceleration from a stop should exist. In this case Time will stop abruptly when the beginning of the buffer is reached.

In order to avoid an instantaneous change in velocity the RFRO will be ramped from the current rate to the specified rate. This command uses a default ramp rate that has been determined based on the Max Allowed Velocities, Accelerations, and Jerks of all the currently defined Coordinate Motion System Axes Channels. In order to specify a different rate the SetRapidFROwRate command may be used.

This command will not alter the rate of execution if the FeedHold mechanism is currently in effect. See StopImmediate. However the specified speed will be saved so that if FeedHold is eventually released, the rate will resume to this specified speed. To change the FRO while in FeedHold use the SetFROTemp or SetFROwRateTemp commands instead. Those commands were intended to be used while in Feed Hold and will not alter the rate that will be resumed after Feed Hold is released.

### Parameters

<F>

Desired RFRO Value. 1.0 corresponds to normal Real Time, 0.0 corresponds to fully stopped, negative values drive time in reverse. Valid range -100...+100

### Example

SetRapidFRO 1.2

## SetRapidFROwRate<F>

### Description

Sets Hardware RFRO (Rapid Feed Rate Override) in KFLOP which is the rate that the Coordinated Motion Buffer is executed. A value of 1.0 = Normal Feed Rate = real time = an advance of 90us of time every 90us Servo Sample Period. This command functions the same as the command SetRapidFRO with the exception that the rate at which the RFRO will be ramped to the new RFRO may be controlled. The ramp rate (rate-of-change-of-rate-of-time) to be used is determined from a user supplied Time Parameter. The Time to ramp from FRO=0. to FRO=1.0. See SetRapidFRO for more information.

Note: KFLOP Maintain separate Rate Overrides for Rapid motion vs normal Feed Motion. Commands (BegRapidBuf and EndRapidBuf) inserted into the Coordinated Motion Buffer determine what type of motion is currently in progress and which Override is to be used.

### Parameters

<F>

Desired RFRO Value. 1.0 corresponds to normal Real Time, 0.0 corresponds to fully stopped, negative values drive time in reverse. Valid range -100...+100

<R>

Time to ramp from RFRO=0.0 to RFRO=1.0 Valid range any positive number.

### Example

SetRapidFROwRate 1.2 0.5

## SetSerialNumber<N> (Kogna only)

### Description

Set board's Serial Number.

Parameters

<N>

Decimal number Valid Range 0...4095.

### Example

SetSerialNumber 123

## SetStartupThread<N> <M>

### Description

Defines whether a user thread is to be launched on power up.

### Parameters

<N>

Selected User Thread. Valid range 1...7

<M>

Mode : 1=start on boot, 0=do not start on boot.

### Example

SetStartupThread0 1

## SetStateBit<N>=<M>

### Description

Sets the state of an actual hardware I/O bit N or Virtual IO bit to either low (0) or high (1) . Actual I/O bits must be defined as an output, see SetBitDirection.

### Parameters

<N>

Bit number to set. Accepted range 0...2047

<M>

State. Valid range 0...1

### Example

SetStateBit0=1

## SetStateBitBuf<N>=<M>

### Description

Inserts into the coordinated move buffer a command to set the state of an I/O bit (actual IO bits must be defined as an output, see SetBitDirection).

### Parameters

<N>

Bit number to set. Accepted range 0...2047

<M>

State. Valid range 0...1

### Example

SetBitBuf0

SetStateBitBuf0=1

## SlaveGain<N>=<S> or SlaveGain<N>

### Description

Sets or gets the Slave Gain for the axis. See also MasterAxis for more information

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<S>

Slave Gain. Any floating point value positive or negative.

### Example

SlaveGain0=-1.0
or
SlaveGain0

## SoftLimitNeg<N>=<M> or SoftLimitPos<N>

### Description

Command to set or display the Negative Software Limit of Travel. Soft Limits will prevent motion in the same manner as a Hardware Limit with the Stop Movement Action Selected. This occurs regardless of the Action Type Selected for the Hardware Limit Switches. To disable Soft Limits set them to a huge range which could never occur. Soft Limits prevent motion within KFLOP when Jogging, moving and so forth. They also are are uploaded by Applications such as KMotionCNC and used to prevent motion during Trajectory Planning. The Negative Soft Limit is used to prevent motion beyond a limit in the negative direction. The Negative Soft Limit does not necessarily need to be negative. See also SoftLimitPos.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Maximum Negative Limit. Valid range - any value. Set to a large value to disable.

### Example

SoftLimitNeg0=-1000000.0
SoftLimitNeg0

## SoftLimitPos<N>=<M> or SoftLimitPos<N>

### Description

Command to set or display the Positive Software Limit of Travel. Soft Limits will prevent motion in the same manner as a Hardware Limit with the Stop Movement Action Selected. This occurs regardless of the Action Type Selected for the Hardware Limit Switches. To disable Soft Limits set them to a huge range which could never occur. Soft Limits prevent motion within KFLOP when Jogging, moving and so forth. They also are are uploaded by Applications such as KMotionCNC and used to prevent motion during Trajectory Planning. The Positive Soft Limit is used to prevent motion beyond a limit in the positive direction. The Positive Soft Limit does not necessarily need to be positive. See also SoftLimitNeg.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

Maximum Positive Limit. Valid range - any value. Set to a large value to disable.

### Example

SoftLimitPos0=1000000.0
or
SoftLimitPos0

## SPISetMode<N>=<M> (Kogna only)

### Description

Set SPI Pin Mode mux channels 0-5. 1=GPIO 0=HRPWM 2=I2C.

### Parameters

<N>

Specifies the Pin.

<M>

Specifies the Mode.

### Example

SPISetMode0=1

## StepperAmplitude<N>=<M> or StepperAmplitude<N>

### Description

Set or get the nominal output magnitude used for axis if in MicroStepping Output Mode to the specified value. This will be the output amplitude when stopped or moving slowly. If Lead Compensation is used, the amplitude while moving may be higher.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<M>

PWM Stepper Amplitude. Valid range 0...255

### Example

StepperAmplitude0=250

## StopImmediate<M>

### Description

Controls the Feedhold Mechanism for the set of coordinated motion Axes. This command can be used to feedhold (bring to an immediate stop) the set of axes, Resume from a feedhold, or clear the feedhold state. This command can stop the set of axes regardless of whether the current motion in progress is due to coordinated motion (Interpolated Linear or Arc) or independent axes motions (Rapids). The current state can be obtained using the GetStopState command.

### Parameters

<M>

Mode

0 - Stops the axes motion (equivalent to User C Program function StopCoordinatedMotion)

1 - Resumes the axes motion (equivalent to User C Program function ResumeCoordinatedMotion)

2 - Clears the Feed hold state (equivalent to User C Program function ClearStopImmediately)

### Example

StopImmediate0

## TrigThread<S>

### Description

Triggers a coordinated motion threading operation. The coordinated motion path in the coordinated motion buffer begins execution synchronized with the Spindle motion. The Speed specified will be used as the baseline speed such that if the actual spindle speed is equal to the base speed, then Pseudo Time will progress the same as real time. Otherwise Pseudo time will be adjusted to match the spindle motion

See also: ConfigSpindle and GetSpindleRPS

### Parameters

<S>

Base Spindle Speed in revs per second. Range: Any floating point value.

### Example

TrigThread 10.0

## USB (Kogna only)

### Description

Commands from USB Mode.

### Parameters

None.

### Example

USB

## Vel<N>=<V> or Vel<N>

### Description

Get or Set the max velocity for independent moves.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

<V>

The max velocity. Units are in Position units per sec

### Example

Vel0=100.0

## Version

### Description

Display DSP Firmware Version and Build date in the form:

KMotion 2.22 Build 22:26:57 Feb 16 2005

Note it is important that when C Programs are compiled and linked, they are linked to a firmware file, DSP_KMotion.out, that matches the firmware in the KMotion where they will execute.

### Parameters

None

### Example

Version

## WaitBitBuf<N>

### Description

Inserts into the coordinated move buffer a command to wait for an IO bitto be at a high level. This command is useful for synchronizing motion to external events without any PC delays.

This command can be inserted into the Coordinated motion buffer from KMotionCNC GCode using the special comment command format of:

(BUF,WaitBitBuf46)

### Parameters

<N>

Bit number to wait to be high. Accepted range 0...2047

### Example

WaitBitBuf46

## WaitNotBitBuf<N>

### Description

Inserts into the coordinated move buffer a command to wait for an IO bitto be at a low level. This command is useful for synchronizing motion to external events without any PC delays.

This command can be inserted into the Coordinated motion buffer from KMotionCNC GCode using the special comment command format of:

(BUF,WaitNotBitBuf46)

### Parameters

<N>

Bit number to wait to be low. Accepted range 0...2047

### Example

WaitNotBitBuf46

## Zero<N>

### Description

Clear the measured position of axis. Note for an axis that uses the Position to perform brushless motor commutation, the commutation offset may be required to be adjusted whenever the position measurement is changed.

### Parameters

<N>

Selected Axis for command. Valid range 0...7 (KFLOP) 0..15 (Kogna).

### Example

Zero0