From bebd793a2fe798d088dc22c362f2ea1e35796a21 Mon Sep 17 00:00:00 2001 From: InsanityAutomation Date: Thu, 18 Mar 2021 22:51:52 -0400 Subject: [PATCH] Allow G34 on Raptor with Trex board --- Marlin/Configuration.h | 17 ++++++++++++++++- Marlin/Configuration_adv.h | 8 +++++--- Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h | 9 +++++++-- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index b41c69d16f..185e537602 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -35,11 +35,13 @@ //#define SKR14 //#define SKR14Turbo //#define SKRPRO11 +//#define Trex3Board +//#define RaptorFanPins // When using the trex board, invert fan pins to match raptor extruder PCB //#define I2C_EEPROM // use I2C EEPROM on SRK PRO v1.1 e.g AT24C256 //#define SKR14_PowerLossKit // Bigtreetech power loss kit for SKR14 -//#define DualZ // Uses 5th driver on SKR boards as Z2 +//#define DualZ // Uses 5th driver on SKR Or Trex 3 (Use X2 plug) boards as Z2 /** * Enable if you install a KEENOVO AC BED with Solid State Relay @@ -102,6 +104,17 @@ #if ANY(SKR13, SKR14, SKR14Turbo, SKRPRO11) #define SKRBoard #endif + +#if ENABLED(Trex3Board) + #define Z2_STEP_PIN 42 + #define Z2_DIR_PIN 43 + #define Z2_ENABLE_PIN 44 + + #if ENABLED(RaptorFanPins) + #define FAN_PIN 6 + #endif +#endif + /** * Marlin 3D Printer Firmware * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] @@ -250,6 +263,8 @@ #define MOTHERBOARD BOARD_BTT_SKR_V1_3 #elif ENABLED(SKRPRO11) #define MOTHERBOARD BOARD_BTT_SKR_PRO_V1_1 + #elif ENABLED(Trex3Board) + #define MOTHERBOARD BOARD_FORMBOT_TREX3 #elif ENABLED(RAPTOR2) #define MOTHERBOARD BOARD_FORMBOT_RAPTOR2 #else diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 32739647d0..653aa46703 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -480,7 +480,9 @@ * Multiple extruders can be assigned to the same pin in which case * the fan will turn on when any selected extruder is above the threshold. */ -#if ENABLED(RAPTOR2) && DISABLED(SKRBoard) +#if ENABLED(Trex3Board) && DISABLED(RaptorFanPins) + #define E0_AUTO_FAN_PIN 6 +#elif ENABLED(RAPTOR2) && DISABLED(SKRBoard) #define E0_AUTO_FAN_PIN 9 #else #define E0_AUTO_FAN_PIN -1 @@ -585,7 +587,7 @@ // // For Z set the number of stepper drivers // -#if ENABLED(SKRBoard) && ENABLED(DualZ) +#if ANY(SKRBoard, Trex3Board) && ENABLED(DualZ) #define NUM_Z_STEPPER_DRIVERS 2 // (1-4) Z options change based on how many #else #define NUM_Z_STEPPER_DRIVERS 1 // (1-4) Z options change based on how many @@ -762,7 +764,7 @@ * Z Steppers Auto-Alignment * Add the G34 command to align multiple Z steppers using a bed probe. */ -#if ENABLED(SKRBoard) && ENABLED(DualZ) +#if ANY(SKRBoard, Trex3Board) && ENABLED(DualZ) #define Z_STEPPER_AUTO_ALIGN #endif #if ENABLED(Z_STEPPER_AUTO_ALIGN) diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h b/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h index 6046b793fe..7e7d592fb0 100644 --- a/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h @@ -124,10 +124,15 @@ #define HEATER_1_PIN 7 #define HEATER_BED_PIN 8 -#define FAN_PIN 9 +#ifndef FAN_PIN + #define FAN_PIN 9 +#endif #define FAN1_PIN 12 -#define NUM_RUNOUT_SENSORS 2 +#ifndef NUM_RUNOUT_SENSORS + #define NUM_RUNOUT_SENSORS 2 +#endif + #define FIL_RUNOUT_PIN 22 #define FIL_RUNOUT2_PIN 21