ComposicaDMetal Documentation V2.4

Ultimate Filament Winding

Machine Controller

Composicad has a very flexible method for generating the required output formats for specific machine controllers.

The type of controller is selected in the Controller Menu:

_images/ControllerMenu.png

Each controller has a specific set of directives for generating the required output format. Most modern controllers follow some form of “G” code format - MCL, Delta Tau PMAC, Sinumeric, Kuka Robots and others are all “G” code format controllers. Other controllers require a specific output structure such as the .seg or .mmt format for McClean Anderson controllers.

G Code Controllers

Shown below is a typical menu for a “G” code type Controller. There are several tabs each with a set of related directives.

_images/GcodeDialog.png

Each directive generates a specific piece of the pattern. Within the directive, text is echoed directly into the output file. Meta commands embedded in the directive, are used to generate the pattern data in the specific format required.

ComposiCAD has predefined support for the following types of "G" Code controllers:

  • Sinumeric
  • Fanuc
  • MCL (Machine Control Language)
  • PMAC (Delta Tau)
  • Kuka robots

Other controller types can also be supported.

SEG Format

SEG format is used on some older McClean Anderson winding machines.

seg format dialog

McClean Anderson (MA) file formats are relatively unique in that they don't follow a conventional G code type approach. MA machines typically specify each axes relative to another axis (usually the spindle or time) in sequence; that is, all of the spindle points are specified, then all of the carriage points, etc. for each machine axis.

Using the SEG format dialog we can specify the syntax required for each of the axes. Currently only five axis machines are supported.

 

MMT Format

MMT format is used on the newer MA winding machines. It follows the same general approach as the SEG format, but uses a different syntax.

Composicad generates the MMT format directly.

mmt format dialog

Both .buf and .chn mode for the .mmt format are supported. Currently only 4 axes machines are supported. For the .buf format the ultimate destination directory of the .mmt files can be specified by checking the Destination directory box and then entering the correct directory on the winding machien where these files will be stored.

 

Meta Commands

Within each of the directive sections, meta commands may be used. A meta command consists of a command enclosed in curly braces - {}. Some commands take one or more parameters. The parameters are given after the command with each parameter separated by a comma. Some parameters are optional. Parameters can be given in sequence or can be individually specified by the parameter name, an equal sign and then the parameter.

Example - Position meta command:

{PO, sp, f='%.2f', a=True, i=0}

Following is a list of the currently support meta commands:

{PO, axis, f, a, i, pos, off, lp} - returns axis positions

   axis is the required two character axis designator:

   sp - spindle
   ca - horizontal carriage
   cc - cross carriage
   re - rotating eye
   yw - yaw
   pc - perpendicular carriage
   fl - fiber length

   f is the optional format designation in the form "%.Nf" where N
   indicates the number of decimal places return - use "%+.Nf" to
   return the value with a + or - sign

   a is the optional absolute position flag given as a=True or Abs, returns
   absolute positions instead of the relative position

   i is the optional point number with 0 being the first point in
   the form i=0

   pos is the optional flag that can be used to return the minimum (pos=LL or LL) or maximum
   (pos=HL or HL) position of the Cross Carriage axis (see example below)

   off is the optional flag (off=False or NoOff) to not include the Pattern Offset 
   and the Carriage Offset (from the lamina Output Options) in the values returned 
   for the Horizontal Carriage axis - {PO, HC, Abs, NoOff} 
   or the Cross Carriage Offset for the Cross Carraige axis
   
   lp is the optional flag (lp=True or LP) to return the last point instead of the current
   point - returns the absolute position. 

   The following meta commands affect how the PO (Position) command works:

   {AssignAxis, sp, ca, cc, re, yw, pc, fl} - assigns the appropriate code for each
   axis - ex: {AssignAxis, 'X', 'Y', 'Z', 'U', 'V', 'W'} - codes can be single letters
   or strings

   {AssignAxis} (without parameters) sets all codes to a null string '' - the default setting

   {IncludeZeroRelative, True or False} - include points that have a relative position value
   below the threshold value, else exclude them - ex: {IncludeZeroRelative, False} - causes
   the PO command to not generate any output for points that have a relative value below
   the threshold- default is to include values below the threshold

   {SetThreshold, sp=x.x, ca = x.x, cc=x.x, re=x.x, yw=x.x, pc=x.x} - set the threshold
   value used by the IncludeZeroRelative meta command - default is 0.01 for each axis - 
   units are the same as the output units (degrees and mm scaled by each axis' Scale value)
   useful for filtering out small changes in output position

   {IncludeAll, True or False} - If True include all axes - If False exclude axes that
   are not calculated - Default is True

   {NoSpace, True or False} - If True no extra space is added after the position comannd -
   If False an extra space is included after the PO command output - Default is NoSpace -
   Useful to limit extra spaces when using the IncludeAll or IncludeZeroRelative options

   These commands do not return any value. The must be executed before the first PO command

   A special PO command can be used to return the Cross Carriage retract position -
   {PO, cc, pos='HL'} - this is useful for start routines that retract the cross Carriage
   before moving the other axes

{Velocity, axis, f, i} - return the current axis velocity

   axis is the required two character axis designator - the same as for the PO command
       with the addition of:

       tp - tool point

   the f and i are optional parameters with the same function as for the PO command

{FR, f, ai, min} - returns the pattern feedrate in increments per minute

   f is an optional format string as described above
   
   ai is the optional list of axes to include in the FR calculation. 
   The default is all axes. 
   Ex: {FR, ai=[2,3,6]} would include only the linear axes - carriage, cross carriage 
   and perpendicular carriage in the FR calculation. The axes are:
   1 = spindle, 2=carraige, 3=cross carriage, 4=eye, 5=yaw, 6=perpendicular carriage
   
   min is the optional minimum value to return. Default is 0.0.

{TM, f, a} - returns the pattern time in seconds

   f and a are optional parameters as described above
   
{Var, variable, value}

   Assigns a value to an internal variable that may be used later in the program. The
   variable may be accessed by using {Var, variable} which returns the current value 
   for the variable. If the variable is undefined the function returns an empty string.
   The variables may also be accessed in a conditional string by using self.variable.
   
   Ex: {Var, 'LastCarrDir', Int('ADir, ca)} assigns the carriage direction to a 
   variable called LastCarrDir. The variable name must be in quotes.
   
{IF, 'condition', 'True expression', 'False expression'}

   The IF meta command can be used to select which of two expressions will be 
   evaluated based on a conditional result. If the condition evaluates to True then 
   the True expression is evaluated; if not then the False expression is evaluated.
   
   Ex: {IF, 'self.LastCarrDir == 0', ';carriage is not moving', ';carriage is moving'}

   The expressions can contain meta commands. 
   
   Ex: {IF, 'self.LastCarrDir == 0', '', '{FR}\n'}
   
   A \n can be placed in the expression to include a carriage return in the output.
   
{ADir, axis, i}  

   ADir returns the direction the specified axis is moving as -1 if moving to 
   decreasing positions, 0 if stopped, and +1 if the axis is moving to larger 
   positions. The axis and i parameters are as specified for the PO command. 
   
{AExt, axis, mm, f, off}

   AExt retruns the maximum or minimum extent (position) in the current layer for 
   the specified axis in absolute position.
   
   mm is the optional flag to specify the minimum (mm='Min' or Min) or maximum 
   (mm='Max' or Max) extent. The default is the maximum value.
   
   The axis, f, and off parameters are the same as the PO command'
   
{CloseToLast, d}

   CloseToLast returns True or False depending on whether the last delivery point position 
   is close to the current delivery point position. The points are close if the distance
   between the two points is less than the parameter d. The default for d is 5 mm. This
   conditional can be used in an IF meta command to determine if the cross feed 
   should be retracted or not when moving to the start position.
   
   Ex: {IF, 'self.CloseToLast(12)', 'X{PO, ca, Abs} Y{PO, cc, Abs} B{PO, re, Abs} 
   ; dont retract cc\n', 'Y{PO, cc, HL} ;retract cc\nX{PO, ca, Abs} B{PO, re, Abs}
   ;move carr and eye\nY{PO, cc, Abs} ;move cc into start\n'}
     
   CloseToLast can only be used in an IF command conditional, since it returns a True 
   or False value and not a string. Note the use of the self.CloseToLast() syntax in 
   the conditional.
   

{OutputFileName, NoExt, NoPath, PathOnly, ExtOnly}

   Returns the current Output File Name including path and extension.

   NoExt flag - removes the extension
   NoPath flag - removes the path
   PathOnly flag - return only the Output File path including trailing slash
   ExtOnly flag - return only the Output File Name extension including the dot (period)

   Ex: If the Output FileName is C:/project1/smallbottle/X123.mpf - {OutputFileName, NoPath}
   returns x123.mpf - {OutputFileName, PathOnly} returns C:/project1/smallbottle/ -
   {OutputFileName, NoPath, NoExt} returns x123

{OutputDir}

   Returns the output directory for the selected Machine output

{OutputExt}

   Returns the output file extension for the selected Machine output

{PartName, Space='_'}

   Returns the Part Name with spaces replaced by the Space character
   The default Space replacemnt character is the underscores (_), but can be set to any 
   character or string
   Example: if the part name is Mikes Test {PartName} would return Mikes_Test
   {PartName, Space=''} would return MikesTest
   {PartName, Space = 'Space'} would return MikesSpaceTest
   Example: the directive {Outputdir}{PartName}{OutputExt} would return a valid filename
   for the output file name (Used in the Part Menus for auto file name)

{Date} - the current date

{Time} - the current time

{LaminaNumber} - the current lamina number

{NumberLamina} - returns the total number of lamina

{LaminaType} - returns the lamina type

{LaminaTypeCode} - returns the lamina type in the current language

{MaterialNumber, NoEcho} - returns the Material number if the NoEcho parameter is not 
	specified. This command must be executed immediately before another material meta command.
	
{MaterialParameter, 'p'} - returns the specified material parameter. 
	Defined parameters are:
		MaterialName, TEXValue, Yield, NumberRovings, ResinDensity, FiberDensity, 'CompositeDensity,
		FiberVolumeFraction, ResinVolumeFraction, FiberWeightFraction, ResinWeightFraction, ResinCost, 
		FiberCost, CompositeCost, BandWidth, BandThickness, CrossSection, BandCost, MaxSlip, LinealWeight 
		Note the parameter name must be in quotes. Note the values are returned in internal units ie.
		mm, sqmm, g/cc, $/kg, $/m, g/m
		
		Other paramters that may be defined (user defined) are the material mechanical properties:
            'UFTS' - Ultimate Fiber Tensile Stress
            'UFE' - Ultimate Fiber Tensile Elongation
            'E1' - Modulus of Elasticity for Local Axis 1
            'E2' - Modulus of Elasticity for Local Axis 2
            'E3' - Modulus of Elasticity for Local Axis 3
            'v12' - Poisson Ratio for Local Plane 12
            'v13' - Poisson Ratio for Local Plane 13
            'v23' - Poisson Ratio for Local Plane 23
            'G12' - Shear Modulus of Elasticity for Local Plane 12
            'G13' - Shear Modulus of Elasticity for Local Plane 13
            'G23' - Shear Modulus of Elasticity for Local Plane 23
		for the other parameters you can also use:
		{MaterialParameter, 'p', Units} {MaterialParameter, 'p', Description} to get other information

{VesselWA} - returns the winding angle for a vessel part in degrees

{VesselNumberLayers} - returns the number of layers in the current lamina

{BandWidth, scale=True}

   Returns the band width for the current lamina in the units used for the 
   Carriage Axis if scale is True (the default). If scale is False {BandWidth, False} 
   will return the band width in mm.

{PartDiameter, scale=True}

   Returns the part diameter at the Headstock for the current lamina in the units 
   used for the Carriage Axis. If scale is False {PartDiameter, False} will return 
   the diameter in mm.

{PathLength, scale=True}

   Returns the path length for the current lamina in the units used for the Carriage 
   Axis. If scale is False {PathLength, False} will return the length in meters.
        
{OutputUnits, i='IN', m='MM', u='')}

   Returns the units selected for the linear axes in the Machine Setup. Returns 
   the i parameter for inches, returns the m parameter for mm and the u parameter for
   anything else. 
   Example: {OutputUnist, 'IN', 'MM', 'Feet'} would return 'Feet' if the setup for 
   the linear axes is set to Use Scale Factor, 'IN' if it is set to Output in Inches, 
   and 'MM' if it is set to Output in MM.

{Blk, f} - the current block number - f is an optional format string - default returns a five 
digit blk number typical format strings: '%i' - returns just the blk number with no leading 
spaces, '%05i' - returns a five digit number padded with leading zeros (the default)

{FirstBlock} - replaced with the results of interpreting the First Block directive if it is the first block.

{LastBlock} - replaced with the results of interpreting the Last Block directive if it is the last block.

{Zero} - replaced with the results of interpreting the Zero Block directive

{{text}} - returns {text} - useful for embedding text that is enclosed in curly braces

/{ or /} - returns { or } respectively

The feedrate is derived from the time base as follows:

feedrate  = \frac{\sqrt{ \Delta P^2_{sp} +  \Delta P^2_{ca} +  \Delta P^2_{cc} +  \Delta P^2_{re} +  \Delta P^2_{yw} +  \Delta P^2_{pc}}}{time / 60}

In addition, many of the internal part and path variables are accessible by name. See the Other Options to see how to enable showing the variable names in the menus and dialogs. Following is a list of some variables that are useful:

{ProgramNumber} from the Project definition

{NumberCircuits} - returns number of circuits for a helical lamina

{NumberLayers} - returns the total number of helical and circ lamina
                

Meta commands that return a string can have an optional slice notation: two indices separated by a colon.:

{OutputFileName[:-4]} - return the output filename without the last four characters

Calculations can also be done in a meta command. Example:

{100.0 + 100.0 / 2.0}

returns 100.0

All of the meta commands return a string which is inserted into the output, replacing the meta command. Two special functions are provided:

Int('metacommand') - return an integer form of the meta command

Flt('metacommand') - return a float form of the meta command

Do not use curly brackets in the parameter to the Int or Flt functions. The metacommand parameter must be in quotes. These functions are useful for doing arithmetic on a value.

Example:

{Flt("FR") / 60.0} - returns the feedrate in increments per second

If a meta command parameter the Int() and Flt() functions returns a value that is not numeric, Int() and Flt() return zero.

 

Documentation


G Code Controllers

SEG Format

MMT Format

Meta Commands


Machine Definition

 

©2014 Composicad - All rights reserved. This page revised May1 ,2014.
Composicad, the stylized C Composicad logo and the ComposicaD logo are trademarks of Composicad