Cadfil Help Contents Page

Cadfil - Advanced filament Winding software for program generation for all type of filament winding machine.

Post-processor configuration-machine data file (.SM)

At version 7 all post-processor configuration is in a file with the .SM extension. The file is usually found in he Cadfil install directory. When Cadfil is run a file called ‘’. is always read. If is is not found in the install directory a windows ‘file open’ dialog box is shown and you must ‘browse’ to find it.

If on reading the .SM there are errors in it there is than an option to view the error log which will identify the problems. If there are errors in the file all the post-process options will be greyed out, that is, you will NOT be able to post-process.

On the ‘NC-Post Process menu’ there is a ‘select winding machine’ option which allows the selection of a different .SM file, Thus if you have two different winding machines you could have ‘’ and ‘’.

Each time you post-processes the text ‘The Active machine configuration is >’ is displayed in the text window so you know which configuration is in use.

If you change a .SM file while CADFIL is running you need to exit or re-select the .SM file using the ‘select winding machine’ option to ensure the changes are being used.

The .SM file is a text file that can be viewed or changed using a text editor such as Notepad. If you use notepad set ‘Word Wrap off’ on the ‘Format’ menu.

The SM file contains comments describing all the parameter and variables in it. A number of sample files are usually supplied. It is normal for CCL to configure the ‘’ file to the best knowledge we have available at the time the software is supplied. We can offer technical assistance on this if required, please ask!

If you are unsure do not modify this file and always make a safe copy of the original file before changing it.

There are three types of data in the SM, system constants which are $ variables i.e. $constant-name some of these parameters are described below. There are some  $constants  that define the program layout  and this can contain @@variables. These variables have the format  @@variable-name@@, for example @@DATE@@, during the post-process run time this variable would be substituted for the current time & date. A list & description of @@logicals can  be found under the topic post processor logicals.

The are several possible entries such ad $FORMAT-LINE-NO=(I4) or $FORMAT-AXIS-1=(F12.2) that control how numbers are written to the NC data. this aspect is discussed in the topic, post processor numerical formats.

$GEARING-AX-n These are the ratios, which relate the units of of the winding machine. The post processor uses rotational units of degrees, thus if an axis rotation of 1 degree corresponds to a rotation of 234.567 machine units then the scaling ratio would be 234.567. If the rotating axis units on the machine are degrees, then the scaling factor would be 1.0. For linear axes e.g. cross-feed these relate the units used to define the mandrel in Cadfil to those of the machine i.e. if the machine uses mm and the mandrel is specified in mm the gear is 1.0. It is strongly recommended that a system of units for the mandrel are adopted and then used constantly. This removes the need to change the scaling data in the configuration file once it has been set up correctly. In practice all customer use either mm or inch for the mandrel definition.

$OFFSET-AX-n These values for each axis (n=1 to 6) from the machine reference point (machine 'home' position or payout origin) to the spindle datum. The offsets MUST be in machine units and have the CORRECT SIGN. They are the values one would use to instruct the machine to move (crash!) the centre of the payout origin (the position were the payout eye is attached), to the spindle datum point. These offsets are constants for the machine, but may change when maintenance work is performed on it.

The spindle datum point is a fixed point on the machine winding axis, this usually being located on the head-stock or tail-stock. When the mandrel is located in the machine, the position of the mandrel must then be measured from this point. Thus, the mandrel's position can be defined in the machine co-ordinate system vie the Xdatum post-process variable.

Click here to see a diagram for OFFSETS

$FEED-DEFAULT-WIND: This is the value of feed-rate that is used in the NC sub-program to wind the component.

$FEED-DEFAULT-START: This is the value of feed-rate that is used in the move to the start position in the NC main program.

