I always thought that FOC itself is very suitable for packaging into a module, so I made a universal 3205 brushless motor driver board, which is the same shape as the motor itself, with a reserved I2C interface, and can be integrated into other projects as a slave device. The master device only needs to read the angle through I2C, send the desired torque, control mode and other high-level instructions, and the underlying FOC algorithm runs in STM32.
Chip:
STM32F070 Main control
MT6701 Magnetic encoder
TMC6300 Motor driver chip
SN74LVC3G04DCTR Three-way inverter, used to save PWM pins on the microcontroller, only 3 outputs are needed to drive 6-way motor driver chip
Some ideas during design:
The magnetic encoder is a separate small board, which is supported by a pin header in the middle, because the 3205 motor is hollow, and in some application scenarios, the wire must be passed through the middle, so it is supported to leave space for the wires
The magnetic encoder board can be pasted up and down, and can be flexibly adjusted according to the application scenario
Three groups of motor interfaces are left on the back, one group is the original 0.8mm terminal of the motor, one group is 1.25mm terminal, and another group is 2.54mm pad, this is to consider that if the original line is broken, the plug-in can be replaced or directly soldered on the pad
Two LEDs are connected to CH2 and CH3 of TIM1, and the brightness can be adjusted by PWM
The 4P pin header is the motor power supply (5-9V) and I2C interface, and there is an AMS1117 on the board. If the motor VCC is connected, there is no need to connect 3.3v separately. But you can also not solder AMS1117 and power the chip separately from the 2P pin header of aux3v3. There is also a 2P pin header that is all GND. These three sets of pins are arranged in a triangle, which is suitable for designing an expansion baseboard and can be firmly plugged into it.
Note:
F030F4P6 can be replaced (cheaper). The I2C pins become the two pins of the LED. If you don't use I2C, you can replace them perfectly. The three outputs of TIM3 are exactly the same; if you want to use I2C, you need to fly a wire
program Demo:
https://github.com/xdedss/f070f6p6_foc_borad