rt-stepper

with EMC2

External Reference Specification (ERS)

Table of contents

1 Purpose

The purpose of this document is to present a description of what the rt-stepper product is and how it is used. This description is intended to define what the product controls, human interface, machine interface and how to use the product.

This document is provided "AS IS" without warranties of any kind including warranties of merchantability, fitness for a particular purpose, or non-infringement of intellectual property.

2 Introduction

The rt-stepper USB-to-Parallel dongle is a special dongle designed specifically for CNC controllers. This dongle provides CNC parallel port support and real time stepper motor control. You can use this dongle to convert a parallel port CNC controller into a USB CNC controller.

Most CNC controllers are designed to be driven with a PC parallel port. Unfortunately parallel ports are a thing of the past and many new PCs have no parallel port. Commercial USB-to-Parallel dongles do exist, but these dongles are designed for printers not CNC controllers. CNC controllers require XYZ step/direction signals. With the rt-stepper dongle you can now drive XYZ step/direction signals over the USB bus.

The rt-stepper software is used to drive the dongle over the USB bus. This software is open source similar to the EMC2 open source project at www.linuxcnc.org. Both projects are separate PC applications that interpret gcode and drive CNC controllers. Instead of re-inventing another gcode interpreter the rt-stepper software is based on the EMC2 software from www.linuxcnc.org. By re-purposing the EMC2 software the rt-stepper software provides - 4-axis support, complete gcode interpreter, trajectory planner, GUI front-end and Backploting.

Note through out the rest of this document the term "EMC2" and "EMC2 software" refers to software from the EMC2 project at www.linuxcnc.org. Both projects have separate code bases and create separate executables or binaries.

Since the rt-stepper dongle provides the real time step pulse generator this version of EMC2 has been re-factored. The EMC2 real time component has been removed. There are no kernel modules or real time kernel patch dependencies. This allows EMC2 (rtstepperemc) to run on Linux, Mac or Windows.

For those familiar with EMC2 some functionality was dropped. USB devices are different from parallel port devices. Basically the rt-stepper dongle must be treated as a buffered device in order take advantage of USB bus speed. You cannot control the device one-byte-at-time like a parallel port and expect guaranteed speed. This means a different approach must be used for USB. Step buffers must be created with known distances and trajectories before being sent over-the-wire. EMC2 code for continuous jogging, homing or probing must be re-factored or dropped. As a result only incremental jogging is supported and homing is now done via python scripts.

HAL has been removed. All configuration options are done via a *.ini file. The rcslib library dependency has been removed.

The rt-stepper software is an open source project available at www.ecklersoft.com.

2.1 Requirements

rt-stepper was created to satisfy the following requirements.

2.2 Design Goals

rt-stepper software will be based on software from the EMC2 project at www.linuxcnc.org.

The GUI will be similar to the existing EMC2 mini.tcl GUI.

Since the rt-stepper software is a single process multi-threaded design, the NML messaging protocol is not longer used.

Any EMC2 dependency on the rcslib from www.isd.mel.nist.gov/projects/rcslib has been removed.

Only USB IO will be supported. Parallel port support will be provided via the rt-stepper USB-to-parallel dongle.

All USB IO will be based on libusb. rt-stepper is designed to be used by Linux, but other OSs that support libusb will also work.

The rt-stepper software will be open source, but the dongle will be sold as a product.

GNU software tools will be used to build the source code. This includes an ANSI C compiler and POSIX compliant environment.

The tar ball will have built-in binary package support.

Device permissions and user policies should be settable independently by administrators and distributions.

The dongle will have IO support for 8-bit output and 3-bit input. Both output and input are supported by the rt-stepper software.

The dongle 8-bit output will be configurable for axis support or general digital output.

Spindle and coolant mcodes will be implemented via python scripts.

All user-defined mcodes will be implemented via python scripts.

Homing will be performed with a user-defined mcode.

2.3 License

