DRO5.4 Help

Overview
The DRO program is a DOS application that interfaces to up
to four quadrature position encoders and displays movements
of the encoders on a computer screen.  When used on an 
obsolete desktop or laptop computer, it becomes a low cost 
alternative to commercial Digital ReadOut systems.  The 
program has many features found on commercial DRO systems, 
plus features not found on such systems (the Geometry 
Utilities).

The quadrature encoders are a method of converting linear 
motion into a stream of pulses, or steps.  The quadrature 
encoding method gives both a count of steps and a direction 
at the same time.  This allows the position to be computed 
by adding, or subtracting, a counter for each step.  When 
the steps are multiplied by a fixed step size calibration 
factor, the absolute position of whatever is being moved 
can be displayed on the screen.  The encoders can be direct 
linear displacement, rotary to linear displacement, or 
rotary sensing.  For some information on constructing rotary 
to linear conversion devices, see the appendix.

The primary application of this program is for machine tool 
axis position sensing.  The encoders are placed on a mill 
table, quill, or knee or on a lathe bed, cross-feed, or 
compound.  The displayed values are then the position of 
any of these axes’s as machining operations are carried out.
The program has been tested on a range of machines from a 
386-33 to a 700mHz Pentium III.  This program should be run 
on a DOS operating system.  It reads I/O devices directly 
and requires real-time response to maintain accuracy of 
the displayed values.  It has been tested on DOS 3.2 up 
to DOS 8 (Windows XP floppy boot disks).

DRO uses a configuration file to remember the settings of
the program options and the machine tool settings that 
you want to use. When the program is run for the first time
you should not have any DRO configuration files in the same
directory as the program (with a “.CFG” file type).  If 
you are upgrading from a previous version, you should delete
or rename the .CFG files.  If a .CFG file for an older DRO 
release is found, a warning message will be displayed asking 
you to not start the program with this file.

Installation

The program is distributed in a ZIP file.  Two files are 
available, one with the program executable file and one with 
the source code.  The program ZIP file can be extracted in 
to any directory.  If the high-res graphics display is going 
to be used the DRO.FON file must be in the same directory.  
If the help command is to be used the DRO.HLP file must be 
In the same directory.  The program is run from the DOS 
command line like:

  DRO <enter>

An optional configuration file can be specified on the 
command line to customize the startup, something like:

  DRO LATHE
Or
  DRO BPORT

The filetype for the configuration file should be .CFG. The 
configuration file is created with the Program Options 
command from the Main Menu. If no filename is given on the 
command line, the default filename ENCODER.CFG will be 
created the first time the program exits after being started.  
This file will then be used each time the program is started 
with no filename given.  If no configuration file is found, 
expect to see a warning message indicating a default file 
will be created.

Operation

General Operation
The program uses a full screen display with single keystroke 
commands.  Menus of available commands are displayed as the 
program runs.  The key to execute each command is 
highlighted in RED.  

Certain commands are available “all the time”.  These are 
Esc, Tab, and Home.  The “Esc” or escape key is usually in 
the upper left corner of the keyboard.  It will return back 
one menu level to a previous screen.  If an input value is 
expected, escape will cancel the input and not complete 
whatever function was in progress.  The Tab key will go 
straight to the counter display screen.  The Home key will 
go straight to the main menu.

Sound notes are played for most error conditions and as 
conformation for some operations that you commonly are 
not looking at the screen while performing.  If the sound 
is not wanted, it can be turned off in the Program Options 
screen.

Main Menu

The first screen DRO will display when started is the Main 
Menu.  

The available commands are:
* Read Encoders goes to the counter display screen.
* Zero All Encoders is the master zero command.
* Program Options command will open the Program Options 
  screen to change program related settings.
* Machine Tool Options setup is used to customize settings 
  for a particular machine tool.
* Geometry Utilities allows you compute circle, triangle, and 
  general expressions.
* Help reads and displays a help text file.
* About gives program version details.

Read Encoders 
The R command is the same as pressing the Tab key from any 
where in the program.  The counter display will be shown and 
encoder movements will count up or down the counters.  The 
counter display is either a character display or a graphic 
display.  The graphic display has larger characters that are
easier to read, but consumes more compute power and may be 
too slow on very old PC hardware. If you are not using 
interrupt interface hardware, the graphic display is not 
available.
	
Both displays show the same data, just different character 
sizes.  The first line shows a name assigned to this machine, 
myMachine for example.  This can be set in the Machine Tool 
Options screen.

