From your pin choice - I guess you are targetting TIM3. Which I guess is ok - it can’t do 6PWM but should be fine for 3PWM.
Perhaps you can enable the printTimerCombination by defining SIMPLEFOC_STM32_DEBUG as a build arg. This should confirm that PA6, PA7 and PB0 have been correctly identified as TIM1 CH1, CH2, CH3 (non inverted)
I suspect this is unrelated but noticed that BLDCDriver3PWM doesn’t set pinMode=OUTPUT on the enable pins - this is left for you to do. But you said you saw HIGH on those enables.
With only 2 PWM working - your motor should be vibrating (not rotating) - if it is not vibrating then you probably have a driver issue as well as a PWM issue.
I changed the microcontroller.
The engine jerks under Trapezoid control.
When controlled by Sine, nothing happens.
I suspect that the Enable signals still need to be controlled, but they are constantly at a high level.
On Monday I can take measurements with a logic analyzer.
The motor began to twitch in Trapezoid mode.
In Sine mode nothing happens.
It is necessary to somehow additionally control the Enable pins on the driver.
At the PWM_A, PWM_B and PWM_C inputs I see a normal PWM signal. But at the driver output I have a signal only in Trapezoid mode.
What could be the problem?
Maybe the library does not work correctly with the MP6540H driver?
No, the MP6540H is just a 3-PWM driver, the library can certainly work with it.
It doesn’t look like you’re dealing with the nSLEEP pin in your code? If your schematic is accurate it looks like you’ll have to pull that high to switch on the driver…
Bringing up a new MCU board with onboard driver needs careful attention to the software side. Don’t assume anything is automatic. Set all the pins to the state you need, make sure the clock setup matches the oscillators you’re actually using, etc…
There is a suspicion that the wrong drivers were received… Instead of MP6540H I got MP6540HA (6PWM). And my circuit is not working correctly.
I’m designing a new board.
I use the Cube to correctly set the pins for connection.
How to choose the right timers when setting up a project?
This driver can also work, I’ve used it myself. You will need 6-PWM mode, and it is a good idea to choose all the pins on TIM1 or TIM8, using “PWM Generation CHx CHxN”. You don’t need the Output Compare option.
Thank you!
At the moment my engine spins for 2-5 seconds and stops. PWM signals are sent to the driver and nFAULT is in a high state (no error).
How do you work with current sensors?
What is your basis for VREF?
And where are ENA, ENB, ENC, PWMA, PWMB, PWMC connected?
Maybe you can show the full diagram?