cancel
Showing results for 
Search instead for 
Did you mean: 

Is this possible with complementary PWM?

Cemre .
Associate II
Posted on December 22, 2016 at 12:43

Hello everyone,

I want to ask something about Advanced Control Timers.

In RM0008, I saw an example (Fig. 95) but I can't understand how it is possible.

I tried an example and my PWM signals (ex. on Fig. 95 'OCx & OCxN') are complementary PWM both of them. But I want that, OCx is in PWM mode, OCxN is normal Logic mode, which is the same in Fig.

Is this possible?

And sorry for my bad English grammer.

https://spostimg.org/t8hybf4kr/Ekran_Al_nt_s.jpg

complementary pwm timers advanced-control-timer

4 REPLIES 4
hatem_ch
Associate II
Posted on December 23, 2016 at 11:25

Hi,

Yes, this is feasible. Here is attached a source code snippet which I used before to generate that waveform.

Which is of interest in that snippet is the void commutate5(uint32_t); function's body. it describes the timer channels configuration for each phase of the 6 phases a BLDC motor can be in.

All the rest of the source code snippet is for demonstration purpose (you may think of it as a debug project for the commutate5 function). It is mainly simulating a BLDC rotor that's rotating in a constant angular speed so it is continuously changing phase after a constant time delay. For sure you can chage that with a real feedback on the rotor position provided by the Hall-sensor interface buit-in into STM32 GP timers. For that purpose you will need a second timer.

You should aslo know about STM32 GP timers synchronization. Because the timer you will use for the Hall-sesnoring feature should trigger the commutation event on the timer controlling the BLDC motor. I'm supposing that you already know about STM32 GP timers' Commutation event (the backbone feature for BLDC control). Within the demnstration example, the commutation event is triggered by software after a certain ~constant delay (constant angular speed assumption) as there is no real feedback.

If you are going to impelment this, I mean the part related to hall-sensor and the real feedback, may you please share the source code snippet for doing that. Thanks!

hatem_ch
Associate II
Posted on December 23, 2016 at 11:27

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6np&d=%2Fa%2F0X0000000bvn%2F_kPvu0mLYX6ByCU9Zl2C4qhv7psjmz03PWZI330X1s4&asPdf=false
Posted on December 23, 2016 at 11:43

Hi

CHEBIL.Hatem

‌,

To format source code, click on ''More >> Syntax Highlighter'':

0690X00000605taQAA.png

-Nesrine-

Posted on December 23, 2016 at 13:40

Thank you

I implemented that with CubeMX in a few minutes. But I don't know how can I share all the project here. In my project, we just need to change Commutation Callback function with your Commutate5 content.

I will implement all of them and share with a .zip file here.

Thanks again.

Edit: I shared all of the project with rar file and the image is my 6 output on logic analyzer..

________________

Attachments :

23Dec2016.JPG : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hz1P&d=%2Fa%2F0X0000000bFK%2FF1mtYR4tIKYtoJko.YnOJQLlI4lnH8sJc2gcrpGcE8s&asPdf=false

HALL_Try2.rar : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hz1K&d=%2Fa%2F0X0000000bFL%2F8.OvFx2iu2ENULBV1YlDpEA_xpvtwC8bW.AHH2yBF_g&asPdf=false