# HyperCube 3Dプリンターを作ってみる その17
###### tags: `3D Printer` `HyperCube3D`
## 3D Touch取り付け&オートレベリング
Z軸のリミットスイッチや、オートレベリングのセンサーになる3D Touch(BL Touch)を取り付けます。
### 購入部品
* [Trianglelab新 2020 3Dプリンタ 3Dタッチ送料無料自動ベッドオートレベリングセンサー 3dタッチセンサーanetためA8 tevo reprap mk8 i3\|auto leveling\|3d mk8mk8 3d \- AliExpress](https://ja.aliexpress.com/item/32832887426.html)
### プリントパーツ
* [Hypercube E3D mount with BLtouch by ziemowitp \- Thingiverse](https://www.thingiverse.com/thing:2848466)
本家のHyperCubeは、BL Touchではないセンサーなので、BL Touch用のE3D mountを利用させてもらいます。

### 取り付け
E3D mountに、3D TouchをM3ネジで固定します。

Xキャリッジに、M3ネジとナットで、固定します。

### 配線
3D Touchからの配線を、写真のように接続します。

## ファームウェア修正
こちらを参考にファームウェアを変更します。
[3D\_TOUCH · makerbase\-mks/MKS\-Robin\-Nano\-V2\.X Wiki](https://github.com/makerbase-mks/MKS-Robin-Nano-V2.X/wiki/3D_TOUCH)
* Configuration.h
``` diff
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -850,7 +850,7 @@
* 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
+#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
@@ -909,7 +909,7 @@
/**
* The BLTouch probe uses a Hall effect sensor and emulates a servo.
*/
- //#define BLTOUCH
+ #define BLTOUCH
/**
* Pressure sensor with a BLTouch-like interface
@@ -996,7 +996,7 @@
* | [-] |
* O-- FRONT --+
*/
-#define NOZZLE_TO_PROBE_OFFSET { -44, -10.4, -1.5 }
+#define NOZZLE_TO_PROBE_OFFSET { 30, 15, 1 }
// Most probes should stay away from the edges of the bed, but
// with NOZZLE_AS_PROBE this can be negative for a wider probing area.
@@ -1244,7 +1244,7 @@
*/
//#define AUTO_BED_LEVELING_3POINT
//#define AUTO_BED_LEVELING_LINEAR
- //#define AUTO_BED_LEVELING_BILINEAR
+#define AUTO_BED_LEVELING_BILINEAR
//#define AUTO_BED_LEVELING_UBL
//#define MESH_BED_LEVELING
@@ -1395,7 +1395,7 @@
// - Move the Z probe (or nozzle) to a defined XY point before Z Homing.
// - Prevent Z homing when the Z probe is outside bed area.
//
-//#define Z_SAFE_HOMING
+#define Z_SAFE_HOMING
#if ENABLED(Z_SAFE_HOMING)
#define Z_SAFE_HOMING_X_POINT X_CENTER // X point for Z homing
@@ -2400,7 +2400,7 @@
* Set this manually if there are extra servos needing manual control.
* Leave undefined or set to 0 to entirely disable the servo subsystem.
*/
- #define NUM_SERVOS 1// Servo index starts with 0 for M280 command
+#define NUM_SERVOS 1// Servo index starts with 0 for M280 command
// (ms) Delay before the next move will start, to give the servo time to reach its target angle.
// 300ms is a good value but you can try less delay.
```
* Configuration_adv.h
``` diff
--- a/Marlin/Configuration_adv.h
+++ b/Marlin/Configuration_adv.h
@@ -1656,10 +1656,10 @@
* the probe to be unable to reach any points.
*/
#if PROBE_SELECTED && !IS_KINEMATIC
- //#define PROBING_MARGIN_LEFT PROBING_MARGIN
- //#define PROBING_MARGIN_RIGHT PROBING_MARGIN
- //#define PROBING_MARGIN_FRONT PROBING_MARGIN
- //#define PROBING_MARGIN_BACK PROBING_MARGIN
+ #define PROBING_MARGIN_LEFT PROBING_MARGIN
+ #define PROBING_MARGIN_RIGHT PROBING_MARGIN
+ #define PROBING_MARGIN_FRONT PROBING_MARGIN
+ #define PROBING_MARGIN_BACK PROBING_MARGIN
#endif
```
## 動作確認
電源を入れると、3D Touchの動作確認なのか、「カチカチ」棒を出し入れします。
これが起きない場合は、電源を切って確認しましょう。
#### ホーミング&オートレベリング動作(動画)
{%youtube P0mMhMStQOk %}
### 全制作工程
[HyperCube 3Dプリンターを作ってみた-目次](https://hackmd.io/@seya128/HyperCube-Book)