STM32 Timer Tutorial ⌚ // TRIAC Control ✅

Поділитися
Вставка
  • Опубліковано 28 чер 2024
  • ▬ I need your support ▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    If you like my videos, please like, share and subscribe.
    One small click for you, one giant leap for me :)
    🙏🙏🙏
    ▬ About this video ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    Controller: STM32F407VGT6
    Board: MikroE EasyMx PRO v7 for STM32
    ▬ More details ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    CubeMx project and source code available here:
    embeddedlightning.com/linearis...
    Looking forward to YOUR ideas / comments!
    ▬ My website ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    www.embeddedlightning.com
    ▬ LinkedIn ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    / en
  • Наука та технологія

КОМЕНТАРІ • 55

  • @bryannavarrete2052
    @bryannavarrete2052 2 роки тому +2

    Top notch lecture!

  • @roberttetrault2577
    @roberttetrault2577 2 роки тому +1

    Clear, concise, detailed, well-paced.

  • @yosmanyhernandezsanchez9760
    @yosmanyhernandezsanchez9760 Рік тому +2

    Simply wonderful. Thanks for sharing your knowledge in a such understandable and practical way. 👍

    • @AchimDoebler
      @AchimDoebler  Рік тому +1

      Thank you very much. Please like and share this video, so I can create more content like this. BR, Achim

  • @STAR_Boy_6
    @STAR_Boy_6 Рік тому

    I have never seen such training before, it was wonderful ❤💯

  • @FixTronics
    @FixTronics 2 роки тому

    Beautiful
    Thank you so much

  • @electronic7979
    @electronic7979 2 роки тому +1

    Helpful video

  • @BrunoLeppe
    @BrunoLeppe Рік тому

    Great video! Some time ago I was designing a phase controller for a PIC32 and, after obtaining the voltage equation v(a), I got stuck on the inverse function a(v). The LUT implementation seems like a great option! Thank you for sharing this knowledge.

    • @AchimDoebler
      @AchimDoebler  11 місяців тому

      I'm glad you like my video. BR, Achim

  • @mauriciocarazzodec.209
    @mauriciocarazzodec.209 Рік тому

    Awesome! I wish I had a professor just like you in college.

    • @AchimDoebler
      @AchimDoebler  Рік тому +1

      Thanks a lot for the kind feedback! If you like my videos, please support my channel by sharing it 🙏

  • @SanelKeys
    @SanelKeys Рік тому +1

    I've used PIC18 for this type of project and always used opto-isolated zero-crossing detection circuit, based on simple optocoupler. I don't remember of accuracy of measurement/detection delay of z.c signal behind real z.c event, but it was not a big deal. Big deal was processing capability of PIC18.

    • @AchimDoebler
      @AchimDoebler  Рік тому +1

      Sure, PIC18 can also do the job, I just chose the STM32 for this tutorial.

    • @SanelKeys
      @SanelKeys Рік тому

      @@AchimDoebler I've started recently to use STM32. Lot cheaper and better performance than for example dsPIC33. Not to mention bigger support and community.

  • @psykjavier
    @psykjavier 2 роки тому

    I am hats off with this amazing explanation... you are one mentor for me to achieve this relation between power electronic and uC development I am really dream with achieve the 3 phase motor control as well as I want to have your knowledge regarding with lvds and ltdc peripheral to control dpi displays.

    • @AchimDoebler
      @AchimDoebler  2 роки тому +1

      Thanks for your very kind feedback 🙏😊

  • @vahabheydarie9347
    @vahabheydarie9347 7 місяців тому

    its veeeeeery good❤

  • @Juan123qwerty
    @Juan123qwerty Рік тому

    Is it possible to change the contain of the CRRx register in the fly ??? Say I decide the angle by a pot and a adc read

  • @Yusuf-dx4hw
    @Yusuf-dx4hw Рік тому

    Amazing job, thank you Mr. Döbler. I need to execute for STM8S, what would you advice for me while getting help from your video for STM32 ?

    • @AchimDoebler
      @AchimDoebler  Рік тому

      What exactly do you mean here? Kind regards, Achim

  • @ibrahelsheikh
    @ibrahelsheikh 2 роки тому

    Can Design Ebike

  • @hungst3499
    @hungst3499 Місяць тому

    Hi. this video very good for technicial. I need funtion P(α) from excel file. U can help me?

  • @hoangsang2975
    @hoangsang2975 2 роки тому

    Hi, your project is great, but can i use the zero capture circuit with opto.

    • @hoangsang2975
      @hoangsang2975 2 роки тому

      @ཧᜰ꙰ꦿ➢ Thank you, can I ask if I need to change anything on STM32F103C8T6 using this code.

  • @senerdinc9019
    @senerdinc9019 2 роки тому

    thanks for such a kind labor, soon ? when ?

  • @08acbest
    @08acbest Рік тому

    Excellent work, wonderful tutorial. Is it possible to use you information to make a similar video in Spanish? Thank you

    • @AchimDoebler
      @AchimDoebler  Рік тому +1

      Thanks for the feedback. Well, you can use my material as long as your video references to this video / my channel. Also my video can be used with Spanish subtitles.
      Buenas noches

    • @08acbest
      @08acbest Рік тому

      @@AchimDoebler Thank you very much, I'll reference your video in my video description for sure.

  • @liamferro7123
    @liamferro7123 Рік тому

    It is the best video , really! but when i connect an LCD 20x4 VIA i2c, the lcd works fine but i dont have the pulses( output of the timer 1. What can i do? Danke ACHIM!

    • @AchimDoebler
      @AchimDoebler  Рік тому

      But in this video I don't show any I2C?!

  • @onjofilms
    @onjofilms 2 роки тому

    omg

  • @HansMuller-cf9qk
    @HansMuller-cf9qk Рік тому

    Danke ACHIM! I will write in english because the video is in english. I followed your video and i want to ask something if it is possible: You have made a code for zerocrossing detection, so you are generating 3 pulses in 20 ms and it works very fine. What i am trying to do is to give the pulses but 2 pulses in 20 ms. So, iam trying to detect only a positive edge modifying TIM1->CCER = 0x0001; // OC1: On, AH; IC2: On, Positive edges. It seems that work but with oscilloscope i see that's not perfect because casually appears 3 pulses in 20 ms. What i am wrong? Can you help me on this topic? Danke schön!

    • @AchimDoebler
      @AchimDoebler  Рік тому

      Hello Hans, yes, I know the reason for that. Could you please reach out to via email, because it's easier to communicate. Kind regards, Achim

    • @hansmuller8581
      @hansmuller8581 Рік тому

      @@AchimDoebler I wrote you Achim. if you can help will be my pleasure.Danke!

  • @liamferro7123
    @liamferro7123 2 роки тому

    Firstable it is a very good job! congratulations brother!
    Now i have a question: i want to change power variable from Potentiometer using ADC conversion! I have tried to do it but it doesnt function. Can someone help me?
    HAL_ADC_Start(&hadc1); // Start ADC Conversion
    HAL_ADC_PollForConversion(&hadc1, 1); // Poll ADC1 Peripheral & TimeOut = 1mSec
    power=HAL_ADC_GetValue(&hadc1); // Read The ADC Conversion Result & Map It To power
    HAL_Delay(1);

    • @AchimDoebler
      @AchimDoebler  2 роки тому

      Have you enabled the ADC clock? Have you properly initialized the ADC and also selected the correct GPIO analog alternate functions?

    • @liamferro7123
      @liamferro7123 2 роки тому

      @@AchimDoebler thanks for have answering.
      int power=0;
      void set_alpha( int alpha )
      {
      TIM1->CCR1 = alpha;
      TIM1->ARR = alpha + SCR_PULSE_WIDTH;
      }
      /* USER CODE END 0 */
      /**
      * @brief The application entry point.
      * @retval int
      */
      int main(void)
      {
      int alpha;
      HAL_Init(); // Initialize STM32 HAL
      SystemClock_Config(); // Configure core clock
      MX_TIM1_Init(); // Initialize Timer 1 (OC1 / IC2)
      MX_GPIO_Init(); // Initialize GPIOs

      alpha = alpha_lut[ power ]; // Get alpha from LUT
      set_alpha( alpha ); // Generate alpha on output
      while( 1 );
      /* USER CODE BEGIN 1 */
      /* USER CODE END 1 */
      /* MCU Configuration--------------------------------------------------------*/
      /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
      HAL_Init();
      /* USER CODE BEGIN Init */
      /* USER CODE END Init */
      /* Configure the system clock */
      SystemClock_Config();
      /* USER CODE BEGIN SysInit */
      /* USER CODE END SysInit */
      /* Initialize all configured peripherals */
      MX_GPIO_Init();
      MX_ETH_Init();
      MX_USART3_UART_Init();
      MX_USB_OTG_FS_PCD_Init();
      MX_TIM1_Init();
      MX_ADC1_Init();
      /* USER CODE BEGIN 2 */
      /* USER CODE END 2 */
      /* Infinite loop */
      /* USER CODE BEGIN WHILE */
      while (1)
      {
      HAL_ADC_Start(&hadc1);
      HAL_ADC_PollForConversion(&hadc1,1000);
      power = HAL_ADC_GetValue(&hadc1);
      /* USER CODE END WHILE */
      /* USER CODE BEGIN 3 */
      }
      i would read a potentiometer and put a value in power, in this way i am able to change alpha but doesnt work

    • @liamferro7123
      @liamferro7123 2 роки тому

      i also have tried to do that :
      HAL_ADC_Start(&hadc1);
      HAL_ADC_PollForConversion(&hadc1,1000);
      power = HAL_ADC_GetValue(&hadc1);
      TIM1->CCR1 = power;
      TIM1->ARR = power + SCR_PULSE_WIDTH;

  • @haru1fly
    @haru1fly 2 роки тому

    I'm looking forward to the source code.

    • @AchimDoebler
      @AchimDoebler  2 роки тому +1

      It will be uploaded on my website soon.

    • @AchimDoebler
      @AchimDoebler  2 роки тому +1

      Source code is now available!

  • @EmbeddedEnigma
    @EmbeddedEnigma 2 роки тому

    implementing it using stm32cubeide and HAL. But for some reason its not working as intended. I am using stm32f103c8

    • @AchimDoebler
      @AchimDoebler  2 роки тому

      Well, I suggest you to directly try my code shown on an STM32F4 since it will immediately work on this platform and then slowly port the configuration step by step to your F1.

    • @EmbeddedEnigma
      @EmbeddedEnigma 2 роки тому +1

      I actually made it work. Used trigger mode for timer and I kept the period to 10ms and change compare output time according to the table it worked then.

    • @Lichtdesign
      @Lichtdesign 2 роки тому +1

      @@EmbeddedEnigma Congratulations 👍🏻

    • @EmbeddedEnigma
      @EmbeddedEnigma 2 роки тому

      @@Lichtdesign thank you

    • @user-xs5en8ze8l
      @user-xs5en8ze8l 2 роки тому

      @@EmbeddedEnigma Hi, I have a similar problem not working properly on stm32f103c8t6, can you please share the timer initialization file .ioc?

  • @mail87523
    @mail87523 2 роки тому

    Please to share source code