Jump to content

UM S5 API: Amount of filament used by print job?


Recommended Posts

Posted · UM S5 API: Amount of filament used by print job?

Hello,

I'm trying to write a script that automatically calculates the cost of every job printed by our machine, but I find it rather difficult.

Is there really no direct way to read via API how much material is used during a print job?

 

 

  • Link to post
    Share on other sites

    Posted · UM S5 API: Amount of filament used by print job?

    Hello

    as far as I know, no, because the printer doesn't know or don't take care about how much material will be used or is actually used. You can only take the values after slicing in Cura and put in in a script or Excel to calculate your printing costs. 

     

    I have done this with an Excel sheet and I took various other values into account, like printing time and so on. I find it better to know (or to tell the customer) how much his model costs before printing, so the customer can decide which quality he wants to have and such things.

  • Link to post
    Share on other sites

    Posted · UM S5 API: Amount of filament used by print job?

    That is a pity.

     

    I use Cura & Excel as well when I'm printing as a service. We are a Maker Space though, so most of the time people are launching their own jobs and we charge them afterwards for used filament + print time.

    It would be really cool to be able to see how much material has been used - until now we were only printing on an UM2+ and only with PLA, stopping time and charging a fee per hour that, on the average, covers our material expenses. For the UM5 with its variety of cheap and expensive materials I want a fairer (and yet automated) approach.

     

    Since the Ultimaker keeps count on the length of filament left on a spool, and there is an overall material statistics (but not per print job) on the web interface, it should actually know how much material it has used during a print?

     

    If not: is this a feature I (and for sure other people as well) could realistically ask for a Christmas present? 🙂

  • Link to post
    Share on other sites

    Posted · UM S5 API: Amount of filament used by print job?

    I guess you have already found the API documentation of the printer? 

    http://<YOUR_IP>/docs/api

     

    But I checked it now, and could not find any useful information you are looking for.

    The UM counts the length only for UM spools with NFC chip, all other spools are not counted.

     

    The S5 has a history of previous prints, but unfortunately, there is only the print time shown, but no material usage.

  • Link to post
    Share on other sites

    Posted · UM S5 API: Amount of filament used by print job?
    14 hours ago, Smithy said:

    as far as I know, no, because the printer doesn't know or don't take care about how much material will be used or is actually used. You can only take the values after slicing in Cura and put in in a script or Excel to calculate your printing costs. 

     

    I have done this with an Excel sheet and I took various other values into account, like printing time and so on. I find it better to know (or to tell the customer) how much his model costs before printing, so the customer can decide which quality he wants to have and such things.

     

    This is not true. The machine does know and it also cares. This is especially the case if you have a filament flow sensor & nfc spools. That way we can actually track the amount of material used and if the job needs more than there is material left.

     

    Cura Connect 5.1>, for instance, has an analytics page that shows you these kinds of nifty things (eg; the material used per type for the cluster and the like)

    • Thanks 1
    Link to post
    Share on other sites

    Posted · UM S5 API: Amount of filament used by print job?

    Thanks, @nallath for the clarification, but we cannot use the information via the API currently, it is just an internal information, right? It would be great if the history would also have the information about the material and if all history information is available via the API. 

     

    @walterw

     

    But check the analytics page, nallath mentioned, maybe that helps for your maker space.

  • Link to post
    Share on other sites

    Posted · UM S5 API: Amount of filament used by print job?

    @Smithy I have found the analytics page, that's why I assumed that the Ultimaker does in fact know how much material has been used. But I can't access that information through the API, or at least I could not find out how to do it. And even if I did I'd need to save the current amount of every material after each job and calculate the differences.

    @nallath, are there any plans to make these values, that is: both Cura Connect Analysis data, and the amount of material used by each print job, accessible by API in a future firmware version?

    Thank you

  • Link to post
    Share on other sites

    Posted (edited) · UM S5 API: Amount of filament used by print job?

    It's already accessible. See http://{ip}/cluster-api/v1/ for the documentation of the cura-connect API documentation. Using http://{ip}/cluster-api/v1/print_jobs/history should get you what you need.

     

    On the bottom of the analytics page, there is also a link that allows you to download the data as a CSV.

    As for the things that are exposed by means of the API; Everything the CuraConnect webpage does is exposed by means of an API. It's the only way for the front-end to actually tell the machine what needs to be done.

    Edited by nallath
    Added extra info
    • Thanks 1
    Link to post
    Share on other sites

    Posted · UM S5 API: Amount of filament used by print job?

    Wow, great news! Thanks nallath!

  • Link to post
    Share on other sites

    Posted · UM S5 API: Amount of filament used by print job?

    Oh yes it does, thank you very much @nallath. Exactly what I need

    What is the material amount's unit? mm?

     

    PS, can it be that there is a bug in the api?

    http://xx/api/v1/materials/<guid> gives me 404 even when I try the guids I get from http://xx/api/v1/materials

  • Link to post
    Share on other sites

    Posted · UM S5 API: Amount of filament used by print job?

    You found a bug in the documentation.

    Correct is: http://xx/api/v1/materials/<guid>

    but the documentation web page adds an extra '/' at the end. Remove that and it works.

     

    I created a ticket to have the documentation fixed.

  • Link to post
    Share on other sites

    Posted · UM S5 API: Amount of filament used by print job?

    Oh, right! Thanks @CarloK

  • Link to post
    Share on other sites

    Posted · UM S5 API: Amount of filament used by print job?

    @nallath, there is one little flaw (for my use case) with getting the material amount from http://{ip}/cluster-api/v1/print_jobs/history.

    The "job_material_amount_{x}"-fields show the material used if you don't cancel the print, is that correct?

    By the way, what unit is this? mm³?

     

    I've also tried to get the difference of the values in http://{ip}/api/v1/printer/heads/0/extruders/{x}/statistics/material_extruded.

    But the values are rather low. Is this the same unit as the value in http://{ip}/cluster-api/v1/print_jobs/history (if the job is concluded)?

     

    It would be really cool if the printer would store the real extruded values in http://{ip}/api/v1/print_jobs/history (printer, not cluster log) - the fields are there, but they are always 0.

     

    PS: I've encountered a bug in Cura Connect. I've cancelled a job (because of a non adhering print), skipped cooldown, tried to avoid losing time by quickly extracting the piece (no problem as it didn't adhere) and immediately re-started the job. It was successful -  but does not appear in the log of completed jobs! Only the failed one with print time of 22 minutes (instead of 3 hours).

     

  • Link to post
    Share on other sites

    Posted · UM S5 API: Amount of filament used by print job?

    Currently, it shows the material of the job as a whole, so not what it actually used.

     

    As for aborting a print, those should show up in the history (That's also how it keeps track of the completion rate in the dashboard).

     

    If I remember correctly, the unit in for the material extruded is mm3

  • Link to post
    Share on other sites

    Posted · UM S5 API: Amount of filament used by print job?

    "material_extruded" as reported in the printhead api is in mm

    Cura Connects reports the material amount as mm3.

  • 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...