Ocean Controls KTA-190 Serial Stepper Motor Controller

Similar documents
Ocean Controls RC Servo Motor Controller

KTA-223 Arduino Compatible Relay Controller

The Programming Interface

Part Number Description Packages available

EVAL-UFDC-1/UFDC-1M-16

PolyBot Board. User's Guide V1.11 9/20/08

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

RDF1. RF Receiver Decoder. Features. Applications. Description. Ordering Information. Part Number Description Packages available

[F/T] [5] [KHz] [AMP] [3] [V] 4 ) To set DC offset to -2.5V press the following keys [OFS] [+/-] [2] [.] [5] [V]

Bluetooth HC-06 with serial port module Easy guide

NC-12 Modbus Application

SYSTEM 4C. C R H Electronics Design

MEMOBUS/Modbus Communications

Serial Communications

SDN INSTRUCTIONS 07/10, Ver 1.2. Somfy Digital Network (SDN) Installation and Programming

B Robo Claw 2 Channel 5A Motor Controller Data Sheet

Total solder points: 167 Difficulty level: beginner advanced DMX CONTROLLED RELAY K8072 ILLUSTRATED ASSEMBLY MANUAL

The $25 Son of a cheap timer This is not suitable for a beginner. You must have soldering skills in order to build this kit.

RS-232 Communications Using BobCAD-CAM. RS-232 Introduction

The components. E3: Digital electronics. Goals:

SMS based remote control system

- 35mA Standby, mA Speaking pre-defined phrases with up to 1925 total characters.

SYSTEM 45. C R H Electronics Design

DMX-K-DRV. Integrated Step Motor Driver + (Basic Controller) Manual

GLOLAB Two Wire Stepper Motor Positioner

RS - SPM. Serial parallel translator module

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

CHAPTER 11: Flip Flops

Technical Manual. For use with Caller ID signaling types: Belcore 202, British Telecom, & ETSI

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

How to connect to a Class II router using a mobile-phone data cable specifically for Solwise & Safecom routers

STIM202 Evaluation Kit

RS-485 Protocol Manual

The Answer to the 14 Most Frequently Asked Modbus Questions

Bluetooth to serial HC-06 wireless module

Data Sheet. Adaptive Design ltd. Arduino Dual L6470 Stepper Motor Shield V th November L6470 Stepper Motor Shield

DS1621 Digital Thermometer and Thermostat

Modular I/O System Analog and Digital Interface Modules

User Manual. AS-Interface Programmer

Varedan Technologies. LA Series

Home Security System Using Gsm Modem

MC433 Stepper Motor Controller

Web Site: Forums: forums.parallax.com Sales: Technical:

