MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
15.94k stars 19.08k forks source link

QUICK_HOME_SECONDARY_AXES #27005

Open DerAndere1 opened 3 weeks ago

DerAndere1 commented 3 weeks ago

Description

QUICK_HOME_SECONDARY_AXES extends QUICK_HOME to include secondary axes I(A), J(B), K(C). U, V, W. With QUICK_HOME_SECONDARY_AXES enabled, G28 first does a coordinated quick home of all axes except Z. When one axis reaches home, each remaining axis is homed individually. This PR is more a show case of what changes are necessary. I do not encourage to merge this, because there is hardly a single homing sequence that works for every multi-axis machine. For such complex machines, a custom-tailored safe homing sequence should be implemented by the machine builder.

Requirements

Benefits

fix https://github.com/MarlinFirmware/Marlin/issues/26868

Configurations

None

Related Issues

https://github.com/MarlinFirmware/Marlin/issues/26868

Elias-Ta commented 3 weeks ago

@DerAndere1 , thank you for this pull request ,

  1. I added your changes and activated QUICK_HOME_SECONDARY_AXES in Configuration_adv.h and I tried to home secondary axis on my machine however nothing changed, the machine is still following the old sequence as before I added your changes (Z, XY, A, B, C ), I think there is some conflict between the old QUICK_HOME and the new QUICK_HOME_SECONDARY_AXES, maybe in sometime we may replace the original QUICK_HOME as your code can include it anyway and it's more general.

  2. I believe in G28.cpp the code :

    #if ENABLED(QUICK_HOME)
         if (doX && doY) {
           #if ENABLED(QUICK_HOME_ALL_NON_Z_AXES)
             // move all axes except Z towards 0 first if all are homing
             if (SECONDARY_AXIS_GANG(doI, && doJ, && doK, && doU, && doV, && doW))
               quick_home_xyijkuvw();
             else
               quick_home_xy();
           #else
             // Diagonal move first if both x and y but not not all secondary axes are homing
             quick_home_xy();
           #endif
         }
       #endif

    should be:

    #if ENABLED(QUICK_HOME)
         if (doX && doY) {
           #if ENABLED(QUICK_HOME_SECONDARY_AXES)
             // move all axes except Z towards 0 first if all are homing
             if (SECONDARY_AXIS_GANG(doI, && doJ, && doK, && doU, && doV, && doW))
               quick_home_xyijkuvw();
             else
               quick_home_xy();
           #else
             // Diagonal move first if both x and y but not not all secondary axes are homing
             quick_home_xy();
           #endif
         }
       #endif

    using QUICK_HOME_SECONDARY_AXES instead of QUICK_HOME_ALL_NON_Z_AXES

DerAndere1 commented 3 weeks ago

Oh the joy of intruducing bugs while updating code and changing names last minute. fixed as you proposed

Elias-Ta commented 3 weeks ago

Do you have any suggestions about n.1 ? actually the code is still not changing the default behaviour, and non-Z axis are not moving simultaneously to their home position