W-EDM TESTWARE for DOS Version 1.0
by B.J.Rao 
Amsterdam, Netherlands
Copyright 2001-2008 by Proved By Practice Publications

Please read License Agreement and Disclaimer before using this software.

Contents:

  1. Program Overview
  2. Requirements
  3. Software Installation & Start Up
  4. Machine Setup
  5. Input Test
  6. Machine Task 
  7. G-codes & Programming
  8. System Setup
  9. Source Code

1.Program Overview:

The function of this software is to test the workings of the constructed     W-EDM setup described in the "DeskTop Engineering Project W-EDM" manual. The software controls and regulates the Wire-EDM machining process while executing a G-code file machine task. The G-code file can be written in most any text editor and linked to the software for subsequent execution. The design directive of the software is to provide the user with a very basic yet usefull G-code interpreter tool for the development of the EDM machine process. The program is equipped with all basic machine setup features and can be employed towards most any two axis machine setup that accepts step and direction signals. The software allows each axis more than two million absolute steps per G-code line. It includes user set pause time and retract steps features which are automatically activated based on a process feedback signal. As testware the software does not include an editor, syntax checking, graphical nor numerical simulation features. It does not incorporate much user interface luxury.  Rather it includes only what is needed to control and regulate an EDM machine task using most any older type PC. If wrong values are typed in the program may ignore them or not, without giving warning that they are in error. If any connection is not hooked up, the program may not run correctly.  

2.Requirements:

  - 386, 486, 586 type Processors up to 166MHz
  - DOS 6.2 and above (older versions not tested)
  - 2MB of Memory
  - 60 KB Hard Disk Space (excludes MPG file space)
  - 3.5 Inch Floppy Disk Drive
  - Standard Parallel Port 

The software was complied and tested on a 486 33 MHz for use on older type    systems running on the DOS platform. Machine tasks should not be executed     under Windows as results may be unpredictable. This also applies to       faster type PC's above 166 MHz.    

3.Software Installation & Start Up:

