Introduction to Computerized Motion Control
Video Training Series

Snap "Play", then please wait a few moments for the movie to load.

Part 1 - Overview  (time 7:07)

This movie provides an introduction to the concept of computerized motion control, and shows how control systems can be easily managed when broken down into a few clearly defined component parts.

This series of instructional videos is intended to cover some of the basic principles involved in computerized motion control. Breaking down the process of motion control into a few clearly defined functional units, and demonstrating how these units interact, not only eases understanding, but also provides a model which the technician can use to simplify his designs, and make them more maintainable.

Some of the same principles that are explained here can be applied to implementing servo motors, but alternatively, stepper motor technology will be used in this series due to its simplicity, economy and reliability.

Stepper motors are powered by a special type of device called a “translator”.  Most translators function very similarly. When activated by an electronic signal, or “pulse”, the translator moves the motor shaft by a small, incremental amount.  A second signal, called the direction signal, determines whether the pulse moves the motor shaft clockwise or counterclockwise. This is described more thoroughly in the next video entitled “The Stepper Motor and Translator”.  

For each signal that it receives, the translator only has the capability to rotate the motor’s shaft from its current position to its next adjacent position. However, input signals provided to the translator in timed succession are used to accomplish more complex motion. The functional unit that provides these signals to the translator is called the “indexer”.   

Ability Systems Indexer LPT software uses an IBM compatible PC to generate translator compatible control signals from the standard parallel output port connector. The parallel port is ideally suitable for controlling motors due to the multiple outputs that are physically available. These multiple outputs can be simultaneously manipulated by the software, enabling Indexer LPT to control up to seven motors together across complex patterns.

Computers can be outfitted with multiple parallel ports by means of plug-in adapter cards. Parallel port adapter cards are rugged, inexpensive, widely used and readily available. Standardized mass production of these devices simplify troubleshooting and make machines more maintainable.  

Indexers receive commands and also interact with the electronic signals in the control system.  Indexer LPT’s “Plain English” command set is designed to give the machine designer and technician close control over the machine. Using the Diagnostic screen provided with the program, here an Indexer LPT command is being used to generate 2000 electronic pulses. The translator portion of the system responds to each pulse, moving the stepper motor motor shaft 2000 incremental steps.

While useful in exercising close control over the machine for the technician, indexer commands may not be convenient to a machine operator.  For example, Indexer LPT’s  “move” command, just shown in this demo,  is useful for the technician to use for experimentation, design and troubleshooting, but it is much more suitable in certain settings for an operator to direct machine motion in more familiar units, like inches or centimeters. Among other things, the Application Program accomplishes this purpose. 

Using the indexer to generate pulses, the technician can experimentally determine exactly how far a linear stage moves for a given number of pulses. The application program, here the Ability Systems G Code Controller program, accepts this information as part of its configuration.  To move the Y stage of our demo machine by one inch, 5080 pulses are required as shown here in this setup dialog.

This clip shows how a “G Code” script, with dimensions called out in inches, can generate a tool path that would cut a 4 inch diameter circle using a 1/2 inch diameter circular cutting tool. The application program calculates the straight line paths that are required, communicating these approximating line segments to the indexer.  Indexer LPT assembles these paths end to end and smoothly generates the electronic pulses that move the machine over the desired path. Between the actions dropping and retracting the stylus you can hear the pitch of the control signals change as the motors accelerate over the circular path, traversing from one segment to the next then decelerating to a stop.  

Simple shapes like this circle are easy to script by hand in a text editor like Notepad. Even panels like this are relatively simple to hand code.  

More complex paths, like this, are more suitably scripted from CAD/CAM software that is designed for 3D Modeling, such as BobCAD, SignLab, MasterCAM, Visual Mill etc.  So in this case the CAD/CAM software generates the scripts.  The Applicaton Program interprets the scripts into indexer commands and transparently uses these commands to interact with the Indexer. The indexer, in turn, directs the translator with appropriately timed control signals.

Though Ability Systems  G Code Controller is very versatile, and can be configured to accommodate a variety of different types of machines, there are applications that are specialized to the extent that a custom application program is needed.  In these cases, Indexer LPT’s simplified programmers interface and thorough documentation open the possibility of writing your own application program using a standard programming language, such as BASIC, C or Delphi.  Here is a telescope lens grinding machine which is controlled by an application program written in FORTRAN.  You can check out the Pictures section at abilitysysems.com for other examples.

Now that we have summarized Ability Systems approach to computerized motion control, and discussed automation ranging from defining tool paths using CAD/CAM to the actual signals used for controlling the motors that move the machine, I hope you will enjoy the following sessions which more comprehensively explore and explain each of these categories in more detail.


Part 2 - The Stepper Motor and Translator   (time 9:20)

This movie introduces the device that is used to power stepper motors, called the “translator”.

The principle elements in a stepper motor control system include the stepper motor itself, the device that powers the stepper motor, called a “drive” or  “translator”, and the device that directs the translator, called an “indexer”.  A full PC based motion control system, such as one that may control a machine tool, also has an application program that interacts with a human operator.

 Breaking down the control system into clearly defined and understandable portions not only makes learning more enjoyable, but also aids in designing and troubleshooting. This video concentrates on the stepper motor and its translator.  

A stepper motor is an electric motor with an internal structure that is capable of holding its output shaft to one of many positions.  The internal electric windings are structured so that the motor shaft can be moved from one position to an adjacent position by activating the windings in different ways.

Stepper motors are manufactured with multiple magnetic elements spaced equally around the motor. The most common number of divisions for industrial stepper motors is 200. Stepper motors are manufactured in various sizes and capabilities. Here is a small “size 23” stepper motor.

The device that is used to apply power to a stepper motor is called a “translator. Translators are also manufactured by numerous sources, in various sizes and with different capabilities. Choosing the appropriate stepper motor and translator is the subject of another session. However, most translators function very similarly. Once you grab the concept of stepper motor translation, you will be more capable of adapting the type of translator that most fits your needs.

Translator manufacturers are generally most helpful in providing information relating to the type of step motor that can be used with their product, and how it is wired.  This demo uses a very common and simple type of translator, of the “two phase” variety, and a four wire hook-up between the translator and the stepper motor.  It is “point to point” wiring, and once the stepper motor is correctly connected to the translator; detailed understanding of how the translator performs its job is inconsequential to our purpose here. It can be considered a “black box” in the sense that it receives controlling input from one end, resulting in motor shaft rotation as the intended result.

Most translators are controlled by two input signals. One is called “Step” or “Pulse”. The other is called “Direction”.  Sometimes the “Direction” line labeled “Clockwise/Counterclockwise” or “CW/CCWbar” as shown on this translator.  The part of the control system that provides these signals to the translator is called the “indexer”.  Ability Systems’ “Indexer LPT” software uses  industry standard parallel ports, commonly called “printer ports”, to generate these control signals.  Here is a plug in adapter card that supports two parallel ports.

Here is the same card installed in a PC.  Contacts on each port can generate control signals that translators will accept for input.  The translator in this demo accepts 5 Volt pulses.  We will use Ability Systems Indexer LPT Diagnostic program to demonstrate what a “pulse” is, and how it is used to control a translator.

The electrical term “pulse” describes a change in voltage from one level to another and back again. In this case, pin 2 on the printer port is being used to generate “negative” 5 Volt pulses, which means that the voltage on pin 2 will normally be 5 Volts,  transition to zero volts for the duration of the “pulse”, then transition back to 5 Volts again. An easy way to visualize this is to generate very slow pulses from Indexer LPT and observe the output from pin 2 using a voltmeter.

Using the Indexer LPT Diag program, I am setting the pulse rate to one pulse per second for Indexer LPT’s  “jog” command when it is used to generate the pulse signal on pin 2. The ground reference is pin 25.

