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.

 

 

<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.

 

 

<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.

 

 

<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

Channels 0-3 are ±10V general purpose inputs

Channels 4-7 are Motor Currents

Parameters

<N>

 

ADC channel

Valid range 0 ... 7

 

 

Example

 

ADC 0

 

 

 

 

 

Arc <XC> <YC> <RX> <RY> <θ0> <dθ> <Z0> <Z1> <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 is 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.

 

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

 

- amount of angular change for the path

 

Z0 - initial Z position of path

 

Z1 - final Z position of path

 

3rd order parametric equation where

p = a t3 + b t2 + 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)

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

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

<Z1> - final Z position on path, units are position units of z 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 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.1 0.0 10.0

 

 

 

 

 

ArcHex <XC> <YC> <RX> <RY> <θ0> <dθ> <Z0> <Z1> <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 13 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 motion, performed in 10 seconds)

 

 

Arc 3f000000 3f000000 3f800000 3f800000 0 40c8f5c3 0 0 0 0 40c8f5c3 0 41800000

 

 

 

 

 

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.

 

 

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

 

 

 

 

 

CheckDoneXYZA

 

Description

 

Displays status of a commanded MoveXYZA command.  See also DefineCS.

 

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

 

CheckDoneXYZA

 

 

 

 

 

ClearBit<N>

 

Description

 

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

Parameters

<N>

 

Bit number specified as a decimal number.  Valid range 0...31 for actual hardware I/O bits.  Valid range of 32...63 for virtual I/O bits.

 

 

Example

 

ClearBit0

 

 

 

 

 

ClearBitBuf<N>

 

Description

 

Inserts into the coordinated move buffer a command to clear an IO bit N(0..30) or a Virtual IO bit (32..63) (actual IO bits must be defined as an output, see SetBitDirection)

Parameters

<N>

 

Bit Number to clear.  Valid Range 0...63.

 

 

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.

 

 

<X>

 

Offset in units of Position.

 

 

Example

 

CommutationOffset0=100.0

 

 

 

 

 

D<N>=<M>

or

D<N>

 

Description

 

Get or Set PID derivative Gain. 

Parameters

<N>

 

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

 

 

<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

 

DAC to value.  DACs 0...3 have  ±10 Volt ranges, DACs 4...7 have 0...4 Volt ranges.  See also Analog Status Screen.

Parameters

<N>

 

DAC channel to set.  Valid Range 0...7.

 

 

<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.

 

 

<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.

 

 

<M>

 

±Range in Position units,

 

 

Example

 

DeadBandRange0=1.0

 

 

 

 

 

DefineCS<X> <Y> <Z> <A>

or

DefineCS

 

 

Description

 

Set or get the defined X Y Z A coordinate system axis assignments.  Unused axis are assigned an axis channel of -1. 

See also Coordinated Motion.

Parameters

<X>

 

Assigned Axis channel number for X.  Valid range -1 ... 3. 

Use -1 if axis is not defined.

 

 

<Y>

 

Assigned Axis channel number for Y.  Valid range -1 ... 3. 

Use -1 if axis is not defined.

 

 

<Z>

 

Assigned Axis channel number for Z.  Valid range -1 ... 3. 

Use -1 if axis is not defined.

 

 

<A>

 

Assigned Axis channel number for A.  Valid range -1 ... 3. 

Use -1 if axis is not defined.

 

 

Example

 

DefineCS 0 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.

Parameters

<N>

 

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

 

 

<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.

 

 

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.

 

 

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.

 

 

<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.

 

 

Example

 

Enabled0

 

 

 

 

 

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 TimeKMotion 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.

 

 

<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.

 

 

<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

 

 

 

 

 

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.

 

 

<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.

 

 

<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

 

 

 

 

GetBitDirection<N>

 

Description

 

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

Parameters

<N>

 

I/O bit number.  Valid range 0...30

 

 

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 signal injection 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

 

 

 

 

 

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 (100) 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...99.

 

 

 

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 (100) 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...99.

 

 

 

Example

 

GetPersistHex 10

 

 

 

 

 

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

 

 

 

 

I<N>=<M>

or

I<N>

 

Description

 

Get or Set PID Integral Gain. 

Parameters

<N>

 

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

 

 

<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

or

I0

 

 

 

 

 

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.

 

 

<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

 

or

 

IIR0 0

 

 

 

 

 

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.

 

 

<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.

 

 

<C>

 

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

 

 

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

 

InputChan0 3=3

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.

 

 

<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:

ENCODER_MODE 1

ADC_MODE 2

RESOLVER_MODE 3

USER_INPUT_MODE 4

 

Parameters

<N>

 

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

 

 

<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.

 

 

<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.

 

 

<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.

 

 

<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.

 

 

<V>

 

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

 

 

Example

 

Jog0=-200.5

 

 

 

 

 

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.

 

 

<M>

 

Lead Compensation. Valid range - any.

 

 

Example

 

Lead0=10.0

or

Lead0

 

 

 

 

LimitSwitch<N>=<H>

 

Description

 

Configures Limit Switch Options.  Specify Hex value where:

 

