Project:RELaserSoftware/MOL file format: Difference between revisions

From London Hackspace Wiki
(Added hexdump matching the description.)
(Clarified float format)
 
(12 intermediate revisions by 4 users not shown)
Line 19: Line 19:


<hr>
<hr>
The following stuff was added by [[user:Wonko]]:


= DESCRIPTION =
There is a script available that reads Leetro MOL files into QCad:
https://www.ribbonsoft.com/rsforum/viewtopic.php?f=30&t=2436&p=7965#p7965


== ABOUT ==
= Description =
 
== About ==


The .MOL files are generated from CAD drawings (dxf import) using a proprietary library  
The .MOL files are generated from CAD drawings (dxf import) using a proprietary library  
Line 31: Line 35:
basic functions and manage file up- and download. This protocol is not documented here!
basic functions and manage file up- and download. This protocol is not documented here!


== STATUS ==
== Status ==


we have a pretty good understanding of the file format to the point that we can  
We have a pretty good understanding of the file format to the point that we can generate new MOL files from a dxf drawing, at least for cutting patterns on the test machine. This is for cutting only, no raster engraving and other features yet! The engraving process uses different commands, which I found surprising, because the commands for cutting would be sufficient. Raster engraving is not covered here,
generate new MOL files from a dxf drawing, at least for cutting patterns on the test  
machine. This is for cutting only, no raster engraving and other features yet!


== THE FILE FORMAT ==
== The File Format ==


The file format is binary, using LSB 4-byte words. The floating point format is not IEEE, so
The file format is binary, using LSB 4-byte words. The floating point format is not IEEE, so
a conversion is required. All files have four chunks at fixed locations:
a conversion is required. All files have four chunks at a location described in the header:


* the header chunk starts at 0 and contains 32 words, followed by 0's
* the header chunk starts at 0 and contains 32 words, followed by 0's, followed by the locations of the following blocks
* the config chunk is at 0x00000200 and contains informations about the total artwork
* the second chunk is the config chunk and is usually located at 0x00000200. It contains informations about the total artwork (this block may start somewhere else. See header.)
* the test chunk is at 0x00000400 and moves the laser head on the bounding box of the artwork
* the third chunk is the test chunk and is usually at 0x00000400. It moves the laser head on the bounding box of the artwork (this block may start somewhere else. See header.)
* the draw chunk is at 0x00000A00 contains all commands to output the actual drawing and cutting commands
* the fourth chunk is the cut chunk and is usually at 0x00000600. It cuts the artwork a few millimeters around the bounding box (this block may start somewhere else. See header.)
* the fifth chunk is the draw chunk and is usually at 0x00000A00. It contains all commands to output the actual drawing and cutting commands (this block may start somewhere else. See header.)
* the file is then patched to the next 512 byte boundary
* the file is then patched to the next 512 byte boundary


== THE HEADER ==
== The Header ==


The header chunk contains the parameters of the destination machine, version numbers,
The header chunk contains the parameters of the destination machine, version numbers, and general information including file size. All data is at fixed positions.
and general information including file size. All data is at fixed positions.


== THE CONFIG CHUNK ==
== The Config Chunk ==


This block has all the information about the position and size of the artwork. It uses, like the  
This block has all the information about the position and size of the artwork. It uses, like the following chunks, a number of binary commands, most of them deciphered below.
following chunks, a number of binary commands, most of them deciphered below.


== THE TEST CHUNK ==
== The Test Chunk ==


This is called when the "Test" button is pressed on the panel. It moves the laser head
This is called when the "Test" button is pressed on the panel. It moves the laser head around the bounding box of the artwork and is a great help for positioning the material. In this file, it is simply a bunch of line drawing commands.
around the bounding box of the artwork and is a great help for positioning the material.
In this file, it is simply a bunch of line drawing commands.


== THE DRAW CHUNK ==
== The Cut Chunk ==


This is called when the "Play" button is pressed and contains a setup part followed by
This is called when the "Cut Outline" menu is selected and contains a setup part followed by a list of machine control commands that cut around the bounding box.
a list of machine control commands that cut and draw the artwork.


== BINARY COMMANDS ==
== The Draw Chunk ==


Every command starts with three bytes describing the command itself, plus one byte containing
This is called when the "Play" button is pressed and contains a setup part followed by a list of machine control commands that cut and draw the artwork.
the number of parameters following. The parameters are always 4-byte words in LSB integer
 
or floating point format, or four individual bytes. The FP format differs slightly from the IEEE  
== Binary Commands ==
standard, but can be converted by shifting a few bits around.  
 
Every command starts with three bytes describing the command itself, plus one byte containing the number of parameters following. The parameters are always 4-byte words in LSB integer or floating point format, or four individual bytes. The FP format differs slightly from the IEEE standard, but can be converted by shifting a few bits around.   LEETRO float: [eeeeeeee|smmmmmmm|mmmmmmm0|00000000]


The same command can have a different number of arguments!
The same command can have a different number of arguments!


The size byte can be 0x80 in which case, the actual number of arguments is give in the 4-byte
The size byte can be 0x80 in which case, the actual number of arguments is give in the 4-byte integer that follows.
integer that follows.


A special command (0x46 0x09 0x00 0x80 0xnnnnnnnn) encapsulates n motion commands.  
A special command (0x46 0x09 0x00 0x80 0xnnnnnnnn) encapsulates n motion commands. The motion commands follow the same scheme as all other binary commands. This is likely used for multiple prints of the same drawing in a matrix layout.
The motion commands follow the same scheme as all other binary commands. This is likely  
used for multiple prints of the same drawing in a matrix layout.


= SAMPLE FILE =
= Sample File =


== Header ==
== Header ==


The header describes the parameters of the machine for which the data was created.
The header describes the parameters of the machine for which the data was created. We find information about the file size and the stepper resolution. There should not be any information how to map channels to motors, etc., as that is likely done in a separate configuration file.
We find information about the file size and the stepper resolution.
There should not be any information how to map channels to motors, etc., as that is
likely done in a separate configuration file.


