HOW TO USE YOUR ENGRAVER/MILL IN LINUX

These instructions are designed for the camm2/camm3 but can easily be used for the newer units and also the vinyl cutters.


Below is the latest Updates!


Last Update Apr/08/09


Skip this section if you want to continue with the early solutions.



After completing the following steps you will be able to:


Engrave/Cut/3D Mill from Inkscape via extensions pull-down


Engrave/Cut/3D Mill from Inkscape via print to “cups-pdf”


Engrave/Cut/3D Mill from gimp or any other vector based Linux app via print to “cups-pdf”


Engrave/Cut/3D Mill from CorelDraw (wine) via print to “device independent postscript”


Engrave/Cut/3D Mill from CorelDraw (wine) via saved file from export to hpgl (any .plt file can be processed by right clicking file in nautilus and selecting your script) eg: Camm2-Engraver-Job





Step1 Install pstoedit and hpgl-distiller

Try the unedited hpgl-distiller first it may suit your needs without my edits

Click below for my edited version replace and recompile.

/camm-scripts/hpgl-distiller.c


pdftoengraver.sh

Step 2 Copy the above file to your $HOME folder and make it executable.


Camm2-Engraver-Job

(copy the above to /etc and make executable)

Make a link to this file in $HOME/gnome2/nautilus-scripts

Make a folder in your $HOME/tmp/camm/



Download Inkscape the following extensions and place in $HOME/.inkscape/extensions or /usr/local/share/inkscape/extensions or /usr/share/inkscape/extensions depending on your version.


roland.inx


roland.py


