Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Spirograph emulator with Duet2

    Scheduled Pinned Locked Moved
    CNC
    7
    62
    1.9k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ironhydroxideundefined
      ironhydroxide @mrehorstdmd
      last edited by

      @mrehorstdmd said in Spirograph emulator with Duet2:

      If I enter M98 p"{random(55)}^.gcode" it returns {random(55)}^.gcode not found. It isn't converting the expression to a random number, or even treating it as an expression, just a string of characters. I've tried a few variations on the syntax and none have worked so far.

      you need to complete the quotation, then append the value, then continue the quotation.

      M98 P""" <-gives you M98 "
      ^{random(55)} appends the result of the random 55
      ^".gcode""" appends the string .gcode"

      Leaves you with
      M98 P"randomnumber.gcode"

      I was wrong,
      After some testing it seems here's the syntax.

      M98 P{random(55)}^".gcode"

      dc42undefined 1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators @ironhydroxide
        last edited by dc42

        @ironhydroxide the correct syntax is:

        M98 P{random(55)^".gcode"}

        Duet WiFi hardware designer and firmware engineer
        Please do not ask me for Duet support via PM or email, use the forum
        http://www.escher3d.com, https://miscsolutions.wordpress.com

        ironhydroxideundefined mrehorstdmdundefined 2 Replies Last reply Reply Quote 1
        • ironhydroxideundefined
          ironhydroxide @dc42
          last edited by

          @dc42 Thanks for that correction.

          Tested with my system and it seemed to work the other way (though likely can cause problems when getting more complex)

          1 Reply Last reply Reply Quote 0
          • mrehorstdmdundefined
            mrehorstdmd @dc42
            last edited by mrehorstdmd

            @dc42 I have drawing files in /gcodes/draw/ and wipe files in /gcodes/wipe/ folders. All files are renamed with numeric names and gcode extension, like "16.gcode".

            I have tried about 50 variations on:

            M98 P{/gcodes/draw/random(214)^".gcode"}
            and get various error messages, mostly about expecting a string at one column or another.

            How do I specify the folder to find the target files? Is this syntax documented somewhere?

            Thanks!

            m98 P"/gcodes/draw/^{random(22)}^.gcode"
            Warning: Macro file /gcodes/draw/^{random(22)}^.gcode not found
            ok
            M98 P"/gcodes/draw/{random(55)^".gcode"}
            Warning: Macro file /gcodes/draw/{random(55)^ not found
            Error: Bad command: gcode"}
            ok
            M98 P{/gcodes/draw/{andom(55)^".gcode"}
            Error:  at column 7: M98: expected an expression
            ok
            M98 P{/gcodes/draw/{random(55)^".gcode"}
            Error:  at column 7: M98: expected an expression
            ok
            M98 P{/gcodes/draw/random(55)^".gcode"}
            Error:  at column 7: M98: expected an expression
            ok
            M98 P "/gcodes/draw/{random(55)^".gcode"}
            Error:  at column 6: M98: expected a string expression
            Error: Bad command: gcode"}
            ok
            M98 P "/gcodes/draw/{random(55)^.gcode"}
            Error:  at column 6: M98: expected a string expression
            ok
            M98 P {/gcodes/draw/random(55)^.gcode"}
            Error:  at column 6: M98: expected a string expression
            ok
            M98 P{random(55)^".gcode"}
            Warning: Macro file 39.gcode not found
            ok
            M98 P /gcodes/draw/{random(55)^".gcode"}
            Error:  at column 6: M98: expected a string expression
            Error: Bad command: gcodes/draw/{random(55)^".gcode"}
            ok
            M98 P "/gcodes/draw/{random(55)^".gcode"}"
            Error:  at column 6: M98: expected a string expression
            Error: Bad command: gcode"}"
            ok
            M98 P "/gcodes/draw/{random(55)^".gcode"
            Error:  at column 6: M98: expected a string expression
            Error: Bad command: gcode"
            ok
            M98 P "/gcodes/draw/{random(55)^".gcode"}
            Error:  at column 6: M98: expected a string expression
            Error: Bad command: gcode"}
            ok
            M98 P /gcodes/draw/{random(55)^".gcode"}
            Error:  at column 6: M98: expected a string expression
            Error: Bad command: gcodes/draw/{random(55)^".gcode"}
            ok
            M98 P "/gcodes/draw/{random(55)^".gcode"}"
            Error:  at column 6: M98: expected a string expression
            Error: Bad command: gcode"}"
            ok
            M98 P "/gcodes/draw/"^{random(55)^".gcode"}"
            Error:  at column 6: M98: expected a string expression
            ok
            M98 P /gcodes/draw/^{random(55)^".gcode"}
            Error:  at column 6: M98: expected a string expression
            Error: Bad command: gcodes/draw/^{random(55)^".gcode"}
            ok
            M98 P {/gcodes/draw/random(55)^".gcode"}
            Error:  at column 6: M98: expected a string expression
            ok
            M98 P {0:/gcodes/draw/random(55)^".gcode"}
            Error:  at column 6: M98: expected a string expression
            ok
            M98 P "0:/gcodes/draw/"^{random(55)^".gcode"}
            Error:  at column 6: M98: expected a string expression
            ok
            M98 P "0:/gcodes/draw/"{random(55)^".gcode"}
            Error:  at column 6: M98: expected a string expression
            ok
            M98 P"0:/gcodes/draw/"{random(55)^".gcode"}
            Warning: Macro file 0:/gcodes/draw/ not found
            ok
            M98 P{0:/gcodes/draw/random(55)^".gcode"}
            Error:  at column 8: M98: expected '}'
            ok
            M98 P"{0:/gcodes/draw/random(55)"^".gcode"}
            Warning: Macro file {0:/gcodes/draw/random(55) not found
            ok
            M98 P"0:/gcodes/draw/{random(55)"^".gcode"}
            Warning: Macro file 0:/gcodes/draw/{random(55) not found
            ok
            M98 P"0:/gcodes/draw/{random(55)}"^".gcode"}
            Warning: Macro file 0:/gcodes/draw/{random(55)} not found
            ok
            M98 P"0:/gcodes/draw/{random(55)}"^".gcode"
            Warning: Macro file 0:/gcodes/draw/{random(55)} not found
            ok
            M98 P"0:/gcodes/draw/"{random(55)}"^".gcode"
            Warning: Macro file 0:/gcodes/draw/ not found
            Error: Bad command: gcode"
            ok
            M98 P"0:/gcodes/draw/"^{random(55)}"^".gcode"
            Warning: Macro file 0:/gcodes/draw/ not found
            Error: Bad command: gcode"
            ok
            M98 P"0:/gcodes/draw/"^{random(55)}^".gcode"
            Warning: Macro file 0:/gcodes/draw/ not found
            ok
            M98 P"0:/gcodes/draw/"^{random(55)^".gcode"}
            Warning: Macro file 0:/gcodes/draw/ not found
            ok
            M98 P"0:/gcodes/draw/"^"{random(55)^".gcode"}
            Warning: Macro file 0:/gcodes/draw/ not found
            Error: Bad command: gcode"}
            ok
            M98 P"0:/gcodes/draw/^"{random(55)^".gcode"}
            Warning: Macro file 0:/gcodes/draw/^ not found
            ok
            
            

            https://drmrehorst.blogspot.com/

            dc42undefined 1 Reply Last reply Reply Quote 0
            • dc42undefined
              dc42 administrators @mrehorstdmd
              last edited by

              @mrehorstdmd try this:

              M98 P{"/gcodes/draw/"^random(214)^".gcode"}

              Duet WiFi hardware designer and firmware engineer
              Please do not ask me for Duet support via PM or email, use the forum
              http://www.escher3d.com, https://miscsolutions.wordpress.com

              mrehorstdmdundefined 1 Reply Last reply Reply Quote 1
              • mrehorstdmdundefined
                mrehorstdmd @dc42
                last edited by

                @dc42 That's it! Thanks!

                https://drmrehorst.blogspot.com/

                1 Reply Last reply Reply Quote 0
                • o_lampeundefined
                  o_lampe
                  last edited by

                  The Slim Delta is alive and I could reach areas outside of the triangle.
                  The problem is, how do I tell RRF that it mustn't foul the towers?
                  I know there are people using that for their leadscrew area and such, but I couldn't find it in the Wiki.
                  far_out.jpg

                  o_lampeundefined 1 Reply Last reply Reply Quote 0
                  • o_lampeundefined
                    o_lampe @o_lampe
                    last edited by

                    Just found out that M599 can define keep out zones. But searching for "keep out" in the Wiki gave no result...
                    Bad news is, it only works on Duet3 boards due to RAM restrictions.

                    Guess I can build a few sandify patterns, that match such an odd working area, but wipe-patterns usually apply to rectangular or polar areas only

                    droftartsundefined 1 Reply Last reply Reply Quote 0
                    • droftartsundefined
                      droftarts administrators @o_lampe
                      last edited by

                      @o_lampe said in Spirograph emulator with Duet2:

                      The problem is, how do I tell RRF that it mustn't foul the towers?

                      As far as I'm aware there's no way for the firmware to do that. I guess you need to control that when slicing. I'd say it was rare to design a machine with the axes inside the build area.

                      @o_lampe said in Spirograph emulator with Duet2:

                      Just found out that M599 can define keep out zones.

                      Currently only one keep out zone is supported, and the job will be aborted with an error message if the toolhead tries to move inside that zone.

                      Ian

                      Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                      o_lampeundefined 1 Reply Last reply Reply Quote 0
                      • o_lampeundefined
                        o_lampe @droftarts
                        last edited by o_lampe

                        @droftarts said in Spirograph emulator with Duet2:

                        I'd say it was rare to design a machine with the axes inside the build area.

                        You're right, but I wanted the footprint of the table aka delta tower-triangle to be small.

                        I got a nice 38cm dia glasstable with a predrilled footprint of 320mm. I'll have to place the towers accordingly.
                        VidaXL.jpg

                        @droftarts said in Spirograph emulator with Duet2:

                        Currently only one keep out zone is supported

                        Guess, I have to write a postprocessor which takes care of three keepout zones and doesn't quit the job.

                        mrehorstdmdundefined 1 Reply Last reply Reply Quote 0
                        • mrehorstdmdundefined
                          mrehorstdmd @o_lampe
                          last edited by

                          @o_lampe What do you plan to use to generate the drawing and erase pattern files? Maybe the keepout areas can be defined there.

                          You can do all sorts of stuff with post processors. I use a PERL post processor to set the speed of moves on my table. It steps through the pattern file and determines whether each line of gcode draws on the table or moves the ball along the edges. If it's edge motion, it executes it at high speed (usually 1000 mm/sec), and if it's drawing on the table it executes at a lower speed (to preserve detail in the drawing).

                          https://drmrehorst.blogspot.com/

                          o_lampeundefined 1 Reply Last reply Reply Quote 0
                          • o_lampeundefined
                            o_lampe @mrehorstdmd
                            last edited by

                            @mrehorstdmd Currently I'm using Sandify, but I can also produce gcode from .dxf files. With inkscape I could theoreticaly use any bitmap to generate patterns and I could manually drag every knot of a path out of the zones.
                            I used it frequently, when my K40 laser was new.

                            I haven't thought to look elsewhere, but if others (CNC or laser scene? ) have the same problem with keep out zones, I'd be happy to know.
                            Is the PERL post processor open source? I'm looking for a good starting point to write my own.(open file, modify gcode lines, write new file)

                            mrehorstdmdundefined 1 Reply Last reply Reply Quote 0
                            • mrehorstdmdundefined
                              mrehorstdmd @o_lampe
                              last edited by

                              @o_lampe Here's my PERL script for dual speed operation. I used a LOT of notes to make it easy for me to modify or fix because I don't do a lot of programming and have to relearn it for each project.

                              https://drmrehorst.blogspot.com/

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post
                              Unless otherwise noted, all forum content is licensed under CC-BY-SA