Cortex SWIFT 100 User manual

CORTEX CONTROLLERS
50 St. Stephen’s Place
Cambridge, CB3 0JE
Tel: +44 0(1223) 368000
Fax: +44 0(1223) 462800
http://www.cortexcontrollers.com
OSM Manual
SWIFT 100 Motor Controller
Technical Manual
Edition 1.1
8 February, 2002
Geoff Jones

Overview
INTRODUCTION
The SWIFT 100 is a self-contained , single axis, stepping motor controller and drivecard housed on a
standard eurocard pcb. It receives instructions via the RS232 link (J10). A second channel (J9) is used
for daisy-chaining.
There are manual control options using an analogue joystick and/or digital potentiometer.
The user can specify one of 64 different "electronic gears". These correspond to microstep/step ratios in
the range 4-256 and differing current decay characteristics. When used with a 1.8degree step angle
motor one can choose gears in the range 200-12800 steps per rev. The maximum step frequency using
the on-board driver frequency is 60KHz.The board incorporates hardwired limit switch inputs.
The user may program the current (ie: torque) of the motor.
There are 4 optocoupled inputs and 4 optocoupled outputs. Provision is made for a high current extender
card where larger motors are required or for use with an external drive.
Setup parameters may be stored in an EEROM.
The SWIFT 100 requires a supply for motor voltage (max 40V) and a logic voltage input (5V).

Edge Connector Interconnections
C1 o o A1
Motor winding 1 phase A C2 o o A2
C3 o o A3
Motor winding 1 phase B C4 o o A4
C5 o o A5
Motor winding 2 phase A C6 o o A6
C7 o o A7
Motor winding 2 phase B C8 o- o A8
C9 o A9
Motor power supply 40V * C10 o o A10
C11 o o A11
Motor power supply 0V C12 o o A12
winding 1 current sensor ** C13 o o A13 winding 2 sensor **
Logic power supply 5V C14 o o A14
Isolated Vp for inputs *** C15 o o A15 Joystick input (0-5V)
Limit input LP0 C16 o o A16 Limit input LP1
Limit voltage VLP0 C17 o o A17 Limit voltage VLP1
Limit input LM0 C18 o o A18 Limit input LM1
Logic power supply 0V C19 o o A19
Output OP2 C20 o o A20 Output OP3
Output OM2 C21 o o A21 Output OM3
Input IP2 C22 o o A22 Input IP3
Input voltage VP2 C23 o o A23 Input voltage VP3
Input IM2 C24 o o A24 Input IP3
Output OP0 C25 o o A25 Output OP1
Output OM0 C26 o o A26 Output OM1
Input IP0 C27 o o A27 Input IP1
Input voltage VP0 C28 o o A28 Input voltage VP18
Input IM0 C29 o o A29 Input IP1
motor clock output (TTL) C30 o o A30 direction output (TTL)
hand encoder input A C31 o o A31 hand encoder input B
Additional 0V C32 o o A32

Notes
*40V maximum for motor power supply
** only required with extender card
*** used only if total isolation is required,
for convenience this can be linked to your 5V
rail.
RS232 Connections
The SWIFT 100 connects to the host computer via the RS232 channel J10.
The pin connections are as follows:-
J10 pin no function
1transmit data (from SWIFT 100)
2receive data (to SWIFT 100)
3ready to send (from SWIFT 100)
4clear to send (to SWIFT 100)
5Data terminal ready (from SWIFT
100)
6ground
NOTE:
The OSM will work quite normally,should no handshaking be implemented. However, this may not be
true for your host computer, therefore, take care with the wiring up of DSR, RTS and CTS on your host.
The OSM responds to each command you send,therefore, it is important to read these responses.

MANUAL CONTROL
In addition to software commands for the SWIFT 100, there is also a manual control mode which will
allow motion via a joystick or a hand encoder, see commands L1 and L0.
Joystick control is invoked by connecting the joystick analogue voltage, which must be between 0 and
5V , to the edge connector input A15. Then when you enter manual mode from the host, control is
passed to the joystick.
Hand encoder motion is similarly invoked by connecting the two quadrature pulse A and B of a hand
encoder or digital potentiometer, to pins C31 and A31 on the edge connector, and entering manual mode
from the host.
---5---
LIMIT SWITCH INPUTS
The limit switch inputs can be configured in a variety of ways, the basic limits signals are L1 (positive
limit) and L0 (negative limit). They operate through an opto-isolator
for safety reasons. The main signals are subdivided as:-
LP1 opto isolator anode for L1
VLP1 voltage for opto-isolator (can be logic 5V)
LM1 opto isolator cathode for L1
LP0 opto isolator anode for L0
VLP0 voltage for opto-isolator (can be logic 5V)
LM0 opto isolator cathode for L0
Basic Configuration (MAKE-TO-STOP)
o VP------logic 5V
o LP1-------------------o
/ positive limit switch o VLP1------------------o/
o LM1-----logic 0V
This is the most basic and simplest limit switch configuration. It is used for most applications but the
user should be aware of the drawbacks.
1. This is a make-to-stop circuit which means
that if there is a break somewhere, a poor joint or connection the motor will pass by the limit switch and
not stop.
2. Connecting VP and LM1 to the logic's power
supply means that if the limit switch is placed in a high voltage or electrically noisy area, there is no
protection for the sensitive electronics from HV spikes.
An isolated power supply for VP , LM1 and LM0 will
remove the risk of the damage outlined in point 2. ---6---
Alternative Configuration (BREAK-TO-STOP)
o VP logic 0V
o LP1---o-------------------o
||
o VLP1--' o
|
o LM0---o-------------------'