Indexer LPT generates pulses with a square wave. This means that when generating multiple pulses the voltage is low about the same time as it is high. When set up for a pulse rate of one pulse per second, the voltage on pin 2 will lower from 5 volts to zero volts for one half second, then return to 5 volts. The next pulse will start one half second later. The time occupied in sending each pulse, which is the pulse period, is one second.

The oscilloscope shows the change in voltage over time. Here the sweep time is turned down low enough for you to see the voltage reading trace for all five pulses.

Here the pulse output from the parallel port, Pin 2, is connected to the “Step” input pin on the translator.  Pin 25 on the parallel port, which is ground, must be connected to the translator’s ground reference as shown. A small pulley is attached to the output shaft of the stepper motor, marked so that you can see it rotate. Notice that the motor shaft increments from one position to another with each pulse

Without power applied, the stepper motor shaft generates little resistance to movement, but when power is applied, the shaft resists turning. To troubleshoot  a malfunctioning system, with power applied first make sure that the stepper motor shaft resists turning. Then generate control pulses from the Indexer and see if the pulses are reaching the translator.  Since Indexer LPT generates pulses in a square wave, when the pulse rate is slowed  you can test for the presence of the pulses using a voltmeter. If pulses are not present at the translator, you can isolate the problem by testing for them directly at connector to the indexer, as shown here.

The voltage level of the “Direction”  control line determines whether each pulse rotates the motor shaft clockwise or counterclockwise.    In this view a yellow wire connects pin 3 from the parallel port, which is the indexer’s direction control output,  to the CW/CCW input  to the translator. Here we will be observing the voltage level of the this signal using a voltmeter.

As its name implies, the “Direction” signal determines whether the motor shaft will move clockwise or counterclockwise.  When the direction signal is 5 Volts, pulses applied to the step input move the motor shaft in one direction. When it is 0 Volts, the pulses applied move the shaft in the opposite direction.  Here we are using Indexer LPT’s “jog” command to move the motor in one direction using a positive value for the number of pulses. The positive value causes the indexer to present 5 Volts on the direction line. For the other  direction a negative value is used to designate pulses. The negative value causes the indexer to present 0 Volts on the direction line. Though the voltmeter needle is a little delayed, here you can visualize how the state of the direction line affects the way the pulses are acted upon by the translator.

That completes our introduction to translators. To recap, the translator responds to an electronic pulse by moving the stepper motor shaft by a tiny amount. The amount of motor shaft movement per pulse depends on the motor and translator that is used. The motor and translator used  in this demo responds to each pulse by moving the motor shaft 0.9 degrees, requiring 400 pulses for a complete revolution. The status of a second input, called the “direction” input, determines whether each pulse moves the motor shaft clockwise or counterclockwise.

In the following session we will discuss the indexer portion of the system, how it controls speeds, acceleration and the coordination of motors to perform complex tasks – as well as some other things.  A few basic concepts about indexers can be extremely helpful in simplifying system design and maintaining control systems.

Subsequently, we will also cover how an application program can hide the functions of the indexer from the human operator, interacting with both the human operator and the indexer to accomplish smooth, efficient and predictable machine control.


Part 3 - The Indexer   (time 3:04)

The Indexer portion of the control system bridges the gap between the application program and the translator. This movie introduces Indexer LPT.

In the previous session entitled “The Stepper Motor and Translator”, the translator portion of the control system was described as a “black box” that responded to pulse and direction signals so that each pulse effected movement of the motor shaft by a tiny amount. The direction input determined whether the pulse moved the motor shaft clockwise or counterclockwise. The portion of the control system that generates these signals is called the “Indexer”. The Indexer can also be understood as a functional element, another “black box”, which receives input from one source, and responds by generating the pulse and direction signals according to the command that it has received.

Some indexers consist of a controller card like this one. To use this card an application program communicates commands to a microprocessor located on the card. The card’s microprocessor, in turn, generates the pulse and direction signals necessary to direct the translator. Other manufacturers may use an external circuit that receives commands from the application program by means of a serial port. Some manufacturers even package the indexer with the translator.

As it was mentioned in the session entitled “Overview”,  Ability Systems Indexer LPT uses the microprocessor contained in an IBM compatible PC in conjunction with standard parallel interface adapters to generate translator compatible control signals. This series of sessions uses Ability Systems Indexer LPT software to demonstrate the function of the indexer.

Similar to a hardware based indexer, Indexer LPT has no user interface, and so it requires an application program for it to receive commands. The Diagnostic program that comes with Indexer LPT is a very simple application program designed for the purpose of exercising Indexer LPT commands.  Here in its command dialog, Indexer LPT’s “plain English” commands can be typed into a field.  After a command is sent to Indexer LPT, the command and associated feedback is scrolled to the Diagnostic program’s display, as shown here.  We’ll use the Diagnostic program to demonstrate some important concepts regarding indexers.

We will also use Ability Systems “G Code Controller” application program, which also generates Indexer LPT commands.  Sequences of commands are more easily demonstrated from a more powerful application program, and it’s helpful to see how the application program and indexer are designed to work together.

So please relax and enjoy the following sessions, starting with the next one entitled “Instantaneous and Accelerated Motor Movement”.


Part 4 - Instantaneous and Accelerated Motor Movement   (time 5:05)

This movie shows how indexers can reliably make stepper motors attain elevated speeds.

As you may recall from the session entitled “The Stepper Motor and Translator”, pulses applied to the translator by the indexer make the motor shaft move from position to position. We used Indexer LPT’s “jog” command to generate 400 pulses at a constant rate of 100 pulses per second, taking 4 seconds to complete the rotation of the motor shaft by a one revolution. So here the indexer caused the motor shaft to rotate at a constant rate of ¼ revolutions per second.

Just prior to the first pulse the motor wasn’t moving at all. Immediately following the first pulse, when the motor was moving from step to step, the shaft was rotating at a constant rate of ¼ revolutions per second. We say that the motor started “instantaneously” at the rate of ¼ revolutions per second.

In the world of physics, no mass can accelerate instantaneously. The actual acceleration of the shaft occurs within the angular boundary of one step, which for the motor and translator shown here  is .9 degrees.

On our demo machine shown here a stepper motor is coupled to a linear stage so that the stage advances 1cm for every 2000 pulses. Here the jog command is used to generate 4000 pulses at a rate of 2000 pulses per second, taking two seconds. The stage instantaneously starts moving at a rate of 1cm per second, moves at a constant rate for 2 seconds, then comes to an abrupt stop. We may say for convenience that the stage starts moving at 1cm per second, but it actually accelerates from rest within the boundary of the first and second step position, and abruptly decelerates after the last pulse.  

In this case, the magnetic coupling within the motor is sufficiently strong to apply enough torque to accelerate to 2000 pulses per second within the boundary of one step position. But  increasing the instantaneous pulse rate increases the inertial force that the motor shaft would need to overcome in order to move the stepper motor shaft to the next position, where it would be ready to respond to the following pulse. If the force applied by the motor is unable to move the motor shaft to the adjacent step position, the motor loses synchronization with the translator and almost all torque is lost. Notice here when we try to instantaneously start the motor at a rate of 10000 pulses per second, the motor and stage doesn’t move at all.

Indexers can make stepper motors reliably track pulses at elevated speeds by gradually increasing the pulse rate. The interval from the first to the second pulse determines the instantaneous starting speed. For example, if the second pulse occurs one half second after the first, the starting speed is 2 steps per second. In this clip the starting speed is set to 2000 steps per second. Thus the second pulse occurs one half thousandth of a second after the first. The pulses increase in frequency until the motor reaches it’s running speed, sometimes called “slewing speed”. Here the running speed is set to 22000 steps per second.  With an acceleration setting of 40000 steps per second per second, it takes Indexer LPT one half second to accelerate the pulse rate from 2000 to 22000, and one half second to decelerate to a controlled stop at the end of 30000 steps as shown here.

