Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Non-Linear Extrusion

    Scheduled Pinned Locked Moved
    Tuning and tweaking
    7
    22
    6.9k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Alexander Mundyundefined
      Alexander Mundy
      last edited by

      Can someone double check my math? Using this modified macro with M592 D0 A0 B0

      Non-linear extrusion script from Duet forum. Used to adjust A and B parameters in M592.
      ;
      G28
      G1 X0 Y0 Z100 F5000
      M83
      G1 E5 F600
      M400
      M291 S3 R"Extrusion test" P"Press OK to start test"
      
      G1 X100 E100 F60
      M400
      M291 S3 R"Measure extrusion" P"Measure filament taken at 1mm/sec extrusion, then press OK"
      
      G1 X0 E100 F120
      M400
      M291 S3 R"Measure extrusion" P"Measure filament taken at 2mm/sec extrusion, then press OK"
      
      G1 X100 E100 F180
      M400
      M291 S3 R"Measure extrusion" P"Measure filament taken at 3mm/sec extrusion, then press OK"
      
      G1 X0 E100 F240
      M400
      M291 S3 R"Measure extrusion" P"Measure filament taken at 4mm/sec extrusion, then press OK"
      
      G1 X100 E100 F300
      M400
      M291 S3 R"Measure extrusion" P"Measure filament taken at 5mm/sec extrusion, then press OK"
      
      G1 X0 E100 F360
      M400
      M291 S3 R"Measure extrusion" P"Measure filament taken at 6mm/sec extrusion, then press OK"
      
      G28
      

      I get the following with PETG:
      1mm/s = 98.9mm
      2mm/s = 97.1mm
      3mm/s = 94.5mm
      4mm/s = 92mm
      5mm/s = 88mm
      6mm/s = 82mm

      So I come up with

      M592 D0 A-0.0593 B0.475
      

      Running the macro again:

      1mm/s = aprox 118mm (went too far to measure accurately)
      2mm/s = (Again too far to measure)
      3mm/s = 111.8mm
      4mm/s = 107.5mm
      5mm/s = 101.7mm
      6mm/s = 95.7mm

      So obviously my math is flawed or it isn't working correctly.

      I am using a Nimble Extruder with 2660 steps/mm

      Firmware Name: RepRapFirmware for Duet 2 WiFi/Ethernet
      Firmware Electronics: Duet WiFi 1.0 or 1.01
      Firmware Version: 2.01beta2(RTOS) (2018-07-14b5)
      WiFi Server Version: 1.21
      Web Interface Version: 1.21.2-b2

      ;Zesty Nimble PETG
      
      ; Communication and general
      M111 S0                                 ; Debug off
      M550 K250                		; Machine name and Netbios name (can be anything you like)
      M540 P0xBE:0xEF:0xDE:0xAD:0xFE:0xEF     ; MAC Address
      
      ;*** Wifi Networking
      M552 S1            			;  Enable WiFi
      
      M555 P2                               	; Set output to look like Marlin
      
      M575 P1 B57600 S1            		; Comms parameters for PanelDue
      
      G21                                     ; Work in millimetres
      G90                                    	; Send absolute coordinates...
      M83                                 	; ...but relative extruder moves
      
      ; Axis and motor configuration
      M569 P0 S1      	; Drive 0
      M569 P1 S1     		; Drive 1
      M569 P2 S1      	; Drive 2
      M569 P3 S0            	; Drive 3
      M569 P4 S1            	; Drive 4
      M574 X2 Y2 Z2 S1 	; set endstop configuration 
      			; (all endstops at high end, active high)
      
      ; delta radius, diagonal rod length, printable radius and homed height
      M665 R169.784 L330.0 B120 H559.049 X0.079 Y-0.271 Z0.000
      
      M666 X0.69 Y-0.26 Z-0.43            ; endstop adjustments
      M350 X16 Y16 Z16 I1                ; Stepper mode (I1 only works with 16)
      M92 X160 Y160 Z160                 ; Set axis steps/mm
      M906 X1000 Y1000 Z1000 E500        ; Set motor currents (mA)
      M201 X1000 Y1000 Z1000 E120        ; Accelerations (mm/s^2)
      M203 X30000 Y30000 Z30000 E1000    ; Maximum speeds (mm/min)
      M566 X600 Y600 Z600 E40            ; Maximum instant speed changes mm/minute (Jerk)
      
      ; Fans
      M106 P1 T50 S255 H1     	; hotend heatsink FAN1
      M106 P2 T50 S35 H1        	; extruder motor FAN2
      
      ; Thermistors
      M305 P0 T100000 B3950 R4700 ;L54 H-97    ; Bed thermistor ADC correction
      M305 P1 T100000 B4388 R4700 ;L54 H-97    ; First nozzle thermistor ADC correction
      
      M143 S285 	; set the maximum temperature of the hot-end to 285°C
      M143 H0 S120 	; set the maximum bed temperature to 120C
      
      M570 H0 P5 T10 	;Hnnn Heater number H0 is bed, H1 is 1st hot end
      M570 H1 P5 T10 	;Pnnn Time in seconds for which a temperature anomaly must persist 
                     	;on this heater before raising a heater fault (default 5 seconds)
                     	;Tnnn Permitted temperature excursion from the setpoint for this heater 			;(default 10C)
      
      ; PID / B1 = bit bang B0 = PID
      M307 H0 A180.3 C557.9 D2.5 B0		; Bed
      M307 H1 A617.2 C254 D4.5 B0		; Hot End 1
      
      ; Tool definitions
      M563 P0 D0 H1                           ; Define tool 0
      G10 P0 S0 R0                            ; Set tool 0 operating and standby temperatures
      M92 E2660                               ; Set extruder steps per mm (PETG)
      M350 E16 I1                             ; Stepper mode (I1 only works with 16)
      ;M572 D0 S0.04			   	; Pressure advance non Kisslicer
      M572 D0 S0.0				; No Pressure advance with Kisslicer
      
      ; Z probe and compensation definition
      M558 P4 X0 Y0 Z0 H3 I0    	; Z probe is a switch and is not used for homing any axes
      G31 X0 Y0 Z-0.08  P500           ; Z value is trigger point, so a -Z closer to 0 = more smooshed
      M556 S78 X0 Y0 Z0               ; Axis compensation here
      M557 R75 S20			; Define Grid For Mesh Height
      
      M592 D0 A-0.0593 B0.475	; Non Linear Extrusion Orange PETG 230C
      
      M208 S1 Z-0.25        		; set minimum Z
      T0                    		; select first hot end
      
      1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators
        last edited by dc42

        M592 D0 A-0.0593 B0.475

        If your extruder behaves anything like mine, then the A value should never need to be negative, and the B value should be much smaller than you have it.

        Duet WiFi hardware designer and firmware engineer
        Please do not ask me for Duet support via PM or email, use the forum
        http://www.escher3d.com, https://miscsolutions.wordpress.com

        1 Reply Last reply Reply Quote 0
        • Alexander Mundyundefined
          Alexander Mundy
          last edited by

          Obviously I was plotting the wrong data.
          What do I need to plot and find the trend line for?
          Perhaps the additional amount needed like so?

          0_1531793258656_Spreadsheet.JPG

          OBELIKSundefined 1 Reply Last reply Reply Quote 0
          • DocTruckerundefined
            DocTrucker
            last edited by DocTrucker

            Last time I ran the correction I calibrated my extruder steps per mm at 1mm/s. That would bring your first value to 0 correction which may effect the results the spreadsheet software gives. It shouldn't in an ideal world as the curve remanis the same, just altering the point at which the y-axis of the graph crosses the plot.

            Edit: Sorry missed last post. Yes, you are plotting the additional correction required. So if you need to multiply your current extrusion by 1.2 for a specific speed the the value you'd plot would be 0.2.

            Running 3 P3Steel with Duet 2. Duet 3 on the shelf looking for a suitable machine. One first generation Duet in a Logo/Turtle style robot!

            1 Reply Last reply Reply Quote 0
            • OBELIKSundefined
              OBELIKS @Alexander Mundy
              last edited by

              @alexander-mundy
              If you multiply 98,9 * 1,011122346 you get 100, so this is correct.
              Also if you look at the formula for M592 1 + min(L, Av + Bv^2), you can see that you get that exactly.

              P3Steel Toolson mk2 - Duet 2 WiFi --> RatRig V-Core with Duet WiFi 1.03
              Original Prusa i3 MK3S

              1 Reply Last reply Reply Quote 0
              • Alexander Mundyundefined
                Alexander Mundy
                last edited by

                Thanks guys, cleared A & B and corrected my steps/mm to give correct extrusion at 1mm/s and ran the 100mm macro and the trend line gave A=0.0088 and B=0.0022 so I used those values and got the following results

                0_1531857408816_Corrected values.JPG

                After thinking about this for a bit it made me wonder if the correction should be recursive since you are not actually going to get the corrected amount but the corrected amount minus a % under due to the effect it is correcting? Anyway I don't have more time right now to mess with it but will mull that over.

                1 Reply Last reply Reply Quote 0
                • DocTruckerundefined
                  DocTrucker
                  last edited by DocTrucker

                  Yes I gree with that. While you have got data points for the right amount of extrusion it is not necessarily at the right speed. Or at least that was the case the way I did it.

                  I'll check mine next time around but at the moment this needs to be with the head moving so non-linear extrusion is used. Be aware that with these moves the feed rate is soley referring to the motion axis and the extrusion is paced to complete within the move.

                  Other option is to alter the extrusion amount at each speed amount until you get a target extrusion length and calculate the required correction from that, rather than calculating the correction required to reach the target. Guess this would be more accurate.

                  Running 3 P3Steel with Duet 2. Duet 3 on the shelf looking for a suitable machine. One first generation Duet in a Logo/Turtle style robot!

                  1 Reply Last reply Reply Quote 0
                  • Alexander Mundyundefined
                    Alexander Mundy
                    last edited by

                    I made a recursive spreadsheet that sums 6 iterations (yes way overkill, 3 would probably be sufficient) and set A & B back to 0 and started from scratch. The real life results are very good and probably within my measuring tolerance. Since there isn't a "c" in M592 I also had the spreadsheet correct the steps/mm based on the average of the real life results with M592 values in place.
                    0_1531946305284_Spreadsheet.JPG

                    Phaedruxundefined 1 Reply Last reply Reply Quote 0
                    • Phaedruxundefined
                      Phaedrux Moderator @Alexander Mundy
                      last edited by

                      @alexander-mundy That's great. Could you share your excel file?

                      I don't suppose you could post a picture of an actual extrusion pattern before and after the calibration to show the under extrusion at higher speeds and the corrected extrusion afterwards?

                      Z-Bot CoreXY Build | Thingiverse Profile

                      1 Reply Last reply Reply Quote 0
                      • Alexander Mundyundefined
                        Alexander Mundy
                        last edited by Alexander Mundy

                        Edit (Here was the wrong results I removed)

                        If this works, here is the spreadsheet

                        0_1531949228706_M592 Spreadsheet.xlsx

                        1 Reply Last reply Reply Quote 2
                        • Alexander Mundyundefined
                          Alexander Mundy
                          last edited by Alexander Mundy

                          Actually that was the correct results.

                          Here is a non recursive

                          0_1531949549094_Spreadsheet2.JPG

                          And the real world results from the non recursive

                          0_1531949579434_Corrected values.JPG

                          Note that I dropped the 6mm/s from the newest one because I think I might have been getting some lost steps at that speed and I hadn't corrected steps/mm to extrude correctly at 1mm/s

                          1 Reply Last reply Reply Quote 0
                          • Alex.crundefined Alex.cr referenced this topic
                          • Alex.crundefined Alex.cr referenced this topic
                          • Alex.crundefined Alex.cr referenced this topic
                          • Alex.crundefined Alex.cr referenced this topic
                          • mrmkwundefined mrmkw referenced this topic
                          • mrmkwundefined mrmkw referenced this topic
                          • mrmkwundefined mrmkw referenced this topic
                          • First post
                            Last post
                          Unless otherwise noted, all forum content is licensed under CC-BY-SA