|
--o-- logic 0V
This circuit removes the risks outlined in point 1 but not those of point 2. Furthermore, it does not cater for
the condition of a damaged opto-isolator.
A true break-to-stop circuit can be employed using a special PAL, this may be requested.
---7---
INPUTS AND OUTPUTS
Inputs
The four inputs make up a four bit binary number and each
bit operates electrically in precisely the same way as the limit switches, for example:-
IP3 is analogous to LP0
VP3 is analogous to VLP1
IM3 is analogous to LM0
where I3 is input 3 (MSB) and L0 is negative limit.
Outputs
The four outputs are also opto-isolated and also make up a four bit number . They are presented in the
form of a darlington pair open-collector and emitter. For example:-
OP0 is the collector for output 0 (LSB)
OM0 is the emitter
A typical interface would be:-
|Vcc
>
> pull-up resistor
|
o OP0-----------o-----------o output
o OM0-----------------------o ground
The value of resistor depends on Vcc and type
of input device, but for TTL 4K7 would suffice.
Clock and Direction Output
These would only be connected if an external drivecard was required.
---8---
SOFTWARE CONTROL
RS232 Port
The software commands are ascii characters delivered over the RS232 device. The port should be set-
up as follows:
BAUD 9600
data bits 8
stop bits 1
parity none
handshake XON/XOFF

Software Commands
The commands are ascii characters from the host which must be followed by either a LF, CR or CRLF.
The SWIFT 100 will respond to every command, even if it is not understood. For every legitimate
command the SWIFT 100 will return a # after executing. Illegitimate commands are are returned an E.
Command Summary
_A Returns motion status
_C n set constant speed
_D n set datum
_E n set motor current
_F force default parameters
_H smooth stop
_I read 4-bit input
_J jdss set joystick parameters
_L n enter/exit local mode
_M n move n steps
_MA n move absolute
_MC n move at constant speed
_MCA n MA at constant speed
_MCL n MC to limit
_ML n move to limit
_N n add or delete newline (LF) (0x0a)
_O n write n to 4-bit output
_P nnnn set motor parameters
_Q write paramters to EEROM
_R n set microstep ratio
_RL read limits
_RS read remaining steps to go
_S emergency stop
_T n trigger on input #n
_W request position
NOTE: _ denotes the axis number in daisy chained systems.
---9---
Commands in full
Software release 1.3
A
Returns motor status: 0 inactive and 1 active.
C n
Set constant speed for MC commands (62<n<60000).

D [n]
If n is not specified make current position the coordinate zero.
If n is specified then change coordinate system so current position is n.
E n
Set motor current (0<=n<=15) approx 40*n mA. NB. DO NOT EXCEED n=4 IN CONTINUOUS USE
UNLESS A HEATSINK IS FITTED. High values are acceptable for short periods. See page 11.
F
Force default values for all parameters.
At present these correspond to:
basesps = 1000 the starting speed for M,
MA and ML commands
maxsps = 60000 the top speed ''
acc_spss= 30000 the acceleration ''
dec_spss= 120000 the deceleration ''
csps = 150 constant speed for MC
and MCL commands
current = 4 about 160mA
gear = 0 maximum 12800 steps/rev
with 1.8deg motor
newline = 0 no newline (LF) after CR
If the optional joystick is fitted, this is read on an 8 bit A-D giving values 0 to 255 centred on about 128.
The parameters are:
jitter = 4 allowable joystick noise
deadband= 20 joystick deadband
slowband= 10 slow motion band
sense = 0 joystick not reversed
H
Smoothly halt the motor.
I
Read the 4-bit input status (returns 0 to 15).
J jitter deadband slowband sense
Set joystick parameters (see above).
---10---
L n
If n=1 then enter the manual/local mode. If n=0 then exit manual/local mode. Only appropriate if a
joystick or a hand encoder is fitted.
M n
Move n steps with acceleration ( n<2000000000).
MA n
Move to position n with acceleration.