Size of entire file in bytes
Size of entire file in bytes
* 00000000: 0x00001000 Size of file in bytes
* 00000000: 0x00001000 Size of file in bytes


Unknown, fixed value
Unknown, this seems to be close to the number of motion blocks plus 30.
* 00000004: 0x00000022 34d ?
* 00000004: 0x00000022  


File Version Number
File Version Number: file was written with dll 4.1.2.2
* 00000008: 0x02 0x02 0x01 0x04 ?
* 00000008: 0x02 0x02 0x01 0x04 ?


Unknown, fixed value
Unknown, fixed value, probably the version of the file format
* 0000000c: 0x00000001 ?
* 0000000c: 0x00000001 ?


This word changes when the size of the file changes, i.e. when lines are added
This word changes when the size of the file changes, i.e. when lines are added. This line corresponds to the number of "move relative" commands in the entire file counting "unknown 07" and "unknown 09" as well. Is that coincidence? What would this value be good for? perhaps estimating the cutting time?
This line corresponds to the number of "move relative" commands in the entire file counting
 
"unknown 07" and "unknown 09" as well. Is that coincidence? What would this value be good for?
* 00000010: 0x00000029 somehow related to the file size or the number of commands
* 00000010: 0x00000029 somehow related to the file size or the number of commands


Unknown, fixed value
Four booleans, setting the second value will make the artwork relative to the user-set origin. If it is zero, the origin is the center of the work table (not quite though!).
* 00000014: 0x00000001 ?
* 00000014: 0x00000001 ?


Unknown, fixed value
Extent of the artwork to the top right from the origin in steps (divide by 208.33 to get millimeters). This is only used to verify that the artwork fits the machine and will cause an alarm if origin plus this value is outside of the work surface.
* 00000018: 0x00000000
* 00000018: 0x00000000
Unknown, fixed value
* 0000001c: 0x00000000
* 0000001c: 0x00000000


Describing the stepper resolution in x and y
Extent of the artwork to the bottom left from the origin in steps.
* 00000020: -20833 steps per 100mm in x direction
* 00000020: -20833 artwork width in steps
* 00000024: -20833 steps per 100mm in y direction
* 00000024: -20833 artwork height in steps


Unknown, fixed value
Unknown!
* 00000028: 0x00481095 ?
* 00000028: 0x00481095 ?


Unknown, fixed value
Unknown!
* 0000002c: 0x471a0000 ?
* 0000002c: 0x471a0000 ?


Line 133: Line 123:
* 00000030 - 0000006c
* 00000030 - 0000006c


Unknown, fixed value
Location of the config chunk. This is the n'th block, block size is 512 bytes. The 200 block contains general data about the artwork.
* 00000070: 0x00000001 ?
* 00000070: 0x00000001  


Unknown, fixed value
Location of the test chunk. This block is called when the user presses "Test" on the CMD03 and outlines the artwork.
* 00000074: 0x00000002 ?
* 00000074: 0x00000002 ?


Unknown, fixed value, maybe the number of blocks in this file?
Location of the cut chunk. This block is called when the users selects "Cut File" (or so) from the menu.
* 00000078: 0x00000003 ?
* 00000078: 0x00000003 ?


Unknown, fixed value
Location of the draw chunk. This block is called when the users presses "Start".
* 0000007c: 0x00000005 ?
* 0000007c: 0x00000005 ?


== Data Block at 0x00000200 ==
== Data Block at 0x00000200 ==


The configuration chunk still has a bunch of unknown commands, few of them seem to change
The configuration chunk still has a bunch of unknown commands, few of them seem to change for a single machine configuration.
for a single machine configuration.


Unknown, fixed value
Unknown, fixed value
Line 167: Line 156:
Unknown
Unknown
* arg1 is unknown, but repeats in 'unknown 11'
* arg1 is unknown, but repeats in 'unknown 11'
* arg2 is the start speed for all head movements as describen in the settings
* arg2 is the start speed for all head movements as described in the settings
* arg3 is the maximum speed for moving around "quickly"
* arg3 is the maximum speed for moving around "quickly"
* arg4 is the acceleration value to get to the above speed (space acc)
* arg4 is the acceleration value to get to the above speed (space acc)
* arg5 is the value for acceleration from the settings
* arg5 is the value for acceleration from the settings
* arg6 is unknown and nowhere to be found, probably the slow acceleration default
* arg6 is the acceleration when going from vector to vector
* 0000022c: : unknown 05:  603, 1041(5.00%), 41666(200.00%), 145833(700.00%), 104166(500.00%), 72916(350.00%)
* 0000022c: : unknown 05:  603, 1041(5.00%), 41666(200.00%), 145833(700.00%), 104166(500.00%), 72916(350.00%)


Line 185: Line 174:


Object origin. Cutting a 100x100 object on a 900x600 table would move the laser head
Object origin. Cutting a 100x100 object on a 900x600 table would move the laser head
to the top right corner of a centered work piece. (772 see "move rel")
to the top right corner of a centered work piece.
* 00000264: : unknown 07: 772, x:500.005mm, y:350.002mm
* 00000264: : unknown 07: use x/y Axis, x:500.005mm, y:350.002mm


Motion parameters:
Motion parameters:
Line 195: Line 184:


Object size. Our test object is 100x100, so this command moves to the bottom left corner.
Object size. Our test object is 100x100, so this command moves to the bottom left corner.
* 00000284: : unknown 09: 772, x:-100mm, y:-100mm
* 00000284: : unknown 09: use x/y Axis, x:-100mm, y:-100mm


Unknown, fixed value
Unknown, fixed value
Line 208: Line 197:
== Data Block at 0x00000400 ==
== Data Block at 0x00000400 ==


This is the block that is called when the user presses "Test" on the panel. It moves the  
This is the block that is called when the user presses "Test" on the panel. It moves the laser head on the bounding box around the artwork.
laser head on the bounding box around the artwork.


