Cov txheej txheem:

Serial Controlled Variable Speed Motor: 6 Kauj Ruam
Serial Controlled Variable Speed Motor: 6 Kauj Ruam

Video: Serial Controlled Variable Speed Motor: 6 Kauj Ruam

Video: Serial Controlled Variable Speed Motor: 6 Kauj Ruam
Video: How to make 220V 4000W DC Motor Speed Controller ( RPM Control ) 2024, Hlis ntuj nqeg
Anonim
Serial Controlled Variable Speed Motor
Serial Controlled Variable Speed Motor

Tswj kev ceev ntawm lub tshuab DC me me uas tsis muaj dab tsi tab sis qhov chaw nres nkoj hauv koj lub computer, ib qho MOSFET, thiab qee qhov software tsis tseem ceeb. (MOSFET thiab qhov chaw nres nkoj txuas ua "kev tswj nrawm"; koj tseem yuav xav tau lub cav thiab lub zog tsim nyog rau lub cav ntawd; thaum lub chaw nres nkoj txuas tuaj yeem muab qhov hluav taws xob tig lub mosfet rau thiab tawm, nws tuaj yeem t muab qhov xav tau tam sim no los ntawm lub cev muaj zog.)

Kauj Ruam 1: Saib ntawm Circuit

Saib ntawm Circuit
Saib ntawm Circuit

Peb tab tom yuav ua Pulse Width Modulation siv lub dav hlau N-channel fais fab MOSFET txuas nrog rau Kev xa cov ntaub ntawv tus pin los ntawm lub computer rs232 chaw nres nkoj. Thaum qhov chaw nres nkoj tsis ua haujlwm, tus pin yuav zaum ntawm "1" xeev, uas los ntawm lub sijhawm nws tau txhais rau rs232, yog qee yam zoo li -12V (nyob ntawm tus tsav tsheb, nws yuav ze dua rau -9V lossis -5V), thiab lub transistor yuav zoo heev OFF. Thaum peb kis "0" cov khoom ntawm qhov chaw nres nkoj, tus lej rs232 yuav mus rau +12V lossis li ntawd, uas yog txaus los qhib rau feem ntau mosfets zoo nkauj.

Yog tias peb kis ntau "0" bis uake, lub cev muaj zog yuav ze rau tag nrho thiab lub tshuab yuav ua haujlwm nrawm. Yog tias peb kis feem ntau "1" cov khoom, lub cav yuav khiav qeeb dua.

Kauj Ruam 2: Txuas Nws

Hlau Nws Up
Hlau Nws Up

Txij li tsuas muaj ib qho kev tivthaiv thiab tsuas yog ob peb qhov kev sib txuas, koj tsuas tuaj yeem ntxiv cov xov hlau "freeform."

MOSFETs yog qhov hnov zoo li qub, yog li yuav tsum tau ceev faj me ntsis, tab sis tsawg heev yog qhov tseem ceeb.

Kauj Ruam 3: Teem Cov Ntaub Ntawv Nrog PWM Qhov Tseem Ceeb

Teeb Cov Ntaub Ntawv Nrog PWM Qhov Tseem Ceeb
Teeb Cov Ntaub Ntawv Nrog PWM Qhov Tseem Ceeb

Ib txoj hauv kev los tswj lub cav tsis tas yuav sau ib qho software yog los npaj qee cov ntaub ntawv uas muaj cov bytes tsim nyog (nrog ntau lossis tsawg dua 0 khoom), thiab yooj yim theej lawv mus rau COM chaw nres nkoj uas koj muaj lub cav txuas nrog. Kuv tau npaj ntau cov ntaub ntawv (siv emacs, tab sis xijpeem ua haujlwm rau koj yog qhov zoo):

  • 0.pwm:: muaj 5000 tus cim NULL (tswj chaw nyob ntawm cov keyboard feem ntau) [br] Qhov no yog ze li "puv nrawm" raws li peb tuaj yeem tau txais nrog cov txheej txheem no.
  • 1.pwm:: muaj 5000 tus tswj-A cim (ascii 01) (ib "1" ntsis rau ib tus char)
  • 3.pwm:: muaj 5000 tus tswj-C cim (ascii 03) (ob "1" khoom ib tus cim)
  • 7.pwm:: muaj 5000 tus tswj-G cim (ascii 07) (peb "1" khoom ib tus cim)
  • 15.pwm:: muaj 5000 tus tswj-O cim (ascii 15) (plaub "1" khoom ib tus cim)
  • 31.pwm:: muaj 5000 tus tswj-_ cov cim (ascii 31) (tsib "1" khoom ib tus cim)
  • 63.pwm:: muaj 5000 "?" cim (ascii 63) (rau "1" khoom ib tus cim)
  • 127.pwm:: muaj 5000 DEL cim (ascii 127) (xya "1" khoom ib tus cim)

