STM32 Blue Pill for beginners Code and diagram are at www.micropeta.... Servo with potentiometer is at • 28. STM32CubeIDE Servo...
Пікірлер: 26
@NizarMohideen2 жыл бұрын
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
@danielgebala358111 ай бұрын
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?
@lukecage21318 ай бұрын
@@danielgebala3581 i thought so too, but it seems that the datasheet is incorrect lol
@tascheri2 ай бұрын
thank you for your valuable tutorials. I am repurposing old drone flight controllers with great success.
@amirhossein1108 Жыл бұрын
what is the meaning of those numbers. a kid also can do Just copy and pasting
@lehieu665 Жыл бұрын
sir it seems like there is no pulse from A1 pin in my stm32f103c8t6. can you help me ?
@tiennguyenminh6454 Жыл бұрын
ông sửa được chưa, tôi cũng đang không thấy nó chạy
@akshaykumar-uv5ck7 ай бұрын
Sir plz explain the comparison in detail we cant understand properly the rotation
@dduringddu7 ай бұрын
thank you very much!!!
@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Ай бұрын
Also the servo works fine with arduino
@NizarMohideenАй бұрын
Give power from usb 5V
@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
@_NguyenQuangTrung4 ай бұрын
i want to combine Servo Motor with RFID RC522 to make an auto open door, can you give me some advices
@NizarMohideen4 ай бұрын
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 :)
@christopherdyja56162 жыл бұрын
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
@christopherdyja56162 жыл бұрын
Okay i found the problem.. I had to give the servo a seperate power source because my USB hub probably couldn't handle it
@NizarMohideen2 жыл бұрын
Thanks
@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
@digitalzoul574 ай бұрын
what the TIM freq is it 72MHZ ?
@NizarMohideen4 ай бұрын
Please see this video. The answer is here kzfaq.info/get/bejne/frRppq6ZsN7dZ4E.html
@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 Жыл бұрын
I am having the same issue did you solve it?
@sudhansumtripathy Жыл бұрын
@@woodiedave1179 sorry bro, nope was not able to solve it till now
@danielgaribay902910 ай бұрын
I was having the same issue. I changed control to PB3(D3) instead of PA1. I have the same board.@@sudhansumtripathy
@koraycankaya15792 жыл бұрын
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...