Jump to content

Start working with cura engine !


amirps

Recommended Posts

Posted · Start working with cura engine !

Hi ,

I'm developing an automation system for printing object directly from internet .

On the local host side, I need a program that read .STL files from a folder and do the following :

1.Generate G-Code from .stl file.

2.Generate a thumbnail view of model .

3.Estimate the price (I need printing meter,time,grams, like in cura)

:::

printer: Ultimaker .

OS:win 7 .

Experience with c++ and c# (intermediate ).

:::

My questions are :

1-Does CuraEngine provide above mentioned information ?

2-When I generate the G-code does CuraEngine has a routine to send it to the ultimaker ?

3-It's a bit vague for me, for example if we have a 4MB g-code file ,how does it transfer to the device ?

4-is there a help document on CuraEngine ? I dont want to read all the codes and figure it out myself I need to know how to use CuraEngine just to get the above mentioned information :|

thanks in advance :)

 

  • Link to post
    Share on other sites

    Posted · Start working with cura engine !

    The cura engine can transform stl models to G-code. Thats the main function of it all :)

    Depending on the branch that you use, the model is either excepted through pipes, or via a (local) socket. It will use those to return any G-Code it computes. The socket or pipe is also used to recieve settings.

    The engine does not transfer anything to the device. That is the task of the GUI. The engine only accepts models & settings and only returns a set of g-codes.

    All the documentation out there is on the github page or inside Daid's head (and a tiny bit in mine, as it's not my project).

    Your best bet would be to hack into the Cura python code, rip out the graphical stuff and use that to call the engine with the settings & model(s). Cura (Python part) can then send it to the printer.

     

  • Link to post
    Share on other sites

    Posted · Start working with cura engine !

    The cura engine can transform stl models to G-code. Thats the main function of it all :)

    Depending on the branch that you use, the model is either excepted through pipes, or via a (local) socket. It will use those to return any G-Code it computes. The socket or pipe is also used to recieve settings.

    The engine does not transfer anything to the device. That is the task of the GUI. The engine only accepts models & settings and only returns a set of g-codes.

    All the documentation out there is on the github page or inside Daid's head (and a tiny bit in mine, as it's not my project).

    Your best bet would be to hack into the Cura python code, rip out the graphical stuff and use that to call the engine with the settings & model(s). Cura (Python part) can then send it to the printer.

     

    Dear Nallath,

    thanks for your reply, actually after creating this topic ,I start examining the cureEngine and found out that it will only fulfill my first need (Gcode) !

    then I saw in a video(ultimaker-evening video) ,that david said the Cura estimation is not precise he said and I quote "this guess can be off by 20% ",So I write a program that reads a Gcode (that CuraEngine creates) and return some useful parameter such as

     

    • exact head movement during the print

    • total layers of the object

    • 2d plots of head movement in each layer

     

    here is a sample of head movement, it's the first layer of "3D Printable Wrench "

    image.jpg

    to calculate the price ,I need total time as well, but I have some problem calculating the time :

    for example consider these two lines of a Gcode :

     

    
    

    G1 F6000 X30.31 Y106.31 E2303.94952

    G0 F9000 X30.87 Y106.31

    the Gcode says(correct me if I'm wrong) : from point (30.31,106.31) rapidly moves to (30.87,106.31) with the speed of 9000mm per minute, SO

    I calculate the Euclidean distance by :

     

    
    

    distance=sqrt(((PointA(1)-PointB(1)))^2+((PointA(2)-PointB(2))^2));

    which is 0.5600mm for this example ,

    for calculating the time I have

     

    
    

    this_move_time=this_move_distance/9000;

    that gives me 6.2222e-05 min

    I do this for all head movement but it seems that it's wrong!

    for the previous mentioned model Cura give me 2hours/12 minutes

    my code return 1hour/26 minutes

    I would really appreciate your feedback and any comments on this subject :)

     

  • Link to post
    Share on other sites

    Posted · Start working with cura engine !

    You didn't take into account acceleration or jerk settings. These are complicated. For any polygon movement, acceleration is infinite at each vertex unless the head comes to a complete stop. To make it so the head doesn't stop at every vertex there is a "jerk" settting which is not truly "jerk" but instead the maximum instantaneous speed change. This is typically 20mm/sec. So going from 20mm/sec to 0mm/sec is allowed at a vertex. Or going from 10mm/sec in one direction to -10mm/sec an instant later is also allowed. Or at a 90 degree corner, the speed will slow to 14mm/sec (total XY magnitude instantaneous speed change is 20mm/sec on 90 degree corner).

    The latest Cura takes care of this very well and now gives very very good estimates of how long a print will take.

     

  • Link to post
    Share on other sites

    Posted · Start working with cura engine !

    Actually, that video is quite old and the estimate is a lot better these days.

     

    Dear Daid,

    I'm glad that you improved time estimation on Cura :)

    but the problem is I'm writing an app to generate a Gcode using CuraEngine and I have to calculate the time and the price myself ,I don't think it's possible to use cura(I mean your python scripts) in my application to get precise time estimation(or is it ?! ) , so I want some guidance on how to estimate precise time of the print from a single Gcode file ! is it achievable or it's just a far-fetched idea?!

     

  • Link to post
    Share on other sites

    Posted · Start working with cura engine !

    The precise time estimation is in the engine, not the python code.

    https://github.com/Ultimaker/CuraEngine/blob/master/src/gcodeExport.cpp#L388

     

  • Link to post
    Share on other sites

    Posted · Start working with cura engine !

    The precise time estimation is in the engine, not the python code.

    https://github.com/Ultimaker/CuraEngine/blob/master/src/gcodeExport.cpp#L388

     

    wow ,thanks !!! I use -v and get the time !

    (still have problem using config.ini )

    the only problem remaining is how to transfer gcode to the printer ! would you please tell me which script of python code does this task ?

     

  • Link to post
    Share on other sites

    Posted · Start working with cura engine !

    You'll want to look at the Cura/util/machineCom.py

    (The config ini code was contributed. I'm not using it myself, so I have no idea how/if it works)

     

  • Link to post
    Share on other sites

    Posted · Start working with cura engine !

    does this command line gcode sender work with ultimaker ?!

    http://forums.reprap.org/read.php?156,61227

     

  • Link to post
    Share on other sites

    Posted · Start working with cura engine !

    wow ,thanks !!! I use -v and get the time !

    (still have problem using config.ini )

    the only problem remaining is how to transfer gcode to the printer ! would you please tell me which script of python code does this task ?

     

    Could you send the whole command to calculate print time , weight vs ... from STL code with spesific settings ?

    Thanks

     

  • Link to post
    Share on other sites

    Posted · Start working with cura engine !

    Could you send the whole command to calculate print time , weight vs ... from STL code with spesific settings ?

    Thanks

     

    dear Raytrace Nomad,

    I use curaengine.exe in c# here is a code I use to read size and p-time :

     

    
    

    StreamReader myStreamReader = Cura.StandardError;

    string myString = myStreamReader.ReadToEnd();

    foreach (string line in myString.Split('\n'))

    {

    string[] parts = line.Split(':');

    if (parts.Length < 2)

    continue;

    switch (parts[0].Trim())

    {

    case "Size":

    log("Size " + parts[1]);

    break;

    case "Print time":

    log("PTime " + parts[1]);

    break;

    default:

    break;

    }

    }

  • 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.7 stable released
        Cura 5.7 is here and it brings a handy new workflow improvement when using Thingiverse and Cura together, as well as additional capabilities for Method series printers, and a powerful way of sharing print settings using new printer-agnostic project files! Read on to find out about all of these improvements and more. 
         
          • Like
        • 11 replies
      • S-Line Firmware 8.3.0 was released Nov. 20th on the "Latest" firmware branch.
        (Sorry, was out of office when this released)

        This update is for...
        All UltiMaker S series  
        New features
         
        Temperature status. During print preparation, the temperatures of the print cores and build plate will be shown on the display. This gives a better indication of the progress and remaining wait time. Save log files in paused state. It is now possible to save the printer's log files to USB if the currently active print job is paused. Previously, the Dump logs to USB option was only enabled if the printer was in idle state. Confirm print removal via Digital Factory. If the printer is connected to the Digital Factory, it is now possible to confirm the removal of a previous print job via the Digital Factory interface. This is useful in situations where the build plate is clear, but the operator forgot to select Confirm removal on the printer’s display. Visit this page for more information about this feature.
          • Like
        • 0 replies
    ×
    ×
    • Create New...