## Automated generation of machining sequences

When I was an undergraduate student I took a course on Machining. I did not enjoy to study the details of how various machine tools are built or how they work, but I had a lot of fun creating machining sequences, which required ingenuity. The regular visits to the machine shop were also fun. After all, it’s not everyday that one gets to see an object taking shape right before one’s eyes :-)

The instructor would give us a certain mechanical part and ask us to come up with a machining sequence for it. If you are not acquainted with machinist’s jargon, here’s a definition:

Definition: a machining sequence is a sequence of machining operations (such as turning, drilling, milling, boring, broaching, etc) that remove material from, say, an aluminium block in order to obtain a desired object (such as a piston or a cylinder for a car engine).

Note that machining is about removing material, i.e., it’s a subtractive technology. By contrast, rapid prototyping is an additive technology.

Let us consider an example. Suppose I give you the following 3D model:

What machining sequence would you propose? Here’s my proposal:

2. Given the object’s rotational symmetry about the longitudinal axis, use the lathe to shape the cylindrical / conical parts. Use the lathe also to drill the central hole along the longitudinal axis.
3. Note that the surface of the central hole is not smooth. It has “teeth”. I would say that a combined lathe / broach would allow one to obtain the “teeth”.
4. Drill 6 holes at the base.
5. Use a milling machine to remove material at the base, in between the 6 holes.

Here’s a sketchy illustration of the machining sequence I proposed, where a machine tool is assigned to various sections of the object being fabricated:

I am not an experienced machinist, and I make no claims that the machining sequence I have just proposed is any good. If you have ideas, feel free to share.

Suppose you have a 3D model of some object you would like to fabricate via machining. An experienced machinist is able to visualize the object and devise a machining sequence. Could a computer be taught to do the same?

Problem: develop algorithms that, given a 3D model of some object, automatically generate machining sequences. These algorithms should determine which machining operations to use, and in which order.

The machining sequence to be carried out is a function of the geometry and the topology of the object to be fabricated. Hence, algorithms that automatically generate machining sequences would have to “understand” the geometry and the topology of the given 3D model. This suggests that ideas from Computational Geometry and Computational Topology could perhaps be applied in this particular problem. For example, if the object to be fabricated has cylindrical holes in it, then it’s likely that one should use a drill or a lathe. These holes are a geometrical / topological property of the object. How can a computer be taught to understand them?

Furthermore, there probably is more than one possible machining sequence to fabricate the desired object from the same crude block of metal. If there are many possible machining sequences, then one can start thinking of optimality. Some possible optimality criteria would be to minimize the total number of operations, or to minimize the total fabrication time, for example. Can you think of other criteria? Given one optimality criterion, one can then try to find the “best” machining sequence.

I wonder if Machine Learning could help, too. Give the same 3D model to an experienced machinist and to the software system we’re developing. Both devise machining sequences. The human will probably beat the computer. Feed the computer with the machining sequence devised by the human. Repeat this procedure many times. Iterate until one has obtained a skilled “machining expert system“. The ingenuity and creativity required to transform crude blocks of metal into beautifully machined parts would be emulated by algorithms. I make no claims that this would be easy to implement ;-)

I looked for work on this area. I found a few patents [1]-[5], and a bunch of technical papers [6]-[12] dedicated to this problem. Interestingly, most patents I found on this topic were filed by Japanese. This should come as no surprise. After all, the Japanese are notoriously good at optimizing manufacturing processes.

This post is admittedly vague. I propose a problem, but I do not present any sketch of a solution. Basically, I wanted to share my thoughts in order to invite constructive discussion. Any ideas?

__________

References

[1] Hajimu Kishi, Masaki Seki, Kunio Tanaka, Teruyuki Matsumura, Automatic machining process determination method in an automatic programming system, U.S. patent #4723203. Filed: 1985 / Issued: 1988.

[2] Koichi Asakura, Machine tool with tool selection and work sequence determination, U.S. patent #4739488. Filed: 1985 / Issued: 1988.

[3] Yasushi Fukaya, Yuto Mizukami, Method for determining a machining method in numerical control information generating apparatus, U.S. patent #5107414. Filed: 1989 / Issued: 1992.

[4] Kotaro Watanabe, CAD/CAM unit data generating apparatus and process, U.S. patent #5297022. Filed: 1992 / Issued: 1994.

[5] Takashi Takegahara, Shigetoshi Takagi, Koji Suzuki, Machining sequence determining method and apparatus for wire-cut electric discharge machining and computer readable medium storing a machining sequence determining program, U.S. patent #6445972. Filed: 1999 / Issued: 2002.

[6] In-Ho Kim, Jung-Soo Oh and Kyu-Kab Cho, Computer aided setup planning for machining processes, Computers & Industrial Engineering, 18th International Conference on Computers and Industrial Engineering, Vol. 31, Issues 3-4, pp. 613-617, December 1996.

[7] Z. Gu, Y.F. Zhang, A.Y.C. Nee, Identification of important features for machining operations sequence generation, International Journal of Production Research, Vol. 35, Issue 8, pp. 2285-2308, August 1997.

[8] Majid Tolouei-Rad, An efficient algorithm for automatic machining sequence planning in milling operations, International Journal of Production Research, Vol. 41, Issue 17, pp. 4115-4131, November 2003.

[9] W.D. Li, S. K. Ong, A.Y.C. Nee, Optimization of process plans using a constraint-based tabu search approach, International Journal of Production Research, Vol. 42, Issue 10, pp. 1955-1985, May 2004.

[10] D. Kingsly Jeba Singh, C. Jebaraj, Feature-based design for process planning of machining processes with optimization using genetic algorithms, International Journal of Production Research, Vol. 43, Issue 18, pp. 3855-3887, September 2005.

[11] L. Wang, N. Cai, H.-Y. Feng, Z. Liu, Enriched machining feature-based reasoning for generic machining process sequencing, International Journal of Production Research, Vol. 44, Issue 8, pp 1479-1501, April 2006.

[12] Rezo Aliyev, A strategy for selection of the optimal machining sequence in high speed milling process, International Journal of Computer Applications in Technology, Vol. 27, Issue 1, pp. 72-82, September 2006.

### 12 Responses to “Automated generation of machining sequences”

1. anand Says:

… nevertheless exciting and interesting. One of the problems that I really wanna try my hand at. Will do as soon as I get some free time…

2. Douglas Webb Says:

One critical aspect of the machining sequence is that at each step, the part’s geometry must allow it to be clamped securely into the machine that will be used next, without interfering with the machining process on that machine. The algorithm needs to know all about the clamps and clearances needed for each machine and operation, in addition to what each operation can do to the part.

• Rod Carvalho Says:

I am aware of that. I abstained from including such details in order to avoid “cluttering” the post with too much information. I wanted to focus on the forest, not on the trees ;-) Another reason is that, though I understand the difficulty of transitioning from one machining operation to another, and even though I can visualize it, it’s been a long time since I had that machining course, and I have forgotten most of the technical jargon in the meantime…

I believe it would be hard to teach a computer how to switch from one machining operation to another in an optimal way. We, humans, can do it easily. But endowing a machine with imagination is very hard!

3. dleary Says:

I took machine shop in high school a long time ago, and am definitely not a pro, but:

It looks to me like most of this part would be cast. It certainly looks like the spaces between the 6 holes was cast (because of the rounded corners).

What would be the point of milling away the material there? It wouldn’t affect the functionality of the part (except to reduce weight slightly). You would save a little money in the cost of materials (with the metal recovered from milling between the holes), but adding another pass with another tool would probably offset that cost savings.

It looks like the ‘precision’ parts are the toothed hole, the 6 bolt holes, and the flat bottom mating surface.

• Rod Carvalho Says:

It looks to me like most of this part would be cast. It certainly looks like the spaces between the 6 holes was cast (because of the rounded corners).

I entirely agree. Note, however, that I needed a 3D model to serve as an example of a machining sequence, and I liked the shape of this mechanical part in particular ;-) After all, I suppose that the average reader of this blog lacks experience in the machine shop, and examples convey ideas in a more efficient manner.

Indeed, it would make a lot more sense to fabricate the part via casting. But one would need a mold, and to obtain a mold, one would need a prototype, right? Hence, wouldn’t it make sense to machine a block of metal to obtain the desired mechanical part? Once one had a prototype, one could make a mold, and fabricate many other parts via casting.

What would be the point of milling away the material there? It wouldn’t affect the functionality of the part (except to reduce weight slightly). You would save a little money in the cost of materials (with the metal recovered from milling between the holes), but adding another pass with another tool would probably offset that cost savings.

Once again, that’s a very good point. It would only make sense to use milling if one wanted a prototype. For mass production, it would be really, really dumb to use milling.

It looks like the ‘precision’ parts are the toothed hole, the 6 bolt holes, and the flat bottom mating surface.

Agreed. I guess the best solution would be to use casting to obtain a rough model of the desired object, and then machine the parts that you mentioned. I have no idea what is the use of this mechanical part, so it’s hard to guess what should be and what should not be machined. I am pretty sure the toothed hole needs to be machined, though.

4. Rod Carvalho Says:

By the way, I have just found this cool video of a V8 engine block being machined on a Matsuura 5-axis MAM72-63V CNC machine tool:

Very impressive, indeed!

5. pebbie Says:

funny enough, i also happened to stuck to machining topics lately. unfortunately, i’ve never take any class/course about machining so i have to dig about it from books.

well, some modelling package creates the model using boolean ops which can be translated to machining sequences. but if you’re asking about b-rep to cnc seqs. that would be interesting problem to face.

IMHO, the initial solution to this problem would be just as you wrote. it would combine the knowledge of computational geometry tools driven by rule-based expert system. since the machining operation is subtractive that would be analogous to combinatorial search problem.

2 use set difference morphology to achieve which material to be removed (R)
3 reduce the detail (holes, teeth) for later processing (using morphological operators)
4. segment the volume mesh.
5. approximate each segmented mesh with geometries associated with each machining tool (knapsack-like problem)

it seems that it is enough to arrange the rule heuristically or trying combinaton of sequences using genetic programming since it’s solution is so alike with CSG modeling (tree).

• Rod Carvalho Says:

Wow! I had some vague ideas of possible avenues of research worth exploring. By contrast, you actually have a “sketch of a framework” on which one can start working :-)

I have very little experience with 3D models, Computational Geometry, and the like… so I need to study a lot before I can even try to take a shot at this problem. If you ever get to attack the problem and happen to make some progress, please let me know. I would love to hear about it.

6. ARM Says:

A ideia é interessante. Sem pensar muito no problema, eu diria que o busílis será o computador ser capaz de identificar o starting point: qual a primeira operação a aplicar na peça. As restantes devem ser pacíficas. Isto deve ficar um algoritmo complicado se, para além das operações em si, adicionares os pontos de fixação da peça para cada operação de maquinagem. Aí é que o problema se deve tornar bicudo, pois o computador é bem capaz de sugerir pontos de fixação absurdos, apesar de teoricamente possíveis. Talvez se usarmos um sistema CAD que, em vez de apresentar apenas a geometria final, mostre também os passos necessários para desenhar essa geometria, o computador estabeleça uma relação entre cada etapa em CAD e uma determinada operação de maquinagem. Por exemplo: uma peça de revolução => torno.

É um desafio interessante :-)

7. Chuck M. Says:

Machining is feasible in any situation where the tooling costs cannot be amortized in the course of a production run, or when a higher-strength ‘billet’ component is needed to handle stresses a casting cannot.

That said, your basic strategy is fine, though the component will need transferring to a sub-spindle — or turned 180º in the primary spindle — to machine the flange-side. Any ‘multi-task’ lathe (turn & mill) could finish this part; bolt-hole circle and internal spline included.

• Rod Carvalho Says:

Thanks for the insight. It’s good to have feedback from someone with experience and expertise in manufacturing.

• Chuck M. Says:

Thank you Rod. Glad there’s something here I might shed a little light on.

Being only a hobbyist programmer, I’m afraid that — while very interesting — much of the information here falls into the category of, “over my head”. That probably won’t keep me away though. :)

Cheers