Converting from units of steps to linear distance for this stage, 30000 steps traverses 15cm.  The stage starts at 2 cm/second, and accelerates to 22 cm/second at a rate of 40 cm/per second each second. In minutes, then, it would start at 120 cm/minute and accelerate to 1320 cm/minute at a rate of 2400 cm/minute per second. The application program does the math for you. Here these values are configured into G Code Controller, and a dialog box is used to more conveniently move our stage by 15cm. So now we have covered instantaneous and accelerated methods of stepper motor motion. Each method has a purpose in machine design, as we will cover in the next session entitled “Controlled and uncontrolled stopping”.


Part 5 - Controlled and Uncontrolled Stopping   (time 5:49)

This movie demonstrates how position tracking is maintained, and how starting and stopping motion can be attained by means of external switches.

In the previous session two methods of stepper motor motion were explained. The first method, which we called “instantaneous”, applied a fixed frequency pulse rate to the translator, which moved the motor shaft at a constant speed.  The ability of the motor to accelerate to speed within the boundary of the first and second step position limited the instantaneous speed that a motor could attain using this method. However, once a motor begins moving instantaneously, higher shaft speeds could be attained by gradually increasing the pulse rate. We called this the “accelerated” method. This session will explain how instantaneous and accelerated motion applies to accurate positioning and position tracking.

Indexer LPT keeps track of the control pulses that it generates, adding positive and subtracting negative movements.  It is necessary, however, to initialize the starting position for pulse tracking to have meaning. The initial, or “zero Position” is called the “home” position”, which is set by Indexer LPT’s “set_home” command.  

Before position tracking is initialized, Indexer LPT will execute motion commands, but will not report its position. Here 1000 pulses are generated using Indexer LPT’s “move” command, but the destination position is reported to be “unknown”.  Now after initializing position tracking, the move command is used to generate 1000 pulses and the destination location is reported. After generating 600 pulses in the negative direction, the location is 400 steps from the home position, reported as shown.                                            

In this example, the G Code Controller application program directs Indexer LPT to automatically determine the home position. From an unknown position, it initiates an instantaneous movement lengthy enough to always be interrupted by an end limit switch. Indexer LPT reads the limit switch before sending each pulse, so the motor is stopped instantly when the limit switch is contacted. Instantaneous motion is used to accurately stop on the pulse that causes the switch to be activated. Accelerated motion is used to rapidly withdraw the stage from the switch to a position that will be referenced as “home”. 

Here is a way external switches are used initiate machine motion. Indexer LPT does not require switching an externally applied oscillator to the translator for manual controls. Instead, Indexer LPT senses the status of the joystick switches and keeps track of each pulse that it generates. With the “Fast” option selected, the joystick accelerates the motor for rapid positioning. Some overshoot may occur during deceleration when the switch is released. The “Slow” option, however, uses instantaneous rate, so the motor stops the instant the joystick switch is released. 

The operator can still vary the instantaneous rate with the feed rate override dial, as shown here. The robust joystick response of instantaneously starting and stopping greatly increases ease of use.  A separate session will be devoted to Indexer LPT’s joystick option, as well as the feed rate override feature. The point that is emphasized here is to demonstrate controlled stopping and position tracking. Later we will see how it enables G Code Controller to accomplish things like locating fixture offsets, sensing a homing plate, measuring and assigning values for tool length compensation, and recovering from tool breakage.

So far we have only discussed “controlled” stopping.  “Uncontrolled stopping” occurs when an end limit switch abruptly interrupts any movement that requires acceleration.  If acceleration is required, position information is not considered reliable if the motion is abruptly terminated. In such cases Indexer LPT abandons position tracking on all affected motors until the home position is reestablished.

Indexer LPT’s “feed hold” feature was designed to provide for controlled stopping whether or not accelerated motion is being employed. Activating the “feed hold” switch will bring all motion to a decelerated and controlled stop.  Position tracking is preserved. Deactivating the switch accelerates the motion into its resuming path. When motion is stopped, however, activating the Release switch provides the application program with the opportunity to exercise additional control, such as G Code Controller options to recover from broken tools, change offsets and to resume from a prior location along the tool path.

 A separate session will be devoted to recovery from interrupted operations. But now that we have covered the implications of instantaneous and accelerated motion, and controlled and uncontrolled stopping,  it’s time to explore multiple motor control in our next session entitled “Interpolation”.


Part 6 - Interpolation   (time 5:37)

This movie demonstrates how the multiple motors can be used to control a machine over geometric paths, and how the speed across the work is regulated for cutting operations.

In the field of motion control the process of using two or more motors to subscribe a geometric path is termed “interpolation”. A straight line path connecting two points is called “linear interpolation”. More complex interpolation, including circular interpolation, is generally accomplished by means of traversing a number of approximating linear interpolations end to end.

We have discussed how a stepper motor can overcome inertial forces resisting acceleration within the boundary of a small shaft rotation, which is to say one step position. Thus stepper motors can be considered to start moving from step to step at an instantaneous rate. We have also discussed how the motor can be made accelerate from its initial instantaneous rate to a higher speed, and then decelerate to a stop. The time between the first and second pulse defines the instantaneous starting rate, and the time between the last and next to last pulse defines the instantaneous stopping rate.

Motors can be coupled to control linear stages situated at right angles, like on our demo machine. If the indexer makes two of these motors are start, accelerate, run and decelerate to a stop in an identical manner, thus moving each stage the same, a straight line path will be interpolated at a 45 degree angle, as shown here. The angle of interpolation can be varied by proportionately varying the control over the speeds and acceleration of one motor with respect to the other.

Another way of visualizing linear interpolation is to view the relationship between the positions of each motor, advancing from step to step as if they were connected by gears. The motors would start together, stop together, and maintain a linear path along the way regardless of speed. Thus the ratio between the completed numbers of steps for the stages determines the interpolated angle. This is the most helpful method of visualizing how Indexer LPT controls speeds and acceleration during the interpolation process.

For its multiple axis “move” command, Indexer LPT automatically selects the motor that is being moved the greatest number of steps to be “dominant”. This means that the configured values for starting speed, acceleration and running speed for this motor governs its motion from start to completion as if it were the only motor that was being controlled. The other motors, up to six, are “slaved” to the dominant as if connected by gears. Thus all motors start together, finish together and subtend a proportional distance to each other throughout the extent of the motion.

G Code Controller translates rapid traversal G01 commands into Indexer LPT’s “move” command since it is the most time efficient method to get all motors from one position to another.

Rapid traversal is not the best method to control something like a cutting tool, however, because using this method the speed of the tool across the work is dependent on the angle of the interpolated line. Here is an exaggerated example. A ten centimeter excursion at a constant rate of ten centimeters per second takes one second. But if two axes were being moved together, the tool travels over roughly 41% more distance in that second, thus moving 41% faster.

Indexer LPT’s “feed” command regulates the speed of the tool across the work by automatically scaling the speed of the dominant axis according to the geometry of the straight line path that is being subtended. This is called “vector rate control”. G Code Controller uses Indexer LPT’s “feed” command for operations that typically require vector rate control, which is to say motion controlled under G01, G02 and G03 command modes.  Indexer LPT automatically compensates for the effect that the geometry has on the tool speed in two and three dimensions.

The regulated feed rate is called “Vector Speed”.  Since controlling vector speed necessarily spans multiple axes, Indexer LPT’s configuration for feed rate starting speed, acceleration and vector speed apply to all axes of motion, not to each axis individually as in rapid traverse type motion.  This G Code Controller job setup dialog allows you to configure these values using familiar units.  The vector speed can also be modified along the tool path using the F command inside of the G Code script

The “Feed Shift” field in this dialog will be discussed in the next session.

As mentioned, when end to end linear interpolations are made to approximate complex paths like curves and arcs it is generally called “contouring”.  Each transition point presents is own particular challenge, since not only does the path of motion change instantly, but the speeds of each motor as well. The next session, entitled “Contouring” explains how Indexer LPT accommodates these transitions smoothly and reliably.