Active command keys in the encoder screen are highlighted 
in RED.  Entering an axis label key, X Y or Z in the example, 
will go to a configuration screen for that axis.  From the 
configuration screen various axis setup parameters can be 
changed.

This screen is where a counter can be preset to a specific 
value.  The counting direction can be changed (reversing the 
axis).  The number of decimal places can also be set.  This 
is also where the step size, or Unit to count by, can be set 
manually.  The Rotary coordinates feature allows an encoder 
to used on a rotary table or indexer head and have it read 
out on the screen.  Backlash allows a rotary encoder to be 
put on an axis screw shaft to measure movement and have the 
mechanical backlash in the screw shaft subtracted out of 
the DRO readings.

Back to the Read Encoders screen, the Mode command steps 
the counter modes from Absolute through 4 Incremental modes 
(A, B, C, D).  The Backspace key steps backward through the 
sequence. Note the space bar key can also be used to step 
forward through the modes.  The incremental modes can be 
used to set a “local” or temporary zero point without 
loosing the Absolute Zero point. The current mode is 
displayed on the second line at the top of the encoder 
display screen.

The Load command key allows you to select a coordinate pair 
from a stored pattern list.  This feature is commonly called 
the Bolt List.  The list can be a Circle, and Arc, or a Line.  
If no list has been setup, you will be asked if you want to 
setup a list now.  The list is up to 99 points.

The Edge command is used to set an edge of the work piece 
as an axis zero.  This is commonly called auto zeroing.  
Pressing the E command will cause the message “Select Axis 
to auto-zero” to appear.

You can select the target axis by either pressing the axis 
label key (X, Y, Z) or simply moving the axis.  The first 
axis to move after pressing E is the target axis.  Once the 
target axis is set, the message “Waiting for edge touch” will 
appear.  The axis is then moved to touch the work piece.  
This can be done with a wiggler type edge finder device, a 
piece of round bar stock, or a probe interfaced to the PC.

The diameter of the auto Zero edge finder device is 
configured into the program in the Machine Tool Options 
screen.  If you are using an edge finder or bar stock, press 
the E key again when at the work piece edge.  The axis value 
will then be set to the radius of the edge finder device in 
the current mode, thus establishing the work piece edge as 
“Zero”. If a probe is used, the touch is sensed 
automatically and zero is set.

When waiting for the edge touch to complete, the axis and 
the Edge command on screen is highlighted with color in 
graphics mode or by blinking in character mode.

The Center command works much like the edge command.  It is 
used to find the center of a work piece.  The axis is first 
moved to touch one side of the work piece.  Pressing the C 
command will cause the message “Axis to auto-center” to 
appear.  You can select the target axis by either pressing 
the axis label key (X, Y, Z) or simply moving the axis.  
The first axis to move after pressing C is the target axis.

The edge finder is then moved to the other side of the work 
piece and the C key pressed again (if a probe is active no 
key press is required).  The counter for the axis will be 
set to one half of the distance moved.  This sets the center 
of the feature as the zero point, in the current mode.

The 0 (digit zero) command sets all of the axes to zero in 
the current mode.  Note the F1, F2, F3, and F4 keys set an 
individual axis to zero.

The Z command is the master zero command.  It sets to zero 
all the encoder counters, and error counters, for absolute 
and all incremental modes.  You will be asked are you sure?

Program Options

The P main menu command will open the Program Options menu 
screen.

The R, S, and C commands can be used to Read, Save, or 
Create a new configuration file. 

The D command will change the display update time delay.  
This is used to slow down screen updates in favor of 
monitoring encoder input steps.  The higher the delay number 
is the more the input data stream will be monitored to 
prevent missed steps (errors).  This time value is not used 
if a hardware interrupt interface is used to collect the 
encoder step data.

The I command selects the input port.  The input port can be 
either a parallel port printer interface or an external 
serial device (the external serial device is described in 
the appendix).  The port address and interrupt status can 
be set with this command.

The G command toggles the graphic display setting.  When ON 
the high-res graphic display is used, when OFF the character 
display is used.

The A command is used to set the auto display function.  
When auto display is ON, the program will go straight to 
the encoder counter display screen at startup, bypassing 
the Main Menu.  When OFF the Main Menu will be the first 
screen displayed.

The S command turns ON or OFF the sound feature.  Sounds 
are played when certain events happen in the program.  If 
sounds are not wanted, set to OFF.

Machine Tool Options

The M main menu command is used to customize settings for a 
particular machine tool.

