CRVFIT commands in APT/GPost: (Arc/Nurb Fit)

The Curve fit process is to convert a set of input linear GOTO/cmds
into arc/spline motion that fit the tolerance and other given options.
This may reduce the MCD file size and/or generate a smoother machining
operation.

The Curve fit process has been implemented in both APT and GPost systems.
The difference being, it is optional in APT and must be purchased to be
used with your custom posts. It is shipped with Gpost and no purchase
or option is needed.

APT setup requirements:

  1. The CRVFIT/cmd must be given in the input source to turn on this
  option. This will inform the APT to examine the subsequent CL records
  and convert the proper GOTO/cmds into to arc or nurb data. All options
  must be controlled via the CRVFIT/cmd for APT. Also you can place these
  in your uncapt.ini file. This will allow site specific tolerance etc
  to be stated for curve fit.

GPost setup requirements:

  1. Post option file must have INTCOM(4334)=1 set in the common panel.
  This will inform the Post to examine the input file at start and convert
  the proper GOTO/cmds into to arc or nurb data.

  INTCOM(4334)=1 

  The main options have been added to the new Java/Optfile generator in
  a separate panel. You can use this to set the values or use the CRVFIT
  command as in APT above in the input file.

  You can NOT use CRVFIT/cmd in a FIL file as this process is done 
  before FIL is executed. Again, you can set the option globally in
  option file or in the input file.


Curve fit vocabular words:

Two new words have been added to the system vocabulary table to provide
curve fit control in any program. You need not speciy these PPWORDs since
they are built-in.

  PPWORD/CRVFIT,1093
  PPWORD/MOVNRB,1094

CRVFIT command syntax:

   1. CRVFIT/ARC,c1 =dblcom(0994)

   This command initiates the "arc fit" process of the CLfile.

   c1 = ON or OFF to enable or disable arcfit. (def=OFF)

   The arcfit process is to convert a set of linear GOTO/cmds
   into circular motion that fit the tolerance and other options
   specified. This may reduce the MCD file size or generate a
   smooth machining operation.

   The following commands specify various options for arcfit:

   CRVFIT/ARCSLP,c2 =dblcom(0995)
   c2 = ON or OFF to allow helical motion with arcfit (def=OFF)

   CRVFIT/XYZ,f1 =dblcom(1009)
   f1 = Specifies a condition to output arc data as MOVNRB/cmd
   to support circular interpolation in any plane, such as Siemens
   CIP format. (0=no 3D arc, 1=output 3D arc data)
   (def=0)

   
   CRVFIT/RADIUS,1,r1 =dblcom(1010)
   CRVFIT/RADIUS,2,r2 =dblcom(1011)
   r1 = minimum radius allowed (def=0.0001)
   r2 = maximum radius allowed (def=99999.0)

   It is suggested not to change these values, since the GPost has
   a maximum radius and will switch into linear interpolation for any
   large radius automatically.

   2. CRVFIT/SPLINE,c1 =dblcom(0996)

   This command initiates the "spline/nurb fit" process of the CLfile.

   c1 = ON or OFF to enable or disable nurb fit. (def=OFF)

   The nurb fit process is to convert a set of linear GOTO/cmds
   into nurb curve motion that fit the tolerance and other options
   specified. This may reduce the MCD file size or generate a
   smooth machining operation.

   The output of Nurb parameters and the points of the Nurb curve will
   be output as MOVNRB/cmd.

   The following commands specify various options for nurb fit:

   CRVFIT/TYPE,e1 =dblcom(0997)
   e1 = specifies the type of spline required (0=Nurb,1=Cubic spline)

   3. CRVFIT/data

   The following commands specify various options for arc and/or nurb fit:

     CRVFIT/PLANE,pl   =dblcom(0998)
     CRVFIT/TOLER,1,t1 =dblcom(1001)
     CRVFIT/TOLER,2,t2 =dblcom(1002)
     CRVFIT/TOLER,3,t3 =dblcom(1003)
     CRVFIT/TOLER,4,t4 =dblcom(1004)
     CRVFIT/TOLER,5,t5 =dblcom(1005)
     CRVFIT/TOLER,6,t6 =dblcom(1006)
     CRVFIT/TOLER,7,t7 =dblcom(1007)
     CRVFIT/TOLER,8,t8 =dblcom(1008)
     CRVFIT/POINT,1,p1 =dblcom(1010)
     CRVFIT/POINT,2,p2 =dblcom(1011)

     p1 = XY,YZ,ZXPLAN or ALL to specify the desired plane (def=ALL)
     t1 = General curve fit tolerance (def=0.005)
     t2 = Z-change tolerance (def=.005)
     t3 = Tool axis vector change tolerance (def=.005)
     t4 = Direction change tolerance in degrees (def=60)
     t5 = Distance length tolerance (def=.5)
     t6 = Z-change tolerance with ARCSLP=ON (def=.015)
     t7 = Arcfit ratio tolerance (arcs to goto points) in percentage (def=10)
     t8 = Chordal tolerance for adjacent points (def=.025)
     p1 = minimum number of points allowed (def=5)
     p2 = maximum number of points allowed (def=500)

Output from Crvfit/cmd:

  When the curve fit process is successful, the input file will be augmented
  with CIRCLE/cmd and/or MOVNRB/cmd. The circle command has the same format
  of the GPost and it can convert them into G02/G03 blocks.

  MOVNRB/cmd represent a spline motion and will have to be formatted for the
  proper Fanuc,Siemens control etc. Also a MOVNRB/cmd will be generated by
  the optional CRVFIT/XYZ,f1 option to output a CIP block.
  
  A. The sequence of a MOVNRB/cmd for a regular nurb (CRVFIT/TYPE,0) is
  as follows:

  1. MOVNRB/ON,o,k,w,n,s 
  2. MOVNRB/1,k1..kk
  3. MOVNRB/2,cp1...cpn
  4. MOVNRB/NEXT
     GOTO/p1,p2...pn
  5. MOVNRB/OFF

  The 1st line specifies the (o=order of the curve,k=number of knots,
  w=number of weights as always 0, n=number of control points, s=curve
  length).

  The 2nd line specifies the acutal knot values as scalars. The maximum
  number of knot values will be 24 in one command. If there are more knots,
  then there will be another MOVNRB/1 command and so on.

  The 3rd line specifies the acutal control points as xyz data. The maximum
  number of xyz values will be 24 in one command. If there are more points,
  then there will be another MOVNRB/2 command and so on.

  The 4th line specifies the start of the original points that were converted
  into spline data. This is given, in case the machine does not have a certain
  Nurb funtion and can output G01 motion ignoring the MOVNRB command.

  The 5th line indicates the end of MOVNRB sequence.
  
  B. The sequence of a MOVNRB/cmd for a cubic spline (CRVFIT/TYPE,1) is
  as follows: There wont be any knot values and only control points.

  1. MOVNRB/ON,o,k=0,w,n,s
  2. MOVNRB/2,cp1...cpn
  3. MOVNRB/NEXT
     GOTO/p1,p2...pn
  4. MOVNRB/OFF
    
  The control points actually represent the polynomial coefficients
  for a cubic spline. These are the three vector data along xyz axes
  and the start point. The parameter space t=is from 0 to 1, to satisfy
  the equation d+at+bt2+ct3. For each curve segment, there will be
  12-scalar values (1-3=d start xyz,4-6=a(xyz),7-9=b(xyz),10-12=c(xyz).

  To compute the end point of a curve segment: set t=1 and compute:

  xe=xs+at+bt2+ct3 (with abc(x))
  ye=ys+at+bt2+ct3 (with abc(y))
  ze=zs+at+bt2+ct3 (with abc(y))

  C. The sequence of a MOVNRB/cmd for an arc (CRVFIT/XYZ,f1) is
  as follows: There will be 7-knot values and 2-control points.

  1. MOVNRB/ON,o=3,k=7,w,n=2,s
  2. MOVNRB/2,cp1,cp2
  3. MOVNRB/NEXT
     CIRCLE/xyz,ijk,r
     GOTO/p1,p2...pn
  4. MOVNRB/OFF

  The knot values represent the circle (xyzijk,r) center,axis and radius.
  The 1st control point is the mid point of the arc and the 2nd control
  point is the end point of the arc. This can be used to output the CIP
  block and skip the CIRCLE and original GOTO/cmd for the arc.

end