Part 7 - Contouring   (time 6:44)

This movie demonstrates the effect of changes in direction on motor stress, and shows how motor speeds can be optimally regulated to reliably traverse complex patterns.

In the session entitled “Instantaneous and Accelerated Motion”, we discussed how the ability of a stepper motor to overcome forces of inertia to change speed within the boundary of one step position can be considered an instant change in velocity. In the following session entitled “Interpolation”, we discussed how vector velocity regulation was most suitable for cutting tools because it maintained a constant speed across the material regardless of direction. This session will combine these two concepts.

Loosely defined, “contouring” is the action of traversing a complex path, most often approximated by end to end line segments. When a machine is either depositing or removing material, the speed of the traversal throughout the contour has a significant effect on the quality of the manufactured part. Consistent motion also reduces the total traversal time, thus increasing machine throughput.

It’s helpful first to consider that motor speed necessarily changes instantaneously whenever the direction of traversal changes. Here is an example where no movement occurs in the Y direction until the transition point. A constant vector rate is maintained. At the transition point, the Y stage instantaneously accelerates to a speed that will follow the 45 degree divergent path.

In this demo of our example you can only hear the audio from the X stage. Notice from the tone that the X stage instantaneously decelerates at the transition point in order to maintain the same vector velocity in the following segment.

The amount of instantaneous rate change that occurs at any transition point depends upon the speed of traversal into the transition and the amount of diversion from the current direction.  Similar in theory to starting from rest, in order to successfully negotiate any transition the stepper motor must be able to sustain this rate change within the boundary of one step position.

In the extreme, if every linear interpolation were slowed to the stopping instantaneous rate, then every transition can be safely negotiated without overstressing any motor. But this not only wastes time, but also results in erratic progression along the tool path. In the other extreme, not slowing makes the actual stress on the motor dependent upon the geometry of the path, at best limiting the reliable vector speed to the instantaneous starting rate, and at worst risking occasional overstress and loss of position.

Ability Systems controls, however, automatically optimizes contouring speed to avoid overstress. The technician can specify how much instantaneous rate the machine is capable of sustaining under all circumstances. In this G Code Controller job setup dialog, this value is called “Feed Shift”.  Using this value, then, the software will decelerate from the vector rate only as much as necessary to avoid overstress at every transition point.  Thus the speed through each transition is the maximum that the system can safely negotiate.

Here is an exaggerated example. A relatively low setup for acceleration is used so that you can see and hear the process of anticipating a 45 degree divergent angle.

When the divergence is lessened, as with this 10 degree divergence, almost no slowing occurs.

Smooth contours consist of end to end linear interpolations with relatively little divergence.  Here is a smooth contour comprised of two lines and an arc. The arc is approximated by multiple line segments.  Notice that vector speed is maintained throughout the contour and almost no slowing occurs entering into the arc.

In order to reliably traverse all geometries, however, consideration must be made for instances where segments within the contour are too short to accommodate deceleration into the transition point, as might be necessary in cases where there is an abrupt change in tool path, shown here.  The segment, or several segments preceding the abrupt change may not provide for enough distance to decelerate. For this reason, Indexer LPT decelerates through as many segments as necessary to avoid overstress at any transition point, sensing up to seven simultaneous axes.  In other words, Indexer LPT causes the motors to “seek” the vector rate, slowing when and where necessary.

Here is a G-coded Disney cartoon pattern that was provided to us by one of our customers consisting of a large number of arcs and smooth contours. Under control of G Code Controller, Indexer LPT traverses the path rapidly, smoothly and accurately.

Indexer LPT’s control over instantaneous rate change is also advantageous for step/direction controlled servo systems. Instead of losing synchronization from over-stress, servos round off abrupt corners. For these systems, specifying Velocity Shift enables you to easily control and limit this type of inaccuracy.

To recap, any change in the path of a linear interpolation requires an instantaneous speed change in order to follow the geometry of the new direction. Step motors are capable of instantaneously changing rate to a certain extent. Ability Systems software allows you to specify the extent of instantaneous rate change that your system is capable of sustaining, and automatically regulates speed as close to the vector rate as possible, slowing only as necessary to avoid overstress. For stepper motor systems, greater contouring speeds are made possible. For servo motor systems, the amount of rounding off at transition points can be controlled, thus increasing the quality of the manufactured part.


Part 8 - Signal Grouping   (time 5:49)

This movie explains how organizing input and output signals into symmetrical groups can simplify the design and use of controls software.

The concept of symmetry simplifies the design and use of any system. In our context, all Indexer LPT commands universally apply to symmetrical groups of a small number of signals. Here’s how.

As it was mentioned in Part 1 of this series, standard parallel ports can be used to interact with control signals. Signals manipulated by the software generated from the computer are called “Outputs”. Signals from sources outside the computer that are sensed by the software are called “Inputs”.

Indexer LPT software supports eight outputs and six inputs on each parallel port connector. Indexer LPT references these signals in two electrically identical sets, so each set consists of four outputs and three inputs.  The documentation calls a set of signals an “axis”. Since all Indexer LPT commands apply universally the same to each axis, complexity is reduced to the consideration of only four outputs and three inputs.

Indexer LPT supports hardware installations of up to four parallel ports, thus comprising eight of these symmetrical sets of signals.  However, one parallel port is typically dedicated to a control module, similar to the one shown in Part 5 of this series. The three remaining ports, therefore, support up to six of these signal sets. The most common installation consists of three ports, where the on-board port is used to for a control module, and a dual port parallel interface card provides two ports, thus four sets of signals.

Indexer LPT refers to each “axis” with  a letter designator, “a”, “b”, “c”, “d”, “e”, “f”, “g” or “h”. Groups of two axes are physically presented on each port connector, so one port may support axes “a and b”, another supports “c and d” and so on.   The signal set is called an “axis” because it is typically associated with a geometric axis of motion.  Part 2 of this series demonstrated how two output signals, called “step” and “direction”, are used to control a step motor translator. The remaining two output signals in the set of four can be used for other things, which will be discussed in the next session.

From the outside, each port connector looks the same. The computer distinguishes between each port connector by means of a “Port Address”.  When you install Indexer LPT an association is established between the Port Addresses and the Indexer LPT axis designators, as shown here in one of the Diagnostic program’s dialogs.  Thus, for example, you could label one connector “a-b”, another “c-d” and so on, to easily identify the sets of signals that you are working with. Signal names identify the output pin within the set.

As mentioned, the axis letter designator physically determines the applicable set of signals. So for example, if the command “move:a,100” generates one hundred pulses from pin 2 of the port you labeled “a-b”, the command “move:c,100” would generate one hundred pulses from pin 2 of the other connector, labeled “c-d”.

More completely stated, the “move” command applied with the designator “a” manipulates the output pins entitled “step” and “direction” and monitors the limit switch input pins entitled “low limit” and “high limit” for the grouping under axis “a”. The “move” command can be applied to the other axes, “b”, “c”, “d” and so on, in a similar manner.

The application program, such as G Code Controller, associates the signal set with nomenclature commonly understood in the industry for machine movement, such as X, Y and Z. The document entitled “Axis and Motion Nomenclature for Numerically Controlled Machines”, available from the Electronic Industry Association as EIA-267-B, describes standard nomenclature for different types of machines.

Our demo machine, referred to in EIA-267-B as a “Gantry Profiler”, consists of two linear stages situated at right angles and parallel to the floor plane. These stages are commonly referred to as X and Y. The third stage, vertical to the floor plane, is commonly referred to as Z. This G Code Controller setup dialog shows how the signals for Indexer LPT axis set “a” can be assigned to control movement in the direction that G Code Controller presents to the operator as “X”. Similar setup dialogs are used for stages Y and Z.

To recap, since each Indexer LPT signal set consists of only four outputs and three inputs, and each set behaves identically, the matter of dealing with inputs and outputs is greatly simplified. Input and Output is the topic of the next session.


