Use VC++ process designing to realize CNC Turning to emulate
- Time:
- Click:87
- source:NEWRGY CNC Machining
.
.
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