The rt-stepper software that runs on the PC is covered by the GNU GPL 2.0 license.

Simply stated the GNU GPL license does allow the following.

What this license does NOT allow you to do is make changes or add features to rt-stepper software and then sell a binary distribution without source code. You must provide source code for any changes, or additions to the software and all code must be provided under the GPL or LGPL as appropriate.

3 Solution

4 Overview

rt-stepper consists of PC software and USB-to-parallel dongle. The dongle's USB connector connects to the PC. The dongle's DB25 connector connects to the parallel port of the CNC controller.

The rt-stepper software is based on the EMC2 open source project at www.linuxcnc.org. Note both projects are seperate software applications and the dongle will only run on the rt-stepper software. With the rt-stepper software there is only one process that runs on the PC - TkMini. TkMini is a GUI front-end program that communicates directly to the dongle. This single process performs the gcode translation, trajectory planning and rt-stepper IO. TkMini generates the step pulses, but step timing is maintained by dongle thus eliminating the need for a real time kernel.

The software will interpret the gcode file, covert the gcode instructions into a series of step buffers. Each step buffer is sent over the USB 1.1 bus to the dongle. The dongle then clocks each step byte out over the parallel port at precise step intervals. Each step byte drives the step/direction pins on the CNC controller parallel port.

Both manual and auto CNC operations are supported by the software.

5 CNC Program Codes

The rt-stepper software supports the same gcode interpreter as EMC2. See the "Gcode Overview" section at www.linuxcnc.org for program syntax, parameters, expressions, binary operators, functions and looping constructs.

Mcodes are handled differently the rt-stepper software. Most mcodes are now implemented with python scripts. This means spindle, coolant and homing are now executed via python scripts. Tool Change codes are currently ignored.

Notes on some codes:

Perfect circles can be made with the circular interpolation codes G02 or G03 using the R radius word. Generally this is done with two commands, one command for each half of the circle. Here is an gcode example that cuts a one inch circle at the origin.

G0 X0.5                    (rapid to 0 degree point on circle)
G1 Z-0.035 F6              (plunge)
G3 X-0.5 Y0 R0.5 F6        (cut arc to 180 degree point on circle)
G3 X0.5 Y0 R0.5 F6         (cut arc to 0 degree point on circle)
Of coarse in this example a perfect circle will require accurate XY backlash values in the ini file. I repeat perfect circles require accurate backlash values!

6 Configuration File

A configuration file will be used to set rt-stepper runtime options. By default the rtstepper.ini file is used as the configuration file. You can also specify a custom ini file on the TkMini command line. Be sure to specify the full path to the custom ini file or TkMini may not find it.
tkmini -ini rtstepper.ini

The ini file is a simple ASCII text file that must be customized for each unique CNC controller. Use any text editor to customize the ini file. Multiple ini files can be used for different CNC controllers.

The ini file is divided into different sections and key/value pairs. Sections are defined by brackets "[ ]" and key/value pairs are defined by the "=" character. Comment lines start with the "#" character.

Different digital output configurations can be defined in the ini file. DB25 pins 2-9 can be assigned to different output signals. The following examples show how 8 digital outputs can be configured for different CNC applications.

The rest of this section define some common configuration options and their default values. Generally only these options need to be modified by the user.

6.1 EMC section

[EMC]
MACHINE = TkMini (rtstepper.ini)
Sets the title in the UI application. Useful for identifying what ini file is loaded.

6.2 DISPLAY section

[DISPLAY]
PROGRAM_PREFIX = /etc/rtstepperemc
Sets the default path to gcode and mcode files.

6.3 TRAJ section

[TRAJ]
DEFAULT_VELOCITY =      0.2
MAX_VELOCITY =         400
DEFAULT_ACCELERATION =  200
MAX_ACCELERATION =      400
Sets the trajectory planner default velocity and acceleration in engineering units. In the above example this would be 0.2 inches/second or 12 inches/minute (12 = 0.2 * 60). This sets the trajectory planner overall acceleration and velocity then each axis can be fine tuned individually in the AXIS section.