Begin of the subroutine. I don't know if the ID has a specific meaning, or if the file position
Begin of the subroutine. I don't know if the ID has a specific meaning, or if the file position of this block is sufficient to make it the test block. Just don't change it.
of this block is sufficient to make it the test block. Just don't change it.
* 00000400: : begin subroutine 1
* 00000400: : begin subroutine 1


Line 218: Line 205:
* 00000408: : unknown 05:  603, 1041(5.00%), 41666(200.00%), 145833(700.00%), 104166(500.00%), 72916(350.00%)
* 00000408: : unknown 05:  603, 1041(5.00%), 41666(200.00%), 145833(700.00%), 104166(500.00%), 72916(350.00%)


This command encloses all following draw commands. It may be used for multiple
This command encloses all following draw commands. It may be used for multiple rendering of the drawing commands at different location to keep file size small. The commands inside the block follow the same scheme as those outside.  
rendering of the drawing commands at different location to keep file size small. The commands
inside the block follow the same scheme as those outside.
* 00000428: : command block follows, 112 words (form 00000430 to 000005f0)
* 00000428: : command block follows, 112 words (form 00000430 to 000005f0)


* move relative -100, 0
* move relative -100, 0


The next  8 commands are needed to draw a single line. There are three phases:
The next  8 commands are needed to draw a single line. There are three optional phases:
acceleration, constant speed(optional), deceleration. All three put together move the  
acceleration, constant speed, deceleration. Only one of these phases need to exist. All three put together move the head from a to b along a straight line. If the angle of two consecutive lines is below some threshold, the end speed of the previous line and the initial speed of the current line may be significantly higher.
head from a to b along a straight line. If the angle of two consecutive lines is below
some threshold, the end speed of the previous line and the initial speed of the current
line may be significantly higher.


TODO: Curves are probably done differently, but also from line segments? Future.
Curves are done using short line segments.


Accelerate: the following command will accelerate the head along the given line
Accelerate: the following command will accelerate the head along the given line
Line 239: Line 221:
* 00000438: : set speeds a:1041(5%), b:41666(200%), c:145833(700%)
* 00000438: : set speeds a:1041(5%), b:41666(200%), c:145833(700%)


Move the head on a straight line to the new position. The position is given in steps relative
Move the head on a straight line to the new position. The position is given in steps relative to the current position. The meaning of 772 (0x0304) is unknown but could very well be the index of the stepper that is requested to move (3=Y, 4=X - remember that this is LSB, so in the binary file, we see 0x04 0x03 0x00 0x00 - maybe we can move Z as well, or even up to four axes at the same time? (2=Z))
to the current position. The meaning of 772 (0x0304) is unknown but could very well be the
index of the stepper that is requested to move (3=Y, 4=X - remember that this is LSB, so in the  
binary file, we see 0x04 0x03 0x00 0x00 - maybe we can move Z as well, or even up to four
axes at the same time? (2=Z))


TODO: is 722 the axes parameter? If so, can we move Z?
TODO: 03/04 (722 in decimal) is the axes parameter (x and y). This can probably be used to move in Z as well.
* 00000448: : move rel 772, x:-28.5509mm, y:0mm
* 00000448: : move rel 772, x:-28.5509mm, y:0mm


Even though we still are in acceleration mode, setting the initial speed equal to the  
Even though we still are in acceleration mode, setting the initial speed equal to the maximum speed will make this a constant speed motion.
maximum speed will make this a constant speed motion
* 00000458: : set speeds a:41666(200%), b:41666(200%), c:145833(700%)
* 00000458: : set speeds a:41666(200%), b:41666(200%), c:145833(700%)
* 00000468: : move rel 772, x:-42.9175mm, y:0mm
* 00000468: : move rel 772, x:-42.9175mm, y:0mm


Set the next speed parameters so that they are used for deceleration from the maximum
Set the next speed parameters so that they are used for deceleration from the maximum speed (b) to the ending speed (a), using the deceleration parameter (c)
speed (b) to the ending speed (a), using the deceleration parameter (c)
* 00000478: : decelerate
* 00000478: : decelerate
* 00000480: : set speeds a:1473.12(7%), b:41666(200%), c:145833(700%)
* 00000480: : set speeds a:1473.12(7%), b:41666(200%), c:145833(700%)
Line 294: Line 270:
This is the end of subroutine 1
This is the end of subroutine 1
* 000005f0: : end subroutine 1
* 000005f0: : end subroutine 1
== Data Block at 0x00000600 ==
This block cuts the bounding box of the artwork plus 2mm on each side. This block is optional. Fill with 0 if not used.


== Data Block at 0x00000a00 ==
== Data Block at 0x00000a00 ==
Line 330: Line 310:
* 00000a50: : laser power corner:40.00%, straight:40.00%, p3:30.00%, p4:50.00%, startspeed:1041(5.00%), speed:20833(100.00%), ??:0
* 00000a50: : laser power corner:40.00%, straight:40.00%, p3:30.00%, p4:50.00%, startspeed:1041(5.00%), speed:20833(100.00%), ??:0


Command block used for repetition. Interestingly, the blower commands are inside the block.
Motion Command Block. These blocks divide the file into 2kByte chunks at command boundaries. Command blocks never contain more than 510 (512?) words (<=2kBytes). This subroutine can have many command blocks. Motion Commands are switching periphery (laser,  lower), setting acceleration and deceleration, and moving the head.
* 00000a70: : command block follows, 290 words (form 00000a78 to 00000f00)
* 00000a70: : command block follows, 290 words (form 00000a78 to 00000f00)


Switch on the blower. The numerical values here probably correspond to the output
Switch on the blower. The numerical values here probably correspond to the output ports on the controller board. If we find the pattern, we can control additional devices, like switching the Y axis to control a rotary device, or starting the roller of a laser sintering setup.
ports on the controller board. If we find the pattern, we can control additional devices,
like switching the Y axis to control a rotary device, or starting the roller of a laser sintering
setup.
* TODO: find the command-to-port mapping for this
* TODO: find the command-to-port mapping for this
* TODO: verify that this really is the blower, since our machine has no switched blower
* TODO: verify that this really is the blower, since our machine has no switched blower
Line 354: Line 331:
* 00000ae8: : move rel 772, x:9.97936mm, y:0mm
* 00000ae8: : move rel 772, x:9.97936mm, y:0mm


