Creating/Editing Macros



  • Hello!

    Our project is a bioprinter that will be using syringes of bioink/cells instead of extruding plastic.

    It is a dual syringe (extruder) design that has a linear rack mechanism between the two syringes A and B that, when the stepper attached to this mechanism moves one direction, syringe A travels up while syringe B travels down. When the stepper moves the opposite direction, syringe A travels back down and syringe B travels back up.

    The reason for this is to extrude from the syringe that is lower, stop printing when that layer is done, then use the mechanism to lower the other syringe to print and get the first syringe out of the way (each syringe will contain different material that will need to be printed at different times).

    Instead of changing the firmware, I was talking with Tony and he recommended that this could be done with macros.

    1.) Our printer is not built yet, but we need to get a head start on this. How can we begin the legwork of these macros?

    2.) I know this is a newb question but y'all have been so nice and patient. Are the macros done in gcode or C++? I saw somewhere on the forums that macros can be created within the webcontrol application from computer -> ethernet -> Duet board, but I am looking for a bit more information so we can get started.

    Thank you in advance for the help!

    Just as a P.S. - The account I am using is a shared account for my project group. In the future we will try to add our names of each post so you know exactly who you are talking to.


  • administrators

    Hi
    First if you want accounts for each of you in the project grtoup just let me know and I will get them made.

    Macros are witten in Gcode. examples such as homing are bult in system macros. For an example of such a macro look here:
    https://duet3d.dozuki.com/Wiki/ConfiguringRepRapFirmwareCartesianPrinter#Section_Homing_files

    So really if you can carry out the action you want to carryout using Gcodes one step at a time then you can bundle it up into a macro to happen automatically. Specifically in your case on tool change So have a look at tool change macros:

    https://duet3d.dozuki.com/Wiki/ConfiguringRepRapFirmwareCartesianPrinter#Section_Tool_change_files

    There are three types of tool change macros: TfreeN.g which runs when the current tool is freed. TPre#.g which runs just before the new tool is activated and Tpost#.g which runs just after it is activated.



  • @T3P3Tony:

    Hi
    First if you want accounts for each of you in the project grtoup just let me know and I will get them made.

    Macros are witten in Gcode. examples such as homing are bult in system macros. For an example of such a macro look here:
    https://duet3d.dozuki.com/Wiki/ConfiguringRepRapFirmwareCartesianPrinter#Section_Homing_files

    So really if you can carry out the action you want to carryout using Gcodes one step at a time then you can bundle it up into a macro to happen automatically. Specifically in your case on tool change So have a look at tool change macros:

    https://duet3d.dozuki.com/Wiki/ConfiguringRepRapFirmwareCartesianPrinter#Section_Tool_change_files

    There are three types of tool change macros: TfreeN.g which runs when the current tool is freed. TPre#.g which runs just before the new tool is activated and Tpost#.g which runs just after it is activated.

    Tony,
    Thank you for the reply! We will begin working on this.



  • @T3P3Tony:

    Hi
    First if you want accounts for each of you in the project grtoup just let me know and I will get them made.

    Macros are witten in Gcode. examples such as homing are bult in system macros. For an example of such a macro look here:
    https://duet3d.dozuki.com/Wiki/ConfiguringRepRapFirmwareCartesianPrinter#Section_Homing_files

    So really if you can carry out the action you want to carryout using Gcodes one step at a time then you can bundle it up into a macro to happen automatically. Specifically in your case on tool change So have a look at tool change macros:

    https://duet3d.dozuki.com/Wiki/ConfiguringRepRapFirmwareCartesianPrinter#Section_Tool_change_files

    There are three types of tool change macros: TfreeN.g which runs when the current tool is freed. TPre#.g which runs just before the new tool is activated and Tpost#.g which runs just after it is activated.

    Tony,

    On the Duet wiki page, https://www.duet3d.com/ , it says the firmware can handle 2 extruders already. So instead of building these macros from the ground up, where would I go to access the existing code/macro for the dual extruder set up?

    Thanks in advance! Our team is still looking into making these macros ourselves, but wanted to see if we can use any existing templates to make sure ours is good.


  • administrators

    There are some very old macros for 2-nozzle printing near the middle of https://miscsolutions.wordpress.com/2014/07/27/converting-the-reprappro-ormerod-to-dual-colour/,



  • @dc42:

    There are some very old macros for 2-nozzle printing near the middle of https://miscsolutions.wordpress.com/2014/07/27/converting-the-reprappro-ormerod-to-dual-colour/,

    Thank you dc42, you've been much help to us!

    On a related note, how do we set up the code to run our macros? For example, the main gcode file of what we want to print is inputted through SD card. And then we need to specify when each extruder is going to be operating…how do we do the function/macro call that will run our macro to switch extruders?


  • administrators

    The tool change macros are run automatically when you use T commands in the GCode file to switch tools.



  • @dc42:

    The tool change macros are run automatically when you use T commands in the GCode file to switch tools.

    I aam starting to see now! Thanks so much, I will continue working on this. Sorry if all these questions seem rather basic, it seems all the reading material online is pretty scattered and not directly related to the task at hand that we need to complete. We appreciate the help we have received here! Will check back with an update.



  • @dc42:

    The tool change macros are run automatically when you use T commands in the GCode file to switch tools.

    So I have been researching the tool change macros and, as I understand it, it switches tools and in doing so it switches all the temp controls to the current tool and sort of forgets about the previous tool.

    Since we have 2 syringes, 1 filled with cells and the other filled with structural gel, we need to keep both at the specified temperatures even when the syringe is printing or not. To clarify, we have a stepper motor that is pushing the syringe down instead of a filament.

    Is a tool change what we need? Essentially, as we understand, the gcode should reflect when the other syringe is to be used. Then, when the gcode gets to the part where the other syringe is to be used, we want to pause the print, switch to the other syringe, use the aforementioned slide rack system to rotate the new syringe down (using a stepper in between the 2 syringes), then print that layer and continue to swap/alternate through the whole gcode print file.


  • administrators

    It doesn't forget about the previous tool, it sets the previous tool to its standby temperature. In FDM printing, the standby temperature is normally set a little lower than the normal extrusion temperature to control oozing.


Locked
 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.