???: ?????????? ????????? ?? ????? ?? ???????? ?? NC ???? ???????? ??????? VB 6 ?? ??????? ?? ?? ??? 0. ??????, ?? N091 NC ???? ?? ??? Fanuc-0i Mate TB NC ???????? ?????? ?? ?????? ???? ??, ??? ??????? ?? ????? ???? ?? ???? ?? NC ??? ?????, ??? ????????? ?? ???? ????, ?????? ????????? ????? ?? ???????, ???? ?? ?????????? ?? ?????? ????????? ?? ??????? ????????? ?? ???? ???????? ??????? ?? ?????? ?? ??091 ???? ???? ?? ?????? ?? ???? ??? ????? ?? ????? ????? ?? ???? ??? ?? ?????????? ??? ??,????? ?? ?????? ?? ???????? ??? ?? ?????? ??. ?????? (??? ?????? ??????? ?? ???-??? ???? ????????? ??? ?? ?? ????? ??? ??? ???? ??? ??) ????? ????: N091 ????? ????; ???? 6. 0 ?????????; ???? ????????0 ???????????????? ???? ????? ?????? ????????? ?? ??? ???????? ????? ?? ??? ???, ??????? ?? ???????????? ?? ?????? ?? ???, ?? ???????? ????????? ???????, ??????? ?? ?????? ?? ??? ??? ???????? ?? ?????????? ???? ?? ??? ???????? ??? ?? ?????? ???, ????? ??????????????? ?? ??????? ?? ??????????? ?????? ?? ??????????? ???????? ?? ?????????? ???? ?? ??? ?????????? ???????? ???? ????? ?? ???? ?? ??????????? ????????? ???? ?? ??? ??????????? ????????? ?????? ??????? ??? ???? ??????? ???, ?????? ?? ??????? ????????? ?? ??? ?????? ?????????? ?????????? ?? ????? ???? ?????, ??????? ??? ???????? ?????? (???????? ???? ???? ????? ?? ????????? ??????) ?? ??????? ??????? ?? ??? ???? ???? ?????? ?????????? ???????? ?????? ????? ???, ?? ??????? ?? ?????? ???? ????? ?????????? ???? ???? ?????????? ?????, ?? ??? ????????? ?? ???????? ?? ????? ??? ???? ???, ???? ????? ????? ?? ???? ?? ?? ????? ?????? ?? ????????? ??????? ?? ?? ???? ??? ??? ???? ??? ?????, ???? ?????? ?? ?????? ????????? ??????? ?? ??? ???????? ???? ??? ?? ?????? ???? ??? ??????????? ????????? ?? ????? ???? ?? ??? ??????? ???? ??? ??????? ????? ?? ????? ?????? ???? ??? ?? ??????? ?? ?????? ???????? ?? ???? ?? ??? ?? ?????? ???? ?? ??? ??? ???? ???? ??? ?????? ???? ??? ?? ???????????? ?? ?????? ?????? ??????? ?? ??? ?? ?????? ???? ?? ??? ????? ???????? ?? ?????? ?? ????? ?? ???? ???? ????????? ??? ?????????? ?????? ?????? ??????? ?? ?????? ???? ?????????? ???????? ??????? ?? ???? ?????? ?? ?????? ?? ?? ?? ???? ?? ???? ??? ??????? ??????????? ????????? ?????, ???? ?? ??? ?? ????? ???? ??, ?? ??????? ?? ???????? ??, ?? ?? ??? ?? ??? ?? ?????? ?????? ?????? ??????? ?? ???? ??? ??????? ?? ????, ?? ?? ??? ?????? ?? ?? ?????? ?? ?????? ??? ?? ????????? ?? ?? ?????? ?????? ?????? ??? ??????? ???, ??? ?? ???? ????????? ??????? ???, ???????? ???????? ????????? ??? ????? ??? ?? ??? ????????? ????? ???: ??????? ????, ????? ?????? ?? ?????? ????? ?????? ?? ??? ?????? ?? ?????????? ??? ???????? ???? ?????? ??? ???-??? ????? ?? ?????? ???? ???, ???? ????? ?? ?????? ?? ???? ?????, ???? ???????? ?????? ???? ???? ???? ???? ?? ??????? ?? ?????????? ?????? ?? ?????? ??? ????? ??????? ?? ???????? ?? ??? ?? ??? ???, ???? ???? ?????????? ?? ???? ???????? ?????????? ?? ??????? ????? ??? ?? ???????? ?????????? ?????? ?????? ?? ???????? ?? ?????????? ????????? ?? ?????? ??? ???? ?????????? ???????? ?? ?????? ??? ?????????? ?????? ?? ??? ?????? ?? ???? ???? ?? ???? ?? ??? ?? ?? ????????? ?????????? ???????????? ????????? ?? ???? ????? ???? ?? ?? ?????????? ?????? ?????? ??? ?? ????????? ???? ???? ?? ???? ??, ??????? ?? ????????? ?????? ?? ?????? ???, ????? ????? ?? ???? ??? ?????? ?? ??????? ??????? ?????? ???????? ????????? ?? ???? ?? ?? ?? ???? ???? ??? ???? ???? ??????? ?? ?????? ??? ??? ?? ??? ??? ???? ??, ???????? ????? ?? ???????? ????? ?? ???? ??? ???? ??? ??????? ??? ?? ?????? ?????? ???????? ?? ???? ?? ???? ???? ?? ????? ?????? ?? ????? ???? ???? ?? ???????? N091 ?????? ???? ?? ?????????? ???????? ?? ??? ??? ???? ??, ?? ?????? ???? ?? ?????? ??? ?? ????? ????????? ?? ??????? ??? ?? ?????? ???? ?? ??? ?? ???? ?????? ???? ?? ??? ???? 6.0 ???? ?? ????????? ???????? ??????? ??????? ?? ????? ???? ??? ?????? ???? ??? ??????? ????????? ?? ??????? ?? ??????? ???? ?? ???????? ??? ??? ??????? ????????? ????? ???????? ?????????? ????? ?? ??????? ?? ?????? ???? ?? ?????, ????????? ??? ?????? ?? ????????? ?? ????? ???????? ???? ?? ?? ??????? ?????? ?????? ???? ??????????? ????????? ?? ??????? ??? ???? ????? ?? ?? ???? ???? ????? ???????????? ??????? ?? ?????? ?? ????? ?? ?????? ???? ?? ??? ??????? ?? ??????? ??? ?? ?????????? ???? ?? ???, ????????? ?? ???? ????????? ?????????? ????????? ?? ??? ?? ?????? ???? ?? ??? ??????? ???? ??? ??? ??????? ??? ????? ????? ??????? ???-????????? ????????? ?? ??????? ?? ???? ??? ?? ??????? ?????? ?? ???? ???? ???, ?? ????????? ???? ?? ???????? ??????? ???? ?? ???????? ?? ?????? 1 ?????? ????? ???????? ?????? N091 ?????? ???? ?? ??? Fanuc-0i Mate TB ?????????? ???????? ??????? ?? ????? ???? ??? ????? ?????? ????? ?? ??? ???? ?? ???? ??? ?? ?? ?????? ??? ?? ????? ?? ????? ????? ?? ??????? ????? ???? ???? ??, ?? ???? ??????? ????????? ?? ??????? ?? ?????? ???? ??, ?? ?????? ???? ??? ??? ?????????? ????? ?????? ???? ????? ?? ???? ?????? ???? ??? ?????? ???? ?? ?????? ???? ?? ??? ?? ????????? ?? ????? ?? ???? ???, ??????? ???????? ????????? ?? ????? ?????? ????? ?????????? ????????? ?? ???? ?? ???? ???, ???????? ????? ????-???? ?????????? ????????? ????????? ?? ???? ???, ?????????? ?????? ?? ???????? ?? ???????? ?? ???? ???, ?? ??? ?? ????? ?????????? ????????? ?? ??? ????? ????????? ?? ??????? ?????????? ?????? ?? ??????? ???? ???????? ?? ?? ?????? ?? ???????? ?? ?????? ??????? ??? ?? ???? 2 ?????? ????? ???????????? ??????????? ??????? ???? ??????? ????????? ???, ??????? ???? ??? ???? ???? ??? ????????? ???? ?? ???? ??? ?????, ?????? ??????? ?? ???? ???? ??? ?? ?? ??? ??? ????? ?? ????? ?? ???? ??????? ???? ????? ?? ????????? ?? ???? ??? ?? ???????? ?????????? ???????? ??????? ?? ????? ??? ?????? ?????, ????????, ?????? ?????????? ?? ?????????? ???????? ??? ?? ???????? ??????? ?? ?????? ??? ??? ???? ???????? ?? ???????? ???? ???????? ?? ?????, ???????? ???? ?????? ?? ????? ?? ???? ?? ?? ?? ??????? ?? ???? ?????? ???? ??? ????? ????? ???? ?? ????? ???????? ????? ?? ?????? ???? ?? ??? ???? ??????? ???? ????2? 1 ???? ??? ?? ????-????????? ???? ??? ?? ????-?????????? ??? ????? ?????? ?????? ?? ????????? ???? ?? ?????, ???? ??? ??? ???????? ???????? ?? ?????, ???? ?? ????? ?????????, ???? ????????? ?? ?????? ????, ?? ??????? ??????? ?? ?????? ??????? ??? ????????? ???? ????? ??? ???????? ????? ?? ???? ????? ????? ??????? ??? ???? ??? ?? ????? ??? ???? ?????? ?? ?? ?????? ??????? ?? ???? ??, ?? ?? ?????????? ?? ??? ??????? ?? TXT ??????? ???? ??? ????? ????? ???, ??? ???????? ?? ????????? ??????? ??? ?????? ????? ?? ???, ?? ?????? ?????? ???? ?? PROG ??? ?? ????? ???? ??, ?? VB ????????? ??? File1 ???? FileListBox ???????? ?? ?? ??????? ???? ?? ??????? ??? ???????? ??? NC ????????? ????? ????? ?? ???? ??? ???????? ???? ?? ?????? ??????? ??? ????????? ???????? RichTextBox3 ???, ?????? ???? ???????? ???? ?? ????????? ??? ????? ??? ????? ??? ?? ???? ?? NC ????????? ?? ??? ?? ???? ??? ???? ????? ????????? ?? ????? ????? ?? ?????? ??? ?? ????????? ????? ??, VB ??? ?????? ???? ??, ?? ??? ??????? ?? ????? ???? ???? ?? ???? N091 ?????? ???? ?? FANUC-0i MATE TB ?????? ???, NC ????????? ????????? ?? ??? ??? ????? ?? ??????? ???? ?? ?????? ???? ?? ?? ??? ????????? ?? ???? ?????? ???? ???? ?? ??? ????? ???? ??? ???? ??? VB ???? ??? ?????? ?? ??? ??? vbCrLf ?? Chr(13) &Chr( 10) ?? ????? ???? ??, ????? ????? ??? ?? ????? ???? ??????? ?? ???? ??? ?? ??? ??? ???? ????? ?? ????? ???? ?????? ??? ???? ?? ???? ??, ?? ???????? ???? ??? ?????? ?? "????????? + ????????" ?????? ??? ???? ???? ??? (??????????-?????1)? ????????? ??? ?? ?????? ??: ??????????? = ??????? (RichTextBox1. ???????,vbCrLf) '按行拆分RichTextBox1. ??????? = ?????? ?? ??? = 0 ?? UBound(TextLine)RichTextBox1. ?????? = vbYellowRichTextBox1. ?????????? = ichTextBox1. ?????????? ??????????? (??????) ?? Chr (13) ?? Chr (10) RichTextBox1. SelColor = vbYellowNext row????????? ??????????? ?????? ??? ??, VB ????? ??????? ?? ????? ??????? ?? ?????? ???? ??? ???? ??? ?? ??????? ??????? ?? ?????? ??????? ??? ????? ?? ??? ????? ??????? ?? ????? ??? ?????? ????????? ???? ?? ???? ??? ????? ??????? ??? ?? ?? ?????? ?? ?????? ?? ??? ??? ????? ????? ?? ??? ???? ??? ????? ????????? ?? ????? ?? ???, ?? ??? ??????? ?? ????? ?? ????????? ???? ?? ??? ???? ?? ???? ?? 0 ??, ??? ??? 0 ??, ?? ???? ???? ????? ???? ??, ?? ?? ???? ??? ??????????? () ?? ???????? ?? ???????? ?????? ?????? ?????? ?? MoveRow ??????, ???? ?????? Textline(MoveRow + 1) ?? Textline(MoveRow) ??, ?? ????? ???? ??? ; ??? ?? ?? ???? ????? ?????? ???, ?? ??? ?????? ??? ?????? ????? ?? ???? ??? ??? ??????????? ???? ?????? ???? ???2? 2 ???? ??? ????, ????????? ???? ?????? ?????????? ??? ???????? ?? ???, ?? ????? ???? ???? ?????????? ?? ?? ?????????? ??????? ???? ?? ?? ????, ???? ??? ???????? ?????? ?? ????????? ?? ???? ?????? ?? ???????? ???? ?? ????????? ??? ????????? ???? ?? ??? ?????????? ??? ???????? ?? ????? ???? ??? 2. 1 G00 ????? ??????? ?? ????? ?? ??? ????? ???????? ??????? ??????? ?? ???, G00 ?? ?????-????? ????????? ????? ??? ?? ???? ?? ???, ????? ?????? ??????? ??? ??????? ???? ???????? ????? ?? ?????? ?????? ???? ?? ??? ????? ?? ???? ??? ???????? ??????? ???, ??? ?????? ???????? ?? ????????? ?? ???? ????? ?? ????????? ?? ????? G00 ????? ?? ????? ???? ??, ?? ???? ??? ?????? ?? ??????? ???? ????? ????? ???? ????? ?? ????????? ?????? ?? ???????? ??? ?? ?? ????? ???????? ?? ???? ????? ?? ??????? ?? ??? ?? ???? ?? ????? ???????? ??????? ?? ????? ????????? ??? ???????? ???????? ?? ??? ?? ???? ?????? ?? ????????? ??????? ???????? ??????? ?? ?????, ??? ????? G00 ????? ?? ??? ??????? ?? ????? ?? ??? ?? ??? ???? ??, ?? ?????? ?????? ?? ??????? ????? ???????? ????? 1 ??? ?????? ??? ??? ????? 1 ?????? ????? ???????? ????? ?????????? ?? ????? ???? ?? ?? ????????? ??? ????? ??????? ??? ????? ?? ???? ???? ??? ??? ???????? ??????? ???, ??? ?? ??????? ?? ??? ????? ????? ???????? ?????? ??? ?? ??????? ?? ??????, ?? ??????? ??????? ?? ????? ???????????? ????? ?? ?????????? ??? ?? ?????? ????, ???? ???????? ???????????? ??? ?????? ?? ???? ???? ?? ???? ?? ??????? ?? ??????? ???? ?? ???, ?????? ?????? ????? ?????? ?? ?????????? ?? ???????? ???? ?? ??? NowData () ???-???? ???? ?? ???????? ???? ??? ????? ??, NowData (1) ??????? ??????? ??? z ?? ?????????? ??? ?? ???????? ???? ??, NowData (2) ??????? ??????? ??? ?? ?????? ??? x ?? ???????? ???? ??? ????? ?????? ?? ?? ????? ???? ?? ??? ??????? ???? ??? ?? ?? ???? ????? ?? ????? ????? ???????? ???????? ??? ????????? ?? ?? ???? ??, ???? ????? ???? ???????? ?? bl ?? ??? ????? ?? ???, NowData () ??? ?????? ??? ?? ???????? ???????? ??? ???????? bl ?? ???? ???? ???? ??? ????, ??????? ?????? ??????? ?? ???????? ??????? ?? ???? ?? ?????? ??? ?? ??? ?? ?????? ?? ??? ?? ?? ??, ??? ????????? ?? ???????? ????????? ?? ???? ??? ?????, ?? ????????? ???? ?? ??? ?? ???? ??????? ????? ??? G00 ????? ?? ??? ????? ?? ??? ??, ???? ???? ?? ?????? ?? ????????? ???? ?? ???????? ??: 1) ????? ?????? z ????????? ?? ?? ????? 2) ???? ??? ?? ?????????? ??? x ??????? ????? ?? ???????? ?? ???? ??, ?????? ?? ????????? ???? ?? NowData(1) 0 ?? ?? ??, ?? ??? NowData(2) ??????? ???????? ?? ???? ??? ????? NowData(2) ?? ??? x ???????? ??? ?? bl ?? ???? ???? ???? ??, ????? ????? ????? ?? ??? ?? ??????? ?????? ?? ???? ?? bl ?? ???? ???? ???? ??, ???? ??????? ?? ???????? ????? ??, ?????? ?????????? ?? ??? ??? ?????? ???? ??? ?? ?? ?? z<0 ?? x <workpiece. Blank diameter × bl /2. If the system determines that a collision occurs during operation, an alarm will be given and the program will be reprogrammed. The following is the code to implement this feature:If g00 = True ThenIf NowData( 1) < 0 And NowData( 2) < Form2. Text1. Text*bl / 2 Thenmianban. RichTextBox2. SelColor = vbRedmianban. RichTextBox2. SelText = mianban. RichTextBox2.SelText &” ‘G00’命令下禁止切削工件,請重新編寫程序,再次運(yùn)行! “PlaySound ” warn. wav”mianban. temg. Text = ” - - ALM - - ” : mianban. temg.Visible = TrueTimer5. Enabled = TrueTimer16. Enabled = FalseAlm( 116) = True2. 2. 2 cutting parameter out of range alarmThe reasonable setting of cutting parameters directly affects the machining quality of parts. In actual production and processing, due to carelessness or unfamiliarity with the cutting parameters, the setting of the feed amount per revolution of the turning tool may cause problems. The amount of tool feed depends on the surface roughness and the cutting force. When rough-cutting, the surface roughness is not high, and the feed is mainly caused by the knife.The precision and strength of rods, blades, workpieces and machine tools are determined by the cutting forces. When semi-finishing and fine-cutting, the economics of cutting are mainly considered. That is to say, the cutting load cannot exceed the power of the machine tool while ensuring the economic life of the tool. Therefore, the tool feed amount cannot be too large or too small. If an oversight or error occurs during programming, an error will be indicated in the code detection of the simulation system. The simulation system provides that the spindle feedrate of one revolution must not be less than 0. 05mm or greater than 0. 5mm (The amount of cutting is closely related to the workpiece material and the tool type and material. The value range of this feed amount is in most cases. For other individual cases, it can be determined by referring to the manual or cutting test).A line of NC code is read in the FileDebugger of the system code. If the feed “F” is found from this line of code by the Mid function, then the custom GetNumber function is used to convert the number immediately followed by F to a single-precision floating-point number. 0. 05 and 0. 5 if less than 0. 05mm or greater than 0. 5mm, then the alarm prompts, its interface is shown in Figure 2.Fig. 2 Feed range out of range alarm prompt interface2. 2. 3 tool instruction alarm errorIn CNC turning, the tool command T is used to select the tool and its corresponding tool compensation. Example: T0202 represents the No. 2 knife and the No. 2 knife make-up. Therefore, it is agreed in this paper that the tool number and its tool complement number are the same value, which is not easy to confuse. If the tool number and the tool compensation number do not match in the NC program or one of them is default, the coordinate system will be disordered and the machining code will not be executed correctly. The system stores 3 commonly used tools: T0101 for 93° roughing tool; T0202 for cutting tool; T0303 for fine turning tool. If “T” appears in a row and the following number is not the above number, the system will indicate which row of tool number T is illegal. code show as below:If TExist = True Then Call ErrCase( 3,F(xiàn)ileRow,CaseType)TExist = TrueNumberString = GetNumber ( Right ( TextLine,Len ( TextLine ) -NumberStart) )If NumberString = ” ” ThenCall ErrCase( 1,F(xiàn)ileRow,CaseType)ElseNumberStart = NumberStart + Len( NumberString)CaseNumber = CDbl( NumberString)If CaseNumber = 101 Or CaseNumber = 202 Or CaseNumber = 303Or CaseNumber = 404 Then ‘刀具編號ElseCall ErrCase( 9,F(xiàn)ileRow,CaseType) ‘ 此處調(diào)用 ErrCase 函數(shù)顯示錯誤信息End IfEnd If3 system learning functionThis simulation system is used as a teaching aid for engineering training. Students can use this software to conduct self-study, develop good programming styles and operating habits as starting points, and conduct detailed studies on module settings, selection of interaction methods, and logic arrangement of actions.3. 1 Simulation System InterfaceIn order to enable the trainees to quickly get acquainted with the actual machine tool, the software simulates the real machine tool as much as possible in the interface design. The simulation system interface is shown in Figure3.3. 2 Operation Panel Button Function TipsFor trainees who have not touched the N091 CNC lathe or the software, there are dozens of knobs and buttons on the control panel. The system uses the ToolTipText property in the Command control that comes with the VB platform, and the corresponding knob or The name of the button is filled in the operation panel. When the mouse is moved to the corresponding position, the system will give a text prompt. The interactive function is good, which is very helpful for students self-study. The function prompt interface of the machine tool operation panel is shown in Figure 4.Figure 3 Simulation System InterfaceFig. 4 Tool operation panel button function prompt interface3. 3 lathe operation sequence trainingAfter investigating the commercialized CNC simulation software on the market, the author found that most of the software does not strictly regulate the operation sequence of the machine tool. If the trainee has not touched the CNC lathe, the complex operation interface will be at a loss and I do not know where to go. If you start, you will soon lose interest in learning. In view of this, the simulation system uses VB to solve the above problem with the visible property of the Command control, and the order is limited by the selection of the property false/true visible to this control in the Command_Click( ) function. If the operation sequence is wrong, it triggers. MsgBox, prompt error information, operation sequence warning interface as shown in Figure 5.Figure 5 Operation Sequence Warning InterfaceFigure 6 Interpolation Principle Learning Module Interface3. 4 interpolation principle learning moduleLinear interpolation and arc interpolation are the most basic tool path generation methods for CNC lathes. The above two types of interpolation in the N091 CNC lathe are implemented using a point-by-point comparison method. The simulation system embeds an interpolation learning module, and students can select the circumcircle, inverse circle, and linear interpolation in the interpolation learning window, and give the starting and ending coordinates accordingly to generate a circle or a straight line. Realize the consolidation of classroom knowledge teaching. The interpolation principle learning module interface is shown in Figure 6.4 ConclusionThis software is aimed at the training and teaching of CNC lathe engineering. It aims at cultivating engineering practices and focuses on the development of self-learning functions. Students participating in the CNC lathe engineering training can use the computer at any time to carry out simulations of CNC lathe machining procedures, lathe operation methods, and learning of related CNC knowledge. While significantly improving the training effect, it effectively ensures the safety of equipment and trainees. It actually solves the problem of excessive man-machine ratio caused by a large number of students and limited training equipment in the school’s CNC lathe engineering training, and improves the operation practice. The efficiency reaches the goal of the students to better learn the CNC machining process.
?????: ???? ????????