Switch the laser off already. Even though the next line requires no repositioning, LaserCut
Switch the laser off already. Even though the next line requires no repositioning, LaserCut has switched off the laser, just to turn it right back on. This does no harm, but makes the file bigger than needed. It also explains why we should always "connect lines" in LaserCut. If lines are connected, we would simply add movement commands here until we reach the end of the cut.
has switched off the laser, just to turn it right back on. This does no harm, but makes the file  
bigger then needed. It also explains why we should always "connect lines" in LaserCut.
If lines are connected, we would simply add movement commands here until we reach the
end of the cut.
* 00000af8: : laser off
* 00000af8: : laser off


Line 375: Line 348:
(...)
(...)


Leaves the head just where it's at. In case of a repetition, the controller will likely know where  
Leaves the head just where it's at. In case of a repetition, the controller will likely know where to move next and continue with the next cutout.
to move next and continue with the next cutout.
* 00000ef0: : blower off
* 00000ef0: : blower off
* 00000ef8: : blower off
* 00000ef8: : blower off
Line 384: Line 356:
* 00000f00: : end subroutine 3
* 00000f00: : end subroutine 3


The rest of the file is filled with 0x00 to the next 512 byte boundary, probably to avoid reading
The rest of the file is filled with 0x00 to the next 512 byte boundary, probably to avoid readingerrors when buffering from the USB stick to internal RAM.
errors when buffering from the USB stick to internal RAM.


= HEXDUMP =
= Hexdump =


<pre>
<pre>

Latest revision as of 12:53, 2 December 2016

Looking at: /Solexious/MarioBoxes/MINIMARIO.MOL

No ASCII strings (looking using strings)

Does not appear to be compressed (too many zeroes)

0x000 Header
0x200 One set of information What?
0x400 Another set of information.
0xa10 Likely co-ordinate data. Quite repetitive. Analysis document was mario boxes, with many repetitions of sub boxes, so that makes sense. It looks like possible 16bit number co-oords as the numbers range from a few thousands to hundreds. 32bits are in unrealistic ranges (huge in negative ranges).

Projects/RELaserSoftware/Compilation traces


The following stuff was added by user:Wonko:

There is a script available that reads Leetro MOL files into QCad: https://www.ribbonsoft.com/rsforum/viewtopic.php?f=30&t=2436&p=7965#p7965

Description

About

The .MOL files are generated from CAD drawings (dxf import) using a proprietary library from Leetro from within LaserCut. The mol file can be stored on a USB stick and is automatically loaded into the CNC-Laser where it can be selected and run from the keypad.

There is also a USB protocol that connects the CNC machine to a PC to directly control basic functions and manage file up- and download. This protocol is not documented here!

Status

We have a pretty good understanding of the file format to the point that we can generate new MOL files from a dxf drawing, at least for cutting patterns on the test machine. This is for cutting only, no raster engraving and other features yet! The engraving process uses different commands, which I found surprising, because the commands for cutting would be sufficient. Raster engraving is not covered here,

The File Format

The file format is binary, using LSB 4-byte words. The floating point format is not IEEE, so a conversion is required. All files have four chunks at a location described in the header:

  • the header chunk starts at 0 and contains 32 words, followed by 0's, followed by the locations of the following blocks
  • the second chunk is the config chunk and is usually located at 0x00000200. It contains informations about the total artwork (this block may start somewhere else. See header.)
  • the third chunk is the test chunk and is usually at 0x00000400. It moves the laser head on the bounding box of the artwork (this block may start somewhere else. See header.)
  • the fourth chunk is the cut chunk and is usually at 0x00000600. It cuts the artwork a few millimeters around the bounding box (this block may start somewhere else. See header.)
  • the fifth chunk is the draw chunk and is usually at 0x00000A00. It contains all commands to output the actual drawing and cutting commands (this block may start somewhere else. See header.)
  • the file is then patched to the next 512 byte boundary

The Header

The header chunk contains the parameters of the destination machine, version numbers, and general information including file size. All data is at fixed positions.

The Config Chunk

This block has all the information about the position and size of the artwork. It uses, like the following chunks, a number of binary commands, most of them deciphered below.

The Test Chunk

This is called when the "Test" button is pressed on the panel. It moves the laser head around the bounding box of the artwork and is a great help for positioning the material. In this file, it is simply a bunch of line drawing commands.

The Cut Chunk

This is called when the "Cut Outline" menu is selected and contains a setup part followed by a list of machine control commands that cut around the bounding box.

The Draw Chunk

This is called when the "Play" button is pressed and contains a setup part followed by a list of machine control commands that cut and draw the artwork.

Binary Commands

Every command starts with three bytes describing the command itself, plus one byte containing the number of parameters following. The parameters are always 4-byte words in LSB integer or floating point format, or four individual bytes. The FP format differs slightly from the IEEE standard, but can be converted by shifting a few bits around. LEETRO float: [eeeeeeee|smmmmmmm|mmmmmmm0|00000000]

The same command can have a different number of arguments!

The size byte can be 0x80 in which case, the actual number of arguments is give in the 4-byte integer that follows.

A special command (0x46 0x09 0x00 0x80 0xnnnnnnnn) encapsulates n motion commands. The motion commands follow the same scheme as all other binary commands. This is likely used for multiple prints of the same drawing in a matrix layout.

Sample File

Header

The header describes the parameters of the machine for which the data was created. We find information about the file size and the stepper resolution. There should not be any information how to map channels to motors, etc., as that is likely done in a separate configuration file.

Size of entire file in bytes

  • 00000000: 0x00001000 Size of file in bytes

Unknown, this seems to be close to the number of motion blocks plus 30.

  • 00000004: 0x00000022

File Version Number: file was written with dll 4.1.2.2

  • 00000008: 0x02 0x02 0x01 0x04 ?

Unknown, fixed value, probably the version of the file format

  • 0000000c: 0x00000001 ?

