origin inverts when trying to print twice in a row



  • I'm experiencing a weird error. After I print something, if I try to print again, my extruder goes to the opposite corner. Its like the origin gets inverted. I let it keep running once when I was trying to print an object near the origin to see what would happen and it ended up crashing in the x max y max corner. It doesn't matter if I try to print the same object or a different one or home my printer before starting the second print. I have even tried to press stop on the printer, homing and starting a second print. The only thing that works is to power cycle the board.

    I'm stumped on this. Anyone have any ideas on how to fix it?

    Printer info:
    My Duet WIFI is from the first production run
    custom CoreXY with a rectangular bed

    Firmware electronics Duet WiFi 1.0
    RepRapFirmware version 2.02
    WiFi server version 1.23
    Web Interface version 1.22.6

    I'm using Cura 15.04

    start code
    G21 ; metric values
    G90 ; absolute Positioning
    M82 ; set extruder to relative mode
    M107 ; start with the fan off
    G28 X0 Y0 ; home x and y axis
    G29 S1 ; load heightmap
    G1 Z50.0 F{travel_speed} ; move the platform down 50mm
    G92 E0 ; zero the extruded length
    G1 F200 E40 ; extrude 40mm of feed stock
    G92 E0 ; zero the extruded length again
    G1 F{travel_speed}
    M117 Printing... ; Put printing message on LCD screen

    end code

    G90 ; absolute positioning
    G1 Z50 ; move down 50mm
    M104 S0 ; extruder heater off
    M140 S0 ; heated bed heater off (if you have it)
    G28 X0 Y0 ; home x and y axis
    M84 ; turn off motors



    my configuration file

    ; Configuration file for Duet WiFi (firmware version 1.20 or newer)
    ; executed by the firmware on start-up
    ; generated by RepRapFirmware Configuration Tool on Mon Jun 18 2018 19:10:38 GMT-0700 (Pacific Daylight Time)

    ; General preferences
    G90 ; Send absolute coordinates...
    M564 H0 ; allow movement without homing axis
    M83 ; but relative extruder moves
    M555 P1 ; Set firmware compatibility to look like RepRapFirmare

    M667 S1 ; Select CoreXY mode

    ; Network
    M550 PMy printer ; Set machine name
    M552 S1 ; Enable network

    ;*** Access point is configured manually via M587
    M586 P0 S1 ; Enable HTTP
    M586 P1 S0 ; Disable FTP
    M586 P2 S0 ; Disable Telnet

    ; Drives
    M569 P0 S0 ; Drive 0 x motor goes forwards (change to S0 to reverse it)
    M569 P1 S1 ; Drive 1 y motor goes forwards
    M569 P2 S1 ; Drive 2 z motor goes forwards
    M569 P3 S0 ; Drive 3 extruder goes backwards
    M350 X16 Y16 Z16 E16 I1 ; Configure microstepping with interpolation
    M92 X80 Y80 Z3230 ; Set steps per mm
    M92 E820 ; Set extruder steps/mm
    M566 X1500 Y1500 Z20 E500 ; Set maximum instantaneous speed changes (mm/min)
    M203 X50000 Y50000 Z200 E2000 ; Set maximum speeds (mm/min)
    M201 X2000 Y2000 Z250 E600 ; Set accelerations (mm/s^2)
    M906 X2600 Y2600 Z1500 E1400 I30 ; Set motor currents (mA) and motor idle factor in percent
    M84 S30 ; Set idle timeout

    ; Axis Limits
    M208 X0 Y0 Z0 S0 ; Set axis minima
    M208 X585 Y330 Z400 S0 ; Set axis maxima

    ; Endstops
    M574 X1 Y1 S1 ; Set active high endstops
    M574 Z1 S2 ; Define Z to use Probe. Home to Min

    ; Z-Probe
    ;M375 P"MyAlternateHeightMap.csv"
    G29 S1
    M558 P5 H5 F2000 T4000 X0 Y0 Z1 ; Set Z probe type to unmodulated and the dive height + speeds
    G31 P25 X-6.5 Y-27 Z0.050 ; Set Z probe trigger value, offset and trigger height
    M557 X30:580 Y15:330 S132 ; Define mesh grid

    ;BLTouch - Heaters
    M307 H7 A-1 C-1 D-1 ; Disable the 7th Heater to free up PWM channel 5 on the Duex board

    ; Heaters
    M305 P0 T100000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 0
    M143 H0 S120 ; Set temperature limit for heater 0 to 120C
    M305 P1 X200 ; set PT100 sensor for heater 1
    M143 H1 S280 ; Set temperature limit for heater 1 to 280C

    ; Fans
    M106 P0 S0.3 I0 F500 H-1 ; Set fan 0 value, PWM signal inversion and frequency. Thermostatic control is turned off
    M106 P1 S1 I0 F500 H1 T45 ; Set fan 1 value, PWM signal inversion and frequency. Thermostatic control is turned on
    M106 P2 S1 I0 F500 H1 T45 ; Set fan 2 value, PWM signal inversion and frequency. Thermostatic control is turned on

    ; Tools
    M563 P0 D0 H1 ; Define tool 0
    G10 P0 X0 Y0 Z0 ; Set tool 0 axis offsets
    G10 P0 R0 S0 ; Set initial tool 0 active and standby temperatures to 0C





  • Nothing here stands out as an obvious error in your start and end code and config, ( although it looks like your end code could cause the printer to crash and not homing Z in the start could cause issues if you forgot to home it before starting a print, and not setting temps)

    Do you have anything in start.g or stop.g ?



  • @Sbutterfield said in origin inverts when trying to print twice in a row:

    G28 X0 Y0 ; home x and y axis

    don't need the 0, G28 XY should suffice not sure it matters. but having absolute positioning in start and stop seems odd, is the machine operating in relative mode normally? And instead of G28, why not use G0 if the machine is already homed, which it has to be as there is not G28 Z?



  • I have this issue when I upload using the Cura plugin, but usually it already happens the first print after the upload.

    No issues when I upload using DWC, FTP or directly from PrusaSlicer.


  • administrators

    The only reason I can see why the firmware would invert the origin is if it receives a M579 command, or is behaving as if it has. Are you able to send M579 without parameters before the problem starts, and again afterwards?

    Which firmware version are you using?



  • My original post about the issue: https://forum.duet3d.com/topic/13017/start-of-print-xy-move-to-max-extruder-rattles

    The problem has been there for all RRF2 versions up to 2.0.5. I am fairly certain that it is caused by some interaction with the Cura (4.4.1) upload-to-duet plugin. I did not try yet if the behaviour is still present with RRF3; I made it a habit to hit emergency stop before starting a print to make sure the firmware is in a known state.

    Regarding M579, with firmware 3.01-beta2+1 (2020-01-24b1):
    After emergency stop:

    M579
    Axis scale factors: X: 1.000, Y: 1.000, Z: 1.000
    

    After upload from Cura 4.4.1:

    M579
    Axis scale factors: X: 1.000, Y: 1.000, Z: 1.000
    

    Tried to print, no unexpected behaviour. So either the issue is solved in RRF 3.01-beta2+1 (2020-01-24b1), or it is one of those 'bug not appearing when desperately trying to trigger it' cases.

    I will try again a few times in the coming days and report back in my original topic.


  • Moderator

    @Sbutterfield said in origin inverts when trying to print twice in a row:

    ; Axis Limits
    M208 X0 Y0 Z0 S0 ; Set axis minima
    M208 X585 Y330 Z400 S0 ; Set axis maxima

    You have S0 for both the min and max. The minima needs to be S1.



  • Ok lets try this again. I pressed submit and walked away only to find out that my session had timed out and never sent my reply.

    Phaedrux, I think you figured it out. I made the changes that you suggested and so far its working great! thank you! It is much better now that I don't need to power cycle all of the time which I am assuming isn't that great for the duet board.

    Alex.cr and bearer, Thank you for the responses as well. I did make the change to my start code (just G28) and cleaning them up more is on my to do list.

    Alex, I'm not sure how the end code can cause my printer to crash. I have the bed lower after it prints then move to the origin. I'm a novice at programming though so maybe I'm not seeing what you are seeing. could you elaborate a bit more on that?

    dc42 I made the change Phaedrux recommended before trying the M579. So far its working but I have to test it some more to make sure. Should I still try the M579? What will it do? Does that invert the origin?

    Thanks everyone for the responses. If I have more problems I'll post again.


  • administrators

    @Sbutterfield said in origin inverts when trying to print twice in a row:

    dc42 I made the change Phaedrux recommended before trying the M579. So far its working but I have to test it some more to make sure. Should I still try the M579? What will it do? Does that invert the origin?

    Do not use M579 unless you want to adjust the scaling or have other special requirements. The only situation I am aware of in which it is normal to use M579 to invert an axis is when doing mirror prints on an IDEX printer.



  • @dc42 thanks


Log in to reply