Introduction: How to Add Auto Bed Leveling Sensor to Geeetech Prusa I3 3D Printer DIY Kit

This instructable shows the 3DTouch Auto Leveling Sensor used on our Geeetech prusa I3 pro B 3d printer, you can see the printing quality is greatly improved even when the bed is titled.

You can find more ditaled setting up and configurations on geeetech wiki. http://www.geeetech.com/wiki/index.php/3DTouch_Auto_Leveling_Sensor

Step 1: Required Parts

Step 2:

1. Download the .stl file here and print

one.

2. Fix the mount on the Extruder holder with 2 M3*6mm screw.

3.Fix the 3DTouch sensor on the sensor mount with 2 M3*16mm screws and 2 M3 nuts.

Step 3: Wiring

The 3DTouch Auto Leveling sensor has 5

wires, 3 for the first servo connection and 5v and 2 for the Z min end stop, negative and signal pins.

3DTouch can be operated in the following condition.

One I/O for control (PWM or Software PWM)

One I/O for Z min (Z Probe)

GND and +5V power

Let’s take our geeetech GT2560 3D Printer control board as an example.

There are several ways to connect the 3DTouch Auto Leveling sensor to GT2560, here is the easiest way.

Step1. Remove the Z max connector from the board and replace it with a 3Pin Straight Pin. You need to use soldering iron here.

Step2. Use DuPont wire to extend the wires of
3DTouch. It doesn't matter if you cannot find the wires with the same color, but do not mix the wires up.

Step3. Connect the extended wire to the

GT2560 control board.

Connect the 3 pin wire to the Z max pin.

3-pin: Brown (-, GND) Red (+5V) Orange (control signal)

Step 4: Firmware Setting

Changes need to be

made for the configuration file in the Marlin source code for 3DTouch. The required changes are similar to how you would setup a mechanical servo sensor.

Step1. Find the following code in Configuration.h:

Modify
the code in the red box into:

// Number of servos

/

/ If you select a configuration below, this will receive a default value and does not need to be set manually

// set it manually if you have more servos than extruders and wish to manually control some

// leaving it undefined or defining as 0 will disable the servo subsystem

// If unsure, leave commented / disabled

//

#define NUM_SERVOS 1 // Servo index starts with 0 for M280 command

// Servo Endstops

/

/ This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.

// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.

//

#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1

#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 10,90} // X,Y,Z Axis Extend and Retract angles

Step2. Find the codes regarding to Bed Auto Leveling in Configuration.h.

//=============================Bed Auto Leveling=======================

#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)

#define Z_PROBE_REPEATABILITY_TEST // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.

#ifdef ENABLE_AUTO_BED_LEVELING

#define AUTO_BED_LEVELING_GRID

#ifdef AUTO_BED_LEVELING_GRID

// set the rectangle in which to probe

#define LEFT_PROBE_BED_POSITION 30

#define RIGHT_PROBE_BED_POSITION 200

#define BACK_PROBE_BED_POSITION 147

#define FRONT_PROBE_BED_POSITION 20


Step3: scroll down to find the codes to Define the probe offset

#define
AUTO_BED_LEVELING_GRID_POINTS 2

#else // not AUTO_BED_LEVELING_GRID

#define X_PROBE_OFFSET_FROM_EXTRUDER 6

#define Y_PROBE_OFFSET_FROM_EXTRUDER -43

#define Z_PROBE_OFFSET_FROM_EXTRUDER -1.4


Step4. Find the following code in pins.h

If you do not find the pins.h tab on Arduino IDE, please open it separately, after the modification, please save it.

Find the code as shown in the red box:

/*****************************************************************

* Ultimaker pin assignment

******************************************************************/

#if MB(ULTIMAKER)

#define KNOWN_BOARD

#define Z_MAX_PIN -1//32

#define Z_ENABLE_PIN 35

#define SUICIDE_PIN 54 //PIN that has to be turned on right after start, to keep power flowing.

#define SERVO0_PIN 32//13 // untested

Now, we have finished the firmware; please upload the modified firmware to your control board.

Step 5: Testing

When the 3DTouch is

first powered up it does a self test – Starting with the pin up it them goes down/up 3 times and ends up the LED on solid. Continuous flashing means that there is an obstruction or fault.

The 3DTouch acts on the following g.code that can be used manually to diagnose faults etc but you don’t need to normally worry about them.

M280 P0 S10 ; pushes the pin down

M280 P0 S90 ; pulls the pin up

M280 P0 S120 ; Self test – keeps going until you do pin up/down or release alarm

M280 P0 S160 ; Release alarm

Alarm – The 3DTouch can sense when something is wrong and then goes into alarm mode which is continuous flashing. Alarm can be triggered like an obstruction that stops the pin going up and down freely, it could be dirt etc.

Step 6: Printer Setting

Providing

the firmware is correctly configured, the sensor responds to the same codes as any other sensor e.g. inductive, capacitive or IR. The Start Code in you slicer should contain the sequence G28 followed by G29 to do the auto bed leveling.

Open Slicer>printer setting. Add G29 command right after G28

*Don’t put another G28 after the G29 as it will

just remove the G29 results.

The G29 command should be added every time.

Step 7: Printing Show

Here is a video of using the 3DTouch Auto Leveling Sensor on

Geeetech Prusa I3 pro B 3d printer.