This word changes when the size of the file changes, i.e. when lines are added. This line corresponds to the number of "move relative" commands in the entire file counting "unknown 07" and "unknown 09" as well. Is that coincidence? What would this value be good for? perhaps estimating the cutting time?

  • 00000010: 0x00000029 somehow related to the file size or the number of commands

Four booleans, setting the second value will make the artwork relative to the user-set origin. If it is zero, the origin is the center of the work table (not quite though!).

  • 00000014: 0x00000001 ?

Extent of the artwork to the top right from the origin in steps (divide by 208.33 to get millimeters). This is only used to verify that the artwork fits the machine and will cause an alarm if origin plus this value is outside of the work surface.

  • 00000018: 0x00000000
  • 0000001c: 0x00000000

Extent of the artwork to the bottom left from the origin in steps.

  • 00000020: -20833 artwork width in steps
  • 00000024: -20833 artwork height in steps

Unknown!

  • 00000028: 0x00481095 ?

Unknown!

  • 0000002c: 0x471a0000 ?

Unknown bunch of zeros, likely reserved for later use

  • 00000030 - 0000006c

Location of the config chunk. This is the n'th block, block size is 512 bytes. The 200 block contains general data about the artwork.

  • 00000070: 0x00000001

Location of the test chunk. This block is called when the user presses "Test" on the CMD03 and outlines the artwork.

  • 00000074: 0x00000002 ?

Location of the cut chunk. This block is called when the users selects "Cut File" (or so) from the menu.

  • 00000078: 0x00000003 ?

Location of the draw chunk. This block is called when the users presses "Start".

  • 0000007c: 0x00000005 ?

Data Block at 0x00000200

The configuration chunk still has a bunch of unknown commands, few of them seem to change for a single machine configuration.

Unknown, fixed value

  • 00000200: : unknown 01

Unknown, fixed value, the default driver for the X-axis is #4 (maybe related?)

  • 00000204: : unknown 02: 4, 4.00

Unknown, fixed value, the default driver for the Y-axis is #3 (maybe related?)

  • 00000214: : unknown 02: 3, 3.00

Unknown, fixed value

  • 00000224: : unknown 03

Unknown, fixed value

  • 00000228: : unknown 04

Unknown

  • arg1 is unknown, but repeats in 'unknown 11'
  • arg2 is the start speed for all head movements as described in the settings
  • arg3 is the maximum speed for moving around "quickly"
  • arg4 is the acceleration value to get to the above speed (space acc)
  • arg5 is the value for acceleration from the settings
  • arg6 is the acceleration when going from vector to vector
  • 0000022c: : unknown 05: 603, 1041(5.00%), 41666(200.00%), 145833(700.00%), 104166(500.00%), 72916(350.00%)

Set the Stepper sizes

  • arg1 is the number of steps required in X direction
  • arg2 is the same for Y
  • arg3 is likely the same in Z direction
  • TODO: find out how we can move in Z
  • 0000024c: : step size x:208.333/mm y:208.333/mm z:800/mm

Unknown, fixed value, maybe explicitly switching the laser off?

  • 0000025c: : unknown 06: 0

Object origin. Cutting a 100x100 object on a 900x600 table would move the laser head to the top right corner of a centered work piece.

  • 00000264: : unknown 07: use x/y Axis, x:500.005mm, y:350.002mm

Motion parameters:

  • arg1 is the initial speed
  • arg2 is the maximum speed
  • arg3 is the acceleration
  • 00000274: : unknown 08 a:1041(5%), b:41666(200%), c:145833(700%)

Object size. Our test object is 100x100, so this command moves to the bottom left corner.

  • 00000284: : unknown 09: use x/y Axis, x:-100mm, y:-100mm

Unknown, fixed value

  • 00000294: : unknown 10: 3, 2.000000, 2.000000

Unknown, fixed value, 603 also appears at 0x0000022c

  • 000002a8: : unknown 11: 603

Unknown, fixed value

  • 000002b4: : unknown 12

Data Block at 0x00000400

This is the block that is called when the user presses "Test" on the panel. It moves the laser head on the bounding box around the artwork.

Begin of the subroutine. I don't know if the ID has a specific meaning, or if the file position of this block is sufficient to make it the test block. Just don't change it.

  • 00000400: : begin subroutine 1

See above

  • 00000408: : unknown 05: 603, 1041(5.00%), 41666(200.00%), 145833(700.00%), 104166(500.00%), 72916(350.00%)

This command encloses all following draw commands. It may be used for multiple rendering of the drawing commands at different location to keep file size small. The commands inside the block follow the same scheme as those outside.

  • 00000428: : command block follows, 112 words (form 00000430 to 000005f0)
  • move relative -100, 0

The next 8 commands are needed to draw a single line. There are three optional phases: acceleration, constant speed, deceleration. Only one of these phases need to exist. All three put together move the head from a to b along a straight line. If the angle of two consecutive lines is below some threshold, the end speed of the previous line and the initial speed of the current line may be significantly higher.

Curves are done using short line segments.

Accelerate: the following command will accelerate the head along the given line

  • 00000430: : accelerate

Set the initial speed, the maximum speed, and the acceleration.

  • 00000438: : set speeds a:1041(5%), b:41666(200%), c:145833(700%)

Move the head on a straight line to the new position. The position is given in steps relative to the current position. The meaning of 772 (0x0304) is unknown but could very well be the index of the stepper that is requested to move (3=Y, 4=X - remember that this is LSB, so in the binary file, we see 0x04 0x03 0x00 0x00 - maybe we can move Z as well, or even up to four axes at the same time? (2=Z))

TODO: 03/04 (722 in decimal) is the axes parameter (x and y). This can probably be used to move in Z as well.

  • 00000448: : move rel 772, x:-28.5509mm, y:0mm

Even though we still are in acceleration mode, setting the initial speed equal to the maximum speed will make this a constant speed motion.

  • 00000458: : set speeds a:41666(200%), b:41666(200%), c:145833(700%)
  • 00000468: : move rel 772, x:-42.9175mm, y:0mm

