A comprehensive guide for the MKS XDRIVE Mini, a cost-effective, high-performance FOC driver for robotics. This repository contains configuration files, unbricking procedures, and multi-driver CAN bus setup instructions.
Watch the step-by-step video guide here: MKS XDRIVE Mini Full Instruction & Setup
Follow these steps to configure your driver using the ODrive tool:
- Install Python: Download from python.org.
- Important: Select "Add python.exe to PATH" during installation.
- Install ODrive Tool: Open PowerShell and install the ODrive package version 0.5.1.post0.
- Configuration: Run odrivetool in your terminal. Use the commands provided in the my_config.txt file.
- Motor Tuning: Ensure you set your pole pairs correctly. For example, for an LA8308 170kV motor, you would enter: odrv0.axis0.motor.config.pole_pairs = 20 Note: Calculate this by counting your motor magnets and dividing by 2.
- Web GUI Interface: For a visual setup, use this Awesome WEB GUI.
- Arduino/ESP32 Setup: Ensure your board has CAN support.
- For ESP32, place the ODriveEsp32Twai.hpp adapter in your arduino/libraries/OdriveArduino/src folder.
- macOS Support: odrivetool is functional on Mac, but the GUI is currently unsupported.
- Do NOT use the "upgrade" command in odrivetool. This driver ships with modified v0.5.1 firmware; standard upgrades will brick the device.
- Unbricking: If bricked, you must use an ST-Link programmer. You can find dumped original firmware in this repository, you will need ST-linkV2 to unbrick.
By default, the MKS XDRIVE Mini acts like a dual-axis ODrive. This causes CAN ID conflicts when connecting multiple drivers.
- The Fix: Change the "ghost" Axis1 to a "listen-only" ID to clear the bus by setting: odrv0.axis1.config.can_node_id = 63
Current testing shows that updating to v0.5.6 may result in motor inactivity (likely due to different pin assignments for the DRV8301). Stick to v0.5.1 for now.
Disclaimer: This repository is a community-made guide. I have no affiliation with the manufacturer.