Post-processor configuration-machine data file (.SM)
At version 7 and later all post-processor configuration is in a file with the .SM extension. The .SM file is a text file that can be viewed or changed using a text editor such as Notepad. At Version 9 there is also a facility to review and modify the SM configuration data within Cadfil using the Show Post-Processor Conguration Data menu option on the NC Post Process menu option. The following link describes the SM editor option. If you use notepad set Word Wrap off on the Format menu. New features have been continuously added to the SM files with subsequent Cadfil version updates. The SM file is found in he Cadfil install directory. When Cadfil is run a file called default.sm is always read but the a command line argument can be added to the Cadfil start shortcuts to specify a SM file name, the syntax for the command line is /lang filename.sm. There is also an option to browse and select an SM file from a menu option on the NC menu. 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 machine-name1.sm and machine-name2.sm. Each time you post-processes the text The Active machine configuration is > machine-name.sm is displayed in the text window so you know which configuration is in use. There is also an option to ALL view the current SM file settings from and option on the NC Post Process Menu
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 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 default.sm 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 the SM file and always make a safe copy of the original file before changing it. There are three types of data i n 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 as $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.Format line number just controls the layout of the MFP and SPF line numbers (if used) for example the controller might want 4 digits so leading zero need to be added, (I4) would give '1' or '1234' whilst (I4.4) would give '0001' and '1234' and (I6.6) would give '000001' and '001234'
$LINE-NO-START-MPF sets the first line (block) number in the MPF (main program file).
$LINE-NO-INCREMENT-MPF sets the line counting step the MPF (main program file). So if $LINE-NO-START-MPF=1000 and $LINE-NO-INCREMENT-MPF=10 the line numbers would go 1000, 1010, 1020, 1030
$LINE-NO-START-SPF sets the fisrt line (block) number in the SPF (subprogram files).
$LINE-NO-INCREMENT-SPF sets the line counting step in the SPFs. So if $LINE-NO-START-SPF=10 and $LINE-NO-INCREMENT-SPF=2 the line numbers would go 10, 12, 14, 16
$CONFIG= this can my set to any descriptive name for the contents of the SM file e.g. $CONFIG=The big red 5 axis machine. The name set can then be output to the NC program files to aid traceability.
For $NC-NO-CONDENSE and$NC-NO-MERGE see the topic Filter Length and Angle
$GEARING-AX-n These are the ratios, which relate the units 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.
$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-SPEED-AX-1=60000. $MAX-SPEED-AX-2=60000. $MAX-SPEED-AX-3=60000. $MAX-SPEED-AX-4=40000. $MAX-SPEED-AX-5=30000. $MAX-SPEED-AX-6=30000.
$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 $MAX-ACCEL-AX-1=900000. $MAX-ACCEL-AX-2=900000. $MAX-ACCEL-AX-3=900000. $MAX-ACCEL-AX-4=900000. $MAX-ACCEL-AX-5=900000. $MAX-ACCEL-AX-6=900000.
$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 $AX-3-ROTN-OFFSET+POLEN. 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.
$SPF-NAMED-AS-PAYFILE This takes the values 1 or 0, the default is $SPF-NAMED-AS-PAYFILE=0 in this option NC subprogram and main programs names in the G-code are given by the use of numbers only as is common on many old type NC controllers particularly those compatible with FANUC style G-code. With $SPF-NAMED-AS-PAYFILE=1 Cadfil uses mpf and spf names the same as the ctl/.pay file names used in the earlier stages of program generation.
$ASK-MPF-NUMBER can be used if we are on a controller that uses numbers rather than names for mpf/spf units. If $ASK-MPF-NUMBER=1 Cadfil asks for the numbers to use for the main program, the sub programs are then numbered sequentially so if you give the MPF number as 9000 the SPFs would be 9001, 9002, 9003, etc. The default is $ASK-MPF-NUMBER=0 in which case the user is not asked and the default MPF number is set by the value of $DEFAULT-MPF-NUMBER= which if not itself set has a default of 0000.
$MPF-FIRST-IN-NC. A standard G-code 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, if $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.
With $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'.
With $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=. 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 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.
'$USER-DEF-n' Where n is 1 to 5 can be used to collect together a series of commands or text that you want to use in more than one place in the program block definitions. So for example $USER-DEF-1=F @@FEED@@ @@LAB-AX-1@@ @@AX-INC-1@@ @@LAB-AX-4@@ @@AX-INC-4@@ (some text) so later you can specify @@USER-DEF-1@@ instead of a long sequence of variables. Often $BLOCK-SPF-START= $BLOCK-SPF-MIDDLE= and $BLOCK-SPF-END= repeat a chunk of the same data so these are good places to make use of this feature.
$BEEP-OFF=1 silences Cadfil, if any beeps noises (on error for example) are annoying. $BEEP-OFF=0 is the default if it is not set.
'$USR-PRMT-ACTIVE-n','$USR-PRMT-MSG-n','$USR-PRMT-TYPE-n' There are currently 5 user prompt variables that can be defined, the discussion that follows is for $USR-PRMT-ACTIVE-1 as an example. In the SM file if $USR-PRMT-ACTIVE-1=1 then then during the post process the user will be asked a question. You must define the question text in $USR-PRMT-MSG-1 so we have for example $USR-PRMT-MSG-1=Enter the heater setting (0-10)?. You also must set $USR-PRMT-TYPE-1=value where the type value is 1,2, 3 for real number value, integer (whole number) value or text input. If you have type 1 or 2 the input will be checked that it is a valid number e.g. '1.23' is a valid real number but '1qz4' is not. After checking what you enter is saved exactly as entered and will be output in the NC data wherever you have the variable @@USR-PRMT-VAL-1@@. This feature could be used for many different type on control input.
$USER-SET-PP-OPT-OFF If the winding machine configuration (.SM) does not have a particular axis configured then any post-process menu option that need that axis will not be shown in the menu. It is possible for the user to deconfigure post-process menu options also, for example of you have a 4 axis machine you might never wish to use any of the 2 axis or 3 Axis post-process options. You will see that all the post process options on the menu have a 2 digit number in brackets at the end of the name eg (05), that is the option number. In the SM file you could have $USER-SET-PP-OPT-OFF=[01,09,05,08], this says do not show post-process menu options 01, 09, 05 and 08. The options must be 2 digits and separated by a single space or comma. The square brackets are required.
See also the values to set the transfer software to the NC winder which are also set in the SM file.