Set the next speed parameters so that they are used for deceleration from the maximum speed (b) to the ending speed (a), using the deceleration parameter (c)

  • 00000478: : decelerate
  • 00000480: : set speeds a:1473.12(7%), b:41666(200%), c:145833(700%)
  • 00000490: : move rel 772, x:-28.5317mm, y:0mm

This is the end of the move command. All the following commands use the same scheme.

move relative 0, -100

  • 000004a0: : accelerate
  • 000004a8: : set speeds a:1473.12(7%), b:41666(200%), c:145833(700%)
  • 000004b8: : move rel 772, x:0mm, y:-28.5317mm
  • 000004c8: : set speeds a:41666(200%), b:41666(200%), c:145833(700%)
  • 000004d8: : move rel 772, x:0mm, y:-42.9367mm
  • 000004e8: : decelerate
  • 000004f0: : set speeds a:1473.12(7%), b:41666(200%), c:145833(700%)
  • 00000500: : move rel 772, x:0mm, y:-28.5317mm

move relative 100, 0

  • 00000510: : accelerate
  • 00000518: : set speeds a:1473.12(7%), b:41666(200%), c:145833(700%)
  • 00000528: : move rel 772, x:28.5317mm, y:0mm
  • 00000538: : set speeds a:41666(200%), b:41666(200%), c:145833(700%)
  • 00000548: : move rel 772, x:42.9367mm, y:0mm
  • 00000558: : decelerate
  • 00000560: : set speeds a:1473.12(7%), b:41666(200%), c:145833(700%)
  • 00000570: : move rel 772, x:28.5317mm, y:0mm

move relative 0, 100

  • 00000580: : accelerate
  • 00000588: : set speeds a:1473.12(7%), b:41666(200%), c:145833(700%)
  • 00000598: : move rel 772, x:0mm, y:28.5317mm
  • 000005a8: : set speeds a:41666(200%), b:41666(200%), c:145833(700%)
  • 000005b8: : move rel 772, x:0mm, y:42.9175mm
  • 000005c8: : decelerate
  • 000005d0: : set speeds a:1041(5%), b:41666(200%), c:145833(700%)
  • 000005e0: : move rel 772, x:0mm, y:28.5509mm

This is where the block ends

This is the end of subroutine 1

  • 000005f0: : end subroutine 1

Data Block at 0x00000600

This block cuts the bounding box of the artwork plus 2mm on each side. This block is optional. Fill with 0 if not used.

Data Block at 0x00000a00

This is the block that cuts the actual artwork.

This is another subroutine ID

  • 00000a00: : begin subroutine 3

Unknown, fixed

  • 00000a08: : unknown 13: 3000

Unknown, fixed, 4 is the X axis controller, maybe a direction flag

  • 00000a10: : unknown 14: 4, 0

Unknown, fixed, maybe flags for that axis: direction, microstepping, power?

  • 00000a1c: : unknown 15: 516(0x04, 0x02)

Unknown, fixed, 3 is the Y axis

  • 00000a24: : unknown 14: 3, 0

Unknown, fixed, flags?

  • 00000a30: : unknown 15: 515(0x03, 0x02)

Short version of the basic parameters (single laser?)

  • arg1 is the corner power (similar to the stepper acceleration, this is the starting power)
  • arg2 is the maximum power
  • arg3 is the cutting start speed
  • arg4 is the maximum cutting speed
  • arg5 is unknown
  • 00000a38: : laser power corner:40.00%, straight:40.00%, start speed:1041(5.00%), speed:20833(100.00%), ??:0

Long version of the basic parameters (dual laser? or just floating point precision?)

  • arg3 seems to be the initial power of the second laser
  • arg4 seems to be the maximum power
  • 00000a50: : laser power corner:40.00%, straight:40.00%, p3:30.00%, p4:50.00%, startspeed:1041(5.00%), speed:20833(100.00%), ??:0

Motion Command Block. These blocks divide the file into 2kByte chunks at command boundaries. Command blocks never contain more than 510 (512?) words (<=2kBytes). This subroutine can have many command blocks. Motion Commands are switching periphery (laser, lower), setting acceleration and deceleration, and moving the head.

  • 00000a70: : command block follows, 290 words (form 00000a78 to 00000f00)

Switch on the blower. The numerical values here probably correspond to the output ports on the controller board. If we find the pattern, we can control additional devices, like switching the Y axis to control a rotary device, or starting the roller of a laser sintering setup.

  • TODO: find the command-to-port mapping for this
  • TODO: verify that this really is the blower, since our machine has no switched blower
  • 00000a78: : blower on

Now is the time for all danger seekers to put on their goggles… .

  • 00000a80: : laser on

cut relative to -100, 0

  • 00000a88: : accelerate
  • 00000a90: : set speeds a:1041(5%), b:20833(100%), c:104166(500%)
  • 00000aa0: : move rel 772, x:9.97456mm, y:0mm
  • 00000ab0: : set speeds a:20833(100%), b:20833(100%), c:104166(500%)
  • 00000ac0: : move rel 772, x:80.0461mm, y:0mm
  • 00000ad0: : decelerate
  • 00000ad8: : set speeds a:936.9(4%), b:20833(100%), c:104166(500%)
  • 00000ae8: : move rel 772, x:9.97936mm, y:0mm

Switch the laser off already. Even though the next line requires no repositioning, LaserCut has switched off the laser, just to turn it right back on. This does no harm, but makes the file bigger than needed. It also explains why we should always "connect lines" in LaserCut. If lines are connected, we would simply add movement commands here until we reach the end of the cut.

  • 00000af8: : laser off

cut relative to 0, -100

  • 00000b00: : laser on
  • 00000b08: : accelerate
  • 00000b10: : set speeds a:936.9(4%), b:20833(100%), c:104166(500%)
  • 00000b20: : move rel 772, x:0mm, y:9.97936mm
  • 00000b30: : set speeds a:20833(100%), b:20833(100%), c:104166(500%)
  • 00000b40: : move rel 772, x:0mm, y:80.0413mm
  • 00000b50: : decelerate
  • 00000b58: : set speeds a:936.9(4%), b:20833(100%), c:104166(500%)
  • 00000b68: : move rel 772, x:0mm, y:9.97936mm
  • 00000b78: : laser off