6.4 AXIS section

[AXIX_n]
MAX_VELOCITY = 0.15
BACKLASH = 0.0
INPUT_SCALE = 32000
STEP_PIN = 2
DIRECTION_PIN = 3
STEP_ACTIVE_HIGH = 0
DIRECTION_ACTIVE_HIGH = 0
There is a AXIS section for each axis (AXIS_0 - AXIS_3).

MAX_VELOCITY specifies the max velocity for this axis. In the example this would be 0.15 inches/second.

BACKLASH is the amount of backlash or "play" in your XYZ lead screw. Start with zero then after tuning your CNC system, measure your backlash and enter the values here. Note, backlash compensation is a poor substitute for good lead screws. Excessive backlash can "throw" the table, causing inaccurate cuts and or broken tool.

INPUT_SCALE define the stepper motor steps/inch for this axis. This is a function of your motor, lead screw and CNC controller. Metric values can be used here instead of inch.

Here are some notes on how to calculate the INPUT_SCALE for a Sherline mill using the using a Xylotex 3-axis CNC controller and 269 oz.in steppers.

1.8 = degrees/step
360 / 1.8 = 200 steps/revolution
.050 = one revolution of the lead screw
200 / .050 = 4000 steps/inch full steps

Since the Xylotex CNC controller board is set to 1/8 stepping.

4000 * 8 = 32000 steps/inch = INPUT_SCALE

STEP_PIN specifies the step pin on the DB25 connector for this axis.

DIRECTION_PIN specifies the direction pin on the DB25 connector for this axis.

STEP_ACTIVE_HIGH specifies the polarity of the step signal (0 = active_low, 1 = active_high).

DIRECTION_ACTIVE_HIGH specifies the polarity of the direction signal (0 = active_low, 1 = active_high).

The default values for step/direction pins will work for many commercial CNC controller boards. Note, the dongle supports 8 digital output signals on DB25 connector pins 2, 3, 4, 5, 6, 7, 8 and 9. Your CNC controller MUST be built to use these pins, most commercial boards are.

6.5 TASK section

[TASK]
INPUT0_ABORT = 0
INPUT1_ABORT = 0
INPUT2_ABORT = 0
Use the "INPUTx_ABORT" option to automatically trigger a un-synchronized estop. Any "INPUTx_ABORT" option can be used to enable a estop. Generally the input signals are used for limit switches. See the Limit Switches section for wiring details.

When "INPUTx_ABORT=0" the INPUTx signal is ignored. This is the default.

When "INPUTx_ABORT=1" an "active high" transition on the INPUTx pin will cause a un-synchronized estop.

OUTPUT0_PIN = 0
OUTPUT1_PIN = 0
OUTPUT2_PIN = 0
OUTPUT3_PIN = 0
OUTPUT4_PIN = 0
OUTPUT5_PIN = 0
OUTPUT6_PIN = 0
OUTPUT7_PIN = 0
Use the "OUTPUTx_PIN" option to enable a general digital output signal. The signal can be used for turning spindle or coolant on/off. Each "OUTPUTx_PIN" specifies a DB25 pin number. IMPORT!! The pin number MUST be an unused axis step/direction pin. This means the same pin number can NOT be used in [AXIS_n] section.

When "OUTPUTx_PIN" = 0 the OUTPUTx signal is unused. This is the default.

7 Screens

The above screen is an example of TkMini running on Linux. The Backplot example shows the CNC path used to create the dongle case.

The above screen an example of TkMini running on Windows XP. The Backplot example shows a 3D view of the CNC path used to create the dongle PCB.

The above screen an example of TkMini running on Mac OSX 10.6. The Backplot example shows a 2D XY view of the CNC path used to create the dongle PCB.

8 Error logging

Any errors during rt-stepper program execution are written to a local milltask.log file. The log file will always have more specific error information than the TkMini display. Use a text editor to view the log file.

