Skip to main content

deng-foc-v4


DengFOC-v4 Hardware

Introduction

  • DengFOC-v4
  • MKS SimpleFOC v3.3 plus

DengFOC-v4

MCU: ESP32-WROOM-DA Module

Current Sensor: Inline current

Max Current: 5A each with cooling

open-loop.ino
  // Deng's FOC AS5600 test case:DengFOCV4
#include <SimpleFOC.h>

MagneticSensorI2C sensor0 = MagneticSensorI2C(AS5600_I2C);
MagneticSensorI2C sensor1 = MagneticSensorI2C(AS5600_I2C);
TwoWire I2Cone = TwoWire(0);
TwoWire I2Ctwo = TwoWire(1);


void setup() {
Serial.begin(115200);

I2Cone.begin(19, 18, 400000UL); // AS5600_M0
I2Ctwo.begin(23, 5, 400000UL); // AS5600_M1

sensor0.init(&I2Cone);
sensor1.init(&I2Ctwo);
}

void loop() {
sensor0.update(); // Remove if simple foc lib 2.20 and above.
sensor1.update();
Serial.print(sensor0.getAngle());
Serial.print(" - ");
Serial.println(sensor1.getAngle());
Serial.println();
}