Connecting BLTOUCH to KFB2.0

A quick tutorial on how to connect a BLTOUCH to KFB2.0. The reason this is slightly different from other boards is because KFB2.0 is missing dedicated Servo pins.

In order to figure this out I ordered a genuine BLTOUCH from Amazon, so if you’re using a clone, this should probably still work but no guarantees.

The BLTOUCH consists of 2 sets of wires. The end stop wires and the servo wires.

The end stop wires will go into the regular end stop connectors but for the servo wires we need to use an alternative to get around the missing servo pins

There are many parts required to wire up a KFB2.0 but for this instructable you will need at least

BLTOUCH Amazon $37.98 (no extended wires, get extended if you need them)

KFB2.0 Amazon $19.57

For this setup we’re going to use/abuse the Z-Max end stop connector to run the servo on the BLTOUCH

Z-Min is used as the actual end stop

The picture says it all. Connect all 5 wires from your BLTOUCH according to the image with the Servo wires being handled by the Z-Max connector.

In the software setup we’ll redirect the pins

A few changes have to be made to enable the BLTOUCH and redirect the pins

In Configuration.h

Pick the MKS_GEN_L board for the KFB2.0

#ifndef MOTHERBOARD<br>  #define MOTHERBOARD BOARD_MKS_GEN_L
#endif

Practically all of the following settings are a matter of uncommenting/commenting your code by adding/removing // (adding these will disable code)

For this setup it is assumed you will be using the Z-Min for the Z endstop

#define USE_XMIN_PLUG<br>#define USE_YMIN_PLUG
#define USE_ZMIN_PLUG

define your ENDSTOPPULLUPs, make sure it uses ENDSTOPPULLUP_ZMIN_PROBE

#define ENDSTOPPULLUPS<br>#if DISABLED(ENDSTOPPULLUPS)
  // Disable ENDSTOPPULLUPS to set pullups individually
  //#define ENDSTOPPULLUP_XMAX
  //#define ENDSTOPPULLUP_YMAX
  //#define ENDSTOPPULLUP_ZMAX
  #define ENDSTOPPULLUP_XMIN
  #define ENDSTOPPULLUP_YMIN
  //#define ENDSTOPPULLUP_ZMIN
  #define ENDSTOPPULLUP_ZMIN_PROBE
#endif

for my BLTOUCH installation I have the inversion set to false

#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the probe.

let the system know it uses the probe for Z-min

#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN

turn on BLTOUCH

#define BLTOUCH
#if ENABLED(BLTOUCH)
  #define BLTOUCH_DELAY 100   // (ms) Enable and increase if needed
#endif

The following setting are going to depend on where you have mounted your BLTOUCH. Measure the distance from your BLTOUCH pin to your extruder. These values make sure you remain on top of your bed when auto leveling. The values below may (and probably won’t) match your setup

#define X_PROBE_OFFSET_FROM_EXTRUDER 48  // X offset: -left  +right  [of the nozzle]
#define Y_PROBE_OFFSET_FROM_EXTRUDER -2  // Y offset: -front +behind [the nozzle]
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0   // Z offset: -below +above  [the nozzle]

set probe speed

#define XY_PROBE_SPEED 8000

IF you want the probe to do a double touch (or more)

#define MULTIPLE_PROBING 2

The following setting will position your extruder prior to during and after probing

#define Z_CLEARANCE_DEPLOY_PROBE   15 // Z Clearance for Deploy/Stow
#define Z_CLEARANCE_BETWEEN_PROBES  10 // Z Clearance between probe points
#define Z_CLEARANCE_MULTI_PROBE     5 // Z Clearance between multiple probes
//#define Z_AFTER_PROBING           5 // Z position after probing is done

Make the system aware of at least this servo

#define NUM_SERVOS 1 // Servo index starts with 0 for M280 command
#define SERVO_DELAY { 300 }

If you are going to use the BLTOUCH for Auto Bed Leveling set the next values

#define AUTO_BED_LEVELING_BILINEAR

Since the KFB 2.0 does not have its dedicated Servo pins we using the X-Max plug to power the servo that is inside the BLTOUCH.

For this we need to tell the Marlin firmware to redirect some pins.

It is assumed you have selected BOARD_MKS_GEN_L in the configuration.h

