HOWTO: text engraving using 3Drag/K8200

Transcription

HOWTO: text engraving using 3Drag/K8200
HOWTO: text engraving using 3Drag/K8200
Ver. 1.0
1 The Problem
2 Hardware
3 Sofware
3.1
TextGraver
3.2
DeskEngrave
3.3
StickFont
3.4
Inkscape
4 Engraving PLA
5 Toolchain
6 Notes and References
1
The problem
To create a 3D printed keyring for the awards of our Bridge club
(http://www.thingiverse.com/thing:1235307), I wanted to engrave the text "GIOBRIDGE
2015" on the back of the PLA keyring, using 3Drag as CNC.
But after breaking two bits without an acceptable result I decided to stop for a moment and
review the whole thing.
In this document the results of my research and testing on engraving text, it includes also a
toolchain using regexfiler, a my filtering program for text files, that automates some
operations on G-code, with the hope that my work will be useful to some 3Drag user.
1.2 Features required.
✔ Load the Gcode on Repetier host.
✔ Fix the object to be engraved on the bed, very horizontal.
✔ Place by hand with Repetier the end mill in correspondence of a reference point on
the object.
✔ Adjust the height Z based on the depth desired.
✔ Start the drill engine, and then the G-code in Repetier.
✔ At the end the mill head is repositioned in HOME.
✔ Stop the mill and remove the object engraved
In other words, I do not want an absolute code, making it compulsory to place objects in the
same position on the bed, but a relative code.
For the Z axis, I impose in Gcode always 2mm as low value and 5mm as high value. The
start position of the mill bit is taken as 3mm (by the initial code G92 X0 Y0 Z3). Therefore, if
the work begin exactly 0.7 mm above the surface, the milling depth will be 0.3 mm.
I want to do that in Windows 10, using free sw, and in the simplest way possible: after all I
am just a beginner in CNC.
Note: I tested the software using Windows 10, but Inkscape, Notepad ++, CAMotics and
Repetier have versions for different OS and the final toolchain is easily adaptable.
2
Hardware
2.1 Mill and 3Drag mount
I am using a mini-drill Valex (Brico) and a fast-clamp mount (see
http://www.thingiverse.com/thing:951383 ) but you can also use a Dremel
(http://www.thingiverse.com/thing:225465 ), a Parkside (Lidl)
(http://www.thingiverse.com/thing:768599 ) or any rotating engine having a 3mm spindle
and sufficient speed.
Note: If the cable (220/110 V) is too close to the 3Drag control board I noticed malfunctions.
2.2 3Drag quirks
I do not want to alter the Marlin firmware, so the 3Drag as CNC suffers the following
limitations:
◦ The 3Drag goes in error state if the extruder thermistor is not connected.
Solution: put a connector (eg. DB9) on the 8 wire extruder
cable. After removing the extruder insert a plug with only a
resistor of 100 KΩ that simulates the thermistor at room
temperature.
Alternative: you can fix the resistor to a two pin connector
that plugs directly on the controller board instead of the
connection to the extruder thermistor (cable yellow/blue).
◦ The output E is disabled if the thermistor does not reports at least 170 ° C
Solution: Okay so (I do not use the exit E) but just need to reduce the value of the
100 KΩ resistor in order to simulate a temperature greater than 170 ° C.
◦ X, Y, Z must have only positive values
Note: unfortunately this is true even if you switch to Relative Positioning (G91),
which makes this mode completely unusable (Marlin bug).
Solution: use appropriate starting and trailing G-code, use offsets for coordinates
always positive.
2.3 Repetier: preparation
In Repetier/Printer Settings you must create a new profile, for example "3Drag-CNC",
cloning the profile 3DRAG. (Repetier must be disconnected from 3Drag to do this).
In "3Drag-CNC", you must delete all scripts: initial code, final code, etc.
2.4 G-code: simulation on screen
I found very useful to use a simulator for a first impression about the result, or to evaluate
some measures, or to see the effect of changes in Gcode, After some tests my choice is
CAMotics (http://camotics.org/download.html), previously also called openSCAM.
2.5 Simulation on paper using 3Drag
After the unfortunate initial
attempts I found useful, before
milling, to do some tests on paper,
and verify the results.
It is necessary to fix a pen on
3Drag, better using a support for
pen/pencil easy to assemble. This
is mine:
http://www.thingiverse.com/thing:
1196997.
3
Software for engraving texts
….....3.1 TextGraver
http://www.cncdrive.com/downloads.html
3.1.1 PRO
•
Uses the TTF fonts installed in
Windows (see Note 2).
•
Allows the definition of start and end
G-code.
3.1.2 AGAINST
•
Allows only straight writing.
•
Allows you to save in three formats
(.gc, .nc, .tap) but the content is
identical. I use .nc
•
Accepts only integer multiples for the
size, then the minimum size can be
obtained only placing the minimum
height of the font (in points) in the Font
Menu. (In figures: font Microsft Sans
Serif. 8 points → text 6mm x 68mm)
•
The origin (0,0) is in the top left, and
corresponds to the corner of the
rectangle that contains the first
character plus more space between characters (negative Y coordinates).
•
Does not save the setup: it must be re-entered at each run.
•
Countries using Arabic numerals with decimal comma: I recommend the use of the decimal
period with this program (see Note 1)
3.1.3 USO:
Very simple and easy. Only caveat: adjust the Y
Offset in setup.
1. run the "View / Generate code" with Offset X
= 0, Offset Y = 0
2.
put Offset Y = Y max (negative)
Note: use PC-local decimal separator
3. Initial Code (Note 3):
G90
G92 X0 Y0 Z3
4. End code (Note 3):
G00 Z30
G28 X
G28 Y Z
5. Z deep = 2mm (1 mm lower than the starting position).
6. Re-run View/Generate code
7. Save as .nc
3.1.4 USE WITH SIMULATOR (CAMotics)
•
With an ASCII editor (e.g. Notepad ++) or in
CAMotics, choosing "Edit File" in the context menu of
Files:
•
Delete initial comment rows (beginning with '%')
•
If the local do not use the decimal period (note 1)
replace all the commas (,) with a period (.)
•
Delete the last lines. (G0 Z30 G28 G28 X Y Z) ..
•
If you have used an editor, save as .ngc and load in the simulator.
3.1.4 USE WITH 3Drag
•
If required (note 1) replace all the
commas (,) with a period (.) using an
ASCII editor (e.g. Notepad ++) or in
CAMotics.
•
Otherwise the file generated by TextGraver is directly usable with Repetier + 3DRag
•
Load the file in Repetier-
•
Using Repetier commands, place the pen (bit) at the point of departure.
•
Lower the pen (bit) until it touches (use a paper: it must be removed without breaking).
•
Lift the pen exactly 1mm, (bit: 1mm less the cutting depth)
•
Now use the button "Start work"
….....3.2 deskEngrave
http://www.deskam.com/deskengrave.html
3.2.1 PRO
•
Uses the TTF fonts installed in
Windows (see Note 2).
•
•
Allows writing circular
Direct sizing using the height of
the character or of the total length
of the text, in mm.
3.2.2 AGAINST
•
•
•
•
•
Allows you to save in one format
(.dnc), I use .nc
The origin (0,0) is in the bottom
left, (ok), or the circle center (bad:
X, Y negatives)
Z axis down: always negative
It does not allow you to define the start or end code.
Always inserts the line numbers in the G-code
3.2.3 USE:
1. Set the height of text in mm in Height
2. Case circular:
Rad = radius of the circle
Center X = Heigth + Rad
Center Y = Heigth + Rad
3. View / Generate code
4. Save file as .nc
3.2.4 USE WITH SIMULATOR (CAMotics)
•
If required (note 1) replace all the commas (,) with a period (.)
using an ASCII editor (e.g. Notepad ++) or in CAMotics.
•
Otherwise the file generated by TextGraver is directly usable
with CAMotics
3.2.4 USE WITH 3Drag
•
Setup: (Create/Set parameters):
Parameters - deep = 2mm
Parameters – Rapid Height = 5mm
Line Number – Start at = 1
Line Number – Increment = 0
Note: so all line numbers are N1
•
Save (File – Save As G-Code) using the
extension .gcode
•
With an ASCII editor (e.g. Notepad ++):
If required (note 1) replace all the
commas (,) with a period (.)
Replace all "Z-2" with "Z2"
Replace all "N1 G" with "G"
Replace all "N1 X" with "G00 X"
Replace all "N1 F" with "G00 F"
Enter START and END code, see note 3.
•
Save and load in Repetier.
•
Using Repetier commands, place the pen (bit) at the point of
departure.
•
Lower the pen (bit) until it touches (use a paper: it must be
removed without breaking).
•
Lift the pen exactly 1mm, (bit: 1mm less the cutting depth)
•
then do the button "Start work".
….....3.3 StickFont
http://www.ncplot.com/freetools.htm
Perhaps the best program of this group.
3.3.1 PRO
•
Uses its own font
format (.CHR)
•
Extra library with 14
font, with some fonts
single line, other multiline, all in CHR format.
•
You can make custom
fonts in CHR format.
(Ascii).
•
Converts TTF fonts in
CHR, (only if local
uses the decimal period
– see Note 1).
•
Allows written inclined
and circular
•
Direct dimensioning of the character height in mm. Sizing the spacing between characters
•
Allows you to define start and end code.
•
Manages three values for the Z axis
3.3.2 AGAINST
•
It allows you to save in one format (.dnc)
•
Do not turn the TT fonts in single line, CHR remains with the double profile (Note 2)
•
The CHR file contains only straight segments, not curved lines.
•
There is no converter CHR → TTF
•
The origin (0.0) is in the bottom left (ok), or in the circle center (X, Y negative)
•
"Save as Gcode" does not work in the menu: Use the button.
•
Almost essential to use the decimal period (see Note 1)
3.3.3 USE:
•
Case circular, you must adjust offsets:
Text Center X = Text Heigth + Arc Radius
Text Y = Center Text Heigth + Arc Radius
•
Other parameters:
Retract Z
=5
•
Approach Z
=3
Deep Z
=2
Pludge Feedrate
= 200
Feedrate
= 100
Initial Code (Note 3):
G90
G92 X0 Y0 Z3
•
End code (Note 3):
G00 Z30
G28 X
G28 Y Z
•
Save as .nc
3.3.4 USE WITH SIMULATOR (CAMotics)
•
With an ASCII editor (e.g. Notepad ++) or in CAMotics,
choosing "Edit File" in the context menu of Files:
•
If the local do not use the decimal period (note 1) replace all the
commas (,) with a period (.)
•
Delete the last lines. (G0 Z30 G28 G28 X Y Z) .
•
If you have used an editor, save as .ngc and load in the
simulator
3.3.5 USE WITH 3Drag
•
With an ASCII editor (e.g. Notepad ++):
If required (note 1) replace all the commas (,) with a period (.)
Replace all "X" with "G00 X" But not in the 2nd line: "G92
X0 Y0 Z3"
Replace all "Y" with "Y" (space + 'Y')
Replace all "Z" with "Z" (space + 'Z')
Replace all "F" with "F" (space + 'F')
•
Save and load in Repetier.
•
Using Repetier commands, place the pen (bit) at the point of departure.
•
Lower the pen (bit) until it touches (use a paper: it must be removed without breaking).
•
Lift the pen exactly 1mm, (bit: 1mm less the cutting depth)
•
then do the button "Start work".
….....3.4 Inkscape 0.91
https://inkscape.org/en/
This program is different from the previous ones, because it is a generic vector graphics program,
then more powerful but undoubtedly more complex. For example, these are the instructions to get
circular texts (http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Text-Path.html):
Text on a path is initially placed on the “left” side of the path (referenced from the path direction)
starting at the beginning of the path. One can change the direction of the text (and the side it is
placed on) by reversing the direction of the path (e.g., Path →
Reverse (Shift+R)). If the text is
center justified prior to being put on a path, it will centered along the path.
To place text on a circle so that it reads from left to right on both the top and bottom, two
circles must be used as seen on the left. The larger circle has been flipped horizontally
(Object →
Flip Horizontal (H)) so the text is placed inside the circle starting from the
left. The smaller circle has been rotated 180 degrees. (The path of a circle when first
drawn starts from the rightmost point. The circle must be rotated or flipped to move the
starting point of the path to the left.) By turning the circles into half circles and setting the
text to center-justified, the text will automatically be centered at the top or bottom of the
circle. Note that kerning may be necessary as the characters of text placed on the
outside of a curve will be too far apart while those on the inside of a curve will be too
close together.
3.4.1 PRO
•
Powerful free program for vector graphics.
•
Uses the TTF fonts installed in Windows
•
Allows the use of “single line open” TTF fonts: but the glyphs have to be opened by hand or
with the extension reopenSingleLineFont (see Note 2).
•
For linear or inclined text you can
use Extensions / rendering / Text
Hershey (included), which uses a
private set of 'single line' fonts
(not TTF), but generates graphical
objects, not text.
•
For text following paths you must
instead use TTF font.
•
You can make custom fonts
(limited and requires .FontForge)
•
Sizing the spacing between
characters (kerning).
•
Extension / Generate from path /
Paths to OpenSCAD (to install)
for export to OpenSCAD
(http://www.thingiverse.com/thing
:1065500): tested, very good.
3.4.2 AGAINST
•
The use is complex, it takes longer time.
•
Almost essential (wiki-Manual-see note 8) the use of the decimal period (see Note 1)
•
Char sizing in Pt (but text can be resized after in mm).
3.4.3 Inkscape and G-code
I found three Inkscape extensions to create G-code:
1. Gcodetools (included with Inkscape). The latest version (1.7) can be downloaded here:
http://www.cnc-club.ru/forum/viewtopic.php?f=15&p=101) . Very comprehensive but not
well documented on the site, I found it difficult use, although it has nice features, such as the
parametric G-code (accepted by the simulator but not by Repetier), bas-relief, etc ...
Note: I gave (with Inksape 0.91) the error "AttributeError: 'module' object has no attribute
'unittouu'". The solution shown in this post worked for me:
http://www.tylerforsythe.com/2015/02/inkscape-laser-engraver-bug
2. Generate G-Code for Repetier, download (http://www.repetier.com/repetier-g-codeplugin-for-inskscape/ ) and install. It seems to be a simplified version of the previous. Very
simple to use, the generated code is optimized for laser cutter and not for cnc, but this is not
a problem.
3. Save As / EMC GCode: This will create a single file containing all the layers toolpaths and
Extension / Export / Export as GCode: this will output one file per layer in a specified
directory. This can be downloaded here: http://wiki.linuxcnc.org/cgi-bin/wiki.pl?
InkscapeHowto .
Note:With the version 0.91 of Inkscape it gives me some errors.
3.4.4 USE
1. Install the chosen font (in the example: the “stick font” 1CamBam_stick_3.ttf) in Windows
(just copy it in the dir. C: \ Windows \ fonts)
2. Select File / Document Properties, then on the Document Properties / Page / genaral choose
default units: mm. (Ditto in Grids / unit)
3. Do the text, choosing (Text / Text and character) the stick font just installed. Go to Object /
Fill and stroke, then select fill: no paint, stoke paint: flat color.
4. Complete the editing, possibly with Path (in the example, circular), here online help.
5. Kerning: Select the Text Tool (A), select the letters of interest in the text, and use the buttons
in the toolbar.
6. Place the object in the lower left corner of the sheet (origin 0.0).
7. Select all, then Object / ungroup
8. In view mode / display mode / outline, and select Object / Unhide all
9. Clean: select and delete one by one all the items that are unnecessary.
10. Select the entire written remaining, then do Object / group
11. Save (The design is finished and clean).
Estension: “Generate G-Code for Repetier”:
I use this extension because it is simpler than
Gcodetools.
12. Select all, then Object / ungroup
13. Turn text on path: Menu Path / From Object to Path
14. Execute Extensions / Generate G-Code for Repetier /
Repetir Laser Tool
15. Set:
Travel Speed =
100
Laser Speed =
10
Folder = enter the output directory
Filename =
xxxxx.nc
16. Now theApply Button
3.4.5 USE WITH SIMULATOR (CAMotics)
•
With an ASCII editor (e.g. Notepad ++):
Delete all lines starting with ‘M’ (M3, M5, M18, M452)
Replace all "F100" with "Z5 F100"
Replace all "F10." with "Z2 F10."
note: using Notepad++ set Search mode/Normal
After the row “G21” insert START code (Note
3):
G92 X0 Y0 Z3
Delete last rows:
G91
G90
G00 X0 Y0
Insert END code, (Note 3):
G00 Z30
G28 X
G28 Y Z
•
Save the file as .ngc and load it in the simulator.
3.4.6 USE WITH 3Drag
•
With an ASCII editor (e.g. Notepad ++):
Delete all lines starting with ‘M’ (M3, M5, M18, M452)
Replace all "F" with " F" (space+F)
Replace all “F100” con “Z5 F100”
Replace all “F10.” con “Z2 F10.”
note: using Notepad++ set Search mode/Normal
After the row “G21” insert START code (Note 3):
G92 X0 Y0 Z3
Delete last rows:
G91
G90
G00 X0 Y0
Insert END code, (Note 3):
G00 Z30
G28 X
G28 Y Z
•
Save the file as .gcode and load it in Repetier.
•
Using Repetier commands, place the pen (bit) at the point of departure.
•
Lower the pen (bit) until it touches (use a paper: it must be removed without breaking).
•
Lift the pen exactly 1mm, (bit: 1mm less the cutting depth)
•
Pin on a sheet the coordinates X, Y, Z used, then the button "Start work
4
Engraving PLA
•
I used a bit for PCB, 15°, 0.1 mm, with low speeds (F10, drill with speed control halfway)
and 0.1mm deep step, with 2 or 3 passes (using 2 END)
•
Acceptable results. The PLA does not melt
•
Good operation of the XY axes; curves well designed, repeatability of positioning XY
adequate: no problem with the second or third time.
4.1 Problems encountered:
5
•
Excessive eccentricity of the spindle of my drill, for which the incision is larger than
expected, and a milling bit is broken. On the other hand it was really small letters, only 3.6
mm high. (Solution: change spindle or change drill)
•
Bug in sw Repetier (but not in Marlin): the sequence G90 G21 G92 X0 Y0 Z3 G0 Z5 F200
correctly position the tip to Z = 5, while Repetier indicates Z = 8. (Solution: ignore the
indications of Z in Repetier)
•
Always write the coordinates of the starting point !!! If you have to start again they are
essential !!! (Solution: be precise and tidy!).
•
It would be useful to carry out, before a new engraving, the tests indicated in
http://www.precisebits.com/tutorials/calibrating_feeds_n_speeds.htm to find the right
balance between speed / feed rate as a function of the bit and material. (Solution: provide,
for the next work, a sample of the material where performing the tests)
Toolchain
Now I want to automate the process
described above, to have it running faster
and error free. We need another program
and a minimum of setup.
I limit this to the programs that I found
most interesting: StickFont and Inkscape,
for use with Repetier, and CAMotics,
supposing this programs already installed
and operating.
To make the changes in G-code, I use a my
old java program, regexfilter, which
carries out multiple substitutions in a text
using the "regular expressions", much
more powerful than the simple search /
replace.
For details and the regular expressions
syntax, see the
file:///C:\regexfilter\README.html after
installation.
G-code build by
StickFont, Inkscape
file .nc
opzional:
Editing
Auto fit
file .ngc
file .gcode
Simulation
CAMotics
Engraving
Repetier
To launch easily regexfilter (it is a filter without GUI) I will use the potential of Notepad++,
because it has features not found in other editors.
To make it even easier, I use systematically the three extensions ".nc", ".ngc" and ".gcode"
to distinguish the various types of files:
.nc:
initial files, from StickFont and Inkscape,
.ngc:
modified files for CAMotics,
.gcode:
modified files for Repetier
and I associate the "nc" files to Notepad ++ the ".ngc" files to CAMotics and the ".gcode"
files to RepetierHost.
So using Windows Explorer just a click (double click) on the file to open the correct
application.
5.1 Installation:
I make reference to a standard PC Windows 10.
Note for other OS: regexfilter is in Java, so it can be used in all OS. For not-Windows PCs,
you need to adapt doFilter.BAT (e.g. write a dofilter.sh), then plug it into a suitable directory
(e.g. usr / bin) and then add it (see steps 6, 7, 8, 9) to the menu of Notepad ++.
You can also set the associations based on file extensions (see step 11) as required by the
OS in use.
1. If it is not already on the PC, download and install Notepad ++ from https://notepad-plusplus.org
2. Launch Notepad ++ and install the plugin NPPexec (menu: Plugins / Plugin Manager)
3. Unzip the file regexfilter.zip in C:/. The directory regexfilter is created, and the main file is
C: \ regexfilter \ regexfilter.class, used by C: \ regexfilter \ dofilter.bat
4. Java verification - 1
Regexfilter has been tested with Java version 1.7 (and 1.8) If your version of Java is earlier
you should upgrade from https://www.java.com/it/download/
The Java version test can be done online: https://www.java.com/it/download/installed8.jsp
(also possible from Control Panel / Java or from the prompt: >java.exe -version).
5. Java verification - 2.
Launch "Command Prompt" and write “Java”, then enter.
If you see the Java instructions: all okay, you can continue to 6.
If you read a message like this:
"java" is not recognized as an internal or external command, an
executable program or a batch file.
you must look for java.exe path (on my PC is in C: \ Program Files \ Java \ jre1.8.0_66 \
bin \ java.exe) and modify the file C: \ regexfilter \ dofilter.bat using Notepad++ (Notepad
does not fit).
6. Add new commands to Macro menu in Notepad ++.
Launch Notepad ++ and setup the first tool as follows:
Menu: Plugins / NppExec / Execute.
In Command(s) write (or copy / paste) the following three lines:
SET local OUTFILE = $(CURRENT_DIRECTORY)\$(NAME_PART).gcode
C:\regexfilter\dofilter.bat StickFont_3drag "$(FULL_CURRENT_PATH)" "$(OUTFILE)"
NPP_OPEN "$(OUTFILE)"
Press the SAVE button and write the name (internal) of the command:
Script name: StickFont 2 3drag
Press again the button SAVE and then OK to exit the pop-up.
Back in Menu: Plugins / NppExec / Advanced Options:
In Associated script,
choose the command
just entered:
"StickFont 2 3drag"
In the Item name enter
the name used in the
menu, eg "StickFont
-> 3drag"
Click Add / Modify, the
new command will
appear in the Menu
Items.
Note: You can delete
commands by
selecting Menu Items,
and then Delete
button. To change the
position of the selected
command in the Menu
Items use the buttons
Move up, Move down.
Close using the OK button
As required, quit and relaunch Notepad ++.
Verification: In the menu macro is the new command.
Repeat the above steps for the other three commands (commands are similar, it uses 4
different DAT files in C: \ regexfilter) as follows:
7. Command(s):
SET local OUTFILE = $(CURRENT_DIRECTORY)\$(NAME_PART).ngc
C:\regexfilter\dofilter.bat StickFont_CAMotics "$(FULL_CURRENT_PATH)" "$(OUTFILE)"
NPP_OPEN "$(OUTFILE)"
Script name: SickFont 2 CAMotics
Item name: SickFont → CAMotics
8. Command(s):
SET local OUTFILE = $(CURRENT_DIRECTORY)\$(NAME_PART).gcode
C:\regexfilter\dofilter.bat Inkscape_3drag "$(FULL_CURRENT_PATH)" "$(OUTFILE)"
NPP_OPEN "$(OUTFILE)"
Script name: Inkscape 2 3drag
Item name: Inkscape → 3Drag
9. Command(s):
SET local OUTFILE = $(CURRENT_DIRECTORY)\$(NAME_PART).ngc
C:\regexfilter\dofilter.bat Inkscape_CAMotics "$(FULL_CURRENT_PATH)" "$(OUTFILE)"
NPP_OPEN "$(OUTFILE)"
Script name: Inkscape 2 CAMotics
Item name: Inkscape → CAMotics
10. Verification:
In the Macro menu of Notepad ++ they should appear the four new commands just entered.
11. Associations
Facilitates operations to associate the Open command for .nc files with Notepad ++:
In Windows Explorer, select a file with the extension .nc, then click with the right mouse
button ( you can find such files in C: \ regexfilter \ examples \ )
Click Open With, then choose “another app”.
In the pop-up window choose Notepad ++. If it is not present, choose “another app” yet, and
search for the file Notepad ++. exe (e.g, C: \ Program Files \ Notepad ++ \ notepad ++.
exe).
Also select: “Always use this program to open files .nc”.
Click OK to finish.
Repeat the above steps to associate:
.ngc files with the program CAMotics (e.g.: C: \ Program Files (x86) \ CAMotics \
camotics.exe)
.gcode files with the program RepetierHost (e.g.: C: \ Program Files \ Repetier-Host \
RepetierHost.exe)
5.2 Use:
Open a file .nc in Notepad ++ (just double click it in Windows Explorer).
Select in menu / Macro one of four new commands to run the required filter.
The filter reads the input file selected in Notepad ++, applies the changes described by the
regular expressions in the .dat file, and writes an output file.
The output file is in the same directory and has the same name as the input file. Only the
extension will change: .ncg for CAMotics and .gcode for Repetier.
The output file is automatically opened in Notepad ++ to check the result, or for further
manual editing.
Note:
• If the output file already exists, it is overwritten without warning.
• If the input file and output file are the same, the input file is deleted.
Clicking (double-click) on a file .ngc, the simulation (CAMotics) must start automatically.
Clicking (double-click) on a file .gcode, Repetierhost must start automatically.
5.3 Modifications:
•
To edit the files that contain the requiered regular expressions (the four files C: \
regexfilter \ xxxxxxx.DAT) use Notepad ++.
•
The regular expression syntax and the syntax of the DAT file is described in
file://C:/regexfilter/README.html
•
The Java source files of regexfilter are in c: \ regexfilter \ src \ src.zip
Note 1 – Use the point as decimal separator.
Many countries uses the comma (“,”) as decimal separator.
Some programs do not take into account local settings and expect instead the period (.).
In particular, the G-code for Repetier or CAMotics uses period as separator, while some of the
programs examined generate commas (from local setting).
You can change the Gcode using an ASCII editor and changing all the commas (,) in points (.), But
when this is not possible or desirable we can proceed in another way: to get numbers that use the
period (. ) as the decimal separator we must change just temporarily the settings for the local
language.
HOWTO:
1. Go to Control Panel / Clock, Language and Region / Language - Change date, time or
number formats.
or:
Control Panel / All Control Panel Items / Language / Change date, time or number formats.
2. In Additional settings choose Decimal "." (Period).
3. Remember at end to restore the local standard.
Note 2 – Font True Type
True Type fonts always consist of one or more closed
paths, with the interior filled.
For the incision lines are used instead.
Using for engraving normal TTF fonts, it is used the
outline of the glyph and then you always get a double
perimeter inside / outside.
However, there are special TrueType fonts designed just
for cnc engraving, for laser cutter etc.
TTF stick
These special TTF are formed by a closed line that runs through the glyph twice, thus obtaining a
route suitable for linear incision.
PRO:
•
Stick fonts are TTF fonts standard, usable in every application
•
There are versions in 1 line, 2 lines, 3 lines ... to simulate the filling of wide
areas
AGAINST:
•
The double passage of the bit doubles the running time and can fail.
In the figure, you can see how looks a Stick fonts (Inkscape):
above: Filling: yes, outline: No (Objects menu / Fill,
Outline)
under: Filling: no, outline: yes
This font are also called "Single Line Fonts with 2 lines".
example
Single line open path
These TTF fonts contain closed paths which must be "open" with the elimination of the last
segment. This additional step can be performed in a vector graphics program, after transforming the
text in graphic objects and after ungrouping objects. For Inkscape exists a special automatic
extension reopenSingleLineFont
In the figure, appearance of a single line open font (Inkscape):
1. filling: yes, outline: No
(Objects menu / Fill,
Outline)
2. filling no, outline: yes
3. After removed the closing
segment
example
PRO
•
true font with single line
AGAINST:
•
Requires an extra operation executable only in a vector graphics program
•
After cutting we get paths, not more fonts. (I.e., the cut must be the last action to be able to
take advantage of "text" features in the graphics program)
•
Few fonts in the Web.
Note 3 – G-code, Start and End
Not all G-code are supported in the simulator or in 3Drag + Repetier, or by various software.
Also it can be interpreted differently in different environments (see Manual RepRap G-code).
For example, the simulator correctly interprets "G00 X4F100", but this gives an error in Repetier,
who always requires spaces: "G00 X4 F100".
This involves, in general, the need for many checks and modifications to the code produced by
different SW, as before indicated in each case.
START 1:
For the required functionality (see), after placing the pen (bit) 1 mm (bit: 1mm - cutting depth) over
the starting point, we have:
G90
G92 X0 Y0 Z3
absolute coordinate mode (perhaps superfluous, is the default)
the current point assumes coordinates (0,0,3)
END 1:
My pen (bit) in HOME is left of the bed, but lower, and every time I do not want to calibrate the
zero Z axis. This sequence (which also I use by hand-in Repetier) prevents damages.
G28 X
G28 Y Z
Home of the only X axis
Home axis Y, Z
START 2
If you want to always start from home to reach the piece, you can do the following:
•
•
•
•
•
•
Using Repetier place with the pen (bit) at the start of engraving.
Get down with the pen (bit) until it touches (use a piece of paper: it must be removed
without breaking).
Lift the pen exactly 1mm, (bit: 1 mm - engraving depth)
We call AA, BB, CC the coordinates X, Y, Z that we read on Repetier
If there are no obstacles, we can use CC + 5mm as Z height for the rapid moves.
We call this value SS
Starting from HOME the code could be:
G90
G00 ZSS F100
G00 XAA YBB
G00 ZCC
G92 X0 Y0 Z3
absolute coordinate mode (perhaps unnecessary)
lifts the pen (bit) to travel height
moves to the starting point
down to required value
the current point assumes coordinates (0,0,3)
END 2
Sometimes you may want to end on the same starting point, for example to make a second pass at
depths greater:
G00 X0 Y0 Z3
back to the starting point, coordinates (0,0,3)
References:
CAM 2, 2.5, 3:
The text incision does not exhaust the panorama of CNC applications of 3Drag:
• Good start point for CAM sw: http://www.shapeoko.com/wiki/index.php/CAM
• Basic workflow 2D
Inkscape:
I did not use Inkscape before of these tests, but it seems interesting and deserves attention:
• Brief notes for new users
• InkscapeHowto
Gcodetools:
•
Gcodetools also, in my opinion, deserves attention, for example to make incisions in low
relief from photos, etc.
Inkscape and Gcodetools Tutorial: Cut Out a Shape,
•
Spanish manual with instructions for PCB,
•
Generation of G-Code: InkScape and G-Code plugin
Fonts
This seems to be a critical point, with relatively few viable solutions. I think I will try to
develop it soon:
•
•
font TTF stick download.
single line open font TTF download.
•
•
•
•
•
Resources: free font TTF: Google, Fontspace, 1001fonts, daFont
Editor for TTF fonts: FontForge
Tutorial Single line open TTF fonts using Inkscape
Font stick sell: 10$-100$ (esempio)
The sw SFEdit by Roland (included in "Dr. Engrave") should transform the TTF windows
fonts in Stick fonts, but it is only distributed with the HW Roland (sic).
G-code
• Manual RepRap G-code
Materials, cutters and speed
This is one area where I must do quickly experience for better results
• ShapeOko good start point.
3Drag
• Collection of Add-on for 3Drag using Fast Clamp
Windows 10
• To get back a programs menu with all applications, two-level, I installed it and find it very
useful: “classic start menu” http://www.classicshell.net/
© 2016 Marco Sillano (marco.sillano@gmail.com) licensed CC BY-SA (http://creativecommons.org/)