(...)

Leaves the head just where it's at. In case of a repetition, the controller will likely know where to move next and continue with the next cutout.

  • 00000ef0: : blower off
  • 00000ef8: : blower off

This is where the block ends

  • 00000f00: : end subroutine 3

The rest of the file is filled with 0x00 to the next 512 byte boundary, probably to avoid readingerrors when buffering from the USB stick to internal RAM.

Hexdump

0000000 00 10 00 00 22 00 00 00 02 02 01 04 01 00 00 00
0000010 29 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00
0000020 9f ae ff ff 9f ae ff ff 95 10 48 00 00 00 1a 47
0000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
0000070 01 00 00 00 02 00 00 00 03 00 00 00 05 00 00 00
0000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
0000200 48 05 20 00 48 01 60 80 02 00 00 00 04 00 00 00
0000210 00 00 00 02 48 01 60 80 02 00 00 00 03 00 00 00
0000220 00 00 40 01 48 08 20 00 48 07 20 00 48 01 60 80
0000230 06 00 00 00 5b 02 00 00 00 20 02 0a 00 c2 22 0f
0000240 40 6a 0e 11 00 73 4b 10 00 6a 0e 10 46 0e 00 03
0000250 55 55 50 07 55 55 50 07 00 00 48 09 48 09 20 01
0000260 00 00 00 00 40 60 04 03 04 03 00 00 e6 96 01 00
0000270 d4 1c 01 00 41 03 00 03 00 20 02 0a 00 c2 22 0f
0000280 40 6a 0e 11 40 60 02 03 04 03 00 00 9f ae ff ff
0000290 9f ae ff ff 48 00 50 80 03 00 00 00 03 00 00 00
00002a0 00 00 00 81 00 00 00 81 48 00 50 80 01 00 00 00
00002b0 5b 02 00 00 48 06 20 00 00 00 00 00 00 00 00 00
00002c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
0000400 48 00 30 01 01 00 00 00 48 01 60 80 06 00 00 00
0000410 5b 02 00 00 00 20 02 0a 00 c2 22 0f 40 6a 0e 11
0000420 00 73 4b 10 00 6a 0e 10 46 09 00 80 70 00 00 00
0000430 01 46 00 01 01 00 00 00 01 03 00 03 00 20 02 0a
0000440 00 c2 22 0f 40 6a 0e 11 00 60 02 03 04 03 00 00
0000450 c4 e8 ff ff 00 00 00 00 01 03 00 03 00 c2 22 0f
0000460 00 c2 22 0f 40 6a 0e 11 00 60 02 03 04 03 00 00
0000470 13 dd ff ff 00 00 00 00 01 46 00 01 02 00 00 00
0000480 01 03 00 03 b3 23 38 0a 00 c2 22 0f 40 6a 0e 11
0000490 00 60 02 03 04 03 00 00 c8 e8 ff ff 00 00 00 00
00004a0 01 46 00 01 01 00 00 00 01 03 00 03 b3 23 38 0a
00004b0 00 c2 22 0f 40 6a 0e 11 00 60 02 03 04 03 00 00
00004c0 00 00 00 00 c8 e8 ff ff 01 03 00 03 00 c2 22 0f
00004d0 00 c2 22 0f 40 6a 0e 11 00 60 02 03 04 03 00 00
00004e0 00 00 00 00 0f dd ff ff 01 46 00 01 02 00 00 00
00004f0 01 03 00 03 b3 23 38 0a 00 c2 22 0f 40 6a 0e 11
0000500 00 60 02 03 04 03 00 00 00 00 00 00 c8 e8 ff ff
0000510 01 46 00 01 01 00 00 00 01 03 00 03 b3 23 38 0a
0000520 00 c2 22 0f 40 6a 0e 11 00 60 02 03 04 03 00 00
0000530 38 17 00 00 00 00 00 00 01 03 00 03 00 c2 22 0f
0000540 00 c2 22 0f 40 6a 0e 11 00 60 02 03 04 03 00 00
0000550 f1 22 00 00 00 00 00 00 01 46 00 01 02 00 00 00
0000560 01 03 00 03 b3 23 38 0a 00 c2 22 0f 40 6a 0e 11
0000570 00 60 02 03 04 03 00 00 38 17 00 00 00 00 00 00
0000580 01 46 00 01 01 00 00 00 01 03 00 03 b3 23 38 0a
0000590 00 c2 22 0f 40 6a 0e 11 00 60 02 03 04 03 00 00
00005a0 00 00 00 00 38 17 00 00 01 03 00 03 00 c2 22 0f
00005b0 00 c2 22 0f 40 6a 0e 11 00 60 02 03 04 03 00 00
00005c0 00 00 00 00 ed 22 00 00 01 46 00 01 02 00 00 00
00005d0 01 03 00 03 00 20 02 0a 00 c2 22 0f 40 6a 0e 11
00005e0 00 60 02 03 04 03 00 00 00 00 00 00 3c 17 00 00
00005f0 48 00 40 01 01 00 00 00 00 00 00 00 00 00 00 00
0000600 48 00 30 01 02 00 00 00 48 01 60 80 06 00 00 00
0000610 5b 02 00 00 00 20 02 0a 00 c2 22 0f 40 6a 0e 11
0000620 00 73 4b 10 00 6a 0e 10 46 0e 00 05 a0 0f 00 00
0000630 a0 0f 00 00 00 20 02 0a 00 c0 22 0c 00 00 00 00
0000640 46 0e 00 07 a0 0f 00 00 a0 0f 00 00 a0 0f 00 00
0000650 a0 0f 00 00 00 20 02 0a 00 c0 22 0c 00 00 00 00
0000660 46 09 00 80 90 00 00 00 01 46 00 01 01 00 00 00
0000670 01 03 00 03 00 20 02 0a 00 c0 22 0c 00 73 4b 10
0000680 00 60 02 03 04 03 00 00 57 00 00 00 57 00 00 00
0000690 01 03 00 03 00 c0 22 0c 00 c0 22 0c 00 73 4b 10
00006a0 00 60 02 03 04 03 00 00 f2 00 00 00 f2 00 00 00
00006b0 01 46 00 01 02 00 00 00 01 03 00 03 7e ae 7d 09
00006c0 00 c0 22 0c 00 73 4b 10 00 60 02 03 04 03 00 00
00006d0 58 00 00 00 58 00 00 00 06 06 00 01 01 00 00 00
00006e0 01 46 00 01 01 00 00 00 01 03 00 03 7e ae 7d 09
00006f0 00 c0 22 0c 00 73 4b 10 00 60 02 03 04 03 00 00
0000700 83 ff ff ff 00 00 00 00 01 03 00 03 00 c0 22 0c
0000710 00 c0 22 0c 00 73 4b 10 00 60 02 03 04 03 00 00
0000720 51 ac ff ff 00 00 00 00 01 46 00 01 02 00 00 00
0000730 01 03 00 03 b3 23 38 0a 00 c0 22 0c 00 73 4b 10
0000740 00 60 02 03 04 03 00 00 89 ff ff ff 00 00 00 00
0000750 01 46 00 01 01 00 00 00 01 03 00 03 b3 23 38 0a
0000760 00 c0 22 0c 00 73 4b 10 00 60 02 03 04 03 00 00
0000770 00 00 00 00 89 ff ff ff 01 03 00 03 00 c0 22 0c
0000780 00 c0 22 0c 00 73 4b 10 00 60 02 03 04 03 00 00
0000790 00 00 00 00 4b ac ff ff 01 46 00 01 02 00 00 00
00007a0 01 03 00 03 b3 23 38 0a 00 c0 22 0c 00 73 4b 10
00007b0 00 60 02 03 04 03 00 00 00 00 00 00 89 ff ff ff
00007c0 01 46 00 01 01 00 00 00 01 03 00 03 b3 23 38 0a
00007d0 00 c0 22 0c 00 73 4b 10 00 60 02 03 04 03 00 00
00007e0 77 00 00 00 00 00 00 00 01 03 00 03 00 c0 22 0c
00007f0 00 c0 22 0c 00 73 4b 10 00 60 02 03 04 03 00 00
0000800 b5 53 00 00 00 00 00 00 01 46 00 01 02 00 00 00
0000810 01 03 00 03 b3 23 38 0a 00 c0 22 0c 00 73 4b 10
0000820 00 60 02 03 04 03 00 00 77 00 00 00 00 00 00 00
0000830 01 46 00 01 01 00 00 00 01 03 00 03 b3 23 38 0a
0000840 00 c0 22 0c 00 73 4b 10 00 60 02 03 04 03 00 00
0000850 00 00 00 00 77 00 00 00 01 03 00 03 00 c0 22 0c
0000860 00 c0 22 0c 00 73 4b 10 00 60 02 03 04 03 00 00
0000870 00 00 00 00 b0 53 00 00 01 46 00 01 02 00 00 00
0000880 01 03 00 03 00 20 02 0a 00 c0 22 0c 00 73 4b 10
0000890 00 60 02 03 04 03 00 00 00 00 00 00 7c 00 00 00
00008a0 06 06 00 01 00 00 00 00 48 00 40 01 02 00 00 00
00008b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
0000a00 48 00 30 01 03 00 00 00 46 0d 00 01 b8 0b 00 00
0000a10 41 4a 00 02 04 00 00 00 00 00 00 00 41 4b 00 01
0000a20 04 02 00 00 41 4a 00 02 03 00 00 00 00 00 00 00
0000a30 41 4b 00 01 03 02 00 00 46 0e 00 05 a0 0f 00 00
0000a40 a0 0f 00 00 00 20 02 0a 00 c2 22 0e 00 00 00 00
0000a50 46 0e 00 07 a0 0f 00 00 a0 0f 00 00 b8 0b 00 00
0000a60 88 13 00 00 00 20 02 0a 00 c2 22 0e 00 00 00 00
0000a70 46 09 00 80 22 01 00 00 06 0b 00 01 01 02 00 00
0000a80 06 06 00 01 01 00 00 00 01 46 00 01 01 00 00 00
0000a90 01 03 00 03 00 20 02 0a 00 c2 22 0e 00 73 4b 10
0000aa0 00 60 02 03 04 03 00 00 1e 08 00 00 00 00 00 00
0000ab0 01 03 00 03 00 c2 22 0e 00 c2 22 0e 00 73 4b 10
0000ac0 00 60 02 03 04 03 00 00 24 41 00 00 00 00 00 00
0000ad0 01 46 00 01 02 00 00 00 01 03 00 03 9a 39 6a 09
0000ae0 00 c2 22 0e 00 73 4b 10 00 60 02 03 04 03 00 00
0000af0 1f 08 00 00 00 00 00 00 06 06 00 01 00 00 00 00
0000b00 06 06 00 01 01 00 00 00 01 46 00 01 01 00 00 00
0000b10 01 03 00 03 9a 39 6a 09 00 c2 22 0e 00 73 4b 10
0000b20 00 60 02 03 04 03 00 00 00 00 00 00 1f 08 00 00
0000b30 01 03 00 03 00 c2 22 0e 00 c2 22 0e 00 73 4b 10
0000b40 00 60 02 03 04 03 00 00 00 00 00 00 23 41 00 00
0000b50 01 46 00 01 02 00 00 00 01 03 00 03 9a 39 6a 09
0000b60 00 c2 22 0e 00 73 4b 10 00 60 02 03 04 03 00 00
0000b70 00 00 00 00 1f 08 00 00 06 06 00 01 00 00 00 00
(...)
0000ef0 06 0b 00 01 00 02 00 00 06 0b 00 01 00 02 00 00
0000f00 48 00 40 01 03 00 00 00 00 00 00 00 00 00 00 00
0000f10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
0001000