open the file pins_MKS_GEN_L.h

in it add the following Make sure you add this AFTER the line #include “pins_RAMPS.h”:

#include "pins_RAMPS.h"
//redirect the servo pin to the X-Max plug
#define SERVO0_PIN 19

If you want to test the pins with g-code m43 you’ll need to enable #define PINS_DEBUGGING in configuration_adv.h

#define PINS_DEBUGGING

Once you’ve uploaded the updated Marlin FW to the board you can test the BLTOUCH.

If your firmware is setup for Safe Z-homing (meaning you can’t home z before having homed X or Y) you either need to turn this feature off in the firmware

in configuration.h comment out Z_SAFE_HOMING

//#define Z_SAFE_HOMING

or have your X and Y end stops connected.

First test is to see what happens with you turn on/power up your board. In this setup the BLTOUCH lights up when powering on and does two servo action. The probe pin comes out twice and retracts

As far as lights is concerned I see the orange light and a small purple led on. (not quite clear in the photo)

connect to the board with something like PronterFace or OCtoPrint and send it g-code m43 (if you’ve enabled PINS_DEBUGGING in the last step)

Check to see if pin 19 is indeed set to SERVO0_pin

Next check out this video for testing the BLTOUCH setup

If this was useful to you in anyway, please consider supporting me through Patreon  or making a small donation here.

Proximity-Sensor-Detection LJ12A3-4-Z-BX vs LJ12A3-4-Z/BY wiring

I had a little mishap with my extruder head. In my absence the Proximity sensor had broken off and got tangled near the hot-end. Suffice it to say, that was the end of it.

The destroyed sensor was a DIYmall LJ12A3-4-Z/BY Proximity Switch DC 10-30V PNP I bought on Amazon(Yes I’m an affiliate).

The sensor takes in 12 volts and comes with a voltage regulator that reduces the signal to 5 volt(ish). I personally like the voltage regulator as I don’t have buy bulk resistors just to get 2 resistors soldered on.

Here is how the LJ12A3-4-Z/BY  was wired and how it worked for me for some time. And yes I do love the auto leveling feature.

wiring compliments of DIYmall (where I purchased the sensor). My sensor had a blue head though

Alternatively you can use the resistors:

 

Now that it was broke, I had to replace it with my spare sensor but it did not work as expected. I wired up the sensor in the same manor and got the little light to work as expected when approaching the sensor with a metal object.

Marlin however kept reading the z-min as triggered, regardless of what the little light on the sensor indicated. I even went into the firmware and futzed around with the  Z_MIN_ENDSTOP_INVERTING but to no avail. No surprise as the z_min was triggered regardless of signal.

Turns out the spare sensor I had was NOT the LJ12A3-4-Z/BY but instead it was the LJ12A3-4-Z/BX (that’s right, I’m affiliated here as well). This where things got a little complicated.

Every site you visit on wiring references either the voltage regulator or resistors (actually resistors seems to be the more prevalent way of implementation).

 

Even in the case of  the LJ12A3-4-Z/BX I’ve seen the schematics using the resistors. For some reason the LJ12A3-4-Z/BX  does not seem to work with the voltage regulator and it might work with the resistors but I really DON’T NEED either.

The specs for the  LJ12A3-4-Z/BY are as follows: DC 10-30 Volt

The specs for the  LJ12A3-4-Z/BX as follows: DC 6-36Volt

Instead of connecting the sensor to the 12 Volt input (like required for the BY) the LJ12A3-4-Z/BX can be connected to the 5 Volt output on the actually stop. The 5 Volt is enough to get the proper signal (even though the specs state 6-36V).

directly powered from 5 volt on z-stop

 

 

UPDATE: Today I tried connecting my second  LJ12A3-4-Z/BX to a KFB2.0 board and IT DID NOT WORK using the 5 volts. I ended up using the resistor method (above) using 2K and 1K resistors.

The reason it may not have worked this time could be explained by one of two ways:

  1. Not all   LJ12A3-4-Z/BX are created equal, anecdotal information out there seems to indicate this
  2. The KFB board outputs 4.9 volts as opposed to the 5.1v on my previous RAMPS 1.4 board. I’m wondering of this little difference may just put it too far from the 6 Volts required.