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
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
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
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> <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 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)
<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
ArcXZ <XC> <ZC> <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 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.
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 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
ArcHexXZ <XC> <ZC> <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 ArcHex Command except circular motion is performed in the XZ 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.
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.
<A>
Floating point Backlash Compensation Amount in units of Steps or Counts.
Example
BacklashAmount=15.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.
<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.
<A>
Floating point Backlash Compensation Rate in units of Steps or Counts per second.
Example
BacklashRate=1000.0
Description
Inserts into coordinated move buffer a command to indicate Rapid is in progress and to use Rapid FRO.
Parameters
None
Example
BegRapidBuf
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
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
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
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
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...2047.
Example
ClearBit0
Description
Inserts into the coordinated move buffer a command to clear an IO bit (actual IO bits must be defined as an output, see SetBitDirection).
Parameters
<N>
Bit Number to clear. Valid Range 0...2047.
Example
ClearBitBuf0
Description
Prepare to download FLASH firmware image. Sets entire RAM flash image to zero
Parameters
None.
Example
ClearFlashImage
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
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
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
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
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
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> <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 -1 ... 7.
Use -1 if axis is not defined.
<Y>
Assigned Axis channel number for Y. Valid range -1 ... 7.
Use -1 if axis is not defined.
<Z>
Assigned Axis channel number for Z. Valid range -1 ... 7.
Use -1 if axis is not defined.
<A>
Assigned Axis channel number for A. Valid range -1 ... 7.
Use -1 if axis is not defined.
<B>
Assigned Axis channel number for B. Valid range -1 ... 7.
Use -1 if axis is not defined.
<C>
Assigned Axis channel number for C. Valid range -1 ... 7.
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 -1 ... 7.
Use -1 if axis is not defined.
<Y>
Assigned Axis channel number for Y. Valid range -1 ... 7.
Use -1 if axis is not defined.
<Z>
Assigned Axis channel number for Z. Valid range -1 ... 7.
Use -1 if axis is not defined.
<A>
Assigned Axis channel number for A. Valid range -1 ... 7.
Use -1 if axis is not defined.
<B>
Assigned Axis channel number for B. Valid range -1 ... 7.
Use -1 if axis is not defined.
<C>
Assigned Axis channel number for C. Valid range -1 ... 7.
Use -1 if axis is not defined.
<U>
Assigned Axis channel number for U. Valid range -1 ... 7.
Use -1 if axis is not defined.
<V>
Assigned Axis channel number for V. Valid range -1 ... 7.
Use -1 if axis is not defined.
Example
DefineCSEX
DefineCSEX = 0 1 2 3 4 5 6 7
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
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
Description
Echo character string back to the Console Screen.
Parameters
<S>
Any character string < 80 characters
Example
Echo Hello
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Description
Reports the current Spindle Speed in revolutions per second.
See also ConfigSpindle and TrigThread
Parameters
Example
GetSpindleRPS
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
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
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
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
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
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
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.
<M>
Mode. Valid range 1...4
Example
SetInputMode0=1
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
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
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
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
Description
Stop execution of a user thread.
Parameters
<N>
Thread to halt. Valid range 1..7
Example
Kill0
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
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> <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 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
<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, however currently the GCode Interpreters available only support 6 axes of simultaneous motion.
(X0,Y0,Z0,A0,B0,C0,U0,V0) - beginning of path
(X1,Y1,Z1,A1,B1,C1,U1,V1) - 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
<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.0 0.0 0.0 0.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
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
LinearHexEx 0 0 0 0 0 0 0 0 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 0 0 3F800000 0 3F800000
LinHex1 <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
LinHex1 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 0 0 3F800000 0 3F800000
LinHex2 <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, LinHex1, or LinHex2, command. 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
LinHex2 0 0 3F800000 0 3F800000
LinHexEx1 <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 LinHexEx1 command. See also KMotion Coordinated Motion.
Parameters
See above.
Example
LinHexEx1 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 3F800000 0 0 3F800000 0 3F800000
<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
<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
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
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
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
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
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
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
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.
<D>
Destination in position units. Valid range - any.
<T>
Time Constant Tau in seconde. Valid range - any positive number.
Example
MoveExp0=1000 0.1
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
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
MoveXYZABC <X> <Y> <Z> <A> <B> <C>
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 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
Description
Clear and open the buffer for coordinated motion.
Parameters
None
Example
OpenBuf
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.
<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.
<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.
<G>
Gain value. Valid range any floating point value.
Example
OutputGain0=-1.0
or
OutputGain0
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 8Parameters
<N>
Selected Axis for command. Valid range 0...7.
<M>
Mode. Valid range 1...4
Example
SetOutputMode0=1
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
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
Description
Program entire FLASH image, downloaded using LoadFlash commands, to FLASH Memory.
Parameters
None
Example
ProgFlashImage
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
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
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
Description
Causes complete power up reset and re-boot from flash memory.
Parameters
None
Example
Reboot!
Description
Sets an actual hardware I/O bit N or Virtual IO bit to high (1) .
Parameters
<N>
Bit number to set. Valid range 0...2047
Example
SetBit0
Description
Inserts into the coordinated move buffer a command to set an IO bit (actual IO bits must be defined as an output, see SetBitDirection).
Parameters
<N>
Bit number to set. Valid range 0...2047
Example
SetBitBuf0
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...255
<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
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
<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
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
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> <R>
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
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
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. Valid range 0...2047
<M>
State. Valid range 0...1
Example
SetStateBit0=1
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. Valid 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.
<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 SoftLimPos.
Parameters
<N>
Selected Axis for command. Valid range 0...7.
<M>
Maximum Negative Limit. Valid range - any value. Set to a large value to disable.
Example
SoftLimNeg0=-1000000.0
or
SoftLimNeg0
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.
<M>
Maximum Positive Limit. Valid range - any value. Set to a large value to disable.
Example
SoftLimPos0=1000000.0
or
SoftLimPos0
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
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
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
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 bit to be at a high level. Buffered IO bits are currently limited to the first 255 IO bits. 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. Valid range 0...255
Example
WaitBitBuf46
Description
Inserts into the coordinated move buffer a command to wait for an IO bit to 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. Valid range 0...2047
Example
WaitNotBitBuf46
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