Part 9 - Inputs and Outputs   (time 8:52)

This movie shows how the parallel interface adapter can be used to activate external devices and detect external events.

The input pins on the parallel interface can sense whether a voltage is 5 Volts or ground. In other words, one of two voltage states can be sensed: 5 Volts or 0 volts. Two of the three inputs for each axis grouping are internally connected to 5 volts through a resistive load, so when one of these input pins is disconnected from the outside world it will always sense the 5 Volt state. Since the signals are connected to a resistive load, a short circuit can be applied to ground without damaging the port. When shorted to ground, the input will sense the 0 Volt state. These two inputs are typically used to sense the closure of end of travel limit switches.

Indexer LPT abruptly terminates motion control pulses when the limit input associated with the direction of motion on its axis is 0 Volts. This means that motion in the positive direction for any axis will be arrested by grounding that axis’s high limit switch input, and motion in the negative direction will be arrested by its low limit switch input. However, motion in the negative direction is permitted when the high limit input is grounded and motion in the positive direction is permitted when the low limit input is grounded. Thus the software is able to recover from certain physical conditions that otherwise might cause a deadlock.

Indexer LPT’s limit switch inputs are designed to be used to delimit operational boundaries, and can serve a double purpose as a homing switch. They are not to be used as safety switches.

The remaining input in each axis group, entitled “auxiliary input”, is not internally connected to a driving voltage, and when disconnected it can arbitrarily sense 5 volts or 0 volts at any time. In other words, unlike the limit switch inputs, it cannot reliably sense an open switch, and must be connected to 5 volts or 0 volts in order to read these states reliably. For this reason it does not “fail safe” if used for functions like a start switch input, since an accidental disconnect could cause the machine to start unexpectedly.

The standard parallel port can set the voltage level of an output pin to either 5 volts or zero volts. Indexer LPT’s “reduced current” and “winding power” commands are used to control the general purpose output pins entitled “reduced current” and “winding power”.  These output pins can be used to control features corresponding to their names on certain translators, but most systems use these outputs for other things.

When set to 5 volts, an output pin is capable of sourcing a very small amount of current.  When set to zero volts, the same output pin is capable of sinking a relatively larger amount of current.

Parallel port outputs are ideal for controlling external devices that accept (what is known as) “TTL inputs”.  The manufacturer of the translator used in Part’s 1 and 2 of this series has inputs specified as “TTL compatible”.  Consequently, you can wire directly from the output of the parallel port to the input of such a device. A ground connection also has to be made between the device’s signal ground one of the parallel port’s ground pins.

The translators used on our demo machine, however, are optically coupled. This means that the translator uses a light emitting diode, or “L.E.D.” to transfer the signal that it receives to its internal circuit. Control is accomplished as the signal either lights or extinguishes the L.E.D. in the optical coupler.

L.E.D.’s  are activated by current and so  it is generally unreliable to depend on the parallel port output to provide enough current for optical couplers.  Our demo machine uses a 5 Volt power supply to provide the current.  When the output pin goes to zero volts, the LED in the optical coupler is lit. When the output pin is 5 volts, the LED is extinguished.

The spindle on our demo machine is a small, inexpensive 3.8 Amp trimmer, very simply turned on and off for demonstration purposes. An optically isolated solid state relay turns the motor on and off depending on the state of an output pin.  When “zero” is written to the output, forcing the pin to 0 volts, the L.E.D. within the optical coupler lights and the relay turns the spindle on. When “one” is written to the output, making the output pin 5 volts, no current passes through the L.E.D., the relay opens and the spindle motor stops.

When choosing a solid state relay for a highly inductive load like a spindle motor, it is important to make sure that it is a “zero crossing”  type. Zero crossing relays have internal sensing which disconnects the load at a time within the 60 cycle wave where it will not produce an inductive voltage spike that may damage the device. 

The purpose of this demo is just to show how the computer can turn a spindle on and off.  It may be more desirable, for safety sake, for some machines to require a sequence of operations and/or dependence on a latching relay circuit to assure certain controls are not activated at an unexpected time. Since the state of the output pin cannot be controlled until the software actually assumes control over the computer, I am careful to make sure that the AC power to my spindle is off when I power up the demo machine.

G Code Controller allows you to design an initializing sequence that automatically executes when the software loads. In our demo we are simply making sure that our spindle output control pin is 5 volts, the state that keeps  the spindle motor off.

G code scripts typically use M03 to turn a spindle on, and M05 to turn a spindle off. Configuration dialogs in the G Code Controller application program translate M codes into sequences of Indexer LPT commands. For the purpose of our demonstration, only one or two Indexer  LPT commands are needed. M03 uses “reduced_current:c,0” to turn the spindle on in sequence with a time delay of 1 second to make sure that the spindle is up to speed.  M05 uses “reduced_current:c,1” to turn the spindle off.

G Code Controller’s “Instant Block” dialog lets us manually turn the spindle on and off using these M codes.

Here is a simple part program that turns the spindle on, plunges the Z stage, traverses a square, then retracts the Z stage and turns the spindle off.

Some types of machines, such as machines designed to spray or deposit coatings, require an activation to occur at a particular spot in the tool path, while the tool carriage is in motion and after it has accelerated to  vector speed. Indexer LPT has this capability, which is utilized by G Code Controller. This demo emulates a spraying operation over the path of an arc, where the spray apparatus needs to be activated and deactivated at exact locations along the arc. M09 is customized to turn on a  LED, emulating activation of a spray mechanism. M10 is customized to turn off the LED, emulating its deactivation.

Now that we’ve introduced some factors relating to motion control and digital input and output, it’s time to concentrate more on how these things are made available to the human operator by the Application Program – which is the topic of the next session in this series.


Part 10 - The Application Program   (time 6:30)

This movie introduces some factors involved in the design of an application program suitable for a machine controller.

As mentioned earlier in this series, the application program is the portion of the control system that interacts with the human operator.  You may decide to write your own application program using a programming language such as BASIC, C or Delphi. Alternatively, you may wish to configure an existing application program to meet your needs, such as Ability Systems G Code Controller.

Since the type of machines that incorporate motion control vary considerably, it is impossible to generalize for one machine a type of interface that would be better for all others.  This video introduces some matters that were taken into consideration in the design of Ability Systems’ G Code Controller.

G Code Controller is a general purpose application program that is accommodating to the machine designer, and especially convenient to the end user.  It is typically used to control multiple dimensional cutting tools where “G Code” scripts may be used to describe the operation of the machine, including the path of motion and other functions necessary to accomplish a manufacturing operation.

As a general purpose application program, then, G Code Controller was intended to:

1) Provide the machine designer with the capability to customize the configuration according to the type of machine it is being used on.

2) Provide the set-up technician with the capability to quickly accommodate setups that may change from job to job.

3) Provide the operator with easily accessible controls and diagnostics.

4) Represent the job to the screen in a manner that is suitable to the task at hand.

5) Conveniently accommodate sequences necessary for job setup, completion and interruption.

As shown in Part  1 and Part 4 of this series, machine operation can be accomplished either manually by means of dialogs, or automatically under control of the G Code script.

The System menu is used to customize G Code Controller to the particular type of machine that you are designing.  The next session, entitled “System Configuration” will cover this in more detail.  Please note for now, however, that the System configuration information pertains to the design of your machine. This information includes setups reflecting the characteristics of movable stages, options for controls such as cycle start, joystick, feed hold and feed rate override -  and configuration for other options such as S, M and T codes for such things as spindle control, coolant, automatically actuated clamps and tool changing. The System Configuration information is not likely to change after the machine is designed, and so it is stored to a configuration file that is separated from other data that the application program may use.

One of the ways an application program can offer an increasing number of features while maintaining simplicity and ease of use is to present menus and options only when they are significant to the task at hand. Notice here that the Setup menu can be suppressed so that it does not appear when the program is used from day to day. Optionally, it can be password protected to further guard against accidental modification.

