MKS XDRIVE mini V1.0 - SimpleFOC support

Hi guys,

We have been discussing the awesome MKS XDrive Mini boards form Makerbase for some time now. They are really inexpensive and have awesome characteristics.

For those interested in using them with SimpleFOC here is an example platformio code that configures

  • Driver
  • Sensor
  • Motor
  • Serial commander (setup for webcontroller)
  • CAN communication
  • Real-time timer based FOC (loopFOC at 20khz and move at 4kHz)

I’ve also included some CAN communication examples for those that want to use it in the can_scripts section.

This is an amazing board. It could be a much more robust alternative to the B-G431B-ESC1.
So yeah, if someone wants to use it with SimpleFOC and not Odrive firmware this repo is a good starting point.

Have fun!

Been waiting for this these boards to get some traction! I have a MKS_S, did you have any issues with the DRV8301 init? I struggled to get the shunt gain to actually apply successfully, ended up with this mess! But it works :stuck_out_tongue:, curious if your implementation is enough to keep it simple

Hi there,

I did modify the gain to 80 in my code. Increased it quite a bit, to make it more smooth with my motor.

I am not sure that the way I did it is the best way but it should work :smiley:
I’m pretty sure I did test it. I dont have the setup with me now so I cannot confirm 100%.
But I’m pretty sure I did test it :smiley:

Yeh okay! I might dust off my board and test your way. Keen to try out the Mini, just need a project to use it on. No issue with encoder? There were comments on the SFOC forums a while back that noise was an issue which originally steered me away from it.

I was testing my motor with 10+ amps of current and the board suddenly browned out and restarted, and in a few seconds it started smoking. Is there an explanation for this? Could it be a glitch in the mosfets causing a short circuit in the short time it browned out.