Using STM32CubeMX the hardware peripherals of the STM32F405RG are set up. The most important hardware peripherals are timer 1, which drives the H-bridge at 16khz and the three ADCs, which sample the important signals at the moment where the signal is least disturbed, right before the PWM signal changes polarity. The Usart and the ADCs all use DMA for transfer, so as much CPU time is available as possible. After all ADC conversions are done, an interrupt is generated and the control loop can do it's thing.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.