# AON3D M2+ Wiring Guide - BTT Octopus Pro v1.0.1

## Motor Driver Connections (External DM542T)

Since you're using external DM542T drivers, only **STEP**, **DIR**, and **ENABLE** signals are needed from the Octopus Pro. The drivers handle their own current and microstepping via DIP switches.

### Motor Pin Assignments

| Motor | Function | Octopus Header | STEP Pin | DIR Pin | ENABLE Pin |
|-------|----------|----------------|----------|---------|------------|
| MOTOR0 | X Axis (Carriage 0) | MOTOR0 | PF13 | PF12 | PF14 |
| MOTOR1 | X2 / Dual Carriage | MOTOR1 | PG0 | PG1 | PF15 |
| MOTOR2 | Y Axis | MOTOR2 | PF11 | PG3 | PG5 |
| MOTOR3 | Y1 Axis | MOTOR3 | PG4 | PC1 | PA0 |
| MOTOR4 | Z Axis | MOTOR4 | PF9 | PF10 | PG2 |
| MOTOR5 | Z1 Axis | MOTOR5 | PC13 | PF0 | PF1 |
| MOTOR6 | Extruder 0 | MOTOR6 | PE2 | PE3 | PD4 |
| MOTOR7 | Extruder 1 | MOTOR7 | PE6 | PA14 | PE0 |

### DM542T Wiring per Motor

```
Octopus Pro Motor Header     DM542T Driver
========================     =============
STEP (pin 2) ───────────────► PUL+
GND  (pin 1) ───────────────► PUL-

DIR  (pin 3) ───────────────► DIR+
GND  (pin 1) ───────────────► DIR-

EN   (pin 4) ───────────────► ENA+
GND  (pin 1) ───────────────► ENA-
```

**Note:** The Octopus Pro motor headers have a 4-pin connector:
- Pin 1: GND
- Pin 2: STEP
- Pin 3: DIR
- Pin 4: EN (active low)

---

## Endstop Connections

| Endstop | Function | Octopus Pin | Header |
|---------|----------|-------------|--------|
| DIAG0 | X Min (Carriage 0) | PG6 | DIAG0 |
| DIAG1 | X Max (Dual Carriage) | PG9 | DIAG1 |
| DIAG2 | Y Min | PG10 | DIAG2 |
| DIAG3 | Y1 (optional) | PG11 | DIAG3 |
| DIAG4 | Z Min | PG12 | DIAG4 |
| DIAG5 | Z1 (optional) | PG13 | DIAG5 |
| Probe | Bed probe | PG15 | PROBE |

### Endstop Wiring

```
Endstop Switch          Octopus Pro
==============          ===========
Signal ─────────────────► S (Signal)
GND ────────────────────► G (Ground)
(VCC optional) ─────────► V (+5V for powered sensors)
```

---

## Heater Connections

| Heater | Function | Octopus Pin | Header | Max Current |
|--------|----------|-------------|--------|-------------|
| HE0 | Extruder 0 Hotend | PA2 | HE0 | 5A |
| HE1 | Extruder 1 Hotend | PA3 | HE1 | 5A |
| HE2 | Chamber Heater | PB10 | HE2 | 5A |
| HB | Heated Bed | PA1 | HB | 10A (use SSR for high power beds) |

**Important:** For high-power heated beds (>10A), use a Solid State Relay (SSR) controlled by the HB output.

---

## Thermistor Connections

| Sensor | Function | Octopus Pin | Header |
|--------|----------|-------------|--------|
| T0 | Extruder 0 Temperature | PF4 | TH0 |
| T1 | Extruder 1 Temperature | PF5 | TH1 |
| T2 | Chamber Temperature | PF6 | TH2 |
| TB | Bed Temperature | PF3 | TB |

### Thermistor Wiring

```
Thermistor              Octopus Pro
==========              ===========
Wire 1 ─────────────────► T (Thermistor signal)
Wire 2 ─────────────────► G (Ground)
```

---

## Fan Connections

| Fan | Function | Octopus Pin | Header |
|-----|----------|-------------|--------|
| FAN0 | Part Cooling (optional) | PA8 | FAN0 |
| FAN1 | Part Cooling 2 (optional) | PE5 | FAN1 |
| FAN2 | Chamber/Enclosure Fan | PD12 | FAN2 |
| FAN3 | Hotend Fan 0 (optional) | PD13 | FAN3 |
| FAN4 | Hotend Fan 1 (optional) | PE4 | FAN4 |

---

## Power Connections

### Main Power Input
- **VIN**: 24V DC (or your system voltage)
- **GND**: Ground

### Motor Power
- The DM542T drivers have their own power input - connect them to your 24-48V power supply as per DM542T specifications.

---

## DM542T DIP Switch Settings

Set the DIP switches on your DM542T drivers to match the Klipper configuration:

### Microstepping (match `microsteps` in config)
| Microsteps | SW5 | SW6 | SW7 | SW8 |
|------------|-----|-----|-----|-----|
| 16 (X,Y,E) | OFF | ON | ON | OFF |
| 4 (Z axes) | ON | ON | OFF | OFF |

### Current Setting (adjust for your motors)
Refer to DM542T documentation for current settings based on your stepper motor specifications.

---

## Octopus Pro v1.0.1 Header Layout

```
┌─────────────────────────────────────────────────────────────┐
│                    BTT OCTOPUS PRO v1.0.1                   │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  [MOTOR0] [MOTOR1] [MOTOR2] [MOTOR3] [MOTOR4]              │
│     X       X2       Y       Y1       Z                    │
│                                                             │
│  [MOTOR5] [MOTOR6] [MOTOR7]                                │
│     Z1      E0       E1                                    │
│                                                             │
│  [HE0] [HE1] [HE2] [HB]    ← Heater outputs                │
│                                                             │
│  [TH0] [TH1] [TH2] [TB]    ← Thermistor inputs             │
│                                                             │
│  [FAN0-5]                   ← Fan outputs                  │
│                                                             │
│  [DIAG0-7]                  ← Endstop/diagnostic inputs    │
│                                                             │
│  [PROBE]                    ← Probe input                  │
│                                                             │
│  [USB] [POWER]                                             │
│                                                             │
└─────────────────────────────────────────────────────────────┘
```

---

## Flashing Klipper to Octopus Pro

1. SSH into your Raspberry Pi:
   ```bash
   ssh pi@192.168.86.20
   ```

2. Build Klipper firmware:
   ```bash
   cd ~/klipper
   make menuconfig
   ```

3. Configure for Octopus Pro v1.0.1:
   - Micro-controller: **STMicroelectronics STM32**
   - Processor model: **STM32F446**
   - Bootloader offset: **32KiB bootloader**
   - Clock Reference: **12 MHz crystal**
   - Communication interface: **USB (on PA11/PA12)**

4. Build:
   ```bash
   make clean
   make
   ```

5. Flash via SD card:
   - Copy `out/klipper.bin` to SD card as `firmware.bin`
   - Insert SD card into Octopus Pro
   - Power cycle the board

6. Find the serial port:
   ```bash
   ls /dev/serial/by-id/*
   ```

7. Update `printer.cfg` with the correct serial port.