Next add a cups “raw” printer (my scripts are edited to use Camm1 through Camm4 so for now use Camm1 (uppercase “C”) as the name of your printer until you edit the scripts to your liking. Note if you don't have “zenity” with your gnome install it.


Inkscape should now have a “engraver/cutter” in the extensions pull down.


I'm using the svn “development” version of inkscape 1.47 and the extensions have slightly different opening code so if it needs tweaking run inkscape from a terminal window to troubleshoot.


Don't forget to set document properties (page size) to the sheet size to fit your machine and use mm's for your units. In corel make custom page sizes and make sure you set to your desired page before printing to “independent postscript device”


I have heavily edited these scripts for my needs such as multiple machines and auto settings assignment for special file names. You can easily edit the /etc/Camm2-Engraver-Job script to suit your needs. The xscale/yscale found in there will need to be adjusted for your particular hpgl device I think the camm1 is 1.115

scroll to bottom of this page for more info:

info



At this point Inkscape is setup but if you want to use other apps (native or wine) that can output postscript and pdf's for your engraver/cutter do this:


Add another printer as a cups-pdf printer (install cups-pdf if not already)

after its installed edit your /etc/cups/cups-pdf.conf file and change this section near the top of file to:


Out /var/spool/cups-pdf/camm

same for

AnonDirName /var/spool/cups-pdf/camm


Next make a link to /var/spool/cups-pdf/camm to your $HOME folder and rename it to Camm-spool-files. You can always change it later but thats what my scripts are setup to use.

If the above folder doesn't exist yet do a test print to this pdf printer first then kill the print job. That should create the camm folder.


Then if not installed install “gnome-schedule” and then add a task that runs every minute (click on “no output > /dev/null” to enable) any name for the task will do but in the command entry put “$HOME/pdftoengraver.sh”


It will look once a minute for a postscript/pdf file created by your new cups-pdf printer in “$HOME/Camm-spool-files” and launch /etc/Camm2-Engraver-Job if it finds and .ps or .pdf..


You can also now “print” from inkscape or many other vector based apps to your new cups-pdf device and the script will convert pdf to ps and process it as a ps file in the same way the inkscape extension does, your choice.

.

These scripts as I said have been edited for my needs stripping out certain hpgl commands and adding others. The main /etc/Camm2-Engraver-Job script can be very easily edited for your needs. Each print job will send a copy of the finished processed file to your home folder called diagnose.engrave for troubleshooting.


I have set the script to be compatible with mode1 on my machines eg: ^PU instead of mode2 PU.


NOTE1: If you use coreldraw in wine when outputting to your engraver use “print to device independent postscript” and point it to your /var/spool/cups-pdf/camm folder or the link “Camm-spool-files” in your home folder. Direct corel to cups postscript is kinda screwed up.

Fills don't get translated by pstoedit you must use contour fills in coreldraw.

Hope Inkscape gets this soon!


NOTE2: For Camm4 (PNC3000 CNC Mill) outputting postscript via these scripts is rather flat! Put the file Modela-CNC-Job in your $HOME/gnome2/nautilus-scripts (rename to whatever you like) folder then link it to /etc/cnc.sh. If your saving your mill job from modela or modela4 copy this file to your $HOME/gnome2/nautilus-scripts it works great for modela files. To send to the mill just right click on saved modela job and select “scripts” from nautilus and select “Modela-CNC-Job” or whatever you named it.

Modela-CNC-Job


End of “NEW” section








If your using Gnome go to the update further down this page!


1 Install the latest version of wine www.winehq.org

If your using fedora you can install from a console window as root “yum install wine* “

From a new console window as yourself not root type “wine notepad” if notepad opens

then wine is working.


2 Install coreldraw for windows as you would install any windows app. I recommend ver.9

but people have success with newer versions especially since wine has greatly improved

with the newest rel. of wine ver1.

Help: http://forum.winehq.org/viewtopic.php?t=25

http://wiki.arklinux.org/How_to_get_Windows_applications_to_run


3 Install if not already Inkscape via yum “yum install inkscape* “ as root.

Via yum Inkscape will also install the needed pstoedit app thats needed.


4 Create folder in your home called tmp/camm (case sensitive!)


5 Download hpgl-distiller and install as root with the instructions found on this website

http://pldaniels.com/hpgl-distiller/

Click below for my edited version replace and recompile.

/camm-scripts/hpgl-distiller.c

6 Download and Install my scripts to a folder in your search path such as /usr/bin/. When downloaded

you may have to right click on each script and in the properties make it executable and by everyone.

/camm-scripts/plot

/camm-scripts/cnc.sh

/camm-scripts/engraver

These “plot” script is now edited to allow “mode 1” on your engravers so they are compatible with the windows drivers.

8 Open CorelDraw and create a new page layout called camm2 or whatever, 200mmx140mm

this can be saved and in preferences can be the default page also in preferences change your

units of measure to mm it makes things easier to work with.





9 On your new page draw a simple box with a black fill and a box with no fill. Select export and pick

hpgl , you can ignore on the pop-up window the pen settings leave them as they are but select the

page tab as below





Page size should be 200x140 and change inch to mm , plotter origin is set to bottom left, and plotter

units should be set to 2540.


In the advanced tab as below




Make sure simulate fill is set as above , you can change the density of the fill lines using the line

spacing entry. Curve resolution should be changed to mm.


You should export to the newly created /Graphic-Work/Engraver-Jobs folder to keep things organized

I have more folders created in engraver jobs such as “finished camm2 files” “cnc files” “image libray”

etc. Corel will remember where you saved it.


***GNOME UPDATE***

I have recently switched to Ubuntu/Gnome and found all you have to do is copy the above script files (plot and cnc) to your $HOME/.gnome2/nautilus-scripts folder then when left clicking on a .plt or .cnc file you can send it to the appropriate script via the “scripts” enrty in pop-up nautilus. These newer updated scripts also use zenity (installable for KDE also).





Adding your engraver/mill to CUPS


As root add your engraver/mill as you would a normal printer but select the “RAW” print driver.

You may have to enable “raw” printing by uncommenting “application/octet-stream application/vnd.cups-raw” in /etc/cups/mime.convs.

That way all data passed to the engraver in untouched by cups. The provided script is set to use

Camm1 through Camm4 as the engraver/printer names you can use any name but the script will

need to be edited to exactly match!! To start if your using only one engraver use “Camm1” as

you printer name (use capitol “C” in Camm1).



Changing File Associations In Konqueror


Open your Konqueror file manager and select at top of window settings> configure Konqueror

Since corel will export an hpgl file with a .plt extention we will add a plt extention if not there yet.

Your inital page should look something like below less the cute icon. I just used the ones at the top of this page and saved as png files make them readable by everyone and copied them to /usr/share/icons/default



After clicking the add in the “application pref order” a window similar to below should pop up




In the “command” window point to where the plot script file is that you downloaded and installed , if installed in /usr/bin/as described all you need is as shown “cat %f | plot” only.


If your not using the Camm3 PNC-3000 you can ignore the following few steps. As above edit or add the file extension .prn that is the default file extension Modela and Modela4 uses when saving to a file the generated tool path for the PNC-3000.




Associate the .prn file extension with the script called “cat %f | cnc” you copied earlier. For ease of use to start this cnc script expects the PNC-3000 to be named Camm4 in cups. That can always be edited later but to make it simple for now name it “Camm4” in cups.






Now when you have exported a file from corel or saved a tool path from modela (select the pnc-3000 in the “machines” section). In modela4 I use the mdx-40 as my machine in fact I would recomend using it over the PNC-3000 as my script kind of counts on it to properly edit the file before sending it to the mill.The working bed size is different for the mdx-40 but I always look at the digital readout on the camm3 to know where to tell modela the start cordinates. Especially easy if you center everything in modela. Just click the file in Konqueror and a popup should show up asking what engraver from Camm1 to Camm4 if it's a plt file. If it's a prn file it won't ask anything except if your PNC-3000 cnc machine is ready and then it will proccess the file and send it. These scripts will also generate a diagnose.plt and a diagnose.cnc file in /Graphic-Work/Engraver-Jobs for trouble shooting. That can be commented out in the cnc and plot script when all is known to be working fine.


This script can VERY easily be edited to support Roland Vinyl cutters also and other model engravers and mills as they all use a close version of the hpgl language.

The camm2 engravers should be in mode2 and since I always engrave at the same “z” depth I set it to 2.25mm . And adjust my engraving tool for best location and then leave it there.


I also use a PNC-2200 300mmx200mm cutting bed for cutting out shapes and from coreldraw if I export it as a work-plate.plot(must match exactly for script) file instead of a .plt my script will bypass asking what engraver and speed and directly send it to Camm3 (cups name) with 1mm /sec. Speed and will also pen optimize the movements so everything in red lines (interior cuts) from corel will be cut first then the blue lines (outlines) that way the material being cut will stay in place till the job is done. That feature may be handy for you vinyl cutters I'm not sure. If you want this feature add another file extension definition as usual but add the .plot extension and use just plain "plot" as the command (no "|" pipe)


Roland's Modela , Dr.Engrave , 3Dengrave all work fine from wine just remember to save the file instead of printing to the engraver as it will be sent as a postscript file to your device and not an hpgl file. That roland software is available at http://www.rolanddga.com/color/support/wizard/




I have also used this to print jobs from a standard “cups-pdf” printer.


I install the standard cups-pdf printer and edit the /etc/cups/cups-pdf file to “output” Out /var/spool/cups-pdf/gary and AnonDirName /var/spool/cups-pdf/gary of course use whatever name you want.

Then I install gnome-schedule and set a task to execute every minute task = DISPLAY=:0.0; export DISPLAY; /etc/pdftoengraver.sh

Copy and paste below to a file /etc/pdftoengraver.sh (make it executable)


#!/bin/sh

# -*- shell-script -*-

cd /var/spool/cups-pdf/gary

for f in *.pdf

do

if [ -f "$f" ]; then

cat $f | engraver

else

exit

fi

done


This will take either a postscript or pdf file from cups or even wine and convert it to a hpgl and then process it for the camm engraver. NO Fills are processed though , pstoedit doesn't do hpgl fills. This will work great for cutters needing outlines only. I also changed focus strength to allow the pop-up print window to be on top of other app windows.




INKSCAPE SETUP (latest Inkscape has removed this feature)


Adjust your document size as shown below I can't figure out how to make this the default unless you save a blank document and open it as your template each time you create a new engraving job.






When you print in inkscape change the print command to “ | engraver” and that will bring up a popup like previously described but the script works by changing the postscript data to hpgl before editing it like the “plot” script does. GIMP and some other apps allow you to manually input the print string also.NOTE:Using the "engraver" script in Inkscape for eg. does not do fills only outlines which is fine for vinyl cutters


I sure hope this page does someone some good as I should be working !! :)


If I can be of any help please email me at securetech@eastlink.ca




Some Great software both linux and windows that all run great in linux. Most 3D apps work best with NVidia card and opengl driver installed.:



Google them!


Accutrans3d :for creating 3d images from a jpg or bmp very powerful

Phototomesh : similar to the above mentioned.

Ac3d : 3d full featured /2dcad

Medusa 3D very nice and powerful cad/modeling

Gmesh :3D stl file viwer (opengl)

Cenon : cad graphics

Cam.py : python app that outputs directly to a roland vinyl cutter

Gcad : 3D

Varicad : nice cad app

Blender : nice cad app

CamExpert : cad and pcb design hpgl output

MeshView : stl dxf 3d viewer

Opencam : printer interface for hpgl device (install gambas and then compile opencam from gambas source!)

I installed the opencam binary and it messed up my X11 libs



Modela, DR.Engrave , 3D Engrave , Modela4 are trademarks of ROLANDDG

Windows is a trademark of Microsoft

Corel Draw is a trademark of Corel