KTA-290 Manual - NOT RSPD
KTA-290 Manual - NOT RSPD
KTA-290 Manual - NOT RSPD
Introduction
The KTA-290 USB stepper motor controller makes it easy to connect stepper or servo motors to a
computer. When connected by USB, the card appears as a serial port on your computer. Simple
commands allow configuration of acceleration and frequency settings, relative or absolute moves and
control of digital inputs and outputs.
The controller works as a USB to RS-485 converter. Multiple cards can be connected via RS-485,
allowing control of up to 16 axes of motors.
Connections
The most basic configuration of the KTA-290 requires power, a motor driver connected to one axis
and a USB connection to a computer.
S1 PUL+
COM PUL−
D1 DIR+
DIR−
KTA$290 Driver
VS S1 PUL
COM COM DIR
VO D1 OPTO
KTA$290 Driver
Figure 3 shows the wiring for a single-ended input driver. The VO terminal provides 5 VDC. Each driver
wired in single-ended fashion needs its OPTO terminal connected to VO on the controller.
Multiple motors can be driven from a single axis output by wiring the step and direction signals in
parallel.
Relay Outputs:
The relays on the card can be used to switch equipment on and off. Each relay has a pair of screw
terminals. When the relay is on, the terminals are shorted together. The relays can switch up to 5 A and
30 VDC. To switch large loads, or mains-voltage loads, a secondary relay is recommended.
DIP Switches
The controller has a 4-way DIP switch. The switches set the card address and allow the recovery of a
card with unknown communication settings. The switches are marked 1 to 4 and can be moved using a
small screwdriver, pen or similar item.
Switches 1 and 2 control the card address. Multiple cards can be connected via RS-485. To control
specific axes when multiple cards are connected, each axis needs a unique address. Axis addresses start
at 1, 5, 9 or 12 depending on the position of switches 1 and 2.
Switch 1 Switch 2 Axis Addresses
Off Off 1, 2, 3 and 4
On Off 5, 6, 7 and 8
Off On 9, 10, 11 and 12
On On 13, 14, 15 and 16
Table 1 - Base address selection
Switch 3 has no function.
Switch 4, if on, forces the communication baud rate to 57600 bps and the checksum mode off when
the controller is powered up. Changing the switch position while power is applied to the controller has
no effect.
Using switch 4 to reset the baud rate does not change the baud rate or checksum setting saved in the
controller’s non-volatile memory. To set the baud rate of a card with unknown communication settings,
the full procedure is:
Command format:
@AA CMND[ X][ Y][ Z][ A]<EOL>[<CS>]
Square brackets (‘[‘ and ‘]’) indicate parts of the command that are optional. Commands
should not be sent with square bracket characters in them.
@ is the at symbol. All commands begin with the at symbol.
AA is the axis address, 1 to 16. One or more space or tab characters must follow the address.
CMND is the four character command. The command is not case sensitive.
[ X][ Y][ Z][ A] is a series of up to four parameters. The number of parameters required
depends on the command. Parameters must be decimal integer values and cannot contain
thousands separators. One or more space or tab characters must be present between the
command and the first parameter, and between each parameter.
<EOL> is one or more a line-ending characters. Acceptable line-ending characters are carriage
return (‘\r’ or 0x0D) or newline (‘\n’ or 0x0A).
[<CS>] is the optionally required checksum. If the checksum mode is set (it is not set by
default), the controller will only respond to commands if the line end is followed by a single
byte checksum value. More detail is provided in the Checksum section below.
The command must be less than 255 characters long, including end of line and checksum
characters.
Address:
Each command has an address. The address refers to the axis the command is directed at. Each
controller has four axes, so will respond to four different addresses.
Some commands apply to parameters of the controller (like the BAUD command) or apply to all axes
(like the STOP command). The controller will respond to these commands when the address is within the
range of addresses the controller is set up (by the positions of switches 1 and 2) to respond to.
Some commands allow configuration of multiple axes in a single command. These commands take a
variable number of parameters – one parameter for each axis. In these cases, the first parameter
corresponds to the axis addressed by the command. Any proceeding parameters apply sequentially to
the next axis. Examples are given with each command.
Checksum:
If the checksum option is enabled, the controller will only respond to commands that end with a
correct checksum byte.
The checksum is calculated as the exclusive-or of all the bytes in the command message. For example,
the command “@1 STOP\r” would require a checksum of:
Response:
The controller will respond to most commands with “#AA\r\n” where AA is the address of the axis
the command was directed at. AA is always two digits in responses – commands addressed to axes
numbered less than 10 are padded with a leading 0.
Some commands return one or more values. In these cases, the response is of the form “ #AA X Y Z
A\r\n” where X through to A are the values requested. Values are always returned as decimal integers.
The controller may additionally send a response when an axis finishes its movement depending on
the verbose mode and individual response mode settings. By default, the controller has verbose mode
set and individual response mode not set.
With the default settings, the controller will respond to a movement command with “ #AA\r\n” when
the command is received, and then with with “!BB\r\n” when all axes have finished their movements.
BB is the address of the axis that finishes last.
Switching verbose mode off (with the OPTN command) suppresses the “ !BB\r\n” response. In this
case, the controller will only respond by sending “#AA\r\n” when a command is received.
Switching the individual response mode on will cause the controller to send a response of the form “ !
BB\r\n” when each axis completes its motion. In this mode, a movement command can cause up to five
responses from the controller: “#AA\r\n” when the command is first received, followed by one “!
BB\r\n” style response for each axis.
Commands
Table 2 outlines the commands the controller responds to.
ACCF Set the maximum frequency for an axis (Hz)
ACCI Set the frequency increment (Hz/step) for an axis
ACCS Set the initial frequency for an axis (Hz)
AMOV Move to a position (steps)
BAUD Set the communications baud rate (bps)
DROF Immediately switch a direction output off
DRON Set a direction output on indefinitely or for a period (tenths of seconds)
DRST Report the current status of a direction output
OPTN Set checksum mode and configure how the controller responds to axis move commands
POSN Set the current position of an axis
PSTT Report the current position of all axes
RACC Report the initial frequency, frequency increment and maximum frequency of an axis
RDAN Report analog voltage at AN1, AN2, IO1, IO2 or VS
RDIO Report the status of AN1, AN2, IO1 or IO2 as a digital input
REL1 Set relay 1 on or off
REL2 Set relay 2 on or off
RMOV Move forward or backwards some number of steps
RSET Reset the controller and load settings from non-volatile memory
SAMV Move an axis to a position with initial frequency, frequency increment and maximum
frequency specified in the command
SAVE Save baud rate, checksum mode, axis move response settings, axis frequency settings,
current position and target position to non-volatile memory
SRMV Move an axis forward or backward by a number of steps with initial frequency,
frequency increment and maximum frequency specified in the command
STAT Report the status of axis movement, direction output and limit switch inputs
STOP Immediately stop all axes
WDIO Set the digital outputs IO1 and IO2 on or off
Table 2 - Outline of Controller Commands
The ACCF, ACCI and ACCS commands can also set values for multiple axes (up to 4) at once. The
example below sets the maximum frequency for axis 2 to 1 kHz, axis 3 to 2.5 kHz and axis 4 to 6 kHz:
Send: @2 ACCF 1000 2500 6000\r\n
Receive: #02\r\n
If sent with no parameters, the controller will respond by reporting the current ACCF, ACCI or ACCS
setting for the axis:
Send: @3 ACCF\r\n
Receive: #03 2500\r\n
AMOV and RMOV can also be used to drive up to four axes at once. The example below tells axis 1 to
move forward 100 steps, axis 2 to move forward 300 steps and axis 3 to move backward 200 steps.
Assuming all three axes have the same frequency and acceleration settings, axis 2 will be the last to
finish moving. With the default response settings, the controller responds once when the command is
received and then again when axis 2 finishes.
Send: @1 RMOV 100 300 -200\r\n
Receive: #01\r\n
Receive: !02\r\n
If the BAUD command is issued without a parameter, the controller will respond with the current
baud rate setting.
The BAUD command can be addressed to any of the axes of the card.
Due to limitations in system frequency and dividers, the controller cannot set its baud rate to every
value in the range 10 to 230400 bps exactly. When the BAUD command is issued with a value, the
controller chooses the closest baud rate it can attain. This is the value that is repeated back when the
BAUD command is issued without a parameter. It is normal for the requested baud rate and closest
attainable baud rate to differ by a few per cent and this difference will not affect the operation of the
controller.
Changing the BAUD value does not immediately update the communications baud rate. The baud rate
must be saved to non-volatile memory with the SAVE command and power to the board must be cycled
or the RSET command issued.
Examples:
Send: @2 BAUD 5\r\n
Receive: #02\r\n
Send: @3 BAUD\r\n
Receive: #03 19202\r\n
The DRON command can be used to set multiple axes at once. The example below sets D1 and D2 on
for 10 seconds and sets D3 and D4 on for 20 seconds.
Send: @1 DRON 100 100 200 200\r\n
Receive: #01\r\n
The DROF and DRST commands can also be used on multiple axes at once. In this case the number of
parameters determines how many axes are affected. The values of the parameters are ignored. For
example, to cancel timers on D2, D3 and D4 in a single command, issue:
Send: @2 DROF 0 0 0\r\n
Receive: #02\r\n
Similarly, the DRST command can request the status of more than one axis. The example below
indicates D2 is on indefinitely, D3 is counting down and will be on for 9 more seconds and D4 is off.
Send: @2 DRST 0 0 0\r\n
Receive: #02 -1 90 0\r\n
Options take affect as soon as the command is received. Options are not saved to non-volatile
memory until a SAVE command is issued. If the controller is reset before options are saved, the
checksum mode, verbose mode and individual response mode settings will revert to those last saved in
non-volatile memory.
When issued with no parameters, the POSN command request the current position of the address
axis.
Examples:
Send: @1 POSN 0 100 200 300\r\n
Receive: #01\r\n
Send: @3 POSN\r\n
Receive: #03 200\r\n