An expert system to control the manufacturing process of high-precision, hexagonal nuts

An expert system to control the manufacturing process of high-precision, hexagonal nuts

Saneifard, Rasoul


The expert system described In this paper was developed by students to regulate the manufacturing process of made-to-order, high-precision, hexagonal nuts. The system consists of a set of rules, based on facts, written in a specific expert system programming language, with each rule Implementing a certain action. The actions involve the operation of a conveyor belt, robot arm, and drill press. The project is appropriate for engineering and engineering technology curricula at the senior and graduate levels and is an excellent tool to teach students about the process of designing an expert system. It is anticipated that this paper will contribute toward a better perception of how an expert system can be designed and applied to real-world industrial problems In an academic environment.


An expert system method may be a desirable option when an algorithmic solution is impossible or improbable. An expert system is designed to solve difficult problems using knowledge and inference procedures. Generally, the system provides expert responses as a user (human) supplies necessary information. The expert responses are generated from an inference engine that draws conclusions from a knowledge base consisting of rules, facts, and actions. An expert system is intended to imitate, in all respects, the decision-making ability of a human expert.1

The expert system presented here is the result of student effort. It was originally assigned as a class project to explore the principles and programming of expert systems. The system was designed to control the manufacturing process of a unique, high-precision, high-quality product with limited production in a fully automated, clean-room environment. As demand for the product is rare and manufacturing conditions are strict, the cost of rejects is high and near-100% quality assurance is expected.

The programming language chosen for this scenario was C Language Integrated Production System (CLIPS), an expert system programming language developed by NASA at the Software Technology Branch of the Johnson Space Center.2 CLIPS is a rule-based language, meaning that the knowledge base contains the domain knowledge coded in the form of rules. An efficient algorithm matches facts against rule patterns to determine which rules apply to a particular condition.1 Each rule implements a certain action that controls the process and solves problems.


The expert system described controls the manufacture of made-to-order (i.e., limited quantities), high-precision, hexagonal nuts. This process was chosen because it is simple and may be used as a teaching tool.

During the manufacturing process, hexagonal, highstrength, epoxy-impregnated graphite templates are delivered to a drill press through a conveyor and robot-arm arrangement. A vision sensor, located directly above a stepper motor, ensures precise positioning of the graphite template prior to drilling and tapping. This step is critical because the corners of the template may be damaged by the robot arm or the jaws of the drill-press clamp. To facilitate correct alignment, each graphite template is placed on a disk that can be rotated by a high-precision stepper motor to coincide with defined cursor positions within the vision sensor. Figure 1 shows the desired position of the hexagonal template with respect to the cursor positions.

After the template is aligned properly on the disk, a robot arm grasps and places it between the jaws of a drill-press clamp. The clamp then grips the template so that it will be secure during the drilling and tapping operations. If a template is not detected by the vision sensor (due to a malfunction of the template handling system), neither the robot arm nor the drill press will operate.

At any given time, the dual-head drill press has one drill bit and one tap in place from a backup inventory of twelve drill bits and six taps. If either of these tools break, the drill press will automatically replace the broken bit or tap and the robot arm will discard the damaged template.

Finally, the conveyor belt and robot-arm arrangement is synchronized with the drill-press operation. A new template can be positioned under the drill press only after the previous one has been drilled, tapped, and removed from the clamp. The robot arm must withdraw the finished product from the drill-press clamp and deliver it to an out bin. A schematic of the manufacturing process is shown in figure 2.


In this student project, the expert system will control the manufacturing process of unique, hexagonal-shaped nuts. Because only two hundred units can be produced per eighthour shift, state-of-the-art technology is needed to assure reliable process operation and to produce a superior product in a fully automated environment free of impurities.

Prior to coding the facts and rules into the expert system, the manufacturing system’s sequential operation, including decision points, must be fully understood and documented. Student analysis produced the following:

The operator starts the process at the beginning of an eight-hour shift.

The conveyor belt starts automatically if the vision sensor does not detect a template.

The operator is asked to check the delivery system if a template has not been detected for five consecutive times, and the process continues only when a template is made available.

Upon detection of a template by the vision sensor, the conveyor belt stops.

The positioning of the template is corrected by the stepper motor, if necessary.

The robot arm grasps the template from the conveyor belt and transports it to the drill press for drilling and tapping to required specifications.

The operator is asked to check the robot-arm clamps if a template has not been grabbed for five consecutive times, and the process continues only when the clamps are operating properly.

The template is drilled, and the drill bit is checked to detect if it is broken. If broken, the drill bit and template are discarded, and the remaining number of bits in inventory is displayed and the bit is automatically replaced.

The template is tapped, and the tap is checked to detect if it is broken. If broken, the tap and template are discarded, and the remaining number of taps in inventory is displayed and the tap is automatically replaced; otherwise, the completed nut is delivered to the out bin.

The number of bits and taps in inventory is checked after each nut is drilled and tapped, and a warning message is given if the inventory is low (

The process stops if no bits and/or taps are left in inventory and the operator chooses not to or fails to refill the supply.

The robot arm returns to home position after discarding a bad nut or after delivery of a good nut to the out bin, and the process is repeated.

The procedure stops at the end of the shift.

To facilitate the translation of the process into expert system language, several assumptions are made about process execution, including the following:

All machinery is operational at the start of the shift.

The cursor positions within the vision sensor determine the precise positioning of each template. If a template is not aligned properly, the sensor signals the stepper motor to adjust the template to the correct position as shown in figure 1.

The stepper motor can rotate in both clockwise (+) and counterclockwise (-) directions between -30 deg and 30 deg to correctly position the template at 0 deg.

The robot arm can operate among five different positions as follows:

Home position / P0

Template under the sensor / P1

Drill press / P2

Out bin / P3

Discard bin / P4

The robot arm will not drop the template while carrying it from one position to another.

The robot arm will not interfere with the operation of the drill press.

When open, the drill-press clamps will provide enough clearance to allow the robot arm to pick up the template. The number of bits and taps at the start of the shift are twelve and six, respectively.

The drill press will automatically replace a broken bit or tap that is detected by a vision sensor located in the drilling mechanism.

The out bin will be emptied whenever it is full or at the end of the shift.

The expert system is interfaced with a timer that will stop the process at the end of the eight-hour shift.

If the process is stopped for any reason, it must be restarted by the operator.

The resulting expert system functions like many other expert systems designed to instruct a machine to perform different “human” functions, such as monitoring quality control, controlling the manufacturing process, debugging the system, and diagnosing problems. Furthermore, expert systems may be combined with conventional control systems to enhance overall monitoring and controlling capabilities of the operation.3,4


The expert system designed in this project utilizes a number of rules that are written in CLIPS programming language, with each rule implementing a certain action. CLIPS is low-cost software written for speed and portability. It is easily integrated with external systems and uses a powerful pattern matching process called the Rete Algorithm. The Rete Algorithm stores information about defined rules in a network and, instead of matching facts with every rule, obtains its speed by looking only for changes in matches on every cycle while ignoring the static data that does not change from cycle to cycle.

To solve a problem with CLIPS, a set of data called facts must be given to the software so that it can “reason.”1 For this manufacturing process, fourteen facts were developed and are shown in table 1.

A total of twenty-four rules were then written based on these facts. Figure 3 shows the expert system’s rule tree that was developed to control the overall manufacturing process of the hexagonal nuts. Table 2 shows the CLIPS language code for two of these rules along with their respective pseudo codes. A complete listing of the CLIPS language code for the project may be obtained from the authors.

Finally, the Appendix lists cases that demonstrate several scenarios that may occur during operation of the expert system so that students can understand the system’s development and performance necessary to achieve the desired outcome.


This paper describes an expert system designed by students to control the manufacturing process of specific, high-precision, distinct-material items: hexagonal nuts made of epoxy-impregnated graphite for space station applications. State-of-the-art technology is required to closely monitor and control the automated process in the most cost-efficient manner for specialized, low-quantity production in a clean-room environment. To accomplish this goal, the CLIPS programming language is used to implement twenty-four rules that control the operations of the manufacturing process.

The expert system development was a student class project, and it proved to be a very effective introduction to the fundamentals of expert system design. Moreover, students may explore more complicated systems using the basic method outlined in this paper. Other approaches, such as Programmable Logic Controllers (PLCs), may also be suitable for controlling this type of process. However, since the primary intent in this application was to explore the principles of expert system design and programming, other methods are considered outside the scope of this project.


The author would like to acknowledge the support of the Organized Research Committee of Texas Southern University, Houston, Texas.


1. Giarratano, J. Expert Systems: Principles and Programming. Boston: PWS-Kent, 1989.

2. Giarratano, J. “CLIPS documentation, 5.1 and 6.0 releases.” Houston, NASA, 1993.

3. Irvine, Daniel, and Mysore Narayanan. “Quality Control-An Overview.” Proceedings of the 1994 IEEE Idea/Microelectronics Conference, September 27-29, 1994, Anaheim, Calif.: 206-9.

4. Cram, Robert S., and Bryan R. Clarke. “Expert System Monitoring and Control of a Polymer Plant.” Proceedings of the IEE Colloquium on Expert Systems in Process Control, March 28, 1988, London: 611 – 6/6.

Rasoul Saneifard, Prairie View A&M University

George J. Wakileh, New Mexico State University

Nadipuram R. Prasad, New Mexico State University

Howard A. Smolleck, New Mexico State University

Rasoul Saneifard received a B.S. degree in Electrical Engineering and a M.S. degree in Engineering from Prairie View A & M University, and a Ph.D. degree in Electrical Engineering from New Mexico State University. From 1995 to 1998, he was a faculty member at Texas Southern University. Since January 1999, he has been with the Department of Engineering Technology at Prairie View A & M University, where he currently holds the rank of assistant professor. In the summer of 1998, he participated in the ASEE-Navy Summer Faculty Research Program at the U.S. Navy Air Warfare Center/Aircraft Division in Patuxent River, Maryland. Dr. Saneifard is a member of Tau Alpha Pi National Honor Society. His research interests include fuzzy logic, electric power system analysis, and electric machinery.

George J. Wakileh received a B.Sc. degree in Electrical Engineering from the University of Jordan in 1986, a M.S. degree in Electrical Engineering from New Mexico State University In 1993, and a Ph.D. degree In Electrical Engineering from Kansas State University in 1995. He is currently employed by Omicron GmbH, Austria. Dr. Wakileh has worked for the Jordanian Royal Scientific Society, Amman, and Unitech Engineering, Stavanger, Norway. Dr. Wakileh is a senior member of the Institute of Electrical and Electronics Engineers (IEEE).

Nadipuram R. Prasad has over fifteen years of experience in the power engineering field. From 1975 to 1985 he worked at American Electric Power where he was involved in various capacities in the Bulk Transmission Planning Division and was manager of the System Dynamics Analysis Section. Presently, he is an associate professor in the Electrical and Computer Engineering Department of New Mexico State University, where he received his Ph.D. degree. His research interests are in the areas of control systems and the application of advanced artificial intelligence concepts to the operation and control environment of power systems.

Howard A. Smolleck received B.S., M.S., and Ph.D. degrees in Electrical Engineering from the University of Texas-Arlington. From 1974 to 1979 he was a faculty member at Old Dominion University, and since August 1979 has been with the Department of Electrical and Computer Engineering at New Mexico State University, where he currently holds the rank of professor. He has developed and taught numerous short courses on power systems analysis, machine control, and process control. Dr. Smolleck is a member of Tau Beta Pi, Eta Kappa Nu, Alpha Chi, and is a registered professional engineer. His research interests include electric power system analysis, electric machinery, and the development of educational software.

Copyright American Society for Engineering Education Spring 2000

Provided by ProQuest Information and Learning Company. All rights Reserved