The 3.5 Inch floppy disc should include the following files:
  - WEDMTWV1.EXE       (main program)
  - PATH.DAT           (data file, should not be modified)
  - PROCESS.DAT        (data file, should not be modified)
  - MACHINE.DAT        (data file, should not be modified) 
  - TASKS              (directory, which includes file: PROFILE.CNC)
  - 4FASTPC.EXE        (for use on PC's faster than 166 MHz, not tested)
  - License Agreement
  - Disclaimer 
  - Sparks4U.MPG       (10 sec scene of machine operation. May be freely                             distributed) 

Under Windows 95:
Copy all contents to a desired directory. Restart computer in DOS mode by going to Start > Shut Down > Restart in DOS. Once in DOS the prompt should read

C:\Windows

type

C:..

press Enter, the result should read 

C:\

at the prompt type 
  
CD 

leave a space, add directory name, which includes all of the copied files, and press Enter. The result should read

C:\yourdirectory\

Type

Dir 

Press Enter. A list should appear that includes all of the copied files. At   the prompt type 

WEDMTWV1.EXE

press Enter. The program should now start.

Under Dos:
Create a directory under a desired name by typing the following after the     prompt

C:\MD

leave a space and type in the directory name. Press Enter. The prompt       returns indicating that the directory has been created. At the prompt type
 
A: 

Press Enter. The floppy disc drive should now be ready. Type 

copy

Leave a space. Type

*.*

Leave a space. Type
 
C:\yourdirectory\

Press Enter. The prompt should now return and indicate all copied files. Type

CD

leave a space, type

C:\yourdirectory\

Press Enter. The result should read

C:\yourdirectory\

Type
 
Dir 

Press Enter. A list should appear that includes all of the copied files. At   the prompt type 

WEDMTWV1.EXE

press Enter. The program should now start. 

All parameters in the program have already been set to default values, which  correspond to the machine setup described in the manual.

4.Machine Setup:

Machine setup allows the user to set primary machine values and         configuration. 

Parallel Port:
It is advised to use a separate parallel port card that is not part of the computer mother board. In case wrong connections or errors are made this will leave less chance that the mother board is permanently damaged. The parallel port card should be configured to standard parallel port and default set to address LPT2 278. No other device should be attached to this card. Do not select a port that is in use with another device.    

Unit:
The program allows the selection and use of either Metric or English Units.   Metric unit is in millimeters. English unit is in Inches. Note: all previously set values are automatically converted when units are changed. This does not apply to the G-code values.

Lead Screw Pitch:
This represents the axial length between the lead screw thread. This needs to be precisely determined. Default is set to 1.25mm (M8 thread). 

Step Angle:
The stepper motor step angle must be listed in degrees. Default is 1.8 Degrees.

Max Feed Rate:
The maximum feed rate needs to be determined in the Jog Tool function but     for initial testing the value should reside around 120 step per second.       Maximum rate should be at least 25% less than stall rate of the motor. This will prevent lost steps due to rapid direction changes and/or fluctuating     friction force in the drive system. Software does not include acceleration criteria as motor rotation speeds and feed forces are normally low.

Backlash:
This represents the axial play between nut and lead screw thread. This        needs to be precisely determined and entered. Usually backlash is insignificant due to the mechanical design and may remain at zero. 

Step Mode:
The step mode depends on the stepper motor driver settings. When driver is    set to half step, for instance, then the software should also be set to       this. NEMA 23 sized, 1.8 degree motors should be set to Half Step mode       while NEMA 17, 0.9 or 1.8 degree step motors should be set for Full Step.     Note: only the most powerful motors in the NEMA 17 class should be used      for this project.   

5.Input Test:

This feature allows all input switches to be tested. The initial state of     the switch (off or on) is not registered. Detection of opening or closing     of a switch is registered. A listing at which pin switching occurred and what it must represent is then displayed. The feedback signal can also be sensed and this will allow it to be properly set.    

6.Machine Task:

This field allows certain process values to be set and the linking of the     G-code to the program.

Machine Task File:

Link Task File:
This field allows the user to list the name of the G-code file that is to     be linked to the program for subsequent execution. It must include the       full name plus extension. The file must be a text file written in a text      editor. However the extension can be, for instance, .CNC or .TXT. 

Change Path:
This represents the path that leads to the "task file" directory.     

Go to Editor:
This allows the user to stop the program and go to the OS editor. It may not work on all systems.

Jog Tool:

This function allows X and Y axis positioning of the tool and can be used     to determine the maximum feed rate of the X and the Y motor. Note: this       function does not compensate for backlash and will not work if limit       switches are not properly connected.
  
Process Control:

Cut Feed Rate:
The cut feed rate is an important process parameter that represents the     rate at which the wire tool advances during cutting in steps per second.     In most circumstances it is set at a very low value. Note: only whole numbers are accepted.    

Pause Time:
During sparking the tool motion can be paused for a set time to allow         sufficient cutting (sparking) of the work piece. The pause time is represented in seconds and is activated by the feedback signal going low (sparking sensed). Note: only whole numbers are accepted.    

Retract Steps:
If after automatic pausing, the feedback signal remains low then the tool will automatically retract from the sparking zone along the same path that it entered it. It will do this at maximum feed rate. Directly after this it will reset back to the original position at cut feed rate and attempt to resume cutting. This feature is employed to reduce the chances of the EDM process crashing. It also allows debris to more easily exit the sparking zone. Retracting will be repeated as long as the feedback signal remains low. The maximum amount of retract steps is 1279 steps per cycle. Note: only whole numbers are accepted.    
   
Start Machine Task:

Check List:
Includes a list of machine process criteria.

Run Machine Task:
After entering this field the machine task is executed based on the     G-code file that has been linked to the program. A status report is     displayed with real time updates while the machine task is in progress. If any of the inputs are not detected or any files contain or produce errors then the task will automatically be aborted. During normal machining the process can be paused at any time by pressing the keyboard space bar. This leads to a pause menu, which includes the option to resume or abort the task, jog the tool or change process control parameters. Note: as stated in Jog Tool, backlash is not compensated in this function. In case the task is paused during the automatic pausing or retracting and process control parameters are then changed these modifications will only take effect after the cycle is completed.  

7.G-codes & Programming:

The software supports the following codes:
   - G00 Line at Max Feed Rate
   - G01 Line at Cut Feed Rate
   - G02 Arc CW
   - G03 Arc CCW
   - M02 End of Task

Syntax guideline:

   - only symbols X, Y, I, J, N, G and M symbols may be used
   - do not use fractions using a forward slash to represent distances
   - software is not case-sensitive
   - use a point not comma to create decimal
   - do not place comments in the code 

A G-code file can be created using most any text editor that can create text files. In Windows use Notepad. Save the file under a desired name and extension such as: Profile.CNC. Note: Notepad has the habit of adding a .txt extension even when files are saved without it or when adding different extensions. This can usually be removed by going to Start > Settings > Control Panel > Folder Options > View and then uncheck "Hide File Exstension". File name plus exstensions will now appear on all files. Right click on the G-code file and rename it. 

In DOS type EDIT at the C prompt. This will lead to the DOS EDIT text editor. Save a file in the same manner as stated above.   

As the software is very specific and does not include syntax checking it is important to write the G code very precisely. If wrong syntax is used it may accept this but perform unpredictable results. All code for a machine task must be incremental. The coordinate origin is always at the end of the last position of the tool. 

The sled that allows travel of the tool towards the work piece clamp represents the positive Y axis travel. The sled perpendicular to this is the X axis. Positive X axis travel is defined as tool travel towards the Y axis guideway.  

A sample code and explanation is as follows:

N10 G00 X2.5 Y5
N20 G01 Y5
N30 G01 X-3
N40 G02 X2 Y0 I1 J0
N50 G03 X0 Y0 I4 J0
N60 G01 X-5
M02

The software first determines how many lines of code there are. It then executes each line in the order that the line number indicates. N10 represents the first line (G00). Here tool displacement is 2.5 units in the positive X direction and 5 units in the positive Y direction. This results in a diagonal cut line at maximum feed rate. The next line is N20 (G01) which displaces the tool 5 units in the positive Y direction at cut feed rate. N30 (G01) is 3 units in the negative direction at cut feed rate. N40 (G02) is a clockwise arc displacement at cut feed rate. I and J represent the arc origin or center orientated from the end position of the previous line. I is analog to X and J is analog to Y. The origin here is 1 unit in the positive X axis direction a 0 unit in the Y direction. The X and Y represent the end point of the arc. This is at 2 units in the positive X direction and 0 units in the Y direction. The result is a 180 degree arc with a 1 unit radius. N50 (G03) is then implemented. This is a counter clockwise arc displacement, which produces a full circle with a radius of 8 units. N60 (G01) moves the tool 5 units in the negative X direction. M02 defines the end of the code.   

To link, for instance, this code to the program first save it as described above. Run the W-EDM TestWare program. Go to Machine Task > Machine Task File > Change Path. Enter the path to the saved G-code file. Then go to Load Task File. Enter the name of the file plus its extension. The G-code is now linked to the program and ready to be executed by going to Start Machine Task > Run Machine Task. 

8.System Setup:

The software uses the parallel port as the communications channel. The pin configuration is as follows:

  Output
  Pin 2 Step      X Axis    
  Pin 3 Direction X Axis
  Pin 4 Step      Y Axis
  Pin 5 Direction Y Axis

  Input
  Pin 10 Limit Switch  X Axis  (normally closed)
  Pin 11 Home Switch   X Axis  (normally closed)
  Pin 12 Home Switch   Y Axis  (normally closed)
  Pin 13 Limit Switch  Y Axis  (normally closed)
  Pin 15 Feedback Signal       (closed when EDM circuit is ON) 

All input pins are pulled up to 5 Volts +. Use short length parallel port cable to ensure voltage integrity.

9.Source Code

The supplied source code is written is Pascal and was compiled with Turbo Pascal v7. At the time of its creation there was no demand to provide it for public disclosure. As such, its structure and style may not conform to "easy reading". 

During the DOS periode most languages supported 'port' commands directly which allowed input/output communication with ports such as the parallel port. However, this changed with the introduction of the Microsoft Windows series. The Windows kernal no longer permitted direct access to ports. Today several 3rd party compnents have become available for windows application development. Unfortunatly, while these components do allow direct access to ports the integrity of the commands leave much to be desired when it comes to machine control. Step rate is usually limited as well as command priority (Windows interupts your commands). 

Possible solutions
- Use DOS for machine control (high integrity)
- Develop your own WDM to allow uninteruppted port access (complicated, cost)
- Use 3rd part component to allow access to ports and send commands to a micro controller which provides the machine control(many options available)    

END.
