How to use internal OPamp Stm32G431Cbu6

Hi every one.
I have stm32g431cbu6. I was finish wiring for the driver mosfet and mosfet. Now i want to make shunt resistor. I see that stm have 3x opamp, so its good for low side curent sensing.

Iposible simple foc to use that op amp, because it will simple for me no need external op amp agin.
Thank u somuch🙏

1 Like

I think the B-G431B-ESC1 code should work. Its shunts are 0.003 ohm, and opamp gain is configured as 16x Arduino-FOC/src/current_sense/hardware_specific/stm32/b_g431/b_g431_mcu.cpp at master · simplefoc/Arduino-FOC · GitHub

I get this error i just take from example and upload it sir.

Oke mate thank u so much now i can upload. I select stm32g4 series, mush be discovery.

So if i coustem the board and make the wiring diagram same like esc bg431 discovery. I need to selec like discovery type again or stm32g4 series mate??

You can keep using the Discovery B-G431B-ESC1 board definition with your custom board. It’s basically the same as Generic G431CBUx, except it includes those files for the current sense configuration, and a few #defines for the hall pins and such. You can ignore those if your custom board uses different pins.

Thanks mate, now i try to run the motor but alys show error. My encorder 2000ppr, thant means 8000cpr, i try to use it still error. My encorder connect to ABZ.

And why when i make quadature off, and put ppr 2000 i can check the pole pair. When i make on and put 8000 sometime say polepair to high, or else sir??