Jump to content

Recommended Posts

Posted (edited) · ULTIMAKER S5 G-CODE EDITORS

Hello,

 

I have an Ultimaker s5 and I intend to modify the g-code in real time(while it is printing).I firstly want to know if it is possible at all.I'm aware that it is not possible with Cura. If this is possible, can anyone suggest any other way to do that?

 

Thanks in advance!

Edited by jkashyap16
  • Link to post
    Share on other sites

    Posted · ULTIMAKER S5 G-CODE EDITORS

    In theory, sure it is possible. In the S5, there's a Linux board that hosts Cura Connect and Ultimately sends gcode to a Marlin-based printer controller board. If you enable the developer mode, you can SSH into the Linux board, and though the code that lives there is not open source it is mostly Python and can be edited.

     

    In practice? At best you'll end up with a working edited firmware, and you will have to make your changes/additions again and again when new firmware is released.

  • Link to post
    Share on other sites

    • 4 years later...
    Posted · ULTIMAKER S5 G-CODE EDITORS

     

    Hi Aoeben,

    I was going through one of your suggestions

    “If you enable the developer mode, you can SSH into the Linux board, and though the code that lives there is not open source it is mostly Python and can be edited.“

     

    Can you please tell me how to change the gcode in Ultimaker S5 in real time. I am already in developer mode.

    Thank you so much.

    I really appreciate your help.

  • Link to post
    Share on other sites

    Posted · ULTIMAKER S5 G-CODE EDITORS

    If you aren't a programmer you shouldn't do this.  If you still want to and you've never written a program in your life then start with a course on Python.  You don't need to spend an entire semester learning python - you can learn enough in just 40 hours of taking an online course.  A good course should be fun.  (I'm getting off topic)

     

    Most programmers already know what SSH is and Linux is (but not all) and would know how to get started.

     

    I guess you should just explain your experience with linux and programming and where you got stuck and maybe you should explain what your needs are as we can probably find a much simpler solution for you.

     

    For example did you know that you can easily write a post processor plugin  in cura and change the gcode during/after the slicing process?

  • Link to post
    Share on other sites

    Posted · ULTIMAKER S5 G-CODE EDITORS
    2 hours ago, Abdur said:

    Can you please tell me how to change the gcode in Ultimaker S5 in real time. I am already in developer mode.

    Thank you so much.

    You'd need to be a damn fast typist to edit gcode instructions in real time. Even a simple print will be thousands of lines and even if you're printing as slow as I am right now (which you're almost certainly not; 10mm/s speed, 10mm/s² acceleration, jerk 0.2mm/s) each one is only going to take a fraction of a second to run.

     

    As @gr5 said, there's almost certainly a much easier way to achieve whatever it is you want to do. And if there isn't, that's probably because it's not possible at all.

  • Link to post
    Share on other sites

    Posted · ULTIMAKER S5 G-CODE EDITORS

    Hi Assistant Moderator, I am doing a project where I need to capture images as each layer of my print, I am trying to move the print head slightly and hold there for few secs (say 5) to enable image capturing... Can you please suggest me how to do that either using Cura or if there any other method to do so.. Thank you

  • Link to post
    Share on other sites

    Posted · ULTIMAKER S5 G-CODE EDITORS
    1 hour ago, gr5 said:

    If you aren't a programmer you shouldn't do this.  If you still want to and you've never written a program in your life then start with a course on Python.  You don't need to spend an entire semester learning python - you can learn enough in just 40 hours of taking an online course.  A good course should be fun.  (I'm getting off topic)

     

    Most programmers already know what SSH is and Linux is (but not all) and would know how to get started.

     

    I guess you should just explain your experience with linux and programming and where you got stuck and maybe you should explain what your needs are as we can probably find a much simpler solution for you.

     

    For example did you know that you can easily write a post processor plugin  in cura and change the gcode during/after the slicing process?

    Hi Gr5 thanks for your suggestion... I am familiar with python... and at the moment I have code that can automatically add gcodes at each layer to move the print head slightly however, the gcode seems to be not executing properly. Can you suggets me how to add a custome gcode to do the following...1. Move the print head from current position to a specific position 2. hold there for some time (5sec say)  3. bring the print head back to previous position and repeat the same ..I am looking for some gcode to do so... Thanks 

  • Link to post
    Share on other sites

    Posted · ULTIMAKER S5 G-CODE EDITORS
    4 minutes ago, Abdur said:

    1. Move the print head from current position to a specific position 2. hold there for some time (5sec say)  3. bring the print head back to previous position and repeat the same ..I am looking for some gcode to do so... Thanks 

    This is exactly what post-processors are for. And this would be a relatively easy one.

     

    All you'd need to do would be to iterate through all the lines in each layer, storing the position of the most recent G0/G1 move (just filter out the G1 commands which only have an E parameter) and at the end of each layer insert:

    G0 X20 Y20 ; Move to X 20, Y 20 (replace with your own co-ordinates)
    G4 S5 ; Wait for 5 seconds
    G0 X<last X> Y<last Y> ; In your code put the values from the last movement command here

    If you know Python already you should be able to pick up the structure of a post-processor just by looking at the included ones. Just be a bit wary that the JSON parser in Cura can be a bit picky if your spacing isn't correct and isn't forgiving of unnecessary separators, but you won't have to worry about that too much if you don't mind hard-coding the settings instead of letting you set them in the Cura post-processing scripts window.

    • Like 1
    Link to post
    Share on other sites

    Posted · ULTIMAKER S5 G-CODE EDITORS

    Look at one of the very simple existing post processors - for example there is one that adds a gcode at layer height - called something like "mod at layer height" or something similar.  Maybe it's "tweak at Z"?  Click on the marketplace icon in the top right and install that.  Look at the added python file.  It's probably 10 lines of code and 30 lines of comments.  Easy reading.

     

    Having said all that, octoprint I think will do what you want.  Assuming you don't have an Ultimaker printer - most printers work with octoprint.  Maybe even some UM printers as well?  Octoprint has an option where it moves the head to the side and can even trigger a camera.

     

    You want something like 

    G0 X0 Y0      (move head to position 0,0)  Maybe do it on the first retraction move after layer change.  retraction moves either are shown as G10,G11 (ultimaker only?) or the E value decreases instead of increases.  Either is easy to spot with python code.

     

    Layer changes are obvious if you look at the comments in any cura generated gcode.  Search for "layer" in the gcode.

  • Link to post
    Share on other sites

    Posted · ULTIMAKER S5 G-CODE EDITORS
    4 hours ago, Abdur said:

    I am doing a project

    I'm guseeing this is a programming class and we are helping the poster complete an assignment. Otherwise I assume OP would already have stumbled on one of the many options for timelapse control. 

  • Link to post
    Share on other sites

    Posted (edited) · ULTIMAKER S5 G-CODE EDITORS
    21 hours ago, gr5 said:

    retraction moves either are shown as G10,G11 (ultimaker only?) or the E value decreases instead of increases

    G10 and G11 are in the Marlin specifications as retract and unretract commands, but I've never seen Cura use them, possibly because they use the printer's firmware's settings for retraction (which you can change easily enough with an M207) rather than what's set in Cura and it's easier just to get Cura to do a G1 E<previous value - retraction length>

    Edited by Slashee_the_Cow
    gr5 points out when I post when I'm tired
  • Link to post
    Share on other sites

    Posted · ULTIMAKER S5 G-CODE EDITORS
    13 hours ago, Slashee_the_Cow said:

    G10 and G11 are in the Marlin specifications as retract and unretract commands, but I've never seen Cura use them, possibly because they use the printer's firmware's settings for retraction (which you can change easily enough with an M207) rather than what's set in Cura and it's easier just to get Cura to do a G1 E<previous value - extrusion length>

    "- retraction length" but yes.

     

    However I believe abdur has an S5 (hover over his icon) and I believe the S5 uses G10 and G11.  It's pretty rare to use those gcodes but I think that's what the S5 uses.  I'm not sure.  Maybe only the UM2 uses those.

     

    By the way abdur, the S5 uses a "ufp" file.  To view or edit the gcode in it you can simply rename that to "zip", unzip it and there will be a file with the extension "gcode" in there somewhere which you can edit, rezip and rename back to ufp.

     

    But if you do a post processor you don't have to worry about that.

  • Link to post
    Share on other sites

    Posted · ULTIMAKER S5 G-CODE EDITORS
    Just now, gr5 said:

    "- retraction length" but yes.

     

    However I believe abdur has an S5 (hover over his icon) and I believe the S5 uses G10 and G11.  It's pretty rare to use those gcodes but I think that's what the S5 uses.  I'm not sure.  Maybe only the UM2 uses those.

     

    By the way abdur, the S5 uses a "ufp" file.  To view or edit the gcode in it you can simply rename that to "zip", unzip it and there will be a file with the extension "gcode" in there somewhere which you can edit, rezip and rename back to ufp.

     

    But if you do a post processor you don't have to worry about that.

    Thanks Gr5. regarding the .ufp file I can save the file dircetly as .gcode in the cura slices (save to disk as gcode).

    Yes ... I do have an ultimaker S5 

    got moving the print head G0/G1 works  as mentioned by Slashee_the_Cow.

     

    Can anyone suggest me what G code enables me to extrude some filament before starting the print.

    Thank you

  • Link to post
    Share on other sites

    Posted · ULTIMAKER S5 G-CODE EDITORS
    2 minutes ago, Abdur said:

    Can anyone suggest me what G code enables me to extrude some filament before starting the print.

    Thank you

    G1 (or G0 works, but it's considered bad practice), but why do you need to extrude before starting the print? The startup gcode for the printer should handle everything that needs to be done.

  • Link to post
    Share on other sites

    Posted · ULTIMAKER S5 G-CODE EDITORS
    32 minutes ago, Abdur said:

    Can anyone suggest me what G code enables me to extrude some filament before starting the print.

    what slashee says.  I wouldn't mess with this.  The printer should do it.  Now if you create a gcode file it might not do it but I've never tried that.  The printer should handle all that.

     

    There are 4 steppers for the 4 (not 3!!!!) axes: X Y Z E.  You move the 4 steppers with G0 or G1 (no difference between the 2 on the S5 or any printer I know of).  Extruding means moving the E axis forwards.  So it's the same command for moving the X,Y,Z axes.

     

    There are also "relative moves" where if you do G0 X1 it moves forward 1mm.  You can switch between the modes.  So switch to relative mode, move the E axis forward and then switch back.  Lookup the gcodes for this.  Also you need to set the feedrate (F gcode) which is in mm/minute instead of mm/second.

     

    Here are the gcodes - S5 (and most printers) use Marlin so make sure any gcodes you use are supported by Marlin:

    https://reprap.org/wiki/G-code

     

  • Link to post
    Share on other sites

    Posted · ULTIMAKER S5 G-CODE EDITORS

    Maybe I wasn't clear but the UM2 printers take two different styles of gcode files - one of which you explicitly tell the printer to warm up and extrude using "start" gcodes at the begining.  The other style of gcode files you don't have to do that at all and the printer just does it automatically (no gcodes needed for that warmup and active leveling, etc).

     

    I don't know about the S5 (even though I use one almost daily) - I don't know if the warmup and initial extrude are built into the printer firmware (most likely) or if they are done by cura in the gcode.  I expect the former method.  Meaning if you try to do that yourself in gcodes it might not work right.

  • Link to post
    Share on other sites

    Posted · ULTIMAKER S5 G-CODE EDITORS
    27 minutes ago, gr5 said:

    You move the 4 steppers with G0 or G1 (no difference between the 2 on the S5 or any printer I know of).

    They're exactly the same. But convention is to use G1 for extrusion moves and G0 for travel moves. Not only does it make the code easier to read, but since Marlin is used for a lot of CNC things (not just 3D printers) it really comes in handy with things like laser cutters/markers and engraving machines, since they don't have an extruder it's easier just to make any move with it turned on a G1.

  • Link to post
    Share on other sites

    Posted · ULTIMAKER S5 G-CODE EDITORS

     Thank you ...

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • UltiMaker Cura 5.9 stable released!
        Here comes Cura 5.9 and in this stable release we have lots of material and printer profiles for UltiMaker printers, including the newly released Sketch Sprint. Additionally, scarf seams have been introduced alongside even more print settings and improvements.  Check out the rest of this article to find out the details on all of that and more
          • Like
        • 5 replies
      • Introducing the UltiMaker Factor 4
        We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
          • Heart
          • Thanks
          • Like
        • 4 replies
    ×
    ×
    • Create New...