Spirograph emulator with Duet2
-
@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"
-
@ironhydroxide the correct syntax is:
M98 P{random(55)^".gcode"}
-
@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)
-
@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
-
@mrehorstdmd try this:
M98 P{"/gcodes/draw/"^random(214)^".gcode"}
-
@dc42 That's it! Thanks!
-
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.
-
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
-
@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
-
@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.
@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.
-
@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).
-
@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)