Setting up LinuxCNC for printing

Introduction

This howto is for LinuxCNC 2.5 (formally known as EMC2). It will duplicate your settings to create a new one which is only used for printing. This has the advantage that you can set the machine constraints according to the dimensions and positioning of your heated bed. The required files are in the tarball published under “Electronics” on this site.

Customizing the YourMachine.hal file

Duplicate the .hal file and save it under a different name like MyMachineName_printer.hal. Add a call to start the Python Script for the Temperature Controller:

loadusr -Wn TemperatureControl /full/path/to/your/config/TemperatureControl.py 

Customizing panel.xml

Duplicate the file as well and add the content of TemperaturControl.xml. If you don’t have a panel.xml just take TemperaturControl.xml as it is, we have to adjust the patch later anyways.

Customizing custom_postgui.xml

Duplicate as well. Add the signals which connect the GUI Components to the python script:

net currentExtTempSignal TemperatureControl.extTemp => pyvcp.extTemp
net currentBedTempSignal TemperatureControl.bedTemp => pyvcp.bedTemp

Customizing the YourMachine.ini file

Duplicate the .ini file and save it under a different name like MyMachineName_printer.ini

Add the forth Axis:

[AXIS_3] 
TYPE = LINEAR  
HOME = 0.0  
SCALE = 382.5  
MAX_VELOCITY = 100  
MAX_ACCELERATION = 80  
STEPGEN_MAXACCEL = 92  
FERROR = 1  
MIN_FERROR = .25  
MIN_LIMIT = -9999999  
MAX_LIMIT = 9999999  
HOME_SEARCH_VEL = 0  
HOME_LATCH_VEL = 0  
USE_INDEX = NO 
VOLATILE_HOME = 1  
HOME_SEQUENCE = 3  
DIRSETUP   =  6000  
DIRHOLD    =  6000  
STEPLEN    =  1600  
STEPSPACE  =  1600  

The Scale is for a Greg’s Wade Extruder with 9/47 toothed gears. You probably need to change the scale which I will cover later.

For every duplicated setup file there is a setting in the .ini which needs proper adjustment.

GUI panel (DISPLAY Section):

PYVCP = panel_printer.xml 

 

Postgui HAL (HAL Section):

POSTGUI_HALFILE = custom_postgui_printer.hal

 

HAL File itself (HAL Section):

HALFILE = BZTPF600P_printer.hal

Install the M-Codes

M Codes are used to set Temperatures from the file with the toolpath. M104 (Extruder) and M140 (Heated Bed) are the important ones for us the rest are just dummies for downward compatibility and/or stuff we don’t have (fan, chamber, …)

udev rule for the arduino

Since it’s unpredictable under which tty device the arduino registers, I put up a symlink via udev (/etc/udev/rules.d/80-arduino.rules)

KERNEL=="ttyACM*", ATTRS{product}=="Arduino*", SYMLINK+="temperatureControl"

Leave a Reply