4.3 NC machining class libraries

In order to combine CAD/CAM system effectively with CNC system, it is necessary to have some means to generate machining procedure, which assures most suited machining process for the target work, machine tool and the machining method, making full use of tool data , work shape or fixtures.

In general, any product is manufactured through several machining procedures, each procedure further divided into some generic machining procedures. Starting from rough cutting to remove raw materials, product is machined in sucession through various cutting steps until finish cutting is executed.

Tapping procedure, for example, is achieved through combination of 3 machining steps, i.e. center drilling, drilling and tapping. Each step is executed through fundamental machining functions, such as the spindle rotation, rapid traverse or feed cutting .
Thus, in addition to decide machining dimensions of the work, selection of the machining algorithm plays an important role in the shop floor.
Up to now, these functions have been achieved through proprietary interactive programming systems devised for each machine tools, in which specification have been presented by machine tool builders , and real development executed by NC builders.
In OSEC, FADL interpreter language is employed to provide means for machine tool builders to develope these functions by themselves, making and classifying the NC machining libraries.

A sample of NC machining class library is shown in Figure-4.3.1. There may be several kinds of method to classify NC machining process. In OSEC, NC machining is classified into following 3 levels;

Here, machining description level corresponds to machining steps, and the number of each layer corresponds to the CAD layer output, and machining level corresponds to the NC functions which are , at present, performed by special function code like G codes. And the servo drive control level is used to give appropriate commands to servo drives. These library functions are defined externaly and linked by DLL in order to be able to connect to various kinds of servo drives.

Figure - 4.3.1 NC machining class library

(1) machining description level( class OSE_NC )
functions descriptions
1) new initial set
2) p_sfra milling ( layer 1 )
3) p_cmil full circle / chamfering( layer 2 )
4) p_lmil side end milling( layer 3 )
5) p_ctap tapping around circle( layer 4 )
6) p_sztap through tapping with seat( layer 5 )
7) m_fini finish
8) m_toolchg macro for tool change

(2) machining level ( class NC )
functions descriptions
1) speed feedrate
2) spindle spindle cw/ccw/stop
3) move rapid traverse
4) line linear interpolation
5) arc2,3 circular interpolationCW,CCW
6) toolselect tool select
7) drilling drilling
8) tapping tapping
9) reference 2nd grid
10) toolchange tool change
11) GetToolData get tool file data

(3) machining level ( class FA )
functions descriptions
1) Coordinate coordinate transformation
2) Axis_Move axis movement
3) Axis_Vspeed axis speed
4) Axis_Arc axis arc mivement
5) Axis_Start axis motion start
6) Axis_Stop axis motion stop

In general, NC machining library is developed in correspondence with the CAD layer output, and usually some kind of data setting menu is provided for CAD data input.
Figure-4.3.2 shows the illustrative example for through tapping procedure.

Figure - 4.3.2 CAD data setting menu for through tapping
initial reference point x y z
clearence height
radius for through tapping
start angle
depth of cut
number of holes
center drilling tool number
radius
start angle
bottom of hole
R point
feedrate
repeat number
through holing tool number
radius
start angle
bottom of hole
R point
feedrate
repeat number
tapping tool number
radius
start angle
bottom of hole
R point
feedrate
repeat number

Interpreter language assures far high degree of freedom to make machining libraries, compared to the foregoing macro programming language.
It gives machine tool builders the possibility to afford effective programming means ( i.e. machine tool utilizing means ) , corresponding to the customer's various requirements.
Figure-4.3.3 shows a sample program for full circle cutting, which is used in the demonstration.


Figure - 4.3.3 full circle cutting m_cmil

sub m_cmil{ #full circle cutting
#argumets: diameter,cenetr x,center y,z_surface, cut depth,hole diameter,
# tool number, plane number

my $self = shift;
local( $d,$ox,$oy, $z_surface, $depth,$hole_d, $tno,$pno ) = @_;
local( $diameter ) = $TOOLID{ $tno } -> { DIAMETER }; #tool diameter
local( $rev ) = $TOOLID{ $tno } -> { REV1 }; #spindle revolution
local( $feed ) = $TOOLID{ $tno } -> { FEED1 }; #feed value
local( $r_off ) = $hole_d/2 - $diameter/2; #tool radial offset
local( $z_low ) = $z_surface - $depth; #z_lower end
local( $r_remain ) = $d/2 - $hole_d/2; #radius remained uncut
local( $r_infeed ) = 10; #radial infeed value(fixed)

$self -> m_toolchg( $tno ); #tool change
$self -> spindle( ON, $rev ); #spindle on
$self -> move( ABS, 0, 0, @Target[2]); #to circle center
$self -> move( ABS, $ox, $oy, $r_point); #z to reference point
while( $r_remain > 0 ){ #update radial offset value
if( $r_remain > $r_infeed){ $r_off = $r_off + $r_infeed }
else { $r_off = $r_off + $r_remain }
$self -> speed( $feed); #set feed
$self -> line( ABS, $ox, $oy, $z_low); #feed z to lower end
$self -> line( ABS, $ox+$r_off/2, $oy+$r_off/2, $z_low); #to approach point
$self -> arc2( ABS, $pno, $ox+$r_off, $oy, $z_low, 0, -$r_off/2 ); #approach
$self -> arc2( ABS, $pno, $ox+$r_off, $oy, $z_low, -$r_off, 0); #circle
$self -> arc2( ABS, $pno, $ox+$r_off, $o-$r_off/2, $z_low, -$r_off/2, 0); #escape
$self -> move( ABS, $ox, $oy); #to center
$r_remain = $r_remain - $r_infeed ; #update r_remain
}
$self -> move( ABS, $ox, $oy, $r_point); #to reference point
$self -> spindle( OFF, 0);
}


Next Paragraph