The log file is automatically created in the user home directory. For example the log file for Linux and OSX would be "~/.rtstepperemc/milltask.log". For Windows it would be "c:\Documents and setting\usr_name\.rtstepperemc\milltask.log". Error logging is always enabled and should be referenced before asking for help.

9 Dependencies

10 OS Support

rt-stepper is designed to be used by Linux, Mac and Windows. All though not a complete list the following OSs have be tested.

11 Software Installation

The best way to install the rt-stepper software is with a pre-build binary package. Pre-build binary packages are available at www.ecklersoft.com/download. Installing from source code is an option, but should only be attempted by an experienced programmer or administrator.

11.1 Windows Install

For Windows use the following steps to install rt-stepper. The instructions have been tested on Windows XP. Instructions for Windows 7 would be similar.
  1. Download and install the 32-bit ActiveTcl 8.5 for Windows (ie: ActiveTcl 8.5.x.x) at www.activestate.com. Do not use ActiveTcl 8.6 or higher.
  2. Download the latest rtstepperemc_win32 zip file from www.ecklersoft.com/download. The following screen shot shows the zip file stored in the top directory of your C: drive.

  3. Unzip rtstepperemc_win32 by right clicking on the zip file, then click on "Extract All...".

  4. With the Extraction Wizard click the Next button.

  5. Using the default destination directory click on the Next button.

  6. After the extraction is complete, you can un-click "Show extracted files", then click Finish.

  7. At this point you should be able to run "tkmini.tcl" by double clicking on it. This should start TkMini application.

  8. With no dongle plugged in, TkMini should have displayed the message "unable to connect to the rt-stepper dongle". You can go ahead and exit out of TkMini for now.
  9. Now it is time to install the rt-stepper USB driver. Plug-in a USB cable from the PC to the rt-stepper dongle. This should pop up the "Found New Hardware Wizard". We want to manually select our own driver so select "No, not this time", then click Next.

  10. Select "Install from a list or specific location", the click Next.

  11. Make the selections as shown in the following screen shot, using the Browse button select the directory you created after unziping the zip file in step 7. In the example the directory was "c:\rtstepperemc_win32-1.8-0\rtstepperemc_win32-1.8-0". Now click Next.

  12. Ignore the following "not passed Windows Logo testing" message and continue with the installation by clicking Continue Anyway.

  13. Once the driver is installed you should get the following completion dialog, click the Finish button.

  14. Disable any power save options that will cause the PC to shutdown during CNC operation.
  15. Now you can re-run step 7 and there should now be no "unable to connect to the rt-stepper dongle" message.
  16. You are now ready to proceed with the Power Up section.

11.2 Linux Install

For Linux use the following instructions to install rt-stepper. The instructions have been tested on Fedora and Ubuntu.
  1. Download the latest rt-stepper rpm or deb package from www.ecklersoft.com/download.
  2. Install the binary package. Note the software version number will be the same or higher.
    for Fedora:
    rpm -ivh rtstepperemc-1.7.1-0-x86_32.rpm
    
    for Ubuntu:
    dpkg -i rtstepperemc-1.7.1-0-x86_32.deb
    
  3. At this point you should be able to run "tkmini" from the command line. This should start the TkMini application.
  4. With no dongle plugged in, TkMini should have displayed the message "unable to connect to the rt-stepper dongle". You can go ahead and exit out of TkMini for now.
  5. Plug-in a USB cable from the PC to the rt-stepper dongle.
  6. Disable any power save options that will cause the PC to shutdown during CNC operation.
  7. Now you can run "tkmini" and there should be no "unable to connect to the rt-stepper dongle" message.
  8. You are now ready to proceed with the Power Up section.

11.3 Mac OSX Install

