Тёмный
No video :(

STM32 TIMERS #6. Timer Synchronization || 3 Phase PWM 

ControllersTech
Подписаться 40 тыс.
Просмотров 18 тыс.
50% 1

Опубликовано:

 

24 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 32   
@shahidalikhan7894
@shahidalikhan7894 10 месяцев назад
Thank you for your tutorial. I am new to STM controllers and have been following your tutorials to generate PWM signals using STM32. I'm using an STM32F407 board to generate two PWM signals, and from what I've gathered through online research, I need to use two timers, one in master and another in slave configuration. For the master Timer (Timer 1), I've set up two PWM channels. Channel 1 of Timer 1 is for PWM generation, and Channel 2 of Timer 1 is for triggering Timer 2, which is set to 'output compare no output' mode. I followed your tutorial to configure these channels. What i actually want is to change the phase shift between two these two PWM signals in run time by modifying the CCR registers in the main. The pulse value set in TIM1 CH2 is supposed to change the phase of the PWM generated by Timer 2. However, I'm unable to change the phase at runtime. I've tried changing the value of the CCR2 register in the main code, but it doesn't affect the phase despite updating CCR2. The phase of TIM2's PWM1 is delayed if I set the pulse of TIM1's CH2 in the Pinout and Configuration section of STM32CubeIDE. However, the phase does not change if I modify "htim1.Instance->CCR2" in the main function. This is the problem I am facing. I want to update "htim1.Instance->CCR2" during runtime. Could you please point out my mistake and provide the correct syntax? And if possible, could you explain it in simpler terms, as I'm relatively new to this?
@dmytrokorseko518
@dmytrokorseko518 Год назад
Thank you so much! Little remark. It needs to pay attention to the order of initialization of the master-slave timers in the code. For example, when timer 3 is the master and timer 1 is the slave, when generating the code CubeMX initializes timer 1 first by default. In this case, timer 1 is may starte by itself, asynchronously with the master (timer 3). That is, after the generation of the code, the sequence of initialization of synchronous timers should be adjusted.
@bobshiskabob
@bobshiskabob 7 месяцев назад
THANK YOU SO MUCH!!!!! This drove me crazy for two days until I found this comment. Tim2 initialized before Tim1
@tisserandstephane7845
@tisserandstephane7845 Год назад
Thanks for this great tutorial : all is clear with good explanation !
@singhman1026
@singhman1026 7 месяцев назад
Really good tutorial.... 👍
@dingkuncai4004
@dingkuncai4004 Год назад
Thank you and happy new year!
@TheEmbeddedHobbyist
@TheEmbeddedHobbyist Год назад
Nice video, well explained in that great disjointed voice. May have to find a controller to play with.
@Zurenio
@Zurenio 6 месяцев назад
You are the best...!!!
@siddharthmali5841
@siddharthmali5841 Год назад
Great tutorial.
@egar1956
@egar1956 16 дней назад
It is not possible to control the phase between the timers in runtime. Is there some mthod for this ? Thanks
@ahmadsayuti7937
@ahmadsayuti7937 7 месяцев назад
Thank you for the tutorial, Can you measure time difference phase shift between TIM1 and TIM2 with stm32?
@ControllersTech
@ControllersTech 7 месяцев назад
I am not sure but I think there is no dedicated feature for it. You can manually do it by using 2 input pins with external interrupt on rising edge. Then start the timer once you get the first trigger and stop the timer on second trigger.
@botak333
@botak333 5 месяцев назад
​​@@ControllersTechhi sir i have question, i used acin 220v for ipm igbt module ( after rectifier i get 310v dc) the ipm can handle till 600v, but my motor only acept 200v. Now how ti reduce duty cycle for HIN and lin input sir?? If i used 50%duty cycle i will get 155v out from ipm right sir??? I used stm32 g431 and st mc worckbench motor control sir
@abdoulayebodian3583
@abdoulayebodian3583 Год назад
thank you for this work is it possible to vary the phase shift between the two timer in real time by a potentiometer for example. keeping the same frequency.
@prabuddhajadhav2933
@prabuddhajadhav2933 6 месяцев назад
what if i want to read these three signals, these signals are similar to hall sensor data(120 phase shifted). how will i able to read these signals like 011 , 101, 110 etc
@chinmaykulkarni7835
@chinmaykulkarni7835 Год назад
Very good explanation. One question i have can we convert the 3 phase pwm to 3 phase spwm by CCP register
@mmt1024
@mmt1024 Год назад
Great video
@iliasmatz3922
@iliasmatz3922 Год назад
Hello, thank you for your valuable lessons! Is a possible way to implement phase shift between complementary pairs of different channels at the same timer?
@ControllersTech
@ControllersTech Год назад
Isn't it shown in the video ?
@iliasmatz3922
@iliasmatz3922 Год назад
As I can see the application of this video is generating phase shifted signals between different timers using master/slave configuration (timer synchronization). I am trying to achieve phase shifted signals at a single timer but different channels. I can see that TIM1 OC2 is used to trigger the TIM2. Mby if I choose Output Compare CH2 (instead of output compare no output) and Toggle on match mode (instead of Active level), will it make it possible?
@iliasmatz3922
@iliasmatz3922 Год назад
I am sorry if something doesn't makes sense, I am a beginner to STM32. Thank you very much for your immediate response!!!
@ControllersTech
@ControllersTech Год назад
I don't thik it works like that. The second timer needs to be in slave mode for the synchronization to work. Individual channels can't be configured i. Slave mode. You can try manually though. Start the different channels after some delay. It won't be precise, but if you adjust things properly you might be able to achieve it.
@davidm6967
@davidm6967 Год назад
Thank you so much for yor video, i have a question, i did it for 2 Phase, it works great, but after i stop my Timer Master and Slave in order to have Delay, i mean with HAL_ TIM_PWM_STOP, doesn't work my timer slave any more, can you help me about that? Here is my code, and my Tim3 works only one time and not permanently HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_3) HAL_TIM_OC_Start(&htim2, TIM_CHANNEL_4) HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_2) HAL_Delay(200) HAL_TIM_PWM_Stop(&htim2, TIM_CHANNEL_3) HAL_TIM_OC_Stop(&htim2, TIM_CHANNEL_4) HAL_TIM_PWM_Stop(&htim3, TIM_CHANNEL_2) HAL_Delay(200)
@alexandrev.3332
@alexandrev.3332 Год назад
Hello! How can I change in main.c the value of OC2REF in TIM1. I tried to put in while TIM1 -> CCR2 = 3000; but this not change anything. Can you help me?
@alexandrev.3332
@alexandrev.3332 Год назад
Anybody can help me? I tryed everything but only way to change is in the beggining on the boxes, I want to phase shift in a while the value that i want to put and change again and so on
@andrerodrigues4318
@andrerodrigues4318 Год назад
@@alexandrev.3332 Were you able to do so? I am also having that problem and need to phase sift from one value to another at a certain time while code is running
@alirezam1
@alirezam1 Год назад
Thanks. but with Subtitle would be perfect...........
@ControllersTech
@ControllersTech Год назад
Generally youtube generates the cc. I don't know why it's not doing for this video yet.
@osenson98
@osenson98 Год назад
How can get these 3 pwms with just one tim1?
@ControllersTech
@ControllersTech Год назад
You can use 3 channels of tim1 but you have to manually sync them..
@deveshshevde-cp8xq
@deveshshevde-cp8xq 2 месяца назад
@@ControllersTech how to mannually sync them?
@ahmedrefaie8671
@ahmedrefaie8671 Год назад
Good morning, sir. Where is the translation in Arabic and is it possible to make an explanatory video to make a motor with a pid system
Далее
Simple Flower Syrup @SpicyMoustache
00:32
Просмотров 2,4 млн
Yana bir yangi qo'shiq YORAM BIYO | Yaqin kunlarda
00:57
Lecture 13: Timer PWM Output
16:47
Просмотров 104 тыс.
STM32 PWM basics
18:31
Просмотров 20 тыс.
STM32 TIMERS #9. One Pulse Mode
13:42
Просмотров 11 тыс.