There are many applications that needs to run faster than usual. Especially laser rastering and high-resolution vectorial movements. |
There are many applications that need to run faster than usual. Especially laser rastering and high-resolution vector movements. |
But there are several factors which slow down the system, like the time that EMC2 takes to execute each line of Gcode. |
But there are several factors which slow down the system, like the time that LinuxCNC takes to execute each line of G-code. |
Taking into account these difficulties, this guide aims to bring rastering to users to the least painful way possible. |
Taking into account these difficulties, this guide aims to bring rastering to users in the least painful way possible. |
EMC2 is usually used for engrave vector graphics, moving a drill or a laser along the edges of a shape, for example. Rastering mode means move to the next pixel and update the laser power rapidly in one axis (like X axis). This movement should be at constant speed at X axis. You can find videos on youtube about rastering to have a clearer idea. |
LinuxCNC is usually used to engrave vector graphics, moving a drill or a laser along the edges of a shape, for example. Rastering mode means move to the next pixel and update the laser power rapidly in one axis (like X axis). This movement should be at constant speed at X axis. You can find videos on YouTube about rastering to have a clearer idea. |
Actually, if you go from X0 to X100 to X200 to X300, EMC2 will stops at X100, then goes to X200 and stop then goes to X300 and stops. That means the laser will burn more time at the points 0, 100, 200, 300, etc. If you're engraving a picture, then the laser will stop at each pixel. So, the actual configuration is impractical for this type of applications, and it is necessary to make some changes to solve this problems. |
Actually, if you go from X0 to X100 to X200 to X300, EMC2 will stop at X100, then go to X200 and stop, then go to X300 and stop. That means the laser will burn more time at the points 0, 100, 200, 300, etc. If you're engraving a picture, then the laser will stop at each pixel. So, the normal LinuxCNC configuration is impractical for this type of application, and it is necessary to make some changes to solve this problem. |
From Hacklab Toronto, "Graster" is the name of a Image to Gcode converter (made in Ruby language), and it's designed to work with a particular kind of HAL component for EMC2. |
From Hacklab Toronto, "Graster" is the name of a Image to Gcode converter (made in Ruby language), and it's designed to work with a particular kind of HAL component for LinuxCNC. |
Graster produce two types of files: .NGC and .gmask files. NGC files contains the X and Y movements, and gmask files contains only the laser on/off commands. One reason to separate these instructions in two different files is that EMC2 interrupts the motion each time that normal Gcode on/off commands appears. |
Graster produce two types of files: .NGC and .gmask files. NGC files contains the X and Y movements, and gmask files contains only the laser on/off commands. One reason to separate these instructions in two different files is that LinuxCNC interrupts the motion each time that normal Gcode on/off commands appears. |
Controlling the laser with the Z axis can be tricky because EMC2 thinks that there is a moving physical object attached to the axis and tries to constrain its motion. The M62/M63 commands are realtime and instantaneous, meaning that they can be used to turn the laser on/off without affecting X/Y motion, at least in theory. You can put these commands on the same line as a motion command, in which case the laser will be turned on/off at the *beginning* of the motion. |
Controlling the laser with the Z axis can be tricky because LinuxCNC thinks that there is a moving physical object attached to the axis and tries to constrain its motion. The M62/M63 commands are realtime and instantaneous, meaning that they can be used to turn the laser on/off without affecting X/Y motion, at least in theory. You can put these commands on the same line as a motion command, in which case the laser will be turned on/off at the *beginning* of the motion. |
The HAL component stream the laser on/off and moves the X axis at constant speed. |
The HAL component streams the laser on/off and moves the X axis at constant speed. |
* ImageMagick?: is a image processing software. It can read, convert and write images in a variety of formats. You can find it in the Synaptic Package Manager (Ubuntu) * Rmagick: is a Ruby gem, used to read image files. This installarion is all a bit of a hassle. Maybe you can find it in the Synaptic Package Manager (Ubuntu) * RubyGems?: is a package management framework for Ruby. |
* [ImageMagick]: is an image processing software. It can read, convert and write images in a variety of formats. You can find it in the Synaptic Package Manager (Ubuntu) * Rmagick: is a Ruby gem, used to read image files. This installation is all a bit of a hassle. Maybe you can find it in the Synaptic Package Manager (Ubuntu) * RubyGems: is a package management framework for Ruby. |
Look at the references [2] to get this files. |
Look at the references [2] to get these files. |
So, you need to modify the machine parameters (like max speed, acceleration, step duration, etc) for your X,Y,Z axis (X,Y,W axis in this files). You also need to rewrite the pinouts of the parallel port. |
So, you need to modify the machine parameters (like max speed, acceleration, step duration, etc) for your X,Y,Z axis (X,Y,W axis in these files). You also need to rewrite the pinouts of the parallel port. |
If you run EMC2, and appears a error mesage about the buffer size, try to increase the buffer size in the emc.nml file. |
If you run LinuxCNC, and an error appears with a message about the buffer size, try increasing the buffer size in the emc.nml file. |
This files also can be useful if you don't want install graster but want to try it (if you already have configured the HAL and INI files for your machine). |
These files can also be useful if you don't want to install graster but want to try it (if you already have configured the HAL and INI files for your machine). |
I slumped over my keyboard, frustrated and defeated. After an untold number of attempts, I finally came to the solution to get rastering working. Some googling showed me lists of pages talking about adding modules to blacklists, downloading the latests packages and building them and compiling kernels, etc. Sometimes Linux is a pain. But thanks to the help and patience of Hacklab and EMC2 community, this guide could be finished. |
I slumped over my keyboard, frustrated and defeated. After an untold number of attempts, I finally came to the solution to get rastering working. Some Googling showed me lists of pages talking about adding modules to blacklists, downloading the latest packages and building them, and compiling kernels, etc. Sometimes Linux is a pain. But thanks to the help and patience of Hacklab and the LinuxCNC community, this guide was completed. |
[1] [LaserManual From Hacklab Toronto] (a bit outdated, but may be helpful the troubleshooting section) |
[1] [LaserManual From Hacklab Toronto] (a bit outdated but may be helpful, especially the troubleshooting section) |
[2] [EMC2 configuration and scripts for the hacklab.to laser] |
[2] [LinuxCNC configuration and scripts for the hacklab.to laser] |