MC n
Move n steps at constant speed (see command C).
MCA n
Move to position n at constant speed.
MCL n
Move to limit in direction n at constant speed where (n= -1,0,1).
ML n
Move to limit in direction n with acceleration
N n
If n=1 add a newline (LF) (0x0A) to the normal line terminator of carriage return (0x0D). "n=0" is the
default of no newline.
DO NOT ATTEMPT TO SET N 1 on any card other than the first card as this would result in incorrect
communications between the cards.
O n
Output 4-bit value to optocouplers (0<=n<=15).
P basesps maxsps accel_spss [decel_spss]
Set base speed, maximum speed and acceleration for accelerated motion. When it is specified the
deceleration may be different to acceleration.
Q
Write the current parameter settings to EEROM
R n
Set the number of steps/revolution. See page 11.
RL
Read the limit switch status: returns -1, 0 or 1.
RS
Read steps still left in current move.
S
Emergency stop with no deceleration.
T n
Delay move till input #n goes high. If n is omitted then moves occur as soon as they are requested.
W
Report the current position as a number of steps.
---11---
Special Commands
?
Returns information on the current parameters of the card.
The units of motion commands are steps, steps/sec and steps/sec/sec.
All commands return a single line response (which may be null) followed by a prompt of #\r if the
command was valid or E\r in the case of error.
THE USER'S PROGRAM MUST WAIT UNTIL IT HAS RECEIVED THE PROMPT BEFORE ISSUING
THE NEW COMMAND.

If N=1 (add newline) then \r above is expanded to \r\n ie: carriage return (0x0D) followed by linefeed
(0x0A).
Further error processing commands:
EL
Get length of the error message (no terminator). EM
Returns the error message.
EN
Returns the error number.
EC
Toggles the echoing of the command input and is intended for initial debugging of communications with a
single card. It must not be issued to the slave cards in daisychained systems as intercard communication
would fail.
IMPORTANT NOTES:
1. F command forces the default values shown unless
you have a special default table of your own.
2. RL command ALWAYS stops the motors. Use the _A
command to see motor status, then RL when A = 0.
3. J command is only appropriate when the ADC chip
is fitted for use with a joystick. An error will be reported otherwise.
4. Q will only work if non-volatile memory is fitted.
---12---
Gear Ratio, command R
The standard eprom allows 16 gear ratios with different current decay characteristics.
command usteps steps/rev steps/rev remarks
/step 1.8 motor 7.5 motor
R0 256 12800 3072 finest division
R1 250 12500 3000
R2 200 10000 2400
R3 160 8000 1920
R4 144 7200 1728
R5 100 5000 1200
R6 80 4000 960
R7 72 3600 864
R8 60 3000 720
R9 50 2500 600
R10 40 2000 480
R11 36 1800 432
R12 30 1500 360
R13 20 1000 240
R14 8 400 96 half step mode

R15 4 200 48 full step mode
These gears have a SLOW current decay which gives less ripple and less switching noise.
This pattern is repeated 4 times with progressively faster current decay. FAST current decay may work
better at high speeds.
R0 ->R15 slow current decay
R16->R31
R32->R47
R48->R63 fast current decay
NB: after changing gears the position will be indeterminated to one step.
---13---
Daisy Chaining
To daisy-chain simply connect J9 of your first SWIFT 100
to J10 of your second. Any command with the prefix 2
will now be passed to the second SWIFT 100.
In fact N SWIFT 100 cards may be linked or daisy-chained to form an N axis system.
A command prefixed with a number >1 is sent to the nth card in the system ie:
2W
Report the position of 2nd card.
2M 10000
Move 10000 steps on the second card.
THIS SYNTAX SHOULD NOT BE USED IF NO 2nd CARD IS FITTED as the system would lock up
waiting for a response from a non-existent card.
Required Interconnections
SWIFT 100 #1 SWIFT 100 #2
J10 pin no J9 pin no
12
21
34
4 3
5 not connected
66
---14--SPECIFICATIONS.
Motor DC 40V max
Logic DC 5V
General input Four opto-isolated inputs 5->15V.
General output Four opto-isolated outputs 10mA.
Limits Opto-isolated active high or low.
Motor current up to 600mA/phase, 4-256 usteps/step
(200-12800 steps/rev with 1.8 motor), 63Hz->60KHz.

RS232 9600/4800/2400/1200/600/300/19200 baud
8/7 data bits
1/2 stop bit,
on/off parity odd/even parity (if on) XON-XOFF handshaking
Table of contents