Basic Information:
Printer Model: Sunlu S9 Plus
MCU / Printerboard: AVR atmega2560 16MHz chip and is a Ramps v1.0 pinout
klippy.log (632.8 KB)
klippy.log
Describe your issue:
BLTouch help
I am porting a SUNLU S9 Plus from Marlin to Klipper. I have everything working as far as I can tell except the BLTouch. I even have the attached Drybox working . My problem is that the BLTouch will operate but will not return an Open/Triggered signal as it should. The BLTouch does do its pretest on startup activating the pin twice.
This machine uses a ā3D TOUCHā clone device.
Being new at this, deciphering the Marlin pins to Klipper pins has been challenging but thanks to this VERY HELPFUL post I was able to finally understand how to do the mapping. Marlin Pins, Arduino Pins and Actual pins
The Sunlu S9 uses an AVR atmega2560 16MHz chip and is a Ramps v1.0 pinout.
This is the link to the Marlin source code if you want to see it all: http :// 3dsunlu. com/en/NewsDetail/3912708. html (I have to break the links in order to upload. Just remove the extra spaces.)
Here are snippets of the source files which seem to relate to the BLTouch:
-------------configuration.h-------------
#ifndef MOTHERBOARD
#define MOTHERBOARD BOARD_MKS_BASE
#endif
//
// See https://marlinfw.org/docs/configuration/probes.html
//
/**
* Enable this option for a probe connected to the Z-MIN pin.
* The probe replaces the Z-MIN endstop and is used for Z homing.
* (Automatically enables USE_PROBE_FOR_Z_HOMING.)
*/
#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
// Force the use of the probe for Z-axis homing
#define USE_PROBE_FOR_Z_HOMING
-------------PINS.H-------------
#elif MB(MKS_BASE)
#include "ramps/pins_MKS_BASE_10.h" // ATmega2560 env:mega2560
-------------pins_MKS_BASE_10.h-------------
#include "pins_MKS_BASE_common.h"
-------------pins_MKS_BASE_common.h-------------
#include "pins_RAMPS.h"
-------------pins_RAMPS.h-------------
//
// Servos
//
#ifndef SERVO0_PIN
#ifdef IS_RAMPS_13
#define SERVO0_PIN 7
#else
#define SERVO0_PIN 4//11//for bltouch PG5
#endif
#endif
//
// Limit Switches
//
#ifndef Z_STOP_PIN
#ifndef Z_MIN_PIN
#define Z_MIN_PIN 18 //PD3
#endif
#ifndef Z_MAX_PIN
#define Z_MAX_PIN 19 //PD2
#endif
#endif
//
// Z Probe (when not Z_MIN_PIN)
//
#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN 32//no use //PC5
#endif
#endif
-------------SanityCheck.h-------------
#elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#if DISABLED(USE_ZMIN_PLUG)
#error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires USE_ZMIN_PLUG to be enabled."
#elif !HAS_Z_MIN
#error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires the Z_MIN_PIN to be defined."
#elif Z_MIN_PROBE_ENDSTOP_INVERTING != Z_MIN_ENDSTOP_INVERTING
#error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires Z_MIN_ENDSTOP_INVERTING to match Z_MIN_PROBE_ENDSTOP_INVERTING."
#endif
#elif !HAS_Z_MIN_PROBE_PIN
#error "Z_MIN_PROBE_PIN must be defined if Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN is not enabled."
#endif
From the marlin reference: https ://marlinfw .org/docs/configuration/probes. html
Before configuring any bed probe be sure to read its documentation and the documentation for your electronics (I wish I had some ). Make sure you know to which pins the probe will be connected (thanks a lot ). Marlin provides reasonable defaults, but they will not apply to every situation.
In general, on deltabots the probe should be connected to the unused Z-Min endstop pin (if there is one). On machines that use Z-min for an endstop, the Z-Max pin is recommended next, so this is set as the default alternative on most boards.
ā¢ If the probe is connected to the Z-Min pin, enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN.
ā¢ For Marlin 2.0.5.2 and earlier, if the probe is connected to any other pin, enable Z_MIN_PROBE_ENDSTOP.
ā¢ The probe-specific pin is defined with Z_MIN_PROBE_PIN. Most boards have a default, but it can be overriden in the configuration.
============================================================
So this is what I have so far ā¦.
[bltouch]
control_pin: PG5 works to raise and lower the BLTouch pin. This is SERVO0_PIN and is Digital pin 4.
However, the sensor_pin does not work. From the information above, it should be on the Z-Min pin:
#define Z_MIN_PIN 18 //PD3
The other options might be:
#define Z_MIN_PROBE_PIN 32 //no use //PC5
#define Z_MAX_PIN 19 //PD2
Note the Z_MIN_PROBE_PIN is marked as āno useā
If you look in the klippy.log you will see that I have tried all of these. PD3 is always OPEN and the other two are always TRIGGERED.
So, this is where I am. If I can get the Touch to work, I will have successfully ported the Sunlu S9 Plus to Klipper and will share the configuration with everyone interested. Any help would be very greatly appreciated.
Here are the results of the tests:
[bltouch]
sensor_pin: ^PD3 #^PD3 Z_MIN_PIN #^PC5 Z_MIN_PROBE_PIN #^PD2 Z_MAX_PIN
control_pin: PG5 #SERVO0_PIN 4
#pin_up_touch_mode_reports_triggered: False
12:35 AM probe: open
12:35 AM QUERY_PROBE
12:35 AM Sending BLTOUCH_DEBUG COMMAND=pin_up
12:35 AM BLTOUCH_DEBUG COMMAND=pin_up
12:35 AM probe: open
12:35 AM QUERY_PROBE
12:35 AM Sending BLTOUCH_DEBUG COMMAND=touch_mode
12:35 AM BLTOUCH_DEBUG COMMAND=touch_mode
12:35 AM Sending BLTOUCH_DEBUG COMMAND=pin_down
12:35 AM BLTOUCH_DEBUG COMMAND=pin_down
[bltouch]
sensor_pin: ^PD3 #^PD3 Z_MIN_PIN #^PC5 Z_MIN_PROBE_PIN #^PD2 Z_MAX_PIN
control_pin: PG5 #SERVO0_PIN 4
pin_up_touch_mode_reports_triggered: False
12:40 AM probe: open
12:40 AM QUERY_PROBE
12:40 AM Sending BLTOUCH_DEBUG COMMAND=pin_up
12:40 AM BLTOUCH_DEBUG COMMAND=pin_up
12:40 AM probe: open
12:40 AM QUERY_PROBE
12:40 AM Sending BLTOUCH_DEBUG COMMAND=pin_down
12:40 AM BLTOUCH_DEBUG COMMAND=pin_down
[bltouch]
sensor_pin: ^PC5 #^PD3 Z_MIN_PIN #^PC5 Z_MIN_PROBE_PIN #^PD2 Z_MAX_PIN
control_pin: PG5 #SERVO0_PIN 4
#pin_up_touch_mode_reports_triggered: False
12:42 AM probe: TRIGGERED
12:42 AM QUERY_PROBE
12:42 AM Sending BLTOUCH_DEBUG COMMAND=pin_up
12:42 AM BLTOUCH_DEBUG COMMAND=pin_up
12:42 AM probe: TRIGGERED
12:42 AM QUERY_PROBE
12:42 AM Sending BLTOUCH_DEBUG COMMAND=touch_mode
12:42 AM BLTOUCH_DEBUG COMMAND=touch_mode
12:42 AM Sending BLTOUCH_DEBUG COMMAND=pin_down
12:42 AM BLTOUCH_DEBUG COMMAND=pin_down
[bltouch]
sensor_pin: ^PC5 #^PD3 Z_MIN_PIN #^PC5 Z_MIN_PROBE_PIN #^PD2 Z_MAX_PIN
control_pin: PG5 #SERVO0_PIN 4
pin_up_touch_mode_reports_triggered: False
12:44 AM probe: TRIGGERED
12:44 AM QUERY_PROBE
12:44 AM Sending BLTOUCH_DEBUG COMMAND=pin_up
12:44 AM BLTOUCH_DEBUG COMMAND=pin_up
12:44 AM probe: TRIGGERED
12:44 AM QUERY_PROBE
12:44 AM Sending BLTOUCH_DEBUG COMMAND=touch_mode
12:44 AM BLTOUCH_DEBUG COMMAND=touch_mode
12:44 AM Sending BLTOUCH_DEBUG COMMAND=pin_down
12:44 AM BLTOUCH_DEBUG COMMAND=pin_down
[bltouch]
sensor_pin: ^PD2 #^PD3 Z_MIN_PIN #^PC5 Z_MIN_PROBE_PIN #^PD2 Z_MAX_PIN
control_pin: PG5 #SERVO0_PIN 4
#pin_up_touch_mode_reports_triggered: False
12:46 AM probe: TRIGGERED
12:46 AM QUERY_PROBE
12:46 AM Sending BLTOUCH_DEBUG COMMAND=pin_up
12:46 AM BLTOUCH_DEBUG COMMAND=pin_up
12:46 AM probe: TRIGGERED
12:46 AM QUERY_PROBE
12:46 AM Sending BLTOUCH_DEBUG COMMAND=touch_mode
12:46 AM BLTOUCH_DEBUG COMMAND=touch_mode
12:46 AM Sending BLTOUCH_DEBUG COMMAND=pin_down
12:46 AM BLTOUCH_DEBUG COMMAND=pin_down
[bltouch]
sensor_pin: ^PD2 #^PD3 Z_MIN_PIN #^PC5 Z_MIN_PROBE_PIN #^PD2 Z_MAX_PIN
control_pin: PG5 #SERVO0_PIN 4
pin_up_touch_mode_reports_triggered: False
12:49 AM probe: TRIGGERED
12:49 AM QUERY_PROBE
12:49 AM Sending BLTOUCH_DEBUG COMMAND=pin_up
12:49 AM BLTOUCH_DEBUG COMMAND=pin_up
12:49 AM probe: TRIGGERED
12:49 AM QUERY_PROBE
12:49 AM Sending BLTOUCH_DEBUG COMMAND=touch_mode
12:49 AM BLTOUCH_DEBUG COMMAND=touch_mode
12:49 AM Sending BLTOUCH_DEBUG COMMAND=pin_down
12:49 AM BLTOUCH_DEBUG COMMAND=pin_down
As a sanity check, I reinstalled the Sunlu Marlin firmware to the printer to ensure that the Touch is actually still functioning, and it is working fine. That seems to imply to me that the signal pin is different than the oneās listed above that donāt work or else I am doing something stupid (it wouldnāt be the first time).
So, there you have it. If you are still with me, thank you very much. Any help would be greatly appreciated. Iām at the end of my ability.