Skip to content

Commit

Permalink
BLTouch 3.1 (MarlinFirmware#14839)
Browse files Browse the repository at this point in the history
  • Loading branch information
coding-pivo committed Oct 27, 2020
1 parent 0b8b95b commit 6bc184d
Show file tree
Hide file tree
Showing 120 changed files with 3,348 additions and 267 deletions.
45 changes: 38 additions & 7 deletions Marlin/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,14 +477,45 @@
#endif
#undef Z_SERVO_ANGLES
#define Z_SERVO_ANGLES { BLTOUCH_DEPLOY, BLTOUCH_STOW }
#define BLTOUCH_ANGLES { BLTOUCH_DEPLOY, BLTOUCH_STOW }

#define BLTOUCH_DEPLOY 10
#define BLTOUCH_SW_MODE 60
#define BLTOUCH_STOW 90
#define BLTOUCH_SELFTEST 120
#define BLTOUCH_MODE_STORE 130
#define BLTOUCH_5V_MODE 140
#define BLTOUCH_OD_MODE 150
#define BLTOUCH_RESET 160

/**
* The following commands require different minimum delays.
*
* 500ms required for a reliable Reset.
*
* 750ms required for Deploy/Stow, otherwise the alarm state
* will not be seen until the following move command.
*/

#ifndef BLTOUCH_SET5V_DELAY
#define BLTOUCH_SET5V_DELAY 150
#endif
#ifndef BLTOUCH_SETOD_DELAY
#define BLTOUCH_SETOD_DELAY 150
#endif
#ifndef BLTOUCH_MODE_STORE_DELAY
#define BLTOUCH_MODE_STORE_DELAY 150
#endif
#ifndef BLTOUCH_DEPLOY_DELAY
#define BLTOUCH_DEPLOY_DELAY 750
#endif
#ifndef BLTOUCH_STOW_DELAY
#define BLTOUCH_STOW_DELAY 750
#endif
#ifndef BLTOUCH_RESET_DELAY
#define BLTOUCH_RESET_DELAY 500
#endif

#define BLTOUCH_DEPLOY 10
#define BLTOUCH_SW_MODE 60
#define BLTOUCH_STOW 90
#define BLTOUCH_SELFTEST 120
#define BLTOUCH_5V_MODE 140
#define BLTOUCH_OD_MODE 150
#define BLTOUCH_RESET 160
#define _TEST_BLTOUCH(P) (READ(P##_PIN) != P##_ENDSTOP_INVERTING)

// Always disable probe pin inverting for BLTouch
Expand Down
14 changes: 0 additions & 14 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -734,20 +734,6 @@
* The BLTouch probe uses a Hall effect sensor and emulates a servo.
*/
//#define BLTOUCH
#if ENABLED(BLTOUCH)
//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed

/**
* BLTouch V3.0 and newer smart series
* For genuine BLTouch 3.0 sensors. Clones may be confused by 3.0 command angles. YMMV.
* If the pin trigger is not detected, first try swapping the black and white wires then toggle this.
*/
//#define BLTOUCH_V3
#if ENABLED(BLTOUCH_V3)
//#define BLTOUCH_FORCE_5V_MODE
//#define BLTOUCH_FORCE_OPEN_DRAIN_MODE
#endif
#endif

/**
* Enable one or more of the following if probing seems unreliable.
Expand Down
59 changes: 59 additions & 0 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,65 @@
// Enable this if X or Y can't home without homing the other axis first.
//#define CODEPENDENT_XY_HOMING

#if ENABLED(BLTOUCH)
/**
* Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES
* Do not activate settings that the probe might not understand. Clones might misunderstand
* advanced commands.
*
* Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then
* check the wiring of the BROWN, RED and ORANGE wires.
*
* Note: If the trigger signal of your probe is not being recognized, it has been very often
* because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable"
* like they would be with a real switch. So please check the wiring first.
*
* Settings for all BLTouch and clone probes:
*/

// Safety: The probe needs time to recognize the command.
// Minimum command delay (ms). Enable and increase if needed.
//#define BLTOUCH_DELAY 500

/**
* Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones:
*/

// Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful
// in special cases, like noisy or filtered input configurations.
//#define BLTOUCH_FORCE_SW_MODE

/**
* Settings for BLTouch Smart 3.0 and 3.1
* Summary:
* - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes
* - High-Speed mode
* - Disable LCD voltage options
*/

/**
* Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller!
* V3.0 or 3.1: Set default mode to 5V mode at Marlin startup.
* If disabled, OD mode is the hard-coded default on 3.0
* On startup, Marlin will compare its eeprom to this vale. If the selected mode
* differs, a mode set eeprom write will be completed at initialization.
* Use the option below to force an eeprom write to a V3.1 probe regardless.
*/
//#define BLTOUCH_SET_5V_MODE

/**
* Safety: Activate if connecting a probe with an unknown voltage mode.
* V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0
* V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write )
* To preserve the life of the probe, use this once then turn it off and re-flash.
*/
//#define BLTOUCH_FORCE_MODE_SET

// Safety: Enable voltage mode settings in the LCD menu.
//#define BLTOUCH_LCD_VOLTAGE_MENU

#endif // BLTOUCH

// @section machine

#define AXIS_RELATIVE_MODES {false, false, false, false}
Expand Down
Loading

0 comments on commit 6bc184d

Please sign in to comment.