B-G431B-ESC1 - Arduino not working

Hello,
as the title says im struggling to get a B-G431B-ESC1 working.
I used just the basic open loop velocity code to test it, but i think i forgot something, bc
i can upload it without proplem, but then nothing happens.
Here is the code:

#include <SimpleFOC.h>

BLDCMotor motor = BLDCMotor(6);
BLDCDriver6PWM driver = BLDCDriver6PWM(PA8,PC13, PA9,PA12, PA10,PB15);
float target_velocity = 10;

void setup()
{
driver.voltage_power_supply = 12;
driver.init();
motor.linkDriver(&driver);
motor.voltage_limit = 3;
motor.velocity_limit = 100;
motor.controller = MotionControlType::velocity_openloop;
motor.init();
}
void loop()
{
motor.move(target_velocity);
}

After uploading i get this message:

ST-LINK SN : 0670FF393036424257175128
ST-LINK FW : V2J38M27
Board : B-G431B-ESC1
Voltage : 3.24V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x468
Revision ID : Rev Y
Device name : STM32G43x/G44x
Flash size : 128 KBytes
Device type : MCU
Device CPU : Cortex-M4

Memory Programming …
Opening and parsing file: sketch_jun20b.ino.bin
File : sketch_jun20b.ino.bin
Size : 42944 Bytes
Address : 0x08000000

Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 20]
Download in Progress:

File download complete
Time elapsed during download operation: 00:00:01.204

RUNNING Program …
Address: : 0x8000000
Application is running, Please Hold on…
Start operation achieved successfully

It would be awesome if someone could help me.

@David_Leitner

There is a thread about this board with sample code you can copy/paste, could you please check it out first?

https://community.simplefoc.com/t/b-g431b-esc1-beginner-guide-i2c-guide/515/15

Cheers,
Valentine

Thats what i did first. ^^

Do you have an oscilloscope? Remote debugging a hardware setup is rather challenging. In my case I started with checking the output for signals before I even connected a motor. First I tried flashing the LED, then I moved to reading potentiometer, and connected the motor at the very end when I was sure I was getting signals controlled with the blue potentiometer.

I may be superstitious but could you please replace this above with

BLDCDriver6PWM driver = BLDCDriver6PWM(PHASE_UH, PHASE_UL, PHASE_VH, PHASE_VL, PHASE_WH, PHASE_WL); 

and check if any difference?

I tried, but it didnt make any difference.
I had to write this:

BLDCDriver6PWM driver = BLDCDriver6PWM(A_PHASE_UH, A_PHASE_UL, A_PHASE_VH, A_PHASE_VL, A_PHASE_WH, A_PHASE_WL);

now it works. :grinning:

1 Like

Yeah. That’s a bug I found there. Even I uncommented the pin, my motor is still not smooth. Just jittering. Frustrating…