The File->Open Job menu is used to load setups relating to the manufacturing operation that you are about to perform at the moment. Notice that other menu options, which were not relevant before the job was loaded, now appear.  The “Job” menu, now visible, allows you to change the type of settings that are more likely to change depending on the type of operation that your machine is performing at the moment, such as arc accuracy, fixture offsets and default cutting speeds. The session entitled “Job Setups” will cover these things in more detail. For now, please notice that file that was opened is NOT the G Coded script. Each job can consist of up to ten G Code script files, which may refer to each other according to G Code Convention.  Among other things, the Job file contains the name and location of the file or files for the G Code script.

In its simplest use, the only thing that may change from job to job is the G Code script. In this case, you may load a job that has commonly used settings, and then simply change the name of the G Code script from the Programs dialog as shown here.

In a manufacturing setting where some time is spent determining  a number of unique settings suitable to making a particular part, it is helpful to be able to easily retrieve all of this information when the part needs to be made again. Using File->Save As you can store all of the Job Setup information under its own long file name. Then you can retrieve it as needed by simply opening that file at a later time.

Similar to the System menu, the Job Setup menu can be optionally suppressed and password protected to avoid accidental modification.

As mentioned, the Application Program must also suitably represent the Job to the screen and present sequences of operation and options necessary for the completion of each manufacturing operation. G Code Controller’s controls, graphics and simulation simplify its use by presenting appropriate displays and controls when they are needed. Before going into that, however, the next two sessions, entitled “System Configuration” and “Job Setups” respectively, will introduce some things that software must  take into consideration before a job is run, which is to say,  machine configuration and job setup.


Part 11 - Stage Configuration   (time 6:31)

This movie demonstrates how various types of motorized stages can be accommodated by an application program.

The previous session explained how configuring a general purpose application program, such as Ability Systems G Code Controller, must accommodate the characteristics of movable stages, options for manual controls, such as start switches, joystick, feed hold, feed rate override, and programmed automatic functions like S, T and M codes for such things as spindle, coolant, automatic clamping and tool changing.

Not every machine will need all of these features. G Code Controller is designed so that each feature can be independently installed, configured and tested.

This session will concentrate on configuring the motorized stages for controlled motion.

Selections for stages of motion are presented in the flyout from the “Stage Configuration” selection in the System menu. Our demo system only uses X, Y and Z, but the status bar helps you identify the industry standard nomenclature for additional linear and rotational stages. Linear  stages entitled U, V and W are situated parallel to X, Y and Z stages respectively, and rotational stages entitled (capital) A, B and C rotate around the projection of stages  X, Y and Z respectively.

Snapping over the stage that you wish to configure brings up the setup dialog for that stage.  For example, snapping over “X” brings up the configuration settings for the stage referred to in other parts of the application as  “X”.

The latter part of session 8 in this series, entitled “Signal Grouping”, showed how Indexer LPT refers to symmetrical groups of control signals as “axes”. The drop down list entitled “Feed Motor Axis” allows you to apply one of these groups to the X Stage. Here the step and direction signal from Indexer LPT’s “a” axis group will be applied to the translator powering the motor on the X stage. Corresponding high and low limit switch inputs will monitor end of travel switches. Thus when G Code Controller is instructed to move the stage entitled “X”, either by means of the program’s control panel or from within a G Code script, the control signals associated with Indexer LPT’s “a” group will be used.

The “Active” check box indicates that the stage is being used on the machine. The check also appears next to the stage name on the flyout menu. Only checked stages appear on the position readout and manual controls. As you can see, when I un-check the “active” field on the Z stage, it does not appear on the position readout or the manual controls dialog.

The “Units Name” field and the “Display Position to” field only affect the displays. Notice what happens to this display when I change the units name from “inches” to “centimeters”.

The fields entitled “Ratiometric Steps per Unit” and “Ratiometric Units”, however, affect the behavior of the machine.  The ratio of these two numbers determines how many control pulses are generated for each unit of measurement. As shown here, the X stage on our demo machine will move one inch for every 5080 control pulses.

The “Total Distance” field specifies the extent of motion along the stage. This setting is typically the distance between the high and the low end limit switches.

As its name implies, the “Rapid Traverse Rate” setup governs the speed settings in the “Rapid traverse” mode, instated by G00 in the G Code script. It also governs motion controlled by the manual positioning dialogs and the joystick jog feature when the speed selector switch is set to “Fast”. When the joystick jog speed selector is set to “Slow”, the “Jog Instantaneous Speed” field is in effect.

The “nudge” feature allows you to use the joystick to jog the stage by a fixed distance every half second for very precise positioning. The “Jog Nudge Distance” field specifies this distance.

The “Limit Seek Configuration” button brings up a dialog that allows you to customize automatic limit switch seeking for the stage. Limit switch seeking is generally used to automatically establish the machine home reference position.  The stage will move at the instantaneous rate specified in the “Seek Rate” field until it contacts a limit switch. Then it will retract from the switch the distance you specified in the “Retract Distance” field, and set the home position there if the “Set Home After Retract” check box is checked. If the “Seek Low Switch” check box is checked, low limit switch seeking occurs in the negative direction. Left unchecked, high limit switch seeking will occur in the positive direction.  Our demo machine is set up to seek the high limit switch on the Z stage, since this direction more safely retracts the spindle away from the work.

Automatic limit switch seeking moves one stage at a time. When multiple stages are selected , the “Priority” field determines the order of occurrence.  The Z stage in our demo machine is prioritized so that it positions the spindle to a safe height before the other stages are moved.

The remaining list editing fields provide for sequences of operation that you can use to accommodate things such as squaring parallel stage configurations and homing rotational stages, where the limit switch input may need to be disabled after the home position is established.  You can customize sequences to occur before the stage is retracted, immediately on contact with the limit switch, and after the stage has retracted to its home position.

The “Diagnostic” menu is helpful to verify stage installation and troubleshoot wiring problems. Here the “Limit Switches” readout dialog shows a live view of the status of the end limit switches. The display changes when I activate each limit switch. It’s a good idea to check the limit switches this way before exercising automatic limit switch seeking for the first time on a new machine.

The “Diagnostic” menu also has readouts for the manual controls used for Cycle Start, Joystick Jog and Feed Hold. The next session will discuss configuring these features.


Part 12 - Controls Configuration   (time 7:20)

This movie demonstrates how input from external controls from a control panel or pendant can be configured.

The machine operator can interact with the application program by means of externally wired controls from a pendant or control panel. This video explains how the application program can be configured for operator interaction with the machine.

The “Cycle Start” control is used to activate a physical action from the machine, such as moving stages from a manual control dialog, or initiating an automatic, G coded sequence.

Operator safety should be the primary concern for the machine designer. For this reason, the Cycle Start control should be designed to avoid accidental actuation.  Using a single keystroke or a mouse snap would be exceptionally dangerous. With this in mind, when configured to use the keyboard for “Cycle Start”, Ability Systems G Code Controller requires the simultaneous depression of two keys, “Control Shift” and “F2.

Alternatively, “Cycle Start” can be actuated by means of an external switch. When you un-check the “Keyboard Start Switch” field , a field entitled “Indexer LPT Command to Query Start Switch” appears. Any Indexer LPT command that reads the status of an input signal can be used. However, since the state of the “Auxiliary Input” line is indeterminate when disconnected, it will not fail safe if the switch becomes accidentally disconnected. Our demo machine uses a “scan” command, explained in the Indexer LPT manual in the chapter entitled “Switch Scanning and Joystick” in a manner that fails safe. When the switch is open or disconnected, the query result is zero. When the switch makes contact, the query result is one, as configured here.

Also in the interest of safety, G Code Controller makes sure that the query result is false before acknowledging it to be true. This prevents the Cycle Start action from “flying through” a menu selection if the switch was inadvertently activated. It also keeps the switch from being unsafely rigged.

For additional safety on some machines it may be desirable to require the operator to use both hands to activate “Cycle Start”. When the “Require two start switches” check box is checked, additional fields appear for the second start switch. G Code Controller discourages rigging by making sure both switches are not activated before acknowledging that they are both activated for “Cycle Start”.

A diagnostic menu is provided to check the operation of the Cycle Start input.

The feed hold feature was demonstrated in Part 5 of this series, entitled Controlled and Uncontrolled stopping. It is an essential component of most controlled systems. Switch wiring is explained in the Indexer LPT users’ guide in the section entitled “feed hold”. The feed hold switch permits motion when the circuit path is completed through the switch. Thus the feature fails safe – which is to say, motion will be arrested when the switch opens, or if the switch becomes accidentally disconnected.

Notice when you enable this feature the dialog presents a list box allowing you to choose from Indexer LPT signal groups that have not been allocated for stages or other uses.

This menu  alerts G Code Controller to the presence of the “Feed Rate Override” potentiometer.

The Joystick Jog feature is an integral part of Indexer LPT and a very powerful accessory to G Code Controller.  A separate session will be dedicated to explaining this feature.

The “Startup Commands” dialog allows you to enter a list of Indexer LPT commands and macros that automatically execute when the software loads. This feature provides for setting output signals at predictable levels, and establishing initializing conditions, such as an enabling sequence for spindle control. Macros for setting machine variables, such as tool pick up and drop off locations, are also accommodated here.

 M, T and S codes can be customized to accommodate a large range of design requirements, simple and complex.  For example, to customize an M code, snap over the “M Code” menu, then select the specific M code that you wish to customize using the spin buttons.  Snap over the “Configure” button to bring up the configuration dialog for that M code.

The list editor provides for a sequence of Indexer LPT commands and macros.  Indexer LPT commands are typically used to write to digital outputs or generate dwell time. Macros provide for things such as waiting on digital inputs, positioning stages to machine coordinates and setting machine variables.

The Passwords dialog helps guard against accidental setup modification. When you check “Require Password”, the entire menu will not appear when the software starts. You may gain access to that menu, however, using the “Access” selection from the “File” menu.

Once the design of your machine is complete the System menu is seldom accessed.  You may wish to hide this menu with password protection.  The Job setup menu, however,  is often accessed, but in some manufacturing operations it’s desirable to permit it to be changed only by qualified individuals. In this case, you may wish to password protect it as well.

Finally, if any changes have been made from the System Menu, the “Save System Setup” menu will appear. This option saves the system information to a single configuration file, which is automatically loaded the next time the program is run.

As mentioned in the previous session, the System menu pertains mostly to the design of your machine, and its configuration is not likely to change from job to job. System information, therefore, is accessed from a single menu and stored to a single file. Setup information that is more likely to change, however, is accessed from the Job menu, and can be stored to files with unique long file names. This is the topic of the next session, entitled “Job Setups”.


Part 13 - The Part Program   (time 3:47)

This movie explains how G Coded scripts can be set up for automatic operations.

The Job menu includes, but is not limited to the G Code scripts comprising the Part Program. The Part Program is the primary component of the Job setup, but there are other setups that are crucial as well, such as the position of the raw material in the workspace.  Some of these other setups will change from job to job, others will not. Notwithstanding, there are setups which are more closely related to the part that is being manufactured and less closely related to the design of the machine. G Code Controller keeps the setup settings that are more closely associated with the part being manufactured together under the “Job” menu, and allows you to save and retrieve these settings under a long file name. The extension of the file name is .CAM.

The Part Program consists of a text file, or a collection of text files that contain G coded script. The script defines the path of the tool, as well as other automatic operations such as manipulating a spindle, coolant, and automatic clamps. Each script is stored on the computer under a Windows OS file name. The dialog invoked from G Code Controller’s “Programs” menu allows you to specify the file name (or names) of the G Code Script, as shown here.

According to convention, one script can use routines contained in another script. However, there is no provision for OS file names in the Electronic Industry Association standard for G code scripting. Instead, one script refers to another by means of “O” numbers: O0, O1, O2 and so on. G Code Controller’s “Programs” menu allows you associate “O” numbers with their OS file names.

Automatic operation always begins executing the script designated as O0. In this example, the “O0” script calls a routine that is located in another script file, designated as O1. The association between O1 and its OS file name is made here, using the spin button to select the “O” number. The Browse button lets you snap the script into the job using a Windows file tree. Alternatively, you can type the name of the file into the Program Specification field.

When you snap the button entitled “Edit Program Text”  a text editor, typically Notepad, will open the file for editing -  or create a new file if the file of the name that you typed did not previously exist.

To recap, using File-Open reads the contents of a .CAM file into the settings accessible from the Job menu. This information includes which script file or files compose the Part Program. Other Job Setup settings affect the way that the Part Program is processed. Thus the other setup values accessible from the Job setup menu customize the way the Part Program manipulates the machine. This is the topic of the next session, entitled “Job Setups”.


Part 14 - Job Setups   (time 9:29)

This movie shows settings that customize the way that the Part Program interacts with the machine.

The previous session explained how the file or files that make up the Part Program can be set up into a Job. This session explains some other settings that affect how the Part Program manipulates the machine.

The location of the work within the operational area of the machine is another essential setup that may change from job to job. The positioning information contained within the Part Program always refers to a frame of reference called a “Fixture Offset”.   The “Fixture Offsets” settings allow you to offset the script’s dimensional frame of reference from the machine home position. G Code Controller supports up to six frames of reference, which can be changed within the G Code script using G54, G55, G56 up to G59. The default frame of reference is G54.

The Fixture Offset dialog displays the Stages that you set up as “Active” in the System configuration.  You can type the offset values for the stages into the respective fields. Alternatively, you can automatically apply the current position of each stage. Notice that manual positioning dialogs are available. You can apply the current position of each stage individually, as you might for example in a procedure to “touch off” the tool on the sides and top of a rectangular block. In this demo, a positioning block automatically arrests joystick motion at the fixture offset position, which can be automatically read into the Fixture Offset dialog using the associated control button. The “All” button applies the current position of all axes at once, in cases where that might be more convenient.

Automatic operation can be made to commence using one of two methods:  “ Run” or “Dry Run”.  The dynamics of motion for each of these methods, explained more fully  in Part 7 of this series entitled “Contouring”, is set up in the “Default Feed Rates” dialog. The “Dry Run” operation is often used to check the integrity of the tool path and assure clearance from things such as clamps. The “Dry Run” rates are often set higher than the “Production Run” rates in the interest of saving time.  An “F” command within the G Code script can be used to change the feed rate during the “Run” operation. The “F” command has no effect on the feed rate during a “Dry Run” operation.

The “Feed Rate Override” control can be selectively applied to Rapid Traverse and Vector Feed rates using this dialog. Since the Dry Run operation is generally used to check for tool collision, you would typically want to be able to manually control the speed of the tool during both Rapid Traversal and Feed cutting paths. During a Production Run operation, however, the Feed Rate Override is typically used only to adjust cutting speeds. However, in some production settings it may be important to keep the Feed Rate Override control from accidentally changing a cutting speed that had been previously determined. Leaving both “Feed” and “Rapid Traverse” check boxes unchecked accomplishes this purpose.

The “Contour Tool Feed” feature, also explained more fully in Part 7 of this series, is generally enabled. Disabling this feature allows you to advance the motion under control of the Part Program in finer increments for troubleshooting purposes.

The “Positioning Mode” determines how positioning numbers in the G Code script will be interpreted. Positioning mode can be changed within the G Code script by G90 and G91 commands.  Absolute Mode, instantiated in the G Code script by G90, interprets positioning numbers as distances from the fixture offset position.  Incremental Mode, instantiated by G91, interprets the numbers as distances from the current tool location. This dialog sets the default positioning mode.

Snapping over the “G02-G03” menu brings up the “Arc Translation” dialog. The “Center Point Location” group specifies how the center point locations for arc interpolation will be interpreted from the G Code Script. The “Always Incremental” setting is the most common, and similar to Fanuc controllers. Some older controllers interpret the center point location arguments as absolute positions. Some other controllers interpreted these locations according to the current positioning mode within the G Code script. If the mode was “Absolute”, instantiated by G90, then the center point values would be interpreted as absolute locations.  If “Incremental”, instantiated by G91, the center points would be interpreted as distances from the current position.  This group allows you to set up G Code Controller to emulate these different types of controllers. The “Always Incremental” setting, however, is recommended.

Arcs are approximated using multiple straight line segments called “facets”. “Segment Error” is the maximum distance between the facet and the true theoretical arc. For a given segment angle, segment error becomes more pronounced with larger radii arcs.

In most cases a given segment error is less tolerable for small radii arcs than larger ones. In order to accommodate the greatest range of large and small arcs in a single job, G Code Controller uses the following strategy:

Arcs are generated in segments subtending the setup value for “Segment Angle”. However, if the radius of the arc is sufficiently large, the arc will be divided into sufficiently small segment angles so that the setup value for “Segment Error” will not be exceeded. The “Maximum Segments per Arc” field guards against extreme proliferation of segments.

Arcs are subtended along the current reference plane, instantiated by G17 for the plane in X-Y, G18 for the plane in X-Z or G19 for the plane in Y-Z. This tool path demonstrates arcs subtended in these three planes. Also, the stage normal to the reference plane will be the drill stage for the canned cycle G codes. This dialog establishes the default reference plane.

If the “Skip Block” feature is enabled, using this menu, then any line (or Block) within the Part Program that begins with a front slash character (“/”) will be ignored.  In this example, three canned drilling procedures are performed at one inch intervals. With Block Skip off, all three operations are performed. With Block Skip on, the Block with the front slash character is ignored, and only two holes are drilled.

The “Tool Offset Table” menu provides for length and radius offset compensation for up to 100 tools. The spin buttons are used to select the tool that you wish to size. The diameter of the tool can be entered in the “D” field.  The length of the tool can be entered in the “H” field. The value for Tool length compensation can be conveniently determined using the “H Calculator’s” “Apply” button. You can use the manual positioning controls to “touch off” each tool on the drill stage’s fixture offset position. When you snap “Apply”, the relative offset for that tool will be automatically entered into it’s “H” field.

In some production settings it may be convenient to keep collections of tools pre-loaded in collets and sized. For this reason, you can optionally save and retrieve a collection of H and D offsets to a separate file. When the job is loaded, then, the values saved under that file will be automatically loaded.

As mentioned, most of the settings accessible from the Job menu will not have to change from job to job.  Sometimes only the file name or names of the Part Program will need to be changed. All of the settings, nevertheless, can be saved together under a unique file name using “File-Save as” – or changes can be used immediately to run the Job, which is the topic of our next session entitled “Automatic Operation”.


Part 15 - Automatic Operation   (time 9:39)

This movie demonstrates how to run a G Code script.

G Code Controller’s “Production” menu consolidates the controls that you would typically use to operate your machine. As mentioned in the previous session, entitled “Job Setups”, there are two types of automatic operation: “Run Tool Path” and “Dry Run Tool Path”.

“Run Tool Path” and “Dry Run Tool Path” are identical with the following exceptions. “Dry Run Tool Path” follows the feed rates set up in the Job specifically for “Dry Run” and does not respond to changes in feed rate that may be directed within the G Code script. Also, M codes that are configured in the system to be disabled during “Dry Run” are excluded. For example, the M code used to activate a coolant may be configured to be disabled for “Dry Run”.

With the exception of “Dry Run Tool Path”, all of the selections of the Production menu are accessible from the tool bar.

In the interest of safety, all production operations that physically interact with the machine tool require: menu selection, dialog confirmation followed by “Cycle Start”. As per session 12, entitled “Controls Configuration”, “Cycle Start” can be configured in one of three ways: the simultaneous depression of two keyboard keys, or the closure of a single external switch, or the simultaneous closure of two external switches.

In this demo the machine is made to automatically perform a limit seek sequence using the “Limit Switch Seek” menu. The hint on the status bar provides a more complete description. A button on the tool bar is provided for convenience, and a pop-up tooltip reminds you that you are making the selection that you expect. The “Ok” selection on the dialog that appears confirms that you want the machine to proceed with automatic limit switch seeking. After you snap “Ok”, the dialog prompts you to activate “Cycle Start”. When I press the Cycle Start switch, the automatic operation commences.

The “Limit Seek” operation is typically configured to automatically set the home location for each stage after retracting it from the switch contact position, thus initializing position tracking. You can alternatively initialize position tracking from any position within the machine’s operational boundaries using the “Set Home” menu.

The “Move by” menu does not require position tracking to be initialized, since it is used to move stages by incremental amounts from the current position. The values that you enter in this dialog are persistent, so you can close the menu and re-open it later to use the same values that you had typed in. In this demo, the Z stage is being moved down a thousandth of an inch at a time as you might use to accurately position a dial indicator.

The “Position to” menu does require position tracking to be initialized, since you are directing the stages to a destination relative to an established home position. For convenience, the current position is automatically entered into the destination fields when the dialog appears, so you can simply change the value of the stage that you want to move. You can optionally use the selector buttons to determine whether Machine or Fixture coordinates are being used for destination points.

In this demo the Fixture Offset for G54 is set to one inch for stages X and Y. Notice the current position in the destination fields change when I switch from “Machine” to “Fixture”. Similarly, the “Position Readout” can alternately display Machine or Fixture Coordinates as you snap over its selector button. The fixture that you are referencing can be changed from the “Position to” dialog using the drop down list. In this demo, the Fixture Offset for G55 is set to ten inches for stages X and Y. Notice the Position Readout changes as I change the current fixture from G54 to G55.

Rapid traverse rate is used by the “Move by” and “Position to” controls. Using the selector check boxes, you can move each stage individually, or all together.

The optional “Joystick Jog” control, demonstrated in Part 5 and Part 14 of this series, is most conveniently used for both rapid and accurate manual positioning.

The “Instant Block” menu is typically used for manual control over M codes.

The “Run Tool Path” and “Dry Run Tool Path” dialogs are almost identical. If Feed Rate Override is enabled, use the readout in the Status group to make sure that its dial is set to an expected value, then snap “Ok” to confirm you want to commence with automatic operation. You will then be prompted for Cycle Start to commence. In the interest of safety, if you snap away from the control dialog, your confirmation will be removed. This is to prevent another window or application from covering the “Run” dialog while it awaits Cycle Start to proceed. Simply snap Ok to re-confirm, then commence with Cycle Start.

In this demo I’m milling a cutout pattern into the side of a plastic enclosure. The vice that I am using to hold the work has a reference block attached to it. I have predetermined the distance that the starting point of the part program should be from the edges of the reference block.

To establish a reference point for Stages X and Y, first I use the joystick control to touch off on the edges of the block with a 1/4 inch rod, which is inserted into the spindle chuck as a reference. Each time I touch an edge, I snap the position into the Fixture Offset field for its associated stage.

Now I remove the 1/4 inch rod and insert the tool that I am going to use for cutting, which happens to be a 1/16 inch diameter end mill. I touch off the tip of this tool to the top of the reference block to establish a Z reference position.

I have calculated that the starting point for my tool path is offset from the reference block 2.263 inches in the X direction, 2.109 inches in the Y direction and 3.704 inches in the Z direction.

Since I have already set a fixture offset position, I can use the “Position to” control to locate the spindle these distances away from the current fixture home. The spindle is now located at its fixture offset position for this job.

When I snap the Apply Current Position control button in the Fixture Offsets dialog, the current machine location is automatically read and entered as fixture offsets.

The job is now ready to run. I snap Run to bring up the Run control, then Ok to confirm, followed by Cycle Start.