Cov txheej txheem:
- Kauj Ruam 1: Daim Ntawv Teev Npe
- Kauj Ruam 2: Kev Pom Kom Pom Dua
- Kauj Ruam 3: Cascading Timers rau Siab Daws Teeb Meem
Video: Kev daws teeb meem siab PWM teeb liab rau RC Servos Nrog STM32 Cov Khoom Siv: 3 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Tam sim no, Kuv tab tom tsim RC transmitter/txais raws li SX1280 RF nti. Ib lub hom phiaj rau txoj haujlwm yog tias kuv xav tau 12 ntsis kev pabcuam servo daws teeb meem los ntawm cov pas nrig tawm mus rau servos. Ib nrab vim tias cov digital servos niaj hnub muaj 12 ntsis kev daws teeb meem thib ob lub siab xa tawm siv 12 khoom ib qho lawm. Kuv tau tshawb nrhiav yuav ua li cas kuv thiaj tuaj yeem tsim teeb meem PWM siab rau ntawm STM32 cov cuab yeej. Kuv tab tom siv cov tshuaj dub (STM32F103C8T8) rau lub sijhawm tam sim no.
Kauj Ruam 1: Daim Ntawv Teev Npe
Kho vajtse
- Txhua lub rooj tsav xwm txhim kho STM32F103 (ntsiav tshuaj xiav, ntsiav tshuaj dub, thiab lwm yam)
- USB lub txhab nyiaj hluav taws xob ua lub hwj chim
- STM32 programmer (Segger j-links, ST-LINK/V2, lossis yooj yim st-txuas clone)
Software
- STM32CubeMX
- Atollic TrueSTUDIO rau STM32
- Qhov project los ntawm github
Kauj Ruam 2: Kev Pom Kom Pom Dua
Tej zaum qhov kev daws teeb meem yooj yim tshaj plaws yog siv ib lub sijhawm uas tuaj yeem tsim PWM cov cim, zoo li TIM1-3 ntawm STM32F103. Txog niaj hnub digital servo tus ncej tus nqi tuaj yeem nqes mus rau 5 ms lossis li ntawd, tab sis rau qhov qub analog servo nws yuav tsum yog 20 ms lossis 50 Hz. Yog li, raws li qhov xwm txheej phem tshaj cia peb tsim qhov ntawd. Nrog 72 MHz moos thiab 16 ntsis timer timer daws teeb meem peb yuav tsum teeb tsa lub sijhawm ua ntej rau qhov tsawg kawg 23 thiaj li yuav npog 20 ms tus nqi. Kuv xaiv 24 vim tias tom qab ntawd rau 20 ms Kuv yuav tsum teeb lub txee raws nraim rau 60000. Koj tuaj yeem pom CubeMX teeb tsa thiab tsim tawm 1 thiab 1.5 ms PWM cov cim hauv cov duab. Hmoov tsis zoo, rau 1ms lub sijhawm timer yuav tsum tau teeb tsa rau 3000, uas yuav muab rau peb tsuas yog 11 qhov kev daws teeb meem. Tsis phem, tab sis lub hom phiaj yog 12 ntsis, yog li cia peb sim lwm yam.
Yog lawm Yog tias kuv yuav xaiv lub micro tswj nrog 32 ntsis timer txee, zoo li STM32L476 qhov kev daws teeb meem no tuaj yeem siab dua thiab qhov teeb meem yuav raug daws.
Tab sis ntawm no, Kuv xav tawm tswv yim txog kev daws teeb meem uas yuav ntxiv kev daws teeb meem txawm tias nyob ntawm STM32F103.
Kauj Ruam 3: Cascading Timers rau Siab Daws Teeb Meem
Qhov teeb meem tseem ceeb nrog kev daws teeb meem yav dhau los yog tias tus lej tus lej (20 ms) yog qhov siab dua piv rau qhov tsim tawm PWM teeb liab tiag tiag (nruab nrab ntawm 1 thiab 2 ms), yog li peb tau nkim qee cov khoom muaj txiaj ntsig rau seem 18 ms thaum peb tos tus ncej tom ntej Qhov no tuaj yeem daws tau los ntawm cascading timers siv lub sijhawm txuas txuas rau kev ua haujlwm.
Lub tswv yim yog tias kuv yuav siv TIM1 ua tus tswv los tsim tus ncej tus nqi (20 ms) thiab TIM2, TIM3 txhawm rau tiv nrog PWM cov cim ua qhev. Thaum tus tswv ua rau cov qhev lawv tsuas tsim lub PWM teeb liab hauv ib hom mem tes. Yog li kuv tsuas xav tau npog 2 ms hauv cov sijhawm ntawd. Hmoov zoo koj tuaj yeem cascade cov timers nyob rau hauv kho vajtse yog li qhov synchronization no tsis xav tau kev cuam tshuam los ntawm tus txheej txheem thiab nws yog qhov tseeb heev ib yam, kev ntxhov siab nyob hauv cheeb tsam ps. Koj tuaj yeem pom CubeMX teeb tsa ntawm cov duab.
Raws li koj tuaj yeem pom kuv xaiv 3 raws li prescalar yog li rau 2 ms Kuv xav tau teeb 48000 hauv lub sijhawm timer. Qhov no muab rau peb 24000 rau 1 ms uas yog qhov tseeb ntau dua qhov peb xav tau rau 14 qhov kev daws teeb meem. Tadaaaaaa…
Thov ua tibzoo saib lub vijtsam oscilloscope hauv kab lus qhia txog qhov kawg. Cov channel 3 (ntshav) yog tus tswv lub sijhawm cuam tshuam uas yuav ua rau cov salves los tsim ib qho mem tes. Channel 1 thiab 4 (nqaj daj thiab ntsuab) yog qhov tseeb PWM cov cim tsim los ntawm cov sijhawm sib txawv. Nco ntsoov tias lawv nyob ua ke tab sis lawv tau sib txuas ntawm cov kab tom qab, uas yog vim PWM hom 2. Qhov no tsis yog teeb meem, vim tias PWM tus nqi rau qhov tshwj xeeb servo tseem raug.
Lwm qhov txiaj ntsig ntawm qhov kev daws teeb meem no yog txhawm rau hloov tus nqi yuav txhais tau tias hloov lub sijhawm hauv TIM1 nkaus xwb. Txog niaj hnub digital servos koj tuaj yeem nqes mus rau 200-300 Hz, tab sis thov tham nrog servo phau ntawv qhia yog tias koj xav tau lub suab zoo.
Pom zoo:
Random DC Tsav PWM Kev sim + Kev daws teeb meem daws teeb meem: 4 Cov Kauj Ruam
Random DC Motor PWM Kev sim + Kev daws teeb meem daws teeb meem: Muaj ntau zaus thaum qee tus neeg pov tseg yog lwm tus cov khoom muaj nqis, thiab qhov no yog ib lub sijhawm rau kuv. Yog tias koj tau ua raws kuv, koj yuav paub tias kuv tau ua txoj haujlwm loj los tsim kuv tus kheej 3D tshuab luam ntawv CNC tawm ntawm seem. Cov duab no
Kev teeb tsa Matrix LED hauv Cov Khoom Siv Hluav Taws Xob qub - Yuav Tsum Tau Cov Khoom Siv: 3 Cov Kauj Ruam (nrog Duab)
Kev teeb tsa Matrix LED hauv Cov Khoom Siv Hluav Taws Xob qub - Yuav Tsum Tau Siv Cov Khoom Siv: Lub teeb pom kev zoo los ntawm lub Windows PC dhau Bluetooth thiab LED cov txheej txheem nthuav tawm Ib co piv txwv ntawm pixel kos duab thiab cov duab ua haujlwm khiav ntawm LED Cov Ntsiab Lus ntawm PIXEL Guts Kit Hauv Cov Lus Qhia no, peb ' yuav
ESP32 - Kev daws teeb meem pheej yig rau hauv Kev Pabcuam Debug: 5 Kauj Ruam
ESP32 - Kev daws teeb meem pheej yig rau hauv Kev Tshaj Tawm Debug: Nyob Zoo, Hauv cov lus qhia no tau piav qhia yuav teeb tsa JTAG adapter pheej yig raws li FTDI 2232HL nti, nrog cov lej pom thiab arduino addon. - FTDI 2232HL module nrog USB txuas pib ntawm 8 $ ntawm ebay thiab tsis xav tau software them nyiaj. Qhov no yog qhov zoo tshaj plaws
Kev Nyuaj Siab: Kev Saib Xyuas thiab Saib Xyuas Ntxiv rau Kev Teeb Meem: 9 Cov Kauj Ruam
Hard Drive: Kev Saib Xyuas thiab Kev Saib Xyuas Ntxiv Teeb Meem: Daim duab saum toj no yog Hard Drive ib txwm muaj. Cov no yog cov tsav tsheb feem ntau siv niaj hnub no, tab sis tsis tas yuav nrawm tshaj. Tib neeg siv tus tsav no rau nws tus nqi qis dua gigabyte thiab lub neej ntev dua. Phau ntawv qhia no yuav qhia koj txog qhov sib txawv
Txaus Siab Rau Koj Tus Kheej Tsuas Yog Siv 12V-rau-AC-kab Inverter rau LED Lub Teeb Hluav Taws Xob Tsis txhob Rov Ua Rau Lawv rau 12V.: 3 Cov Kauj Ruam
Txaus Siab Rau Koj Tus Kheej Tsuas Yog Siv 12V-rau-AC-kab Inverter rau LED Lub Teeb Hluav Taws Xob Tsis txhob Rewiring Lawv rau 12V: Kuv txoj kev npaj tau yooj yim. Kuv xav txiav cov phab ntsa uas siv hluav taws xob LED teeb ua ib daim ces rov txuas nws kom khiav tawm 12 volts. Lwm txoj hauv kev yog siv lub zog hloov pauv, tab sis peb txhua tus paub tias lawv tsis muaj txiaj ntsig zoo, puas yog? Txoj cai? Los yog lawv?