Тёмный
No video :(

27. STM32CubeIDE Servo Motor. PWM with STM32F103C8T6 

MicroPeta by Nizar Mohideen
Подписаться 7 тыс.
Просмотров 22 тыс.
50% 1

STM32 Blue Pill for beginners
Code and diagram are at www.micropeta....
Servo with potentiometer is at • 28. STM32CubeIDE Servo...

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

 

24 авг 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 26   
@NizarMohideen
@NizarMohideen 2 года назад
Since I set Counter Period 9999 for PWM, I can change Pulse from 0 to 9999. 0 being 0% and 9999 being 100% pulse width. __HAL_TIM_SET_COMPARE() is a macro to set the pulse on the fly. For the servo motor, I need 50 Hz signal Clock frequency = 8 000 000 Hz If I divide by Prescalor 16 Frequency = 8000000/16 = 500000Hz If I divide again by Counter period 10000 Frequency = 500000/10000 = 50Hz If it is 50Hz, The full pulse with time is = 1/50 seconds = 20 milli seconds For the servo motor, I need to change the pulse from 0.5 ms to 2.5ms Full 100% pulse is 10000 according to counter period 10000 0 → 0 20 milli seconds → 10000 So, 0.5 milli seconds → 250 and 2.5 milli seconds → 1250 So I can set __HAL_TIM_SET_COMPARE() from 250 to 1250
@danielgebala3581
@danielgebala3581 11 месяцев назад
Great! It works! But I don't understand why we need to change pulse from 0.5ms to 2.5ms. Isn't 1ms for servo 0 deg and 2ms for servo 180deg position?
@lukecage2131
@lukecage2131 8 месяцев назад
@@danielgebala3581 i thought so too, but it seems that the datasheet is incorrect lol
@tascheri
@tascheri 2 месяца назад
thank you for your valuable tutorials. I am repurposing old drone flight controllers with great success.
@dduringddu
@dduringddu 7 месяцев назад
thank you very much!!!
@akshaykumar-uv5ck
@akshaykumar-uv5ck 7 месяцев назад
Sir plz explain the comparison in detail we cant understand properly the rotation
@amirhossein1108
@amirhossein1108 Год назад
what is the meaning of those numbers. a kid also can do Just copy and pasting
@lehieu665
@lehieu665 Год назад
sir it seems like there is no pulse from A1 pin in my stm32f103c8t6. can you help me ?
@tiennguyenminh6454
@tiennguyenminh6454 Год назад
ông sửa được chưa, tôi cũng đang không thấy nó chạy
@alaawahba8
@alaawahba8 2 месяца назад
is it possible to power the mcu from st link debugger? because i tried the code and the servo twitches only but works great on proteus simulation! Thanks
@alaawahba8
@alaawahba8 2 месяца назад
Also the servo works fine with arduino
@NizarMohideen
@NizarMohideen 2 месяца назад
Give power from usb 5V
@alaawahba8
@alaawahba8 2 месяца назад
@@NizarMohideen I'm using the 5V pin from debugger to supply the servo, and 3.3V to supply the mcu, and a common ground
@christopherdyja5616
@christopherdyja5616 2 года назад
I am having no luck with a servo and the blue pill no matter which tutorial i'm following. I even use a logic converter for the servo but doesn't work
@christopherdyja5616
@christopherdyja5616 2 года назад
Okay i found the problem.. I had to give the servo a seperate power source because my USB hub probably couldn't handle it
@NizarMohideen
@NizarMohideen 2 года назад
Thanks
@stefanoparlapiano445
@stefanoparlapiano445 Год назад
I have the same problem, I'm working with the SG92R, and I cannot do it work with anything. I've tried use an external power source, but the problem still there
@_NguyenQuangTrung
@_NguyenQuangTrung 5 месяцев назад
i want to combine Servo Motor with RFID RC522 to make an auto open door, can you give me some advices
@NizarMohideen
@NizarMohideen 5 месяцев назад
Do RC4522 separately and make sure it works Do servo motor separately and make sure it works Do servo motor separately with 72MHz clock, set TIM2 Prescaler set to 143 (Instead of 15) and make sure it works Combine together :)
@digitalzoul57
@digitalzoul57 4 месяца назад
what the TIM freq is it 72MHZ ?
@NizarMohideen
@NizarMohideen 4 месяца назад
Please see this video. The answer is here ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-HN9sKhKxy7M.html
@sudhansumtripathy
@sudhansumtripathy Год назад
Hi Sir, I tried with the same code with STM32NucleoF401RE but its not working can you show us with the stm32f4 nucleo please
@woodiedave1179
@woodiedave1179 Год назад
I am having the same issue did you solve it?
@sudhansumtripathy
@sudhansumtripathy Год назад
@@woodiedave1179 sorry bro, nope was not able to solve it till now
@danielgaribay9029
@danielgaribay9029 10 месяцев назад
I was having the same issue. I changed control to PB3(D3) instead of PA1. I have the same board.@@sudhansumtripathy
@koraycankaya1579
@koraycankaya1579 2 года назад
Hello Sir, I need you to ask a question. Can I send it to your e-mail address? I need to explain it well in order to be easier to understand by you. Is it possible? My question involves servo motor usage that's why I commented down here. Thanks...
Далее
Я ДОСТРОИЛ ЗАВОД - Satisfactory
19:13
Просмотров 113 тыс.
💀СЛОМАЛ Айфон за 5 СЕКУНД😱
00:26
29. STM32CubeIDE SD CARD. SPI with STM32F103C8T6
14:45
6 Horribly Common PCB Design Mistakes
10:40
Просмотров 190 тыс.
Servo SG90 | #3 STM32 và ngoại vi
9:42
Просмотров 2,9 тыс.
Using docker in unusual ways
12:58
Просмотров 440 тыс.