layer change detection - ideamaker



  • I'm playing with danal's duetlapse adding a way for it to record with two cameras in the same time and render a two-channel video at the end.. and I noticed it's not detecting layers at all, looked at the dwc and layer chart is blank too 😞 ..

    file sliced with ideaMaker (I can upload example if needed), no layer change detection happening 😞

    Anything I can add on layer change g-code in ideaMaker that can solve this?

    relevant code snippet:

    G1 F1200 Z2.050
    G0 F7800 X-20.056 Y9.738
    G0 X-19.831 Y10.245
    G0 X-18.652 Y11.438
    G0 F7800 X-18.442 Y11.651
    ;TYPE:SOLID-FILL
    ;WIDTH:0.700
    G1 F1200 Z2.000
    G1 F3000 E0.2000
    G1 F1800 X-18.295 Y11.798 E0.0223
    ;LAYER:5
    ;Z:2.400
    ;HEIGHT:0.400
    G1 F3000 E-0.2000
    G0 F1200 Z2.400
    G0 F7800 X-18.295 Y11.798
    G0 X-7.356 Y8.930
    G0 X12.391 Y2.277
    G0 X15.153 Y0.213
    G0 X21.084 Y-5.084
    G0 F7800 X21.307 Y-5.283
    ;TYPE:WALL-INNER
    ;WIDTH:0.700
    G1 F1200 Z2.400
    G1 F3000 E0.2000
    G1 F4200 X21.648 Y-7.851 E0.2774
    G1 X21.535 Y-10.441 E0.2776
    G1 X20.964 Y-12.968 E0.2775
    G1 X19.986 Y-15.292 E0.2700
    G1 X19.277 Y-16.502 E0.1502
    


  • DuetLapse depends on the firmware finding the layer tags.

    The firmware is looking for some specific strings prior to starting a print, and then calculates the "current" layer from Z, with appropriate handling for the fact that layer 0 is often different.

    The most common reason for all of that not working is having a G1 (or G0) in the end G-code that contains a Z value that throws off the scan & calculate. What do the last two dozen or so lines in the file look like? And/or what does DWC show for total height?



  • @Danal, does the layer detection of the duet relies the file preamble from the slicer? E.g. this

    https://github.com/Duet3D/RepRapFirmware/blob/dev/src/Storage/FileInfoParser.cpp#L538

    BTW, theoretically you can have in the timelapse program an additional trigger by z.



  • total height is ok, but everything else is blank
    591ca127-8672-45c7-a6a4-e52ad5ba6879-image.png

    here's a sample g-code
    ideaMaker.gcode

    FileInfoParser.cpp does not know about ideaMaker but that data does not exist in the comment section of ideaMaker ...

    start is

    ;Sliced by ideaMaker 3.5.3.4250, 2020-05-24 01:44:49 UTC+0200
    ;Dimension: 236.000 225.000 300.000 0.600
    ;Plate Shape: 0
    ;Extruder Offset #1: 25.000 0.000
    ;Filament Diameter #1: 1.750
    ;Filament Diameter #2: 1.750
    ;Filament Compensation #1: 92.00
    ;Filament Compensation #2: 90.00
    ;Filament Density #1: 1270.00
    ;Filament Density #2: 1270.00
    ;Bounding Box: -31.745 45.744 -39.743 22.745 0.000 6.000
    ;Model Gap: 0.000
    

    end is

    ;Print Time: 1934
    ;Material#1 Used: 4296.9
    ;Material#2 Used: 0.0
    ;Material#1 Cost: 1.38
    ;Material#2 Cost: 0.00
    

    so not much useful data in the gcode itself 😞

    there is the

    ; LAYER #
    ; Z: ##.##
    

    comment for each layer, but looks like RRF is ignoring that one



  • @zapta said in layer change detection - ideamaker:

    @Danal, does the layer detection of the duet relies the file preamble from the slicer? E.g. this

    https://github.com/Duet3D/RepRapFirmware/blob/dev/src/Storage/FileInfoParser.cpp#L538

    BTW, theoretically you can have in the timelapse program an additional trigger by z.

    Yes, I read the whole thing as:

    1. It has to find a tag (a comment) that tells it the layer height.
    2. It scans the last few K of the G-Code for max Z
    3. It divides to derive total layers
    4. During the actual print, it also divides to decide what layer is current.

    The thing that gets thrown off the most seems to be (2).

    And... that's my reading, I could be off in detail. I've looked at it several times and I'm reasonable certain that is how it works... but we all know that code can do things we are looking right at... and not understanding.



  • @Danal said in layer change detection - ideamaker:

    1. It has to find a tag (a comment) that tells it the layer height.

    Weird that most slicers I tried add this comment but idea maker does not. Would be cool that RRF defines some "standard" for comment info that it recommends that slicers that don't already have that can implement, or that a postprocessor can add to a file.



  • @arhi, can you add the expected tags yourself? E.g. with slicer's gcode settings?



  • @zapta that's why I wrote " Would be cool that RRF defines some "standard" for comment" as I could add it to my postprocessing - upload script. I could try to put codes similar to s3d or slic3r .. we'll play with it more, did not even notice it before this timelapse thing 🙂



  • Added to start script

    ; layer_height={layer_height}
    ; Layer height={layer_height}
    ; layerHeight,{layer_height}
    ; layer_thickness_mm={layer_height}
    ; layerThickness={layer_height}
    

    and now RRF knows about the layer height
    d1291832-837b-437b-b3d2-1d70d3321caf-image.png

    hopefully that's enough 🙂



  • works!!! 😄



  • @arhi, very nice!


Log in to reply