Hi Ben,
I just received my Deng FOC board. Shame I did not see your post before, it took me some time to find the sample code, the only way of knowing the pins to allocate etc.
I agree the board seems to do everything that simpleFOC offers.
As I go through the examples I reached the dengFOC Current test example. This one crashes on me. Does it work for you?
Regards,
Carl
For other readers this is the Feng FOC 3.0 driven by an ESP32 development board lolin32 lite on the bottom.
Here is the code.
//Current detection test routine Test hardware:FOC V3.0
#include <SimpleFOC.h>
// Current Detection
// Sampling resistor value Gain ADC pin
// check if your board has R010 (0.01 ohm resistor) or R006 (0.006 mOhm resistor
InlineCurrentSense current_sense0 = InlineCurrentSense(0.006, 50, 39, 36, _NC);
void setup() {
Serial.begin(115200);
delay(1000);
Serial.println(“Current sense ready.”);
delay(1000);
// Current Detection
current_sense0.init();
//current_sense0.gain_b *= -1;
}
void loop() {
Serial.println(“Current sense ready.”);
PhaseCurrent_s currents0 = current_sense0.getPhaseCurrents();
float current_magnitude0 = current_sense0.getDCCurrent();
Serial.print(currents0.a1000); // milli Amps
Serial.print("\t");
Serial.print(currents0.b1000); // milli Amps
Serial.print("\t");
Serial.print(currents0.c1000); // milli Amps
Serial.print("\t");
Serial.println(current_magnitude01000); // milli Amps
Serial.println();
}
And here is the crash
Rebooting…
Current sense ready.
Guru Meditation Error: Core 1 panic’ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x400d1d1b PS : 0x00060830 A0 : 0x800d11e6 A1 : 0x3ffb27d0
A2 : 0x3ffc1180 A3 : 0x00000014 A4 : 0x0800001c A5 : 0x00000003
A6 : 0x00000001 A7 : 0x00000000 A8 : 0x00000000 A9 : 0x3ffb27b0
A10 : 0x000003e8 A11 : 0x3ffbef48 A12 : 0x00000000 A13 : 0xffffcfc7
A14 : 0x3ffb7e50 A15 : 0x00000000 SAR : 0x00000003 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000020 LBEG : 0x4008646d LEND : 0x4008647d LCOUNT : 0xfffffffa
Backtrace:0x400d1d18:0x3ffb27d00x400d11e3:0x3ffb27f0 0x400d323a:0x3ffb2820
ELF file SHA256: 0000000000000000