(Tam sim no kuv tau kos cov duab, koj yuav pom tias qhov qauv me ntsis tsis zoo tag nrho.

Kauj Ruam 4: Ua Si Nrog DOS: Kho Koj Li Chaw Nyob COM thiab Luam Cov Ntaub Ntawv

Ua Si Nrog DOS: Kho Koj Lub Chaw Nkoj COM thiab Luam Cov Ntaub Ntawv
Ua Si Nrog DOS: Kho Koj Lub Chaw Nkoj COM thiab Luam Cov Ntaub Ntawv

9600 bps yog qhov nquag siv. Nws sib phim zoo rau "txog" ib byte ib millisecond, yog li qhov no nws tau hloov pauv mus rau PWM zaus ntawm 1000Hz, uas kuv xav tias yuav tsum ua tau zoo rau cov cav me me. Koj tuaj yeem sim nrog tus nqi sib txawv los saib seb yam haujlwm zoo li cas, uas yog ib qho zoo ntawm txoj hauv kev no. Tsim DOS (lossis "Command prompt") qhov rai (piv txwv tias koj siv lub Windows OS), thiab teeb tsa koj lub chaw nres nkoj zoo li: hom com1: 9600, n, 7, 1 "Uas qhia qhov chaw nres nkoj comm kom khiav ntawm 9600bps, thiab xa 7 cov khoom hauv txhua tus ua cim (kom phim nrog peb 7 qhov sib txawv me ntsis qhov ntev.) yog li ntawd cov ntawv yuav yog cov ntaub ntawv tsuas yog qhov "1" txhais tau tias yuav muaj ib qho "nres" me ntsis, uas yuav tiv thaiv peb kom tsis txhob tig lub cav txhua txoj hauv kev (huag zoo.) Yog li tam sim no koj tuaj yeem qhib lub cav nrog cov lus txib zoo li: luam 0.pwm com1: Txij li thaum peb xa 5,000 tus cim ntawm kwv yees li 1 rau millisecond, lub tshuab yuav tsum tig rau ntawm qhov nrawm nrawm txog 5 vib nas this. Yog tias koj xav tau tsawg dua 5 vib nas this, ua cov ntawv luv dua., koj tuaj yeem ua: theej 127.pwm com1: kom khiav lub cav ntawm qhov qis tshaj plaws ua tau nrawm. Nrog cov teeb tsa kuv muaj, lub cav yuav tsis tig txhua yam nrog "qeeb" dua 31.pwm, tab sis YMMV (Kuv nyias k Kuv muaj lub cav 12V khiav tawm 5V ntawm lub roj teeb.) Cov lus txib COPY cia koj hlua cov ntawv ua ke, yog li yog tias koj xav kom koj lub cav nrawm dua thiab tom qab ntawd qeeb dua, koj tuaj yeem ua qee yam xws li: theej 31.pwm+15. pwm+7.pwm+0.pwm+7.pwm+15.pwm+31.pwm com1:

Kauj Ruam 5: Tswj Lub Cev Los Ntawm Txoj Haujlwm

Tswj Lub Cev Los Ntawm Txoj Haujlwm
Tswj Lub Cev Los Ntawm Txoj Haujlwm

Yog tias koj tab tom sau ib txoj haujlwm, tej zaum koj tuaj yeem qhib COM1: raws li cov ntawv thiab sau yooj yim rau nws zoo li nws yog lwm cov ntawv. Muaj peev xwm siv sijhawm nyob rau lub sijhawm uas lub tshuab ua haujlwm los ntawm kev tso tawm tus lej tshwj xeeb yuav zoo li ua tau zoo. Tsis txhob hnov qab tias lub kaw lus feem ntau yuav tsis cuam tshuam cov cim uas koj xa mus rau qhov chaw nres nkoj, yog li tsuas yog vim WRITE hu rov qab tsis txhais tau tias lub cav tau ua tiav txhua yam koj tau hais rau nws. Txij li thaum peb tsis ua dab tsi "zoo nkauj" nrog cov cim chaw nres nkoj com, koj yuav tsum tsis txhob tshawb xyuas qhov kev xaiv dav hlau uas nws yuav txhawb nqa. (txawm hais tias, yog tias koj tuaj yeem txheeb xyuas yuav ua li cas xa BREAK ntu mus rau com chaw nres nkoj, uas yog lub xeev "0" txuas ntxiv, thiab yuav tsav lub cav TXHUA txoj hauv kev; ntau dua xa 0 tus cim tas li.)

Yog tias koj cov lus programming tsis pub koj tso tawm rau COM1:, koj tseem tuaj yeem tuaj yeem tswj lub cav los ntawm "hu" DOS los theej cov lus txib. (OK. Kuv tau rub Microsoft lub Visual Basic Express 2005 (uas yog pub dawb) thiab tswj kom khi kab rov tav scroll bar rau lub cev muaj zog nrawm, tswj ntawm tus lej txuas. Zip txuas nrog. ntawm koj lub kaw lus, tab sis kuv tsis tuaj yeem txheeb xyuas qhov tseeb uas xav tau cov khoom me me. Qhov kev zov me nyuam yog ob qho yooj yim dua thiab ua kom nkag siab nyuaj dua (thov txim) los ntawm kev ua ntau txoj xov. Ib txoj xov tsis muaj dab tsi tab sis tso rau hauv chaw nres nkoj, thiab xov tseem ceeb nyeem kab ntawv kab ntawv thiab hloov kho cov ntaub ntawv siv los ntawm cov xov txuas.)

Kauj ruam 6: Kev sim

Kev sim!
Kev sim!

Yog tias txhua yam pib ua haujlwm, qhov no muab ntau chav txaus rau kev sim.

  • Kho kuv tus qauv me ntsis!
  • Puas yog bitrate muaj teeb meem ntau?
  • Koj puas yuav tsum tswj qhov dav ntawm "on" thiab "off" pulses, lossis tsuas yog tswj hwm lawv cov lej txaus?
  • Yog tias koj tsuas yog yuav tsum tswj tus piv, koj tuaj yeem txiav txim siab ntau tus cim ua ntu zus ntawm tus nqi me ntsis kom tau txais qib nrawm dua. Cov txiaj ntsig 0 ua raws los ntawm 127 yuav yog ib nrab ntawm.
  • Qhov no yuav tsum ua haujlwm rau dimming teeb nyem qhov muag, ib yam nkaus.

Pom zoo: