Use VC++ process designing to realize CNC Turning to emulate

  • Time:
  • Click:214
  • source:NEWRGY CNC Machining
Summary: Introduced the implementation method that computer of process of a kind of CNC Turning emulates. Applied object-oriented technology to develop Windows software, should emulate software to be had not only very strong practical, and have apparent advanced sex. The article is emulated to trends of cutting tool contrail and machine process trends to emulated a technology to have detailed introduction. Software runs the effectiveness that proved it and validity. The treatment copy of numerical control program is one of emulation domain important facet really, also be one of the CIMS important segment. Examine traditionally the method of validity of numerical control program is to use wooden model, wax-pattern or plastic pattern to try cut examine in order to undertake. And fall in computer environment, using numerical control to emulate a method to undertake the validity of numerical control program examines is a kind of new method. Through machining the emulation of the process to the spare parts, can check the validity of numerical control code, whether is there interference between the cutting tool in still can examining treatment process and workpiece, machine tool and clamping apparatus (include to collide and be cut too) phenomenon. Treatment process is emulated can compare bona fide report to give actual cutting to machine a process. The error that discovers in emulation process can undertake amendatory immediately. This kind does not need to examine through making counting accusing lathe to try actually cut the convenient characteristic when the method of numerical control code has fast and intuitionistic, province. It saved manpower and material resources, improved manufacturing efficiency, assured to machine quality, got used to modern market to develop production demand to the product. There is the software that be developed below DOS system and runs before. As object-oriented technology and the occurrence that VC++ develops a system, development more be helpful for compositive at CAD/CAM system, use more convenient WINDOWS software to have very great sense. 1 CNC Turning emulates systematic structure and treatment of procedure of flow numerical control to emulate a system is one of CAD/CAM compositive system main component, it is to be based on the turning of cutting tool database to emulate systematic software. Dynamic emulation subsystem is the core of whole system, emulate the target that is a system. Emulated content includes to finish cutting tool contrail to emulate, the cutting treatment of purify material is emulated, cutting tool and be machined interfere between the spare parts (be cut too and collide) examination. To CNC Turning treatment, this treatment emulates a system to want to finish the following jobs: Cutting tool contrail is emulated, cutting treatment is emulated, interference is checked and submit emulation report. Cutting tool database is another of the system main component. It is the logistics safeguard of emulation system. It contains much cutting tool data and accomplish active management. The input that management of cutting tool data includes data, delete, browse, search etc. Systematic model is shown 1 times like the graph. Lathe tool basically involves columnar face, taper seat, spherical, whorl, end panel, grooving to the treatment of the spare parts, cut off the treatment that waits for the surface. No matter machine what kind of spare parts uniform it is workpiece does circumgyrate to move (namely advocate athletic) : And the exercise that cutting tool does linear, circular arc or other contrail (namely feed motion) . In CNC Machining program these motion can pass the instruction such as simple G01, G02, G03 to finish. Emulating a system as a result of this is pair of NC programs the imitate in the PC, to can be on PC screen in emulate trends shows the athletic contrail of cutting tool or cutting process, must dictate numerical control program to the interpreter comes over. Finish pair of NC programs to undertake parse, the job such as coordinate changeover, its process is as follows: Emulation process should undertake those who make handling make file of information of coordinate of a NC to numerical control program. This file is the result that has parse and coordinate shift to NC program. Numerical control process arises automatically by CAD/CAPP/CAM compositive system or artificial clavier is inputted. It is NC coordinate file explanatory program is read from inside file of NC coordinate information take cutting tool news and read from inside file of cutting tool library take corresponding cutting tool news. 2 it is NC coordinate file explanatory program is read from inside file of NC coordinate information take statement of cutting tool exercise and coordinate news, the can achieve pair of cutting tool motion orbit that calls corresponding treatment to emulate algorithm to make is emulated, cutting treatment is emulated reach interference to check. Make emulation report, refer numerical control machine tool to operate personnel to do an analysis. Graph the 1 turning that is based on a database emulates systematic model the identifying of code of 2 numerical control method and grammar examine numerical control machine tool works according to numerical control program, parameter of quantity of contrail of the craft order that numerical control program recorded a spare parts to machine, motion and azimuth, displacement, craft (deepness of rotate speed, feed, cutting) and auxiliary movement (the supply) that exchanges fluid of knife, gearshift, cutting. A whole CNC Machining process is comprise by a certain number of block, average in the program performance is a code. Block has definite pattern, namely the permutation of the word in block, book writes method and order, and the length limitation of every word and whole block and regulation. Different numerical control machine tool controls a system to often have different block pattern, format not system of numerical control of conform to criterion is not accepted. At present domestic and international commonly used block format is alterable block " word address format " . Every word in block begins with address accord with, have symbol and number ever since, the permutation of code words does not have strict requirement orderly, the code words that does not need and as same as upside add effect word need not be written. The ISO4683 of formulate of international Organization for Standardization, 1, the pattern that 1982 standards set is shown as follows: N.

.

.

G.

.

.

X ± .

.

.

Y ± .

.

.

Z ± .

.

.

I ± .

.

.

J ± .

.

.

K ± .

.

.

M.

.

.

S.

.

.

T.

.

.

F.

.

.

Among them N indicates serial number: G instruction says to prepare functional statement, compensation of plane of department of coordinate of the opposite motion contrail that it uses formulary cutting tool and work, machine tool, coordinate, cutting tool, coordinate slants a variety of treatment operations such as buy: X, Y, Z is the address accord with of reference axis: I, J, K uses the coordinate of the circular arc in describing treatment: M calls auxiliary function statement: F, S, T is instruction of feed speed instruction, main shaft rotate speed and injunction of cutting tool order respectively. The emulation process of CNC Machining basically is the imitate of pair of NC code, for this, want to have numerical control program the analysis above all, come out the effective to emulating composition extraction in numerical control program next, form a file to be called for using a program, of NC program compile explanatory process to divide the following paces to undertake: ① reads in NC program. Establish a target of kind of Cbuffer that answers relatively with format of block of numerical control code above all, this object is buffer of a data, because NC program code is a main action to operate an unit with group, set every group to be a basic location so, block medium CNC Machining information is ordinal numerate: ② reads in NC program line by line, undertake according to the effectiveness regulation of NC program character effectiveness checks: ③ filter divides the annotate character in block. Two paces of ② and ③ are artificial to examining manuscript NC program is very important, can discover the book writes a mistake from which: ④ undertakes other regulation is checked, the digit of word of example exactly the number, digital limits extraction a cost: ⑤ in order to go (namely a block) the significant information that gives extraction for the unit carries out semantic analysis, change machine coordinate into window coordinate, finally, keep the coordinate after commutation file of coordinate NC information in. The meaning that executive semantics is analysed even if should identify G, M, S, F, T to wait, include the number after the letter to be handled together again next, make the response that alternates about machining information and coordinate of cutting tool contrail: M repeats above process, till ending of numerical control code, formed a complete NC information file so. Because different numerical control system is syntactic somewhat difference. This treatment emulates a system to basically be a basis with system of F@NAC numerical control and ISO6983-1-1982. In this emulation software, main identifying the effectiveness regulation of NC program is as follows: The effective character set of ① NC program is: Number 0 ~ 9: English letter N, G, M, T, F, S, X, Y, Z, I, J, K, R: Symbol % , (, ) , / : The group of ② NC program must be a symbol " % " or annotate goes. In this numerical control system, symbol " % " the mark that is program begin: The number after ③ G code and M code must be two digit word and for effective code, for example: G00, G01, G90, M00, M06: Code of G of ④ same group cannot reappear again in group now. For example: G00 represents fast fixed position, g01 represents linear interpolation, they cannot appear in same travel: The number must be after ⑤ S code and T code, and suffer specific restriction of use machine tool parameter. The number after T represents knife number, it should not exceed the tolerance of library of machine tool knife. The number after S is main shaft rotate speed, it should not exceed certain range. Additional, to numerical control program medium add effect dictates, this emulation system used data to the method of buffer reads access to accuse code line by line and carry data all the time, solved problem of instruction of supportive add effect conveniently so. The trends of contrail of 3 cutting tool emulates the dynamic copy that reachs cutting process to emulate cutting tool contrail is a kind of method that machines the contrail in the process to check validity of CNC Machining program in cutting through examining cutting tool really, this kind of method is simple and intuitionistic, can make abecedarian judgement quickly to validity of cutting tool contrail. Cutting tool contrail emulates algorithmic flow to basically include 3 shares: Explanation of file of NC coordinate information carries out: Should identifying instruction way above all inside this one part is absolute instruction means (G90) or increment instruction means (G91) . Get the numerical control related to coordinate to dictate next (for example G01, G02) the coordinate parameter with correspondence. The start that circular arc of the starting point that final computation gives cutting tool to walk point-blank and terminal coordinate, cutting tool walks, terminus reachs coordinate of the centre of a circle, become machine coordinate conversion screen coordinate to put for the file, this file is become from the back the basis that orbit emulates. Insert complementary operation: What what numerical control program gives out to the description of the spare parts is sharp starting point and terminus, the start of circular arc and terminus, go against a circle or arrange the information such as circle and circular arc radius. In file of information of coordinate of the NC in ① the description that is these quantities as much. For the intermediate process with circular arc will linear or medium cutting expression comes out to be about to use interpolation, interpolation is mixed in outline start namely computation goes out between terminus a certain number of the coordinate value of the dot intermediate. Used pointwise to compare law interpolation here. Graph orbit shows the trends of dynamic emulation give typical examples of contrail of 2 cutting tool: All coordinate that get linear interpolation show the contrail that will receive point of a knife by order. To distinguish different cutting tool contrail, use different color to express fast feed, linear cutting and circular arc cutting respectively, if pursue 2 emulate a picture for one actual contrail. Data bulk of orbit emulation processing is little, not tall to the performance demand of the computer, go to the lavatory simply. But actual cutting process of report is not overall, especially cutting tool machines the cutting tool in the process to cannot be mirrorred to the interference of workpiece in cutting come out. And it is OK that the trends of process of spare parts cutting is emulated show the geometrical form and structure between cutting tool, workpiece directly come, OK the cutting process of imitate spare parts, it not only more image is clear, and the interference phenomenon in can handling cutting process. The emulation algorithm of the dynamic emulation grammar of cutting process and cutting tool contrail agrees basically, it also is to pass 3 courses, have differently below a few respects: Take cutting tool: It is a label to take a knife to cutting tool database with cutting tool date, extract cutting tool parameter and draw is on screen. Implementation cutting tool moves: In emulate, the shift of cutting tool relies on computer trends to show the technology will come true, in programming, the each contrail point that passes in cutting tool place all should draw cutting tool graph, the meeting on so whole trochoid bestrews cutting tool. Show the pattern with mobile cutting tool for figure ground, already simple commonly used method has two kinds: It is " picture, brush, picture " law, fundamental is cutting tool every are mobile a position obliterates original cutting tool figure, the picture gives new cutting tool figure, this kind of method is only comfortable Yu Jian's single figure, its defect is meeting general jackknife on the graph do not move partial graph to also obliterate. The 2nd kind of method is to use " different or " indication mode plot, the graph on standard buy and the graph of on one position make surprise or show again after operation namely, such loop makes dynamic figure. This kind of method makes code compact not only, and do not have an influence to that part graph of fall asleep. This program used this kind of method, it makes effect of motion of cutting tool generation, and workpiece does not move. Realize the excision of the material on workpiece: The picture gives the semifinished product appearance of the spare parts, the pattern that in knife of dispatch a vehicle of copy of screen upper mould one knife knife cuts the material on next semifinished product is the main component that cutting treatment emulates. The basic method that implements with software is the partial recoat that will be cut color, when the color like Tu Cheng and setting, the visual sense that gives a person was come down by cutting tool cutting namely. Specific implementation method is the place of point of a knife in cutting tool defines a zonule to be the area that fill scene. Such, in the cutting motion of cutting tool, accompanying cutting to dictate, the area that place of part of cutting tool shadow passes turned setting into color, realized cutting process trends to emulate. CNC Milling CNC Machining