Author Topic: CamBam, CutViewer and tools management  (Read 12075 times)

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7352
    • View Profile
    • Cambam V1.0 French Doc
CamBam, CutViewer and tools management
« on: January 21, 2016, 00:01:10 am »
CamBam, CutViewer and tools management .

The CutViewer simulator allows to manage tool profile that are not managed by CamBam. (or the right data are not passed to the simulator ; example, the conical tools)
With some changes in the post processor and a bit of work in the CamBam tool library, you can automate the transmission of this information.
What needs CutViewer is a such information in gcode

(TOOL/MILL, 1, 0, 13, 45)
(COLOR, 255, 128, 64)

The first line defines the size and profile of the tool, and the second the color it will have during the simulation. As can be seen, these two lines are in brackets, which means that in the Gcode these are comments that the driving software will skip and which will only be used by CutViewer.

For this to work with CutViewer simulation, these two lines must be located just before the Tnn M6.
The attached archive contains 3 files:
 - One tool library containing end mills, conical and hemispherical tools. It will be easy to add new tools by copy/paste the existing tools.

- Two post-processors to transmit the tools information to the driving software ; one for Mach3 and one for LinuxCNC

Files installation

Start CamBam, then go to the Tools/Browse System Folder menu.

In the Windows form, open the Tools folder and copy the Tools.xml file that is in the archive (previously unzipped). This is the tool library containing specific CutViewer definitions .

Return to the parent folder, then open the Post folder and copy the two post processor files. (Mach3-CutViewer tools.cbpp and LinuxCNC CutViewer-tools.cbpp) .. or only one if you want, depending of the driving software you are using.

Close and reopen CamBam.

Important Note: You must use one of the post-processor given in attachment instead of the standard Mach3_cutviewer post-processor.

If you want to modify your own, the major change is in the ToolChange macro ; {$tool.comment} has been added so the contain of the tool comment property is written just before the Tnn M6

{$comment} Standard def used if no specifics def in the tool library{$endcomment}
{$comment} TOOL/MILL,{$tool.diameter},{$tool.radius},{$tool.length},0 {$endcomment}
T{$tool.index} M6

The old definitions are always here to insure that, if no definition is given in the comment property of a tool, this default definition will be written in the Gcode.

If the tool have its own definition, it will be written in addition to this default definition by the  {$tool.comment} macro (just after, so because CutViewer uses the last definition that it has read, it will use the definition in the tool comment property instead of the one written in the post-processor)

{$tool.comment} MUST be on the line before the T{$tool.index} M6

CamBam configuration.

Choosing the default postprocessor (from version 0.9 Rev 8N)

Menu Tools/Options: in the Default Post-processor property, select one of the two post-processors that we have copied, depending on whether you use Mach3 or LinuxCNC.

If you cannot find the property, make sure you are in Advanced mode. If you do not find it, it is because your version of CamBam is too old, please update CamBam.

Choice of the tool library:
CamBam uses the default library named Default-mm.xml if you work in mm and Default-in.xml if you work in inches.
If you want to use another tools library that the one set by default, you must select it when starting a new project in the Machining folder property Tool Library.
Once this library has been selected, the tools it contains shall appear in the tool list IN ADDITION to the tools defined in the default library.
If you do not want to have to select each time this custom library, the simplest is to change the file name of the tool library that I puts in attachment.
Delete (or rename) the existing Default-mm.xml file in the Tools folder, and rename the Tools.xml file you just copied to Default-mm.xml; in this way the new library will be directly used as default library.(for mm only)

If you are working in Inches, you must rename the file to Default-in.xml and also change the tools diameter/length of all tools to match inches measurements

Setting the default style:
Now we need to make an adjustment to the default style (the style used to populate the properties of a newly created machining operation)
This setting is intended to automatically transfer the data of the tool (diameter and profile) in the machining operation when you select a tool in the library with it's Tool number.
- Click the System tab
- Unfold the CAM Style folder and its Standard-mm sub folder . (or standard-in if you are using inches)
- Click the first style in the list; one that has no name but just an icon (do not delete or rename this style; it is the basis for all others)
- Set the tool diameter and tool profile properties to Auto.

Using the library.

To assign a tool to a machining operation, click on the Tool number property of this operation and choose a tool from the list.
Remind that CutViewer need that a stock is defined. It must be defined in the Machining folder. The data for the stock will be passed to CutViewer the same manner as the tool data.

Add tools and CutViewer definitions .
See the documentation to see how to copy and paste tools or create new ones.

Only the tool diameter, the tool profile and the tool number are used by CamBam but CutViewer uses also Vee Angle (conical tool) and Length in addition of the three others.
Once that the new tool has been created, it may be necessary to modify its CutViewer definition , which is in the Comment property of each tool, to change its color.
Other information will be automatically taken from the data entered in the tool settings. For example, in this macro of a conical tool:


When it creates the Gcode, CamBam replaces the {$tool.diameter} macro with the value of the diameter that is in the tool diameter property of the tool; same thing for the other macro definition (vee angle and length).

The {$comment} and {$endcomment} are replaced by '(' and ')' in the Gcode (don't forgot them !)

Note that if you want to create a conical tool, you must copy/paste an existing conical tool from the Library because the CutViewer definition is different between the conical tools and end mills/ball nose.

See the CutViewer doc for more information about the tool definitions available.

In some cases it will be impossible to define the tool via macros.

This is the case for profiles unhandled by CamBam ; Tools like radius tool, or Conical tool with a flat end ; CamBam has no properties to store those info thus they can't be passed with a macro and must be "hard coded" in the CutViewer definition of the tool.

So instead of something like this:


we will write directly the values.


There is a way to use CutViewer to generate the tool definition, then after few change to add it in the tool definition.

Here we see the Comment property of the tool, that contains the definition for CutViewer.

Now we can use CutViewer to create easily a new tool definition (without macro) for a tool not handled by CamBam.

With the example of this video, we just need to add the {$comment} {$endcomment}

So to obtain this definition in the Gcode:

(TOOL/MILL, 1, 0, 13, 45)
(COLOR, 255, 128, 64)

we will write:

{$comment}TOOL/MILL, 1, 0, 13, 45{$endcomment}
{$comment}COLOR, 255, 128, 64{$endcomment}

Note: depending of the units you are using, if you get some display defect on CutViewer, try to change the value for Maximum Arc Radius in the post processor (for me, using mm, a value of 10000 works well)


« Last Edit: March 01, 2024, 20:37:11 pm by dh42 »

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8925
    • View Profile
Re: CamBam, CutViewer and tools management
« Reply #1 on: January 31, 2016, 22:26:37 pm »
Nice, David.

That will ease everyone's work with CV.

"Pyro for Fun and Profit for More Than Fifty Years"