B-G431-ESC serial monitor

Hi i trying to run a flycat 5010 36okv motor with a b-g431-esc using platform io but i cant seem to see an serial data printing on the serial montior. I’m using the example code of the i2c magnetic sensor under the utils folder can somebody help?

You are not sharing how you wired the USART, how you configured it in platformio and your code. It’s hard to help.

i connect the b-g431-esc1 via the stlink usb port to my pc and i found that serial wont work and i have to use the serial2 and it worked and i got the serial data in the serial monitor and to be simple i just uploaded the open velocity control loop to the platform io but the motor is just buzzing and not spinning i’m using the below :
12v power supply
flycat 5010 360 kv motor with 0.5 phase resistance and 7 pole pairs
this the configuration and code i’m using
Screenshot 2024-03-27 125735

So you have no serial monitor problem anymore.

yes but i can’t get the motor to spin

What’s the current draw in this state? If it is still very low, you could try raising the voltage a bit.

Also the STM32G431 MCU is a very fast MCU, so for purely open loop mode your main loop will be running very fast, maybe higher than the PWM frequency… you can consider adding a small delay like delayMicroseconds(500) which will slow the main loop down a little.

after adding the delay it is still not working and the current is 2 amps even after increasing the voltage limit to 12 it is still not spinning

Huh, at this point I would definately lower the voltage, see if you can run it at less than 2A so it doesn’t get too hot, and start digging into where the problem lies using an oscilloscope - e.g. do you get PWM signals as expected, are the FETs switching as expected, and are voltages at the levels they should be…

yes it getting quite hot at 2A okay I’ll check with an oscilloscope but how to check whether the FETs are switching correctly?

I’ve got the motor to spin with board don’t know why the motor didn’t work with the old one maybe when i tried to solder the i2c pins for as5600 something must have happened still the board works and i can program it but the motor it not spinning anyways i want position control so i need to connect the i2c sensor to it but i’m scared if this board also will not work can you recommend any other way to do position control or it is worth to try the i2c wth as5600 again? any suggestions @runger

Unfortunately this board is very hard to work with due to its tiny size. Perhaps you can take some consolation knowing you are not alone - and many people have written to the forum and discord about their problems with this board.

Because of the tiny size you will need good equipment and also a certain amount of patience in soldering in order to make reliable solder connections. Be sure to use very thin, flexible wires.

When you have made the connections, using some non-conductive glue compound or just some tape to keep wires in place, to prevent your hard work becoming undone due to physical stress on the cables.

You can certainly try again with the AS5600, or you can also consider using an ABZ type encoder, for which the board has dedicated (but tiny) connection pads.

i have a AS5600 breakout board this one it

It operates on 3.3v can i directly hook it up with the b-g431-esc1 like this

Looks like you’ve grabbed that image from this thread:

That thread says you need to uncomment some code in PeripheralPins, add a few build flags and perhaps assist sda/scl by adding stronger pullup resistors.

So yeh it seems possible.

Some of that advice seems out of date (but useful to read it). For instance the Peripheral Pin uncommenting isn’t needed - you can see here where this variant is defined:

The AS5600 is cheap for a reason. It is slow and its precision (12bit) means it is only good for low pole count motors. Make sure you ramp up the i2c bus speed as much as you can e.g. 400Khz at least. Slow sensors cause all manner of tuning problems.