The N command sets the name of the machine.  This can be set 
to things like Bridgeport, Lathe, Grinder, Mill #25, etc.  
It can be used to remind you which machine you are interfaced 
to, or which configuration file has been loaded.  The string 
can contain any characters, including blanks.

The E command edits the axis configuration.  It is used to 
set which axes are being used, and displayed.  The axis name 
and a “label” can be set, and you can select whether to 
display the name or label next to the counter on the display.  
The axis can be set to display a slew rate.  This is the 
speed the axis is currently moving.

The A command is used to calibrate an axis.  This process 
sets the distance for each quadrature encoder step.  The 
axis to calibrate is selected from a list.  Then the axis 
is moved from one end to the other of a known measurement 
unit.  This can be a precision piece of bar stock, a scale 
fixed to the table, or a caliper opened a certain distance 
held in a vise, I use a 12” dial caliper set to 12.2” and 
find the edges of the caliper ears with a .2” wiggler.  
The longer the measure, the more accurately the step size 
can be set.

The L command set Lathe axis features.  The lathe usually 
has three axis, the long length or bed, the cross slide, and 
the compound.  The bed is usually called Z.  The cross slide 
is called X and the compound is Z’.  The lathe options can 
only be used if there are encoders on all three axes. 

The cross slide carries the compound and the compound swivels 
on the cross slide.  The cross slide and compound interact, 
that is movement of one affects the other.  The DRO program 
can track this and display the “right” thing when any of 
the axes move.  

If the compound is set at 90 degrees to the bed axis, the 
current position of the tool bit is the sum of the cross 
and compound feed positions.  The Sum option adds the cross 
feed and compound, and displays the result in the cross 
feed display counter.

If the compound is set at an angle to the bed, compound 
movement changes both the cross and bed feed positions.  
The Vector option will do the angle math and add to both 
the cross and bed feed display when the compound is moved.

When the Vector option is set, the ratio of compound-to-bed 
feed and compound-to-cross feed will be indicated on the 
Lathe Options menu screen.  This will be something like 10:1 
(or ten to one) meaning that a ten unit movement of the 
compound is a one unit move of the cross feed.

The T command sets tachometer options.  The tachometer is a 
pulse input on either a serial port on the RS-232 RI input 
or a TTL input to the external decoder board.  The pulse can 
come from a Varity of sensors, typically an optical sensor 
with a vane that cuts through an LED light source or a 
reflective sensor “looking” at a shaft with a mark of some 
type on it.  The number of pulses per shaft revolution can 
be set, the more pulses per revolution the lower the RPM 
that can be senses.  A single pulse per rev can only sense 
as low as 60 RPM, two pulses 30 RPM, etc.

If a diameter is set, the Surface Feet per Minute (SFM) is 
displayed.  This can apply to either the speed of a cutting 
tool in a mill spindle or the cutting rate of a tool in 
contact with the work piece on a lathe.

Geometry Utilities

The screen allows computations to be performed.  The results 
of a Circle, Arc, or Line computation is stored internally 
and can be used to guide positioning from within the Encoder 
Display screen with the Load command.

The C and A commands, Circle and Arc, are very similar.  The 
difference being the Arc command includes both end points of 
the arc in the position list, the Circle includes the first 
hole and the last hole before the end of the circle, but 
does not “wrap back” to the start of the circle.  

You will be asked for the number of holes, the circle 
diameter, the size of the holes, the angle that the first 
hole starts at, and the x,y offset.

The key inputs are the number of holes and the size of the 
circle.  The remaining questions can be answered with a 
blank line unless you want to tilt the circle or arc or move 
the origin away from 0,0.  If the hole size is given, a check 
to make sure the bolt holes do not overlap, or touch each 
other, will be done.

Once a list has been setup, the Load command on the Encoder 
Display screen will present a list of bolt hole location to 
choose.

The list can be re computed by entering the N command for a 
new list.
The red cursor arrows can be moved up and down with the 
cursor arrow keya and/or the page up and page down keys.  
Once positioned, the enter key will load the selected 
coordinates in to the encoder counters such that you can 
move the axes to 0,0 and be at the bolt hole center.

The axes used by the load process can be changed by 
pressing the X or Y keys.  This will step through the 
available axes.

The bolt hole coordinates can be used either in Absolute 
mode or in one of the Incremental modes.  The default is 
to load them in to Incremental Mode A.  This can be changed 
with the M (and/or backspace) key to step through the modes.

