No video

27. STM32CubeIDE Servo Motor. PWM with STM32F103C8T6

  Рет қаралды 22,097

MicroPeta by Nizar Mohideen

MicroPeta by Nizar Mohideen

3 жыл бұрын

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

Пікірлер: 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.
@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
@akshaykumar-uv5ck
@akshaykumar-uv5ck 7 ай бұрын
Sir plz explain the comparison in detail we cant understand properly the rotation
@dduringddu
@dduringddu 7 ай бұрын
thank you very much!!!
@alaawahba8
@alaawahba8 Ай бұрын
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 Ай бұрын
Also the servo works fine with arduino
@NizarMohideen
@NizarMohideen Ай бұрын
Give power from usb 5V
@alaawahba8
@alaawahba8 Ай бұрын
@@NizarMohideen I'm using the 5V pin from debugger to supply the servo, and 3.3V to supply the mcu, and a common ground
@_NguyenQuangTrung
@_NguyenQuangTrung 4 ай бұрын
i want to combine Servo Motor with RFID RC522 to make an auto open door, can you give me some advices
@NizarMohideen
@NizarMohideen 4 ай бұрын
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 :)
@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
@digitalzoul57
@digitalzoul57 4 ай бұрын
what the TIM freq is it 72MHZ ?
@NizarMohideen
@NizarMohideen 4 ай бұрын
Please see this video. The answer is here kzfaq.info/get/bejne/frRppq6ZsN7dZ4E.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...
Incremental Encoder and Servo Angle Control in STM32 || PWM
19:39
ControllersTech
Рет қаралды 19 М.
34. STM32CubeIDE Button debounce. Interrupt with STM32F103C8T6
7:15
MicroPeta by Nizar Mohideen
Рет қаралды 21 М.
Logo Matching Challenge with Alfredo Larin Family! 👍
00:36
BigSchool
Рет қаралды 10 МЛН
The Giant sleep in the town 👹🛏️🏡
00:24
Construction Site
Рет қаралды 16 МЛН
Little brothers couldn't stay calm when they noticed a bin lorry #shorts
00:32
Fabiosa Best Lifehacks
Рет қаралды 18 МЛН
Kind Waiter's Gesture to Homeless Boy #shorts
00:32
I migliori trucchetti di Fabiosa
Рет қаралды 7 МЛН
Tinman Electronics 11 - Servo PWM and electrical input
8:43
Tinman Electronics
Рет қаралды 44 М.
28. STM32CubeIDE Servo Motor and Potentiometer with STM32F103C8T6
5:00
MicroPeta by Nizar Mohideen
Рет қаралды 11 М.
The Greenwich Meridian is in the wrong place
25:07
Stand-up Maths
Рет қаралды 752 М.
The Clever Way to Count Tanks - Numberphile
16:45
Numberphile
Рет қаралды 939 М.
Servo motor control using STM32 and PWM || HAL || CubeMx || Keil
10:44
ControllersTech
Рет қаралды 81 М.
29. STM32CubeIDE SD CARD. SPI with STM32F103C8T6
14:45
MicroPeta by Nizar Mohideen
Рет қаралды 23 М.
STM32 Guide #1: Your first STM32 dev board
12:12
Mitch Davis
Рет қаралды 204 М.
115. STM32CubeIDE MCP2551 CAN BUS with STM32 F103C8T6
14:06
MicroPeta by Nizar Mohideen
Рет қаралды 3,3 М.
Why UK 🇬🇧 is going Bankrupt? : Detailed Economic Case Study
20:37
Think School
Рет қаралды 1,4 МЛН
Logo Matching Challenge with Alfredo Larin Family! 👍
00:36
BigSchool
Рет қаралды 10 МЛН