Deng FOC Board - Easy to use!

For anyone trying to use current sensing with MKS-DUALFOC with esp32 and also could not find documentation anywhere on how to use this board (In post above there is 0 direction/help on header pinout which I found annoying that they then pointed to another piece of hardware to buy on aliexpress instead of one in the “supported hardware” I already bought that was listed in the simpleFOC docs but I can complain about that another time) here is the pinout you need. My board from elixpress included headers to solder to pads in picture. Takes a bit of skill with smaller soldering iron.

Pinout numbering I listed here can be found on schematic on left hand side here: MKS-DUALFOC/Hardware/MKS DUAL FOC V3.1 PLUS_001 Schematic.pdf at main · makerbase-motor/MKS-DUALFOC · GitHub

Just connect common ground between esp32 on MKS board powered by 12v+ power supply and pwm pins for bldc motor go to phaseA,B,C and Current0 A/B go to GPIO ADC pins (pins have to have adc functionality to read analog voltage from MKS board) on esp32 board. You then have to use Lowsidesense from simpleFOC library with adc pins you selected and bababooey

BLDCMotor motor = BLDCMotor(11);

BLDCDriver3PWM driver = BLDCDriver3PWM(25, 26, 27);

LowsideCurrentSense current_sense = LowsideCurrentSense(0.01, 50.0, 36, 39, _NC);

On my esspresif esp32 dev module pins 36, 39 are listed as VN and VP respectively.

25, 26, 27 are my pwm “phase” wires to MKS board.

Hope this helps anyone who runs into same problem