$SMALL-MOVE-AX-n: Significant axis motions for axes 1 to n. A value must be supplied for each axis on the machine. This function holds small incremental axis motions, until the value of the motion for an axis is greater than the significant axis motion specified for that axis. If values of zero ( 0.0 ) are entered then all motions are output, however small they may be. The values entered for each axis should be in the relevant machine units. If an axis is not present on the machine, a value should still be entered (0.0 for example), as six values are always expected. If these are set to zero for active axes, then there may occasionally be very small machine motions due to the numerical rounding errors associated with the generation of the path across the surface mesh. Such motions will not add to the accuracy of the winding of the path and may impair the smoothness of the winding operation. This feature is not used on the last line of a subroutine, hence ensuring there is no misclosure error of the payout eye position at the end of each cycle. All axes positions (except A), return exactly to the start position at the end of each cycle. If this was not the case, a program with a large number of cycles would progressively 'shift' the fibre track in relation to the mandrel in one or more axes during winding.

$MAX-SPEED-AX-n: The user can specify a maximum feed rate for each of the axes, this can be used with the speed mode options to ensure no axis goes over-speed and can be used to optimise winding time. When graphics of speed are displayed these are as a proportion of the maximum speed for the axis i.e. 0.5=50% maximum speed.

; example uses deg/min and mm/min
; set all 6 axes even if machine does not have them

$MAX-ACCEL-AX-n: This can set acceleration values for each axis which can help to create a smoother faster winding program. For this option to be active in the post-processor the option $ACCEL_DISABLED=0 must be set, this is NOT the default state. If $ACCEL-DISABLED=0 is set, there is a further option $ACCEL-CALC-OFF this sets the initial (default) state for the ‘acceleration check box’ on the feed-rate dialog box during post process, the acceleration option is default on used if $ACCEL-CALC-OFF=0 is set. This last set can be over ridden by the user each time the post-processor is used.

;example of axis acceleration values 
; in mm/min/mm or deg/min/min 
; example assuming machine can 
; go from 0 to max speed 
; in 1/15 mins (4 seconds) 
; thus accel = vmax * 15 

$AX-3-ROTN-OFFSET: Machines with a yaw axis often have the rotating centre of the yaw not at the fibre dispensing point. When the head yaws the post-processor must compensate with cross-feed and carriage movements. The total rotating length from the dispense point to yaw centre is made up of the FIXED OFFSET+POLEN. The fixed offset is a constant for the machine (and is internally programmed into the post-processor) and will not change. If there is no yaw axis, set the offset to 0.00.

$MAX-AX-3-INCR.The yaw axis moves the head on a circular path. The cross-feed and carriage axes have to make compensating moves. As the axes move on a linear path point to point, if the yaw angle is large the clearance of the dispensing point could temporarily increase or decrease during the motion. If clearances are small this could cause a clash with the mandrel. The max- increment can be set to 10 degrees for reasonable accuracy. Any larger yaw movements are then broken into smaller parts and the correct carriage/cross-feed motions calculated for each. If the max.-increment is set to >2*yaw axis limit the feature is fully deactivated.

$PIPE-MAX-CARRIAGE-INCREMENT. The parameter is not strictly a post processor variable as it affects .PAY file creation for  pipe winding (Multi-pipe, Pipe, Hoop, Multi-hoop). Where there is a  long linear section of motion along the pipe with only 2 axes of motion (for example of a helical winding of a 12000mm long pipe there could be a 'linear' single motion block of 11000mm) this motion can be broken into a number of  smaller motion blocks. If  $PIPE-MAX-CARRIAGE-INCREMENT=1000 was set  a linear motion on the carriage of 8900mm would be slip into 9 equal portions such than none exceeded 1000mm. On some machines this feature could be used to help in recovery from power failure or to help in motion smoothing, or to overcome some controller limitation. If the value is not set the feature is non enabled and is not used.

$MPF-FIRST-IN-NC . A standard Gcode NC program file (<name>.prg) normally consists of a main program (MPF) and a series of sub-programs (SPFs) this option allows the MPF to be the first program in the prg file ($MPF-FIRST-IN-NC=1) or the last program in the prg file ($MPF-FIRST-IN-NC=0). 

There are now further options:

$MPF-FIRST-IN-NC=2 then instead for creating <name>.prg the post processor will create files <name>.mpf and <name>.spf  with the MPF and SPF data in them as some controllers require the two types of program to be separate.

