cancel
Showing results for 
Search instead for 
Did you mean: 

Simulating TL494 Full-Bridge (H-Bridge) control using STM32F103 – 180° phase-shifted PWM

Strsh
Visitor

Hello everyone,

My name is Aleksandar, and this is my first time posting here.
I’m trying to simulate the operation of the TL494 controller in a full-bridge (H-bridge) configuration using an STM32F103 (Blue Pill) and STM32CubeIDE with the HAL library.
Project goal: The aim is to simulate the TL494 controller and apply it to control MOSFETs in a full-bridge (H-bridge) configuration.

The goal is to generate two PWM signals that are phase-shifted by 180°.
I would like to have full control over the switching frequency (1kHz - 200kHz) and duty cycle (5% - 45%) , and I also want to implement dead time (5%) that is proportional (percentage-based) to the frequency.

I have already tried to simulate this behavior in CubeIDE, but I couldn’t get the correct phase-shifted signals.
I would really appreciate some guidance or examples on how to properly configure the timers for this.

My question is:
Is it better to use CH1 and CH1N of a single timer (with complementary outputs), or two independent timers?

Thank you in advance for your help and advice!
This is just an introduction to my project, and I’ll likely have more questions as I move forward.

Best regards,
Aleksandar

1 REPLY 1
Ozone
Principal II

To be honest, I have very little experience with motor control, so I can't really help in this regard.

However, the STM32F103 is one of ST's very first Cortex M3 devices.
It's release far predates Cube/HAL, thus the number of Cube examples is surely very limited.
Most examples and extensions are created with the "legacy" SPL (Standard Peripheral Library), which is still available on ST's site : https://www.st.com/en/embedded-software/stsw-stm32054.html

And, if you check, there are a lot of extension packages for motor control and other tasks available, based upon SPL (section "MCU and MPU embedded software") : https://www.st.com/content/st_com/en/products/microcontrollers-microprocessors/stm32-32-bit-arm-cortex-mcus/stm32-mainstream-mcus/stm32f1-series/stm32f103/stm32f103r8.html#tools-software

 

I suggest to either take the SPL example closest to your requirements and adapt it to your needs, or try to replicate the timer / PWM settings with Cube.