# Machine aperture of circumferential divide into equal parts with grand program and subprogram function

- Time:
- Click:23

Exemple 1: Machine aperture of circumferential divide into equal parts with grand program and subprogram function order. Set the centre of a circle to be nodded in O, its coordinate in department of machine tool coordinate is (X0, y0) , what be R in radius is circumferential go up to drill hole of a few divide into equal parts equably, initial point of view is α , kong Shu is N. It is Z with the surface on the spare parts to at 0 o'clock. See figure below. Computational method uses aperture of graph divide into equal parts to maintain below model variable: #502: Radius R; #503: A of initial point of view; #504: Aperture counts N, when N>0, press anticlockwise direction treatment, when N<0, press clockwise treatment; #505: Coordinate of hole bottom Z is worth; #506: Coordinate of R planar Z is worth; #507: F feed. Use the following variable to undertake operating operation: #100: Express what I pace drills I hole to note number implement; #101: Note number implement final cost (the absolute value) that is N; #102: I the value of the angle position Qi of aperture; #103: I the X coordinate value of aperture; #104: I the Y coordinate value of aperture; With the user grand the bore subprogram of to program is as follows: of of of of of of of of O9010N110 G65 H01 P#100 Q0 / / of of of of of of of #100 = 0N120 G65 H22 P#101 Q#504 / / of of of N130 G65 H04 P#102 Q#100 R360 of │ of #504 of │ of #101 = / / of of 360oN140 G65 H05 P#102 Q#102 R#504 of × of #102 = #100 / / of of #102 = #102 / #504N150 G65 H02 P#102 Q#503 R#102 / / Qi = A + (360o of position of angle of current aperture of #102 = #503 + #102 × I) / NN160 G65 H32 P#103 Q#502 R#102<When #101, return subprogram of 130 block N240 M99 // to end the main program that calls afore-mentioned subprograms to be as follows up: of of of of of of of O0010N10 G54 G90 G00 X0 Y0 Z20 / / entering treatment coordinate is of of of of of of of of of of of of of N20 M98 P9010 / / call bore subprogram, machine aperture of circumferential divide into equal parts of of of of of of of of of of of of of of of of N30 Z20 / / carry of of of of of of of of of of of knife N40 G00 G90 X0 Y0 / / returning treatment coordinate was at 0 o'clock end of N50 M30 program installs G54: X=-400, y=-100, z=-50. #507 of variable #500 ～ can assign in the program, also but by MDI means set. CNC Milling