See also Configuration Screen.

 

Parameters

<N>

 

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

 

 

<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

 

 

 

 

 

Linear <X0> <Y0> <Z0> <A0> <X1> <Y1> <Z1> <A1> <a> <b> <c> <d> <tF>

 

Description

 

Place linear (in 4 dimensions) interpolated move into the coordinated motion buffer.  See also KMotion Coordinated Motion.  A path through space is defined where x, y, z, and A 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) - beginning of path

 

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

 

 

3rd order parametric equation where

p = a t3 + b t2 + 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

<X0> - X end point

<Y1> - Y end point

<Z1 - Z end point

<A1 - A end point

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

<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 1.0 1.0 1.0 1.0 0.0 0.0 1.0 0.0 1.0

 

 

 

 

 

LinearHex <X0> <Y0> <Z0> <A0> <X1> <Y1> <Z1> <A1> <a> <b> <c> <d> <tF>

 

Description

 

Place linear (in 4 dimensions) interpolated move into the coordinated motion buffer.    This command is exactly the same as the Linear command above, except all 13 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

 

LinearHex 0 0 0 0 3F800000 3F800000 3F800000 3F800000 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

 

 

 

 

 

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.

 

 

<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.

 

 

<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.

 

 

<M>

 

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

 

 

Example

 

MaxI0=100.0

or

MaxI0

 

 

 

 

 

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.

 

 

<M>

 

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

 

 

Example

 

MaxOutput0=100.0

or

MaxOutput

 

 

 

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.

 

 

<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.

 

 

<M>

 

new position in position units.  Valid range - any.

 

 

<V>

 

Desired Velocity for the Motion.  Valid range - any.

 

 

Example

MoveAtVel0=100.1 30.0

 

 

 

 

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.

 

 

<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.

 

 

<M>

 

new position in position units.  Valid range - any.

 

 

<V>

 

Desired Velocity for the Motion.  Valid range - any.

 

 

Example

MoveRelAtVel0=100.1 30.0

 

 

 

 

MoveXYZA <X> <Y> <Z> <A>

 

Description

 

Move the 4 axes defined to be x,y,z,A (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 x axis.  Valid range - any.

 

 

<Z>

 

Position to move x axis.  Valid range - any.

 

 

<A>

 

Position to move x axis.  Valid range - any.

 

 

 

Example

 

MoveXYZA 100.1 200.2 300.3 400.4

 

 

 

 

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.   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.

 

 

<C>

 

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

 

 

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

 

OutputChan03=3

 

 

 

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:

MICROSTEP_MODE 1

DC_SERVO_MODE 2

BRUSHLESS_SERVO_MODE 3

DAC_SERVO_MODE 4

Parameters

<N>

 

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

 

 

<M>

 

Mode.  Valid range 1...4

 

 

Example

SetOutputMode0=1

 

 

 

P<N>=<M>

or

P<N>

 

Description

 

Get or Set PID Proportional Gain. 

Parameters

<N>

 

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

 

 

<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.

 

 

<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

 

 

 

 

 

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 (0...30) or Virtual IO bit (32...63) 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.  Valid range - 0...63

 

 

Example

 

ReadBit0

 

 

 

 

 

Reboot!

 

Description

 

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

Parameters

None

 

 

Example

 

Reboot!

 

 

 

 

 

SetBit<N>

 

Description

 

Sets an actual hardware I/O bit N (0...30) or Virtual IO bit (32...63) to high (1) .

Parameters

<N>

 

Bit number to set.  Valid range 0...63

 

Example

 

SetBit0

 

 

 

 

 

SetBitBuf<N>

 

Description

 

Inserts into the  coordinated move buffer a command to set an I/O bit N(0...30) or Virtual IO bits (32...63) (actual IO bits must be defined as an output, see SetBitDirection)

Parameters

<N>

 

Bit number to set.  Valid range 0...63

 

 

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.

Parameters

<N>

 

Bit number to assign.  Valid range 0...30

 

 

<M>

 

Direction 0 = input, 1 = output

 

 

Example

 

SetBitDirection0=1

 

 

 

 

 

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

 

 

 

 

 

SetPersistDec <O> <D>

 

Description

 

Write a single word into the Persistent UserData Array.   Persistent UserData Array is a general purpose array of 100 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 ... 99.

 

 

<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 100 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 ... 99.

 

 

<H>

 

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

 

 

Example

 

SetPersistHex 10 FFFFFFFF

 

 

 

 

 

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 (0...30) or Virtual IO bit (32...63) 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.  Valid range 0...63

 

 

<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 N(0...30) or Virtual IO bits (32...63) (actual IO bits must be defined as an output, see SetBitDirection)

Parameters

<N>

 

Bit number to set.  Valid range 0...63

 

 

<M>

 

State.  Valid range 0...1

 

 

Example

 

SetBitBuf0

 

SetStateBitBuf0=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.

 

 

<M>

 

PWM Stepper Amplitude.  Valid range 0...255

 

 

Example

 

StepperAmplitude0=250

 

 

 

 

 

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.

 

 

<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

 

 

 

 

 

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.

 

 

Example

 

Zero0