Hardware tools and blocks
Mostra commenti meno recenti
Hello
I would like to inquire about the implementation model that I built with Matlab on the hardware side. I did it with normal PWM and it works by connecting each pulse to the GPIO block.
So here as in picure, I need to implement it by using SPWM (Sinwave and comparing it with sawtooth). Which block should I use in hardware like (GPIOx or ePWM) and is there a private block that I should use instead of that used with normal PWM and simulation?
If anyone could please guide me, send me a hardware model or send a video to understand this issue,
These are the pulses that I want to send to my circuit and this picture includes the GPIO block from hardware tools.
Thanks in advance. 

3 Commenti
SALAH alatai
il 14 Lug 2021
LO
il 18 Lug 2021
Hi Salah, which kind of hardware would you like to interface with MATLAB and for what purpose ? It is not clear at all what your issue is, at least not to me :)
SALAH alatai
il 18 Lug 2021
Risposte (1)
Nivedita
il 23 Lug 2026 alle 6:24
0 voti
Hello Salah,
The GPIO block only writes a digital value from software at the model sample time. That can work for slow/manual pulses, but it is not suitable for accurate high-frequency PWM/SPWM because the timing depends on CPU execution and sample time.
For SPWM, the better hardware implementation is:
- Use the C2000 ePWM block. ePWM Type 1-4 - Generate enhanced Pulse Width Modulated (ePWM) waveforms - Simulink
- Configure the ePWM time-base as the carrier, for example up-count or up-down count.
- Generate the sine reference in Simulink.
- Convert the sine reference to a duty-cycle/compare value.
- Feed that duty/compare value to the ePWM block.
- Route the ePWM output pins to the inverter gate driver circuit.
- If complementary switches are used, configure dead time/dead-band to avoid shoot-through.
In other words, you normally should not compare sine and sawtooth in Simulink and then send the result through GPIO. The ePWM peripheral already provides the hardware carrier/timer and compare logic with much more accurate timing.
For a multilevel inverter, use multiple ePWM modules/channels to generate the required gate pulses. The ePWM outputs are still physical device pins, but they should be configured for their ePWM function, not driven as plain GPIO digital outputs.
GPIO DO is acceptable only for slow control signals or simple on/off outputs. For oscilloscope PWM/SPWM gate pulses, use ePWM.
Thanks,
Nivedita.
Categorie
Scopri di più su Control Peripherals in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!