XBee USB Adapter Board (#32400)

Three Axis TB6560 CNC Driver Users Manual

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester

MODULE BOUSSOLE ÉLECTRONIQUE CMPS03 Référence :

STEPPER MOTOR SPEED AND POSITION CONTROL

RGB for ZX Spectrum 128, +2, +2A, +3

Accurate Measurement of the Mains Electricity Frequency

MANUAL FOR RX700 LR and NR

Six-servo Robot Arm. DAGU Hi-Tech Electronic Co., LTD Six-servo Robot Arm

Digital I/O: OUTPUT: Basic, Count, Count+, Smart+

Microstep Driver Manual Version 6/13/2006

PACKAGE OUTLINE DALLAS DS2434 DS2434 GND. PR 35 PACKAGE See Mech. Drawings Section

MIDECO 64-outputs MIDI note decoder USER MANUAL. Roman Sowa 2012

Whale 3. User Manual and Installation Guide. DC Servo drive. Contents. 1. Safety, policy and warranty Safety notes Policy Warranty.

DK40 Datasheet & Hardware manual Version 2

Short Range Wireless Switch System Handheld 8 Installation and Operations Guide

revolution Contents: Introduction Power 28-pin Project Board with input/output cables

Advanced Data Capture and Control Systems

RN-WIFLY-EVAL-UM. WiFly Evaluation Kit Roving Networks. All rights reserved. RN-WIFLY-EVAL-UM Version 1.32r 10/9/2012 USER MANUAL

Table 1 Comparison of DC, Uni-Polar and Bi-polar Stepper Motors

Access Control Using Smartcard And Passcode

Pmod peripheral modules are powered by the host via the interface s power and ground pins.

Bob Rathbone Computer Consultancy

Programming and Using the Courier V.Everything Modem for Remote Operation of DDF6000

S88XPressNetLI v1.0. Installation, user and reference manual KDesign Electronics, PCB design by RoSoft

XS-3525/8S-3. Preliminary DataSheet Version 2.02

User Guide Reflow Toaster Oven Controller

Micro-Step Driving for Stepper Motors: A Case Study

DS1621 Digital Thermometer and Thermostat

IntesisBox KNX Modbus RTU master

A Digital Timer Implementation using 7 Segment Displays

DS1307ZN. 64 x 8 Serial Real-Time Clock

Analog Servo Drive 25A8

Four/Five Axis TB6560 CNC Driver Users Manual

2-Port RS232/422/485 Combo Serial to USB2.0 Adapter (w/ Metal Case and Screw Lock Mechanism) Installation Guide

User Manual Revision English Converter / Adapter Ethernet to RS232 / RS485 (Order Code: HD HD M HD HD M)

Part 1. MAX BIT DAC with an Arduino Board. MIDI to Voltage Converter Part1

Smarthome SELECT Bluetooth Wireless Stereo Audio Receiver and Amplifier INTRODUCTION

ARDUINO SEVERINO SERIAL SINGLE SIDED VERSION 3 S3v3 (REVISION 2) USER MANUAL

Options for ABB drives, converters and inverters. User s manual FDPI-02 diagnostics and panel interface

USB I/O CONTROL BOX 8 relays, 8 digital I/O lines and 8 HV inputs

XR-500 [Receipt Printer User s Manual ]

DS Wire Digital Thermometer and Thermostat

CT-1024 Terminal System Kit (TV Typewriter II)

ABB Drives. User s Manual HTL Encoder Interface FEN-31

FOSTCDR. Industrial Serial to Multimode Fiber Optic Converter PRODUCT INFORMATION B&B ELECTRONICS. Specifications Serial Technology

1.Eastron SDM220Modbus Smart Meter Modbus Protocol Implementation V1.0

Modbus and ION Technology

LDG Electronics External Meter Serial Communications Protocol Specification

AXE033 SERIAL/I2C LCD

Technical description MX-1 VB Edge

Designing VM2 Application Boards

Antenna Rotator System

DKWF121 WF121-A B/G/N MODULE EVALUATION BOARD

RC2200DK Demonstration Kit User Manual

Disturbance Recoder SPCR 8C27. Product Guide

ServoOne. Specification. Option 2 - Technology. x 11. x 8 X 8. x 10. x 9. x 7. x 6 TTL Encoder / TTL Encoder simulation

Transcription:

Ocean Controls KTA-190 Serial Stepper Motor Controller Controls 4 Stepper Motors Simultaneously RS-232, 8N1 ASCII Serial Controlled Baud Rate Selectable Add more units to control up to 16 Motors Up to 29.5KHz Max Stepping Rate Two Acceleration Curves available Parameters can be stored in Non-Volatile EEPROM Limit Switch Input for Each Motor 5V Step and Direction Signal Levels XOR Checksum Option 5V Output for Opto-Coupler Drive 2 SPST 5A Relays for Control 12V or 24V DC Powered Until now it has been difficult to control stepper motors from a computer. The stepper motor kits sold today require you to interface the step and direction inputs to a parallel port and then write the software to switch these signals. If you need to incorporate limit switches and acceleration and deceleration of the stepper motor, what started out as a simple job turns out to be a weekend job and you are in the dog house because you haven t spent time with the wife and kids. The Serial Stepper Motor Controller (SSMC) overcomes this by providing control for up to four stepper motors from a single controller board attached to the serial port, and does away with the need for software to control the acceleration and deceleration of the motors. Additionally, up to four Serial Stepper Motor Controller boards can be ganged together and individually addressed to provide control for up to sixteen stepper motors, all from the one serial port. You couldn t do that from the quickly disappearing parallel port and with the availability of cheap USB to serial converters the controller could easily be adapted for use on any USB port, hence future-proofing it! Stepper Motors: Lets start with a brief look at stepper motors. Unlike regular DC or AC motors which have commutator brushes to switch the coils in the motor on and off automatically, stepper motors require individual activation of coils, by the use of a stepper motor driver circuit, and have no brushes. The major advantage of stepper motors over regular motors is their finite position control, which is virtually impossible with a regular motor. There are two main types of stepper motor, Unipolar and Bipolar. Unipolar Stepper Motors: Unipolar stepper motors have two centre tapped coils inside, and these behave as four individual coils. These motors have either five, six or eight wires. Five wire motors join the two centre taps together, six wire motors bring out the centre taps individually, and eight wire motors have four individual coils, with a wire for each end of each of the coils. The four coils of a unipolar stepper motor are individually activated and deactivated sequentially and each time this is done the motor advances a step. Unipolar stepper motors can act as bipolar stepper motors if the centre taps are omitted. Bipolar Stepper Motors: Bipolar stepper motors are stepper motors with only two coils and have four wires. Since there is only two coils the driving of bipolar stepper motors is somewhat different to that of unipolar stepper motors, the main difference is that the current flowing though the terminals must be able to be reversed. Unipolar stepper motors can generally have more steps than bipolar stepper motors of the same size, but bipolar stepper motors can provide more torque. Page 1 of 8

The Controller: There are many stepper motor driver kits available which can control stepper motors. Kits and Industrial Drivers from Ocean Controls all have Step and Direction inputs which allow the user to control the movement of the motor. The Ocean Controls Serial Stepper Motor Controller does not provide the driving circuitry for individual stepper motors, but rather connects to the step and direction inputs on the driver cards. The Circuit: Refer to the attached circuit diagram for details. Incoming data on the serial port is converted to 0-5V microcontroller friendly levels by the MAX232 chip. The data is then processed by the Atmel ATMega168 microcontroller. The DIP switch SW1 is used to address the board when multiple Serial Stepper Motor Controller boards are used together. The limit switch inputs have pull up resistors and go through R1-R4 for protection. Step and Direction outputs connect to the terminals through the 74HC245 buffer chip, which protects the microcontroller from accidental damage. K2 is a 9-pin female D-connector, this connects the circuit to the PC (via an RS232 cable). K3 is a 10-pin IDC Header, connected to a 9-pin male D-connector which allows additional controller boards to be connected. The resistor R5 and diode D2 allow multiple devices to be connected to the serial link (See the section on multidropping for more detail). The terminal connectors provide connection for power (12V or 24V DC) at terminal Vs, limit switch inputs (L1-L4), step outputs (S1-S4) and direction outputs (D1-D4). The terminal labelled 5V is a 5V output useful when controlling drivers with opto-couplers. Using the Controller: The Ocean Controls Serial Stepper Motor Controller is controlled via the serial port of a personal computer, using any serial terminal software or custom software, set at a baud rate of 9600, 8 data bits, 1 start bit, 1 stop bit and no parity (9600,8,N,1). The commands for the controller are in the form: @AA CMND XXXXCR Where AA is the 2 digit number of the motor being addressed, between 01 and 16 (see Table 1), CMND is the 4 letter command, refer to Table 2 for available commands, XXXX is a numeric value associated with the command (refer to Table 2 for detail), and CR is the carriage return byte (0x0D). Table 1 Addressing S2 S1 Motor Numbers OFF OFF 01-04 OFF ON 05-08 ON OFF 09-12 ON ON 13-16 Simultaneous Motor Control: Sep 07 All four motors can be controlled simultaneously if the user uses the base address of the controller (01, 05, 09 or 13) and the command is in the following form: @AA CMND WWWW XXXX YYYY ZZZZCR Where WWWW is the parameter for motor 1, XXXX is the parameter for motor 2, YYYY is the parameter for motor 3 and ZZZZ is the parameter for motor 4, again CR is the carriage return byte. A motor can be excluded from the command by using the letter N as the parameter. Eg. @01 RMOV 200 400 n 800<CR> will move motor 1 200 steps, motor 2 400 steps and motor 4 800 steps. The motors will start moving simultaneously. Motor 3 will not move at all. With reference to Table 2 only the following commands can be used with multiple parameters: ACCI, ACCF, ACCN, AMOV, RMOV, POSN, RATE. Page 2 of 8

Table 2 Commands Command Description POSN Set the position that motor AA is currently at to be XXXX where XXXX is between -99,999,999 and 99,999,999 PSTT Returns the position of motor AA AMOV Move motor AA to the absolute position XXXX where XXXX is between -99,999,999 and 99,999,999 RMOV Move motor AA relatively from the current position by XXXX where XXXX is between -99,999,999 and 99,999,999 STOP Stop motor AA immediately STAT Get the status of the motors see Status Command Detail ACCN Set the maximum stepping rate of motor AA to XXXX where XXXX is between 0 and 9999 see Acceleration. If the value for ACCN is 0 or less than RATE then no acceleration or deceleration occurs ACCI Set the Acceleration interval of motor AA to XXXX where XXXX is between 1 and 9999 see Acceleration RATE Set the minimum stepping rate of motor AA to XXXX where XXXX is between 1 and 9999 see Acceleration DRON Turn Direction output (D1-D4) associated with AA on for XXXX * 0.028mS. If XXXX is -1 output will be on until a DROF command is received DROF Turn Direction output (D1-D4) associated with AA off immediately from DRON command DRST Returns time remaining of DRON command in time intervals, or -1 if it is on permanently OPTN Bit 1 of the parameter turns Verbose mode on and off, bit 2 turns Checksum mode on and off. Valid addresses are 01, 05, 09 and 13. See the section on the Option Command ACCF When set to 1 the alternate Acceleration Curve is used, when set to 0 the standard Acceleration Curve is used. SAVE Saves RATE, ACCI, ACCN, ACCF, OPTN and BAUD parameters to EEPROM, which are then automatically loaded on the next power up. Valid addresses are 01, 05, 09 and 13. REL1 Turns Relay 1 ON when parameter is 1, Turns Relay 1 OFF for all other parameters. Valid addresses are 01, 05, 09 and 13. REL2 Turns Relay 2 ON when parameter is 1, Turns Relay 2 OFF for all other parameters. Valid addresses are 01, 05, 09 and 13. BAUD Sets the Serial Baud Rate, must be followed with SAVE command for Baud Rate change to take affect on power up. See Baud Command Detail When a valid command is executed by the unit it will respond with the address preceded by a hash symbol, ie. #AA and this will be followed by a value if it is requested. Status Command Detail: The status command returns the state of each of the motors attached to a single controller board. Valid stat commands have the address of the first motor on the board, eg: @01 STAT returns the status of motors 01 to 04 @05 STAT returns the status of motors 05 to 08 @09 STAT returns the status of motors 09 to 12 @13 STAT returns the status of motors 13 to 16 These are the four valid status commands. The returned value is a 12 bit binary representation of whether the motors are moving, their direction and the state of the limit switches in the following format: Table 3 Status Value msb 11 10 9 8 7 6 5 4 3 2 lsb L4 L3 L2 L1 D4 D3 D2 D1 M4 M3 M2 M1 Where M, D and L represent the movement, direction and limit switches respectively. For movement 1 = moving, 0 = stopped. For direction 1 = forward, 0 = reverse. For the limit switches 1 = closed, 0 = open. Page 3 of 8

Multidropping: Multidropping is the term used when connecting multiple slaves to one master. This is achieved by including a signal diode on the transmit outputs of the slaves with a resistor to pull the transmit line to ground when it is not being used. The diode prevents voltages produced by transmitted data from the slaves appearing on the transmit pins of the slaves. All the slaves receive the same data from the master and decode it if necessary. Limit Switches: The Ocean Controls Serial Stepper Motor Controller provides inputs for limit switches for each motor on the board. The inputs have internal pull-up resistors so only require a connection to ground to assert the input. Multiple limit switches can be used on each motor, provided they are wired in parallel (normally open switches must be used). See Figure 4 for wiring detail. When the limiting input is asserted the associated motor stops, and while it is asserted the motor will only perform a single step, for any further command issued. This allows the motor to be backed off the limit switch one step at a time. Limit switch wiring Acceleration Detail: Each time the command to move a stepper motor is issued the Ocean Controls Serial Stepper Motor Controller calculates the stepping times to give a gradual acceleration and deceleration. The acceleration and final speed is determined by the ACCN, ACCI and RATE parameters. These default to 50, 2 and 10 respectively and are changeable by issuing the appropriate command. See the section titled High Speed Version on page 6 to see how these Parameters relate to speed. The motor will start stepping at one step every ACCN interval, decrease this by ACCI intervals every step until the interval is RATE. When the motor is approaching the final position the step interval will increase by ACCI intervals from RATE until the final position is reached, at which point the interval will be back at ACCN. ACCN ACCN - ACCI ACCN - 2 x ACCI RATE + ACCI RATE 50 48 46 12 10 10 10 10 12 46 48 50 RATE RATE + ACCI ACCN - 2 x ACCI ACCN - ACCI ACCN Step Timing New Acceleration: Nov 06 An alternate acceleration curve can activated by using the ACCF command with parameter 1. In this mode the motor starts one step at ACCN, then two steps at ACCN-ACCI, four at ACCN-2xACCI, eight at ACCN-3xACCI etc until RATE is reached. This can be used to reduce the effects of the non-linearity of the normal acceleration. This mode of acceleration will take 2^[(ACCN-RATE)/ACCI] steps to reach top speed. Deceleration is done in the same manner. Page 4 of 8

Assembly & Testing: Start by soldering the resistors and diodes and then the capacitors and crystal. Next add the IC sockets, voltage regulator and DIP switch. Finally add the terminals and 9 pin D connectors, noting the placement of the male and female connectors. If you are going to gang two or more controller boards together you will need to unscrew the screw connectors on the right hand side of all the D9 connectors. This will allow the connectors to mate when pushed together. To test the controller, connect power to the relevant terminals and measure the voltage across pins 10 and 20 of the socket for the 74HC245, ensuring that it is 5V. If this is ok remove the power and insert the microcontroller, max232 and 74HC245 IC s. Reconnect power and connect the board to the computer using an RS232 cable. Set the DIP switches so they address from 01 to 04 (both off) and then run a terminal program at 9600 baud and type @01 STAT. This should return #01 0 if the kit is working properly and nothing else is connected. If you have an oscilloscope you can give a move command such as @01 RMOV 1000 and view the pulses at terminal S1 on the oscilloscope, if you don t, connect a driver board to the S1, D1 and COM terminals and connect a stepper motor to the driver board. Giving a move command should now move the motor! New Commands: Jan 06 Three new commands have been added as of January 2006, these are the DRON, DROF and DRST commands. The DRON command will turn on the direction output for a set time, or turn it on until the DROF command is received. This can be used to turn a relay on for a set time or as a digital output if the connection is not being used for a motor. The DROF command turns the output off. The DRST command returns the time remaining that the output to be on for, or -1 if the output is on permanently. New Commands: Nov 06 The Option, Acceleration Factor and Save commands have been added. Turning the Acceleration Factor on with ACCF and parameter 1 will make the controller use the alternate acceleration curve which is described in New Acceleration on page 4. The SAVE command has been added so that the RATE, ACCI, ACCN, ACCF and OPTN parameters are saved to the controllers EEPROM. The parameters will be loaded automatically the next time the unit is powered up. @01 SAVE saves the parameters for motors 1-4. Option Command: Nov 06 The option command is used to turn the Verbose and Checksum modes on. @01 OPTN 1 will turn Verbose mode on and Checksum mode off. @01 OPTN 2 will turn Checksum mode on Verbose mode off. @01 OPTN 3 will turn both Verbose and Checksum modes on. Turning the Verbose mode on will cause the SSMC to transmit!aa (where AA is the address of the last motor to stop turning) when the last motor has reached its target position through an RMOV or AMOV command, or hit the limit switch during a move. With Checksum mode on the controller will ignore commands unless a XOR checksum byte follows the command immediately after the Carriage Return. The XOR is performed on all the bytes of the command, including the @ and CR. Eg. The checksum for the command @01 RMOV 100 will be (64 xor 48 xor 49 xor 32 xor 82 xor 77 xor 79 xor 86 xor 32 xor 49 xor 48 xor 48 xor 13) = 123 which is the { character. This is generally only useful if you have high level language controlling the SSMC, but not if you are typing the commands as you go. Note also, there must not be a Line Feed character between the Carriage Return character and Checksum character. It may be handy to know that the checksum for the @01 OPTN 0 command is the O character. In case you accidentally turn it on. High Speed Version: Nov 08 As of November 2008 the Serial Stepper Motor Controller has been upgraded to allow for a higher stepping rate. Kits sold between Nov 06 and Nov 08 had a top speed of 0.159mS/step or 6.3KHz, kits sold before Nov 06 had a top speed of 1mS/step or 1kHz. Version 4.2 controllers have a top speed of 0.034mS/step or approx 29.5KHz. The step rate can be calculated from: t n 20.3n 13.6 us And the frequency can be calculated from: 1 10 f Hz Where n= the parameter value for RATE, ACCI, ACCN etc. The graph on page 7 can be used to quickly choose the rate for a desired operating frequency. n t n 6 Page 5 of 8

Relays: Aug 08 For Version 4 (OC-SSV4 PCB) of the SSMC two relays have been added to the board. These relays are single pole single throw (SPST) and rated to 10A at 30VDC or 277VAC but the PCB tracks can only handle about 5A. The relays can be used to control high voltage (up to 277VAC) and current (up to 5A) devices directly. The consequence of this modification is that K3, the Male D9 connector has been replaced with IDC pins and if you want to control more than 4 motors you need to use an extra IDC to D9 male cable to connect to more SSMC units. The SSMC is available as 12V or 24V powered KTA-190 is the 12V version and KTB-190 is the 24V version. Baud Command Detail: Nov 09 Firmware version 4.3 now allows the baud rate the KTA-190 communicates at to be changed. This is done using the BAUD command and parameter from Table 4. @01 BAUD 9 will set the baud rate to 115200, this must be followed by a save ( @01 SAVE ) command, the baud rate will change on the next power up of the controller. If the baud rate is accidentally changed to an unknown value the default baud rate can be used by connecting the pin labelled 18 on the K1 connector to the pin opposite it (COM) while the controller is being powered up. Table 4 - Baud Rates Parameter Baud Parameter Baud Rate Rate 1 2400 6 28800 2 4800 7 38400 3 9600 8 57600 4 14400 9 115200 5 19200 Default 9600 K1 5V ICSP 17 1 19 18 Make Connection here for default Baud Rate Override Example program: An example visual basic program with source code for controlling four motors is available on the Ocean Controls website http://www.oceancontrols.com.au/motor_controller/vb_serialstepper.zip and can easily be expanded for control of 16 motors and virtually any application. Step Timing: The SSMC produces pulses of at least 10μS in length and if a direction signal is used it is activated at least 10μS before the first pulse begins. STEP t s t n DIR t d t d > 10μS t s > 10μS t n > 34μS PCB Revision Notes: V1.01 PCB - DIP Switch ON goes toward edge of board V1.02 PCB - DIP Switch ON goes toward terminal block OC-SSV3 PCB - DIP Switch ON as marked on PCB, 5V Output Added OC-SSV4 PCB - Male D9 connector replaced with IDC connector, 2 SPST Relays Added The Serial Stepper Motor Controller was developed by Ocean Controls Visit www.oceancontrols.com.au for current pricing and purchasing. Ordering Guide: KTA-190 A: 12VDC Powered B: 24VDC Powered Page 6 of 8

Frequency (Hz) KTA-190 Serial Stepper Motor Controller V4.3 Frequency Vs Rate Graph: This graph can be used to quickly estimate the RATE parameters required for a desired stepping frequency. 100000 10000 1000 100 10 1 Frequency Vs Rate 1 10 100 1000 10000 Rate Page 7 of 8

Circuit: Note: V3 Circuit shown, V4 Contains 2 x SPST Relays Page 8 of 8