For that motor, we are developing an electronic speed controller using the hall sensors. The microcontroller is an atmega328p and we are generating a PWM frequency of 8kHz in the low MOSFETs with a 6-step commutation.
The problem is that this configuration generates high currents (4 A in the source and 10 A in each phase) and in a short time of motor operation, the MOSFETS start to heat up.
I would like to know if the problem is in the design of the controller, the frequency of the PWM, or something that we are not considering to improve the performance of the controller.
How can I improve the design of my electronic speed controller?