Total Filament Used Calc Incorrect?

A pre-assembled Delta Printer that can print a 6" cube 8" tall!
Post Reply
RocketMagnet
Printmaster!
Posts: 169
Joined: Sun Sep 14, 2014 3:22 pm

Total Filament Used Calc Incorrect?

Post by RocketMagnet »

I was intending to check filament density whenever I started a new roll and perhaps periodically (especially from different suppliers) but when I use the Total Filament Used" ***.* Meters value the density I get out isn't correct according to the MSDS I've got for my filament.

MSDS says Density = 1.05 g/cm3 (http://3dfilaprint.com/abs-data-sheet/)

I know the weight of filament printed as I weighed a number of objects +skirts etc, I know the thickness of my filament (1.80mm consistent measurement) and used the difference in Meters printed but it's coming out about 0.57 to 0.60 g/cm3.

Clearly as I can measure the other variables it brings into question the "Total Filament Used" Value my Orion is calculating.

I've looked through the Repetier Code and have found a number of references and I can see the calculation it does when it's writing the total filament printed distance to the eprom(seems to add on the latest filamentPrinted X 0.001 to the sum total so far... but I don't know how it's calculating filamentPrinted in Printer.cpp or elsewhere (Static Variables)... seems to define the static variable then set it to zero later so must be somewhere else.

Any help much appreciated, I dug around the code but it's distributed over numerous tabs with lots of Static (global) variables so its hard to follow.. for me anyways as im no coder and maybe im missing the obvious.
Polygonhell
ULTIMATE 3D JEDI
Posts: 2430
Joined: Mon Mar 26, 2012 1:44 pm
Location: Redmond WA

Re: Total Filament Used Calc Incorrect?

Post by Polygonhell »

It's updated here

Code: Select all

void PrintLine::queueDeltaMove(uint8_t check_endstops,uint8_t pathOptimize, uint8_t softEndstop)
{
    //if (softEndstop && Printer::destinationSteps[Z_AXIS] < 0) Printer::destinationSteps[Z_AXIS] = 0; // now constrained at entry level including cylinder test
    long difference[NUM_AXIS];
    float axis_diff[5]; // Axis movement in mm. Virtual axis in 4;
    for(uint8_t axis = 0; axis < NUM_AXIS; axis++)
    {
        difference[axis] = Printer::destinationSteps[axis] - Printer::currentPositionSteps[axis];
        if(axis == E_AXIS && Printer::extrudeMultiply != 100)
            difference[E_AXIS] = (long)((difference[E_AXIS] * (float)Printer::extrudeMultiply) * 0.01f);
        axis_diff[axis] = fabs(difference[axis] * Printer::invAxisStepsPerMM[axis]);
    }
    Printer::filamentPrinted += axis_diff[E_AXIS];
Basically it's converting steps to mm and just keeping count of the total in mm.

However it only updates the values in EEPROM at the point where the last hotend or bed temperature is set to 0, i.e. usually at the end of a print, so if you turn off the power, hit the reset switch or disconnect/reconnect the host without setting the temperature to 0 the total printed filament is lost.

It also always rounds down so so it will under measure.
RocketMagnet
Printmaster!
Posts: 169
Joined: Sun Sep 14, 2014 3:22 pm

Re: Total Filament Used Calc Incorrect?

Post by RocketMagnet »

Hi thanks for the reply and yes the code seems to make sense, as far as I can tell it's simply taking the feed stepper motor "feed forward" and any flow multiplier but im not sure if its accounting for retractions.. must be though.
I seen it was converting mm to m as it writes to the Eeprom but couldn't find the code you highlighted as I searched each tab.. must have missed that tab :).

I was wondering the "when" and frequency it updated, I must be confused how it's writing to the Eeprom as you can watch the Total Filament used value tick up as your printing on the orion (not a the end of the print) and I thought the value it displayed on the Orion display was being read directly from the Eeprom but if it only writes this to the Eeprom at the end then im wrong in this.

However if it under reads buy not recording filament used (with cancel, turning it off etc) then this would result in a higher than actual Density (>1.05 g/cm3) not lower as I'm seeing.

Anyway I've done some testing and the mm or m fed looks to be incorrect by quite a large margin.

Sliced a file in Repetier using Slicer and it predicted "Filament Needed" as 1872mm = 187.2cm
Printed out an object and including the Skirt it miraculously came to exactly 5.0g..
Filament Diameter = 1.8mm => Radius = 0.9mm = 0.09cm
So: Volume of filament used = 3.14159 x 0.09^2 x 187.2 = 4.76cm3
D=M/V = 5.0/4.76 = 1.05 g/cm3 this matches exactly with the MSDS of the ABS I have @ 1.05 g/cm3.

According to the Orion Filament used:
Start 360.6m ; Final 364.8m = 4.2m = 420cm
So Volume of filament used = 3.14159 x 0.09^2 x 420 = 10.69cm3
D=M/V = 5/10.69 = 0.47 g/cm3 when MSDS is 1.05 g/cm3.

So yeah looks like something isn't quite correct with the calculation somewhere?

Still I've got exactly what I need with repetier software calculating the filament correctly (absolutely bang on by the looks of it) and I can
easily check the density of any filament I buy so no worries.
Post Reply

Return to “ORION”