For Mac OSX use the following instructions to install rt-stepper. The instructions have been tested on OSX 10.6 and 10.9.
  1. Download the latest rt-stepper dmg disk image from www.ecklersoft.com/download. Note the disk image software version number will be the same or higher.
  2. Double clicking on the dmg file will automatically mount and popup the following file folder screen. You can use the icons from the disk image or you can drag-and-drop them into a folder on your hard drive. In order to modify the rtstepper.ini file you must drag-and-drop all four icons into a folder on your hard drive.
  3. At this point you can run "tkmini" by clicking on the icon.
  4. With no dongle plugged in, TkMini should have displayed the message "unable to connect to the rt-stepper dongle". You can go ahead and exit out of TkMini for now.
  5. Plug-in a USB cable from the PC to the rt-stepper dongle.
  6. Disable any power save options that will cause the PC to shutdown during CNC operation.
  7. Now you can run "tkmini" and there should be no "unable to connect to the rt-stepper dongle" message.
  8. You are now ready to proceed with the Power Up section.

11.4 Source Code Install

Use this section as a reference for building and installing rt-stepper from source code. WARNING the instructions may not be complete and vary by OS and release. There are a few build time dependencies that are needed in order to build a binary from source code. An experienced programmer should have no problem building from source code since many of the original EMC2 dependencies have been removed.

For Linux use the following steps to build and install rt-stepper.

  1. Download and untar the latest rt-stepper tar ball.
  2. In the rt-stepper directory build and install rt-stepper.
    ./configure
    make
    make install
    
  3. At this point you can follow the Linux install instructions in the previous Binary Install section.
For Mac OSX 1.6 through 1.9 use the following steps to build and install rt-stepper.
  1. Download install xcode to get the GNU tools.
  2. Download install macports at www.macports.org
  3. Install libusb.
    sudo port install libusb-compat
    
  4. Download and untar the latest rt-stepper tar ball.
  5. In the rt-stepper directory build and install rt-stepper.
     ./configure --prefix=/opt/local LDFLAGS=-L/opt/local/lib CFLAGS=-I/opt/local/include CXXFLAGS=-I/opt/local/include
    make
    make dmg
    
  6. At this point you can follow the Mac OSX install instructions in the previous Binary Install section.
Building and installing for Windows XP is a two step process. First build a win32 rt-stepper zip package on Fedora 13 then install the package on Windows. After installing rt-stepper can be run totally from the zip directory. The following steps outline this procedure.
  1. On Fedora 13 install mingw. Mingw is a win32 cross-compiler tool chain. More information about mingw is available at www.mingw.org.
    yum install mingw32-*
    
  2. Copy the following libusb-winusb files to the mingw32 directories. Libusb-winusb is based on Microsoft's winusb user mode driver. The libusb-winusb files are available in the binary download.
    cp libusb-winusb.a /usr/i686-pc-mingw32/sys-root/mingw/lib/
    cp usb.h /usr/i686-pc-mingw32/sys-root/mingw/include/
    cp libusb-winusb.dll /usr/i686-pc-mingw32/sys-root/mingw/bin/
    
  3. Download and untar the latest rt-stepper tar ball.
  4. In the rt-stepper directory build the rt-stepper zip package.
    ./configure --host i686-pc-mingw32
    make
    make zip
    
  5. Now transfer the rt-stepper zip package to the Windows XP PC.
  6. Choose a directory location to run the rt-stepper program(s) from. Unzip the rt-stepper package into this directory.
  7. For TkMini download and install the 32-bit ActiveTcl 8.5 for Windows (ie: ActiveTcl 8.5.x.x) at www.activestate.com. Do not use ActiveTcl 8.6 or higher.
  8. Plug-in a USB cable from the PC to the rt-stepper dongle.
  9. When Windows asks for a new hardware driver, manually choose the rt-stepper.inf file. Ignore any not "digitally signed" messages and continue with the installation.
  10. Windows should now recognize the dongle's USB device vid, pid and serial number at plug-and-play time.
  11. Disable any power save options that will cause the PC to shutdown during CNC operation.
  12. rt-stepper is now ready to run. Run "tkmini.tcl" from the zip directory.

12 Power Up

The rt-stepper dongle is powered from the USB bus on the PC, no external power supply is required. Since the CNC controller has a separate power supply the following power up sequence must be used.
  1. Power up the PC.
  2. If not already connected, plug the dongle into the PC via the USB cable.
  3. After the kernel enumerates the USB device check the dongle's green LED.
    The LED should be on solid (no blinking). 
    
  4. Power up the CNC controller.
Use the reverse order for the power down sequence.

13 Testing

Before we can start CNC stepping the motors we must verify the USB subsystem with the rt-test program. rt-test is part of the rt-stepper package.

IMPORT!! The rt-test program must be performed with no CNC controller connected to the dongle.

rt-test will verify that your USB subsystem on your PC can drive the rt-stepper dongle. Run "rt-test" from the command line and the following checks will be made.

  1. USB device enumeration.
  2. Device permissions.
  3. Start a 65K byte bulk write transfer.
  4. Wait for transfer complete.
  5. Print pass or fail.
Run rt-test several times, if rt-test passes every time proceed to the Tuning section.

14 Tuning

Note if your CNC system matches a pre-configured rt-stepper *.ini file, then this tuning procedure may not be necessary. See the sample *.ini files at www.ecklersoft.com/download.

Before we can cut any real parts we must tune rt-stepper with the CNC system. At this point the INPUT_SCALE values, see the Configuration File section, should be correct for your CNC controller.

Since rt-stepper has it's own real-time clock, tuning is very simple. All we have to determine is the MAX_VELOCITY for each axis on the CNC system. Then update the ini file with the new values.

The MAX_VELOCITY is the max speed the stepper motors can operate at. Stepper motors will go out of sync if they are accelerated or decelerated too suddenly. This is because the magnetic fields are advancing faster than the rotor can keep up. Once a motor is out of synchronization further CNC stepping is useless as the position of that axis has been lost.

For tuning purposes the measured MAX_VELOCITY should be less than the current MAX_VELOCITY values in the ini file. The initial values in the default ini file should be a good starting point for tuning.

The MAX_VELOCITY is a very important control variable and can be used for the following functions.

  1. Set rapid limit in TkMini.
  2. Set the max feed rate in the gcode file.
MAX_VELOCITY must be measured for each axis. Here is the procedure for measuring each axis.
  1. Run TkMini.
  2. Set the default max velocity by clicking the Rapid button.
  3. Jog the axis 1 inch.
  4. If the motor chatters or does not move at all reduce Speed with the slider and repeat step 1.
  5. Measure the distance moved, if not 1 inch reduce Speed and repeat step 1.
  6. Done, the resulting Speed is your measured MAX_VELOCITY, set MAX_VELOCITY = (Speed / 60) in the ini file.
Generally the measured MAX_VELOCITY is a function of your CNC controller board and stepper motors not rt-stepper. If your measured MAX_VELOCITY is not acceptable try reducing your steps/inch on your controller board. If you change your steps/inch remember to change the INPUT_SCALE in the ini file.

When tuning is complete you are ready to start cutting parts.

15 Limit Switches

Depending on the CNC system limit switches are optional. If exceeding the XYZ physical limits can cause physical damage to your CNC system then limit switches are NOT optional.

The rt-stepper dongle supports three "active high" input signals called INPUT0, INPUT1 and INPUT2. Although any of the three input signals can be used for limit switches, the following example uses INPUT0. INPUT0 signal is hard wired to the DB25 connector pin 10. Multiple switches are wired in-series as normally closed switches connected to CNC ground.

This configuration frees up INPUT1-2 for other uses and provides simple in-series cable wiring. Note, "active high" digital input signals means broken wires will be detected immediately.

INPUT0-2 have a internal pull up resistors so no external power or pull up resistor is required. INPUT0-2 use a Schmitt Trigger input buffer for noise immunity, but care should still be taken with the switch wiring. Do NOT route switch wires near power wires.

INPUT0-2 can be used to signal an un-synchronized estop of the current CNC controller move. This functionality can be enabled via the ini file. See the "INPUTx_ABORT" option in the Configuration File section.

Note the "input0-2_abort" option has a small amount of software overhead so the abort sequence in not immediate. Depending on how fast your PC is, some extra steps may be executed after a switch has been tripped. The number of extra steps will be feed rate dependent. Switches should be chosen that can handle any extra steps without being damaged.

16 Python Scripts

Starting with rtstepperemc release 2.0 most mcodes are now supported via python scripts. The python interpreter comes from the tinypy project at www.tinypy.org and is built into the rtstepperemc library. Tinypy is a minimalist implementation of python. Python is a simple programming language that allow users to make their own custom changes without having to recompile the software.

What can you do with python a script? Scripts can perform the same functions as the GUI (tkmini) provides in Manual mode. This includes jogging, spindle on/off and coolant on/off. A good python script example that exercises most functionality is the homing script m190.py.

Python scripts that execute spindle and coolant mcodes are included with the rtstepperemc software. Users can specify in the python script which digital output signal will be used. Here is the python script file for turning the spindle on.

#
# m3.py - m3 mcode script turns spindle on clockwise.
# 
# inputs:
#  path = ARGV[0]   # this python file name
#  rpm  = ARGV[1]   # S parameter (spindle speed)
#
# returns:
#  emc.h result code
#
# example:
#  m3 s250.0
#
import rtstepper

def main():
    return rtstepper.dout(rtstepper.OUTPUT6, True)

return main()

This script will set the digital output bit OUTPUT6 true. The DB25 pin assignment for OUTPUT6 would be defined in the ini file. See the "OUTPUTx_PIN" option in the [TASK] section. A similar python script file (m5.py) would turn the spindle off.

17 Homing

Homing is a process that moves an axis to a known position. Usually this is done with limit switches or in some cases separate homing switches. Homing is especially useful when your CNC system has no dials on each axis. However, different machines have different requirements and homing can be quite complicated.

The rtstepperemc software supports homing with user-defined mcodes. User-defined mcodes are M100-199 and all user-defined mcodes are implemented via python scripts. Included with the rtstepperemc software is an example python script file that implements the user-defined mcode M190 (m190.py). This is simple script file will home a specified axis. The user will need to customize the script for their CNC application. M190 can be executed as a MDI command or from a gcode file.

M190 P0 Q0 (use INPUT0 for estop, home x-axis)
M190 P0 Q1 (use INPUT0 for estop, home y-axis)
M190 P0 Q2 (use INPUT0 for estop, home z-axis)
The script was tested on a Sherline CNC system and proved to be very accurate using an optical switch. Note, when running the script from a gcode file the M190 mcode cannot be executed inline because the estop will cancel the interp_list.

18 DB25 Connector

This figure shows the rt-stepper dongle DB25 connector pin out.

19 CNC/CAD/CAM Support

All though not a complete list the following publicly available CAD/CAM packages and CNC controllers have be tested.

CAD/CAM support

CNC controller support

20 Third-party Support

All the motion control software is in the rtstepperemc shared library. The current GUI is written in TCL/TK and makes calls to the library through a "C" API.
One can replace the GUI in the software stack with a third-party or custom application. In the source code download there a simple "C" code example (pytest.c) that shows how to load the shared library and call the APIs. Pytest is a command line program that can be used to execute MDI commands and gcode files.

21 Specifications

Step resolution: 46,875 hz
Standards: USB V1.1, USB V2.0 Compliant
USB Speed: Full Speed (12 Mb/s)
VID: 0x04d8
PID: 0xff45
Power: Bus Power Only (~5v)
Indicators: Power
Overall Dimensions: 2.6 in.(L) x 2.35 in.(W) x 0.95 in.(H)
Weight: 2.3 oz.
© 2009-2014 Eckler Software

Last updated May 12, 2014