$MPF-FIRST-IN-NC=3  then instead for creating <name>.prg the post processor will create files <name>.mpf and one or more  <name>.spf  files. Thus every program unit is in a separate file. This mode can be useful for example on Siemens 840 controllers the SPF's can be accessed directly from the hard drive (using EXTCALL) without having to 'load them'.

$MPF-FIRST-IN-NC=4  as option 3 above this splits the program into individual SPF files. The MPF is also created as an SPF file, this may be helpful if the main program needs to be integrated into a higher level HMI on the CNC.

$MPF-FILE-EXT= and $SPF-FILE-EXT= As discussed in the sections above Cadfil can create a separate main program file (MPF) and sub-program files SPF's. By default these have the file extensions .MPF and .SPF. Sometimes the CNC or transfer software may have specific file extension requirements e.g. .NC , .txt etc or indeed no file extension. So do this we would set $SPF-FILE-EXT=NC or $SPF-FILE-EXT=txt of $SPF-FILE-EXT=
Please note that if you have mpf and spf with the same extension there are some combinations of $MPF-FIRST-IN-NC= and other options that could lead to 2 files of the same name being generated, or more specifically one being overwritten by the other so some care must be taken or seek advise for the experts if you have a problem.

$SPF-FILE-NAME-PREFIX On some controllers the name of sub-program files my require some prefix to the file name. An example is a LNC controller that was using sub-programs with numerical names (example O2345). The post processor can make the sub-programs with numeric names and you can code so the the main program references the sub-programs using the letter "O" prefix but to create individual file names with this prefix you would set $SPF-FILE-NAME-PREFIX=O . Another controller configuration we use all sub-program names must have the letter LA, so post-processing a .PAY file called myfile would generate a sub-program called LAmyfile due to the setting $SPF-FILE-NAME-PREFIX=LA. If you do no need a prefix do not set any value (blank) or comment out the feature with a semi-colon ";SPF_FILE_NAME_PREFIX="

$AX-2-TYPE-OFF Cadfil has numerous options for creating payout path file (.pay) e.g. Cadfil-Axsym, Multi-Hoop etc. Each of these options has a 2 digit identifier (payid) in the first line of the PAY file, for example Multi-hoop is type 30. Using this option the SM file can be configured such that certain types of payid when post-processed do not use the eye roll axis ( Axis 2) . For example when hoop winding with tape the axis might not be useful or effective. This option is one that is not normally used but in the example below axis 2 will be switched off only when using types 23 and type 30. If $AX-2-TYPE-OFF is not set in the SM this option will be disabled.

Counters K1, K2 and K3 The Cadfil post processor has three counting variables the user can use for any purpose. These are K1, K2 and K3. K1 is used as an example here but all are the same, use K2-xxxx for the K2 counter. In the SM file the user can define $K1-START= and $K1-STEP=,  which are the starting value and the amount of the increment when the counter is increased . In the SM file 'blocks' that define the NC program structure each time the @@K1++@@ variable is encountered the value of the K1 counter is increased by the value of K1-STEP  (k1value=k1value+k1step) . If for example you put @@K1++@@ in the start position block K1 would count the number of NC sub-programs. At any point in the program the current value of the counter can be output using the @@K1-VALUE@@ variable. If it were put in the sub-program line output blocks it would count the number of sub-program lines.

$EXPAND-NC-LOOPS takes values of 0 or 1, 0 is the default. If set to one ($EXPAND-NC-LOOPS=1) then NC sub program data is repeated so that instead of a sub-program with (for example) 20 program motion lines that is called 5 times we would get 100 (20x5) lines of motion data as the NC lines would be added 5 times over. This feature should only be used if the NC controller cannot support sub-programs or program loop (such as If, GOTO, GOSUB loop etc) as it makes the programs larger and harder to understand and modify if required.

>BEEP-OFF=1 silences Cadfil if any beeps noises made are annoying. BEEP-OFF=0 is the default is so it does not need to be set.

See also the values to set the transfer software to the NC winder which are also set in the SM file.

 Next Section