From 87e810a1fe2b9a283a65944e4d69de44467c7330 Mon Sep 17 00:00:00 2001 From: Parker Date: Mon, 4 Mar 2024 10:25:15 -0500 Subject: [PATCH 1/4] added Mellow Fly Gemini v3 MCU template (#527) --- .../main/Mellow_Fly_Gemini_v3.cfg | 42 +++++++++++++++++++ docs/pinout.md | 1 + .../main/Mellow_Fly_Gemini_v3.cfg | 37 ++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 config/mcu_definitions/main/Mellow_Fly_Gemini_v3.cfg create mode 100644 user_templates/mcu_defaults/main/Mellow_Fly_Gemini_v3.cfg diff --git a/config/mcu_definitions/main/Mellow_Fly_Gemini_v3.cfg b/config/mcu_definitions/main/Mellow_Fly_Gemini_v3.cfg new file mode 100644 index 000000000..270715478 --- /dev/null +++ b/config/mcu_definitions/main/Mellow_Fly_Gemini_v3.cfg @@ -0,0 +1,42 @@ +[board_pins mcu_manufacturer] +aliases: + # Stepper drivers + MCU_DRIVE0_EN=PA3, MCU_DRIVE0_STEP=PC13, MCU_DRIVE0_DIR=PC1, MCU_DRIVE0_UART=PB11, # X + MCU_DRIVE1_EN=PD2, MCU_DRIVE1_STEP=PC14, MCU_DRIVE1_DIR=PC4, MCU_DRIVE1_UART=PC10, # Y + MCU_DRIVE2_EN=PC12, MCU_DRIVE2_STEP=PC15, MCU_DRIVE2_DIR=PC5, MCU_DRIVE2_UART=PB7, # Z + MCU_DRIVE3_EN=PC11, MCU_DRIVE3_STEP=PC3, MCU_DRIVE3_DIR=PC8, MCU_DRIVE3_UART=PB6, # E + + # Heaters + MCU_BED=PA2, + MCU_HEAT0=PA0, + + # Thermisors + MCU_THB=PC2, + MCU_TH0=PC0, + + # Fans + MCU_FAN0=PC6, MCU_FAN1=PC7, + + # End stops + MCU_DRIVE0_STOP=PA4, MCU_DRIVE1_STOP=PA5, MCU_DRIVE2_STOP=PA6, MCU_DRIVE3_STOP=PB1, + + # TMC SPI + MCU_TMC_MOSI=PB5, MCU_TMC_MISO=PB4, MCU_TMC_SCK=PB3, + + # CAN TX RX + MCU_CAN_LOW=PB8 , MCU_CAN_HIGH=PB9 , + + # ST-LINK + MCU_STLINK_1= , MCU_STLINK_2=PA14 , MCU_STLINK_3=PA13 , MCU_STLINK_4= , MCU_STLINK_5=<3.3V> , MCU_STLINK_6=<5V> , + + # EXP1 header + EXP1_1=PC9, EXP1_3=PA13, EXP1_5=PA9, EXP1_7=, EXP1_9=, + EXP1_2=PB10, EXP1_4=PA10, EXP1_6=PA8, EXP1_8=, EXP1_10=<5V>, + # EXP2 header + EXP2_1=PB14, EXP2_3=PA15, EXP2_5=PA14, EXP2_7=PA7, EXP2_9=, + EXP2_2=PB13, EXP2_4=PB12, EXP2_6=PB15, EXP2_8=, EXP2_10=, + + + # BL Touch + MCU_SERVO=PB0, # BL Touch servo pin + MCU_PROBE=PA1 # BL Touch end stop pin \ No newline at end of file diff --git a/docs/pinout.md b/docs/pinout.md index e8a681136..ea752c01e 100644 --- a/docs/pinout.md +++ b/docs/pinout.md @@ -93,3 +93,4 @@ For more information on the boards and pinouts, please see directly the manufact - [BTT EBB](https://github.com/bigtreetech/EBB) - [BTT SKR Mini E3](https://github.com/bigtreetech/BIGTREETECH-SKR-mini-E3) - [Fysetc S6](https://github.com/FYSETC/FYSETC-S6) + - [Fly Gemini v3](https://mellow-3d.github.io/fly-gemini_v3_pins.html) \ No newline at end of file diff --git a/user_templates/mcu_defaults/main/Mellow_Fly_Gemini_v3.cfg b/user_templates/mcu_defaults/main/Mellow_Fly_Gemini_v3.cfg new file mode 100644 index 000000000..d2f9073ac --- /dev/null +++ b/user_templates/mcu_defaults/main/Mellow_Fly_Gemini_v3.cfg @@ -0,0 +1,37 @@ + +#------------------------------------------# +#### Mellow Fly Gemini V3 MCU definition ### +#------------------------------------------# + +[mcu] +##-------------------------------------------------------------------- +serial: /dev/serial/by-id/change-me-to-the-correct-mcu-path +# canbus_uuid: change-me-to-the-correct-canbus-id +##-------------------------------------------------------------------- + +[include config/mcu_definitions/main/Mellow_Fly_Gemini_v3.cfg] # Do not remove this line +[board_pins fly_Gemini_v3_mcu] +mcu: mcu +aliases: + X_STEP=MCU_DRIVE0_STEP , X_DIR=MCU_DRIVE0_DIR , X_ENABLE=MCU_DRIVE0_EN , X_TMCUART=MCU_DRIVE0_UART , + Y_STEP=MCU_DRIVE1_STEP , Y_DIR=MCU_DRIVE1_DIR , Y_ENABLE=MCU_DRIVE1_EN , Y_TMCUART=MCU_DRIVE1_UART , + Z_STEP=MCU_DRIVE2_STEP , Z_DIR=MCU_DRIVE2_DIR , Z_ENABLE=MCU_DRIVE2_EN , Z_TMCUART=MCU_DRIVE2_UART , + + E_STEP=MCU_DRIVE3_STEP , E_DIR=MCU_DRIVE3_DIR , E_ENABLE=MCU_DRIVE3_EN , E_TMCUART=MCU_DRIVE3_UART , + + DRIVER_SPI_MOSI=MCU_TMC_MOSI , # Used in case of SPI drivers such as TMC2240 or TMC5160 + DRIVER_SPI_MISO=MCU_TMC_MISO , # Used in case of SPI drivers such as TMC2240 or TMC5160 + DRIVER_SPI_SCK=MCU_TMC_SCK , # Used in case of SPI drivers such as TMC2240 or TMC5160 + + X_STOP=MCU_DRIVE0_STOP , Y_STOP=MCU_DRIVE1_STOP , Z_STOP=MCU_DRIVE2_STOP , + PROBE_INPUT=MCU_PROBE , + RUNOUT_SENSOR=MCU_DRIVE3_STOP , + + E_HEATER=MCU_HEAT0 , E_TEMPERATURE=MCU_TH0 , + BED_HEATER=MCU_BED , BED_TEMPERATURE=MCU_THB , + + PART_FAN=MCU_FAN0 , E_FAN=MCU_FAN2 , # MCU_FAN2 is always on + CONTROLLER_FAN=MCU_FAN1 , + + SERVO_PIN=MCU_SERVO , + From 6be3873c4e80175bd923dd8306368ae96dc4f03a Mon Sep 17 00:00:00 2001 From: Benoitone <63300355+Benoitone@users.noreply.github.com> Date: Mon, 4 Mar 2024 20:50:15 +0100 Subject: [PATCH 2/4] fix pinout for Fysetc_ERB board (#530) --- .../mcu_definitions/mmu/Fysetc_ERCF_ERB.cfg | 15 ++++---- .../mcu_defaults/mmu/Fysetc_ERCF_ERB.cfg | 38 +++++++++---------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/config/mcu_definitions/mmu/Fysetc_ERCF_ERB.cfg b/config/mcu_definitions/mmu/Fysetc_ERCF_ERB.cfg index c19425156..e7f01e7d4 100644 --- a/config/mcu_definitions/mmu/Fysetc_ERCF_ERB.cfg +++ b/config/mcu_definitions/mmu/Fysetc_ERCF_ERB.cfg @@ -12,10 +12,11 @@ aliases: MCU_ENCODER=gpio22 , MCU_RGB=gpio21 , - MCU_UART0_TX=gpio0 , MCU_UART0_RX=gpio1 , - MCU_SPI0_SCK=gpio2 , MCU_SPI0_MISO=gpio3 , - MCU_SPI0_MOSI=gpio4 , MCU_SPI0_CS=gpio5 , - MCU_I2C1_SDA=gpio6 , MCU_I2C1_SCL=gpio7 , - MCU_ADC0=gpio26 , MCU_ADC1=gpio27 , - MCU_ADC2=gpio28 , MCU_ADC3=gpio29 , - GND= , 5V=<5V> , + # EXTRA PINS header + MCU_0=gpio0 , MCU_1=gpio1 , + MCU_2=gpio2 , MCU_3=gpio3 , + MCU_4=gpio4 , MCU_5=gpio5 , + MCU_6=gpio6 , MCU_7=gpio7 , + MCU_26=gpio26 , MCU_27=gpio27 , + MCU_28=gpio28 , MCU_29=gpio29 , + GND= , 5V=<5V> , diff --git a/user_templates/mcu_defaults/mmu/Fysetc_ERCF_ERB.cfg b/user_templates/mcu_defaults/mmu/Fysetc_ERCF_ERB.cfg index 7e92e2fed..592b77464 100644 --- a/user_templates/mcu_defaults/mmu/Fysetc_ERCF_ERB.cfg +++ b/user_templates/mcu_defaults/mmu/Fysetc_ERCF_ERB.cfg @@ -1,6 +1,6 @@ #---------------------------------------------# -#### Mellow Fly ERCF MCU definition ########### +#### Fysetc ERCF ERB MCU definition ########### #---------------------------------------------# [mcu mmu] @@ -9,7 +9,7 @@ serial: /dev/serial/by-id/change-me-to-the-correct-mcu-path # canbus_uuid: change-me-to-the-correct-canbus-id ##-------------------------------------------------------------------- -# If you want to override the wiring of the Mellow Fly ERCF board, keep in mind that this +# If you want to override the wiring of the Fysetc ERCF ERB board, keep in mind that this # board is defined using the "mmu" name. So you should use "pin: mmu:PIN_NAME" # in your own overrides.cfg files. @@ -17,21 +17,21 @@ serial: /dev/serial/by-id/change-me-to-the-correct-mcu-path [board_pins mmu_mcu] mcu: mmu aliases: - MMU_GEAR_STEP=MCU_GEAR_STEP , MMU_GEAR_DIR=MCU_GEAR_DIR , MMU_GEAR_ENABLE=MCU_GEAR_EN , MMU_GEAR_UART=MCU_GEAR_UART , - MMU_GEAR_DIAG=MCU_GEAR_DIAG , - MMU_SEL_STEP=MCU_SELECTOR_STEP , MMU_SEL_DIR=MCU_SELECTOR_DIR , MMU_SEL_ENABLE=MCU_SELECTOR_EN , MMU_SEL_UART=MCU_SELECTOR_UART , - MMU_SEL_DIAG=MCU_SELECTOR_DIAG , - - MMU_SEL_ENDSTOP=MCU_ENDSTOP , - MMU_SERVO=MCU_SERVO , - MMU_ENCODER=MCU_ENCODER , - MMU_GATE_SENSOR=MCU_EXTRA , - - SPI_SCLK=MCU_SCK , SPI_MOSI=MCU_MOSI , SPI_MISO=MCU_MISO , - - MMU_PRE_GATE_0=MCU_IO26 , MMU_PRE_GATE_1=MCU_IO10 , - MMU_PRE_GATE_2=MCU_IO27 , MMU_PRE_GATE_3=MCU_IO11 , - MMU_PRE_GATE_4=MCU_IO28 , MMU_PRE_GATE_5=MCU_IO12 , - MMU_PRE_GATE_6=MCU_IO29 , MMU_PRE_GATE_7=MCU_IO24 , - MMU_PRE_GATE_8=MCU_IO25 , MMU_PRE_GATE_9=MCU_IO13 , + MMU_GEAR_STEP=MCU_GEAR_MOTOR_STEP , MMU_GEAR_DIR=MCU_GEAR_MOTOR_DIR , MMU_GEAR_ENABLE=MCU_GEAR_MOTOR_EN , MMU_GEAR_UART=MCU_GEAR_MOTOR_UART , + MMU_GEAR_DIAG=MCU_GEAR_MOTOR_DIAG , + MMU_SEL_STEP=MCU_SELECTOR_MOTOR_STEP , MMU_SEL_DIR=MCU_SELECTOR_MOTOR_DIR , MMU_SEL_ENABLE=MCU_SELECTOR_MOTOR_EN , MMU_SEL_UART=MCU_SELECTOR_MOTOR_UART , + MMU_SEL_DIAG=MCU_SELECTOR_MOTOR_DIAG , + + MMU_SEL_ENDSTOP=MCU_ENDSTOP , + MMU_SERVO=MCU_SERVO , + MMU_ENCODER=MCU_ENCODER , + MMU_GATE_SENSOR=MCU_HALL_SENSOR , + MMU_NEOPIXEL=MCU_RGB , + + MMU_PRE_GATE_0=MCU_0 , MMU_PRE_GATE_1=MCU_1 , + MMU_PRE_GATE_2=MCU_2 , MMU_PRE_GATE_3=MCU_3 , + MMU_PRE_GATE_4=MCU_4 , MMU_PRE_GATE_5=MCU_5 , + MMU_PRE_GATE_6=MMCU_6 , MMU_PRE_GATE_7=MCU_7 , + MMU_PRE_GATE_8=MCU_26 , MMU_PRE_GATE_9=MCU_27 , + MMU_PRE_GATE_10=MCU_28 , MMU_PRE_GATE_11=MCU_29 , From 51216e45f696359d54a4e1bbba2041b320361d50 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 5 Mar 2024 03:08:33 -0500 Subject: [PATCH 3/4] updated homing_override to improve sensorless homing (#531) by using M400 vs the old 2 second dwell time that is not required anymore --- macros/base/homing/homing_override.cfg | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/macros/base/homing/homing_override.cfg b/macros/base/homing/homing_override.cfg index 3171a585c..94544779c 100644 --- a/macros/base/homing/homing_override.cfg +++ b/macros/base/homing/homing_override.cfg @@ -107,8 +107,8 @@ gcode: SET_KINEMATIC_POSITION X=0 Y=0 Z=0 G0 Z{homing_zhop} F{z_drop_speed} {% if sensorless_homing_enabled and kinematics == "corexz" %} - # Wait for 2s for stallguard registers to clear - G4 P2000 + # Wait for stallguard registers to clear + M400 {% endif %} {% set X, Y, Z = True, True, True %} {% endif %} @@ -147,11 +147,11 @@ gcode: G1 X{x_position_endstop + x_homing_backoff} F{homing_travel_speed} {% if sensorless_homing_enabled %} {% if kinematics == "corexy" %} - G4 P2000 + M400 SET_TMC_CURRENT STEPPER=stepper_x CURRENT={old_current_x} SET_TMC_CURRENT STEPPER=stepper_y CURRENT={old_current_y} {% elif kinematics == "corexz" %} - G4 P2000 + M400 SET_TMC_CURRENT STEPPER=stepper_x CURRENT={old_current_x} SET_TMC_CURRENT STEPPER=stepper_z CURRENT={old_current_z} {% elif kinematics == "cartesian" %} @@ -188,7 +188,7 @@ gcode: G1 Y{y_position_endstop + y_homing_backoff} F{homing_travel_speed} {% if sensorless_homing_enabled %} {% if kinematics == "corexy" %} - G4 P2000 + M400 SET_TMC_CURRENT STEPPER=stepper_x CURRENT={old_current_x} SET_TMC_CURRENT STEPPER=stepper_y CURRENT={old_current_y} {% elif kinematics == "corexz" %} @@ -229,7 +229,7 @@ gcode: G1 Y{y_position_endstop + y_homing_backoff} F{homing_travel_speed} {% if sensorless_homing_enabled %} {% if kinematics == "corexy" %} - G4 P2000 + M400 SET_TMC_CURRENT STEPPER=stepper_x CURRENT={old_current_x} SET_TMC_CURRENT STEPPER=stepper_y CURRENT={old_current_y} {% elif kinematics == "corexz" %} @@ -271,11 +271,11 @@ gcode: G1 X{x_position_endstop + x_homing_backoff} F{homing_travel_speed} {% if sensorless_homing_enabled %} {% if kinematics == "corexy" %} - G4 P2000 + M400 SET_TMC_CURRENT STEPPER=stepper_x CURRENT={old_current_x} SET_TMC_CURRENT STEPPER=stepper_y CURRENT={old_current_y} {% elif kinematics == "corexz" %} - G4 P2000 + M400 SET_TMC_CURRENT STEPPER=stepper_x CURRENT={old_current_x} SET_TMC_CURRENT STEPPER=stepper_z CURRENT={old_current_z} {% elif kinematics == "cartesian" %} From 5cfd2800650697669c9e0eeb3308f32f83b79d0c Mon Sep 17 00:00:00 2001 From: Parker Date: Tue, 5 Mar 2024 11:10:58 -0500 Subject: [PATCH 4/4] fixed v0_display pin and improved overrides docs (#535) --- config/hardware/displays/V0_display.cfg | 2 +- docs/features.md | 4 +++- docs/overrides.md | 13 ++++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/config/hardware/displays/V0_display.cfg b/config/hardware/displays/V0_display.cfg index b301f4be2..5b0984321 100644 --- a/config/hardware/displays/V0_display.cfg +++ b/config/hardware/displays/V0_display.cfg @@ -24,7 +24,7 @@ i2c_bus: i2c1a # Standard: Right (clockwise) scrolls down or increases values. Left (counter-clockwise scrolls up or decreases values. encoder_pins: ^v0_display:PA3, ^v0_display:PA4 # Reversed: Right (clockwise) scrolls up or decreases values. Left (counter-clockwise scrolls down or increases values. -#encoder_pins: ^display:PA4, ^display:PA3 +#encoder_pins: ^v0_display:PA4, ^v0_display:PA3 click_pin: ^!v0_display:PA1 kill_pin: ^!v0_display:PA5 #x_offset: 2 diff --git a/docs/features.md b/docs/features.md index 442749bc0..cef910a15 100644 --- a/docs/features.md +++ b/docs/features.md @@ -22,4 +22,6 @@ Here you can find a list of all the custom features availables in the macros or ## Hardware This config support out of the box a lot of different machine hardware configurations. -More info will be added in this section later... + +Please see [How to write an override](./overrides.md#how-to-write-an-override) in docs/overrides.md for more information on customizing your configuration. + diff --git a/docs/overrides.md b/docs/overrides.md index e8273c4a7..99dcf29ba 100644 --- a/docs/overrides.md +++ b/docs/overrides.md @@ -24,7 +24,18 @@ Additionally, if you want to add a new macro to Klippain or even replace an exis The following examples should help you add all the overrides you need to customize Klippain and make it work correctly with your printer! -Let's say you want to change the motor current for the X-axis. You'll need to override the `[tmc2209 stepper_x]` section because that's where the current is defined. To do this, simply add the following to your `overrides.cfg` file: +If something in your hardware isn't working as expected, first inspect the relevant default configuration file for your hardware. For example if your v0 display encoder is rotating in the opposite direction: +`cd ~/printer_data/config` then `less config/hardware/displays/V0_display.cfg`, copy the relevant portion then edit to suit in your `overrides.cfg`: +``` +[display] +# Set the direction of the encoder wheel +# Standard: Right (clockwise) scrolls down or increases values. Left (counter-clockwise scrolls up or decreases values. +#encoder_pins: ^v0_display:PA3, ^v0_display:PA4 +# Reversed: Right (clockwise) scrolls up or decreases values. Left (counter-clockwise scrolls down or increases values. +encoder_pins: ^v0_display:PA4, ^v0_display:PA3 +``` + +Or let's say you want to change the motor current for the X-axis. You'll need to override the `[tmc2209 stepper_x]` section because that's where the current is defined. To do this, simply add the following to your `overrides.cfg` file: ``` [tmc2209 stepper_x] run_current: ...