Hello !
I’m a fan of your community, very devoted and with lot of expertise on this complicated subject that is foc control, and I’m currently working on integrating SimpleFoc library into a custom pcb project for a small robot arm where I plan on using DRV8616C and STM32G431.
The project specifications and technical solutions are :
-Controling a small robot arm with only BLDC motors (for compact integration, power, longevity), with cheap gearboxes from aliexpress, in order to have good torque and to do slow but very smooth pre-programmed movements (the backlash or angle precision aren’t very important).
There will not be a lot of dynamic load.
-Foc control seems great in order to reduce commutation noise, improve efficiency and permit smooth movements, even if the gearbox already smooth the ripple.
-I will be using 2 different bldc motors : a small 2.8w (0.15A max, so like 2.5 ohms sensing resistor) B1625S03 motor (16 x 24mm) that I’ve put with a cheap gearbox from N20 brushed motor motoreducer type, and a generic (orange) 2212 950kv motor of wich the current will be limited to 1A max (so like 0.35 ohm sensing resistor). This motor will be associated with a cheap gearbox too.
-The small motor will rotate max at 16K RPM and have integrated hall sensors (that will be used for commutation control with simple foc) and will use an AS5600 for angle/speed feedback at the output of the gearbox (so not for foc commutation).
-The bigger motor will rotate at max 4K RPM and use MT6816 encoder for foc control and angle/speed control (before the gearbox).
Everything comes from aliexpress.
You can see the modules in the associated pictures.
-The mcu will be an STM32G431CBU6 (for now, for the prototype, from WeAct studio).
-The main problem I’m encountering is :
-As one of the motors I want to control is very small (3w, 0.15A), the existing boards using drv8616 (or another chip with integrated current sense) aren’t appropriate for this required current sensing, because their integrated sensing FET send a voltage too small at this current in order to have an good usable signal.
The other boards with discrete implementation (hall current sensors or sensing resistor with separated gate drive and mosfets) are also best suited for pretty high current (above 3a generally).
Yes, I could buy an existing board with discrete implementation and for example change the sensing resistors for ones with higher value, but there aren’t many options availables, and I need a system as small as possible, and currently it do not exist with my requirements for low current drive and simple foc ?
-Thereoff, the only practical solution I see right now is to use high value current sense resistor (2.5-3ohms for my 3w motor) in line with each of two DRV8616C’s output phase (the third being deduced by Kirchkoff’ law)…
As I saw, this application needs an high quality current sense amplifier with high common mode voltage tolerance, high slew rate and bandwidth and very good CMMR and precise feedback resistors in order to maintain a good CMMR.
At first I wanted to use the op amp integrated on the STM32G431 but I don’t know if their performance is adapted for in line current sensing (they have a very good slew rate and bandwidth, but as far as I know that’s best suited for low side current sensing anyway, and the CMMR is unknow) and as inline current sensing need bidirectionnal current flow, and that they operate on a single supply, I must add a dc bias to their input and I don’t know if i may do it appropriately…
Also, as their integrated feedback resistors aren’t very precise, I must configure the op amp in standalone mode (with externally set resistor values), but as I saw, it needs very high precision resistors value in order to have good CMMR, so maybe using an appropriate current sense amplifier (like INA303, or other current sense amplifier wich can have very precise laser trimmed resistors) is a really better solution ?
Furthermore, I simply don’t know how to configure the integrated op amp of the STM32G431 in the Arduino ide, as I’m pretty new to all of that ahaha…
-I see another solution, if, to save money (as current sensing amplifiers are pretty expensive) I want to use the integrated op amp of stm32G431 (best suited for low side current sensing I think) : it’s to do low side current sensing, so to make a discrete implementation with dedicated gate drivers and separated mosfets with an added low side shunt resistor that I can select, but this solution is cumbersome…
-So I think that will stick with the first solution : inline current sense with DRV8616C (in hardware setting mode, so configured with resistors), two 2.5 ohms sensing resistors and two INA303 (or similar) current amplifiers.
And the current signal is given to the STM32’s ADC (wich SimpleFoc use in two channels mode in single-ended configuration, not differential?), wich is really good from what I’ve heard.
The pcb boards will be the same for the small and big motor, only the sensing resistors will differ. The MT6816 position sensor for the big motor will be on a separated module.
-I think that this project maybe a good introduction to small bldc motor control with foc for small robot arms etc.
Because that’s a lot better than what we have right now if we want to go small (that is : classic servo from the radio controlled world, that aren’t smooth, fast and precise at all, or brushed motoreducers, that are OK but not very professionnal because lifespan and noise aren’t good).
-So to recapitulate : I need your expert help in order to know :
-If my main solution is right
-If so, wich current amplifier do I have to choose
-If the op amp from the stm32 for in line current sensing are sufficient for my requirements, and if so, how to configure them in arduino IDE (I think that I need ioc file from Cubemx configurator and to import them aside the arduino project?)
-Any other advice that goes throught your mind !
Thanks for your time, any help will be greatly appreciated !