You are on page 1of 27

Hz Denetleyicileri:

1. Tantm:
Motor hz denetleyicinin amac istenilen hz gsteren sinyali alp, o hzda motoru srmektir. Denetleyici motorun hzn lebilir veya lmeyebilir. Eer hz lebiliyorsa buna geribeslemeli hz denetleyici ya da kapal dng hz denetleyicisi denir. Eer hz lemiyorsa buna ak dng hz denetleyicisi denir. Geribeslemeli hz denetleyici daha iyi fakat daha karmaktr ve basit robot tasarmnda gereksinim duyulmayabilir. Motorlar eitli formlara girebilir. Bu formlara baml olarak hz denetleyicinin motor src k deiik olur. Herhangi bir hurdacdan temin edilebilen araba iin bir basit ucuz balatc motor srmeye yarayan hz denetleyici tasarm sunulmutur. Aadaki ekil hz denetleyicinin basit bir blok diyagramdr. Direk olarak detaylca nemli blmlerini blok blok gzden geireceiz.

2. DC Motor Hz Kontrol:
DC motorun hz besleme gerilimiyle doru orantldr. Bylece eer biz besleme gerilimini 12 volttan 6 volta drrsek, motorumuz yar hzla alacaktr. Batarya 12 voltta sabitlendii takdirde bu ilemi nasl gerekletirilebilir? Hz denetleyicisi motora gnderilen ortalama gerilim deiimiyle alr. Bunu motora gnderilen gerilimi basit bir ekilde ayarlayarak yapabilir fakat bunu yapmak biraz verimsizdir. Daha iyi bir yol ise motorun beslemesini ok hzlca ak ve kapal olarak deitirmektir. Eer anahtarlama yeterli hzda ise motor bunun farknda olmaz. Sadece ortalama etkisini fark eder.

Sinemada film izlerken ya da televizyon seyrederken, aslnda grdnz ey gzlerinizin sadece ortalama etkisini-hareketini grmesini salayacak hzda deien sabit resimler serisidir. Beyniniz ortalama etkiyi vermek iin bu bolular doldurur. imdi anahtarla beraber k ampul dnn. Anahtar kapattnz zaman ampul ful parlaklkta yanar ve 100 watt gsterir. Anahtar atmz zaman ise ampul sner ve 0 wattadr. imdi eer anahtar saniyenin kk bir blmnde kapatrsak, sonra ayn zaman blmnde aarsak, ampul teli (filaman) snmaya ve soumaya zaman kalmyacaktr ve siz bunu ortalama 50 watt iddetinde bir parlaklk alglayacaksnz. Bu k kesici reostann alma eklidir. Ayn prensip hz denetleyicilerin motoru srmesi iin kullanlr. Anahtar kapal konumunda iken motor 12 voltu grr, ak konumunda ise motor 0 voltu grr. Eer anahtarn kapal kalma sresi ak kalma sresi ile ayn olursa, motor ortalama 6 voltu grr ve bundan dolay daha yava alacaktr. Anahtarn ak kalma sresi kapal kalma sresiyle karlatrdmzda daha uzun ise motorun ortalama hz artar. Bu ama kapama anahtarlama iini g mosfetleri gerekletirir. Mosfet dk sinyal seviyesindeki gerilim kontrol altnda ok byk akmlar aar ve kapatr. Daha fazla detayl bilgi iin Mosfetlere ayrlm blm gzden geirin. Anahtarlama durumlar altnda motoru hzlandrmak ve yavalatmak iin geen sre rotorun eylemsizliine, srtnme miktarna ve yklenen torka baldr. Aadaki grafik yavaa ve dzgnce alan ve kapanan motorun hz deiimini gsteriyor.

Ortalama hzn biraz deimesine ramen 150 civarnda olduunu grebilirisiniz. Eer besleme gerilimi yeteri hzda deitirilirse, motorun hz deitirmek iin fazla zaman olmaz ve hz daha kararl olur. Anahtar modlu hz kontrolnn prensibi bu ekildedir. Bundan dolay hz Darbe Genlik Modlasyonuyla ayarlanr.

2.1. ndktr (Endktans Bobini) :


Devreler zerinde tartmadan nce endktif ykleme olayn ve indktrler hakknda bir eyler renmemiz gerekir. ndktrler zerine doru akan akmn hemen deimesine izin vermez.(Ayn ekilde kapasitrler karsndaki geilimin hemen depimesine izin vermezler.) ndktr karsna den gerilim ve i akm aada denklemde verilmitir. Burada di/dt oran akmn zamanla deiimidir.

Eer akm anahtar almasyla veya tranzistrn kapatlmasyla aniden deitirilirse, buna kar indktr ok yksek bir gerilim retir. rnein; 100 mikrohenrilik bobine 1 mikrosaniyede 100 amper yklenirse, indktr 10 kV retir.

2.2. PWM Frekans:


Sonutaki PWM sinyalinin frekans rampa dalga form frekansna baldr. Biz frekansn ka olmasn isteriz? Bu basit bir soru deildir. Baz leyhler ve aleyhler: 20 Hz ve 18 kHz arasndaki frekanslar hz denetleyiciler ve motorlardan duyulabilir ses retirler. Bu sizin robot iin ek atraksiyon olabilir. Devre tarafndan yaymlanan RF karm (paraziti) daha yksek anahtarlama frekansndan daha ktdr. Kk g kayb ierisindeki hz denetleyici Mosfetlerin klarnn her bir ak kapal anahtar konumlar. Bu yzden duraan ak ve kapal anahtar konum zamanlarn karlatrdmzda, daha byk olan zaman Mosfetlerde anahtarlama (deiim) kayb olacaktr. Anahtarlama frekansndan daha yksek frekanslar motorlarda daha kararl bir akm dalga ekli oluturur. Bu dalga ekli dk frekanslarda hassas anahtarlama dalga ekli olacaktr. Fakat yksek frekanslarda PWM talebine orantl olarak motorun endktans bu dalga eklini ortalama DC akm seviyesine dzelticektir. Bu hassasiyet sabit DC akm dalga ekline gre motor sarmlarnda, Mosfetlerde ve tellerin direnlerinde daha byk g kaybna sebep olur.

nc nokta aadaki 2 grafikte grlebilir. Biri en kt durum olan ak-kapal akm dalga eklini, dieri ise en iyi durum olan sabit DC akm dalga eklini gstermektedir.

Her iki dalga ekli ayn ortalama akma sahiptir. Bununla birlikte motor ve hz denetleyicide bulunan rasgele reziztanstaki g yaylmas DC durum iin:

ve anahtarlama durumu iin ortalama g:

Bylece anahtarlama dalga eklinde herhangi bir dirente 2 kat daha fazla g kayb grlr. Pratikte akm dalga ekli kare dalga ekli gibi olmayacaktr fakat DC olmayan dalga eklinde daha fazla g kayb olduu her zaman doru kabul edilir.

Motor Karakteristiine Dayanan Frekans Seimi:


Uygun frekans seimi iin bir yol sylemek gerekirse rnein; p yzde ierisinde akm dalga eklinin duraan(sabit) olmasn isteriz. Sonra bu amaca ulamak iin minimum frekans matematiksel olarak zeriz. Bu blm biraz matematie kayor. Bunun iin bu ksma gemeyelim ve sadece final denklemini kullanalm. Aadaki ekil motorun edeer devresini ve PWM sinyalinin alp ve kapanmas durumundaki dalga eklini gsterir. Bu en kt durumu gsterir, 50 :50 PWM orann ve akm art en kt durum iin yani duraan (almayan) motor iin gsterilmitir.

T anahtarlama frekansnn tersine karlk gelen anahtarlama periyodudur. Sadece akm dalga eklinin d kenar alndnda, denklemde verildii gibi;

L / R ye karlk gelen devrenin zaman sabitidir. Bylece t = T/2 (i1) zamanndaki akm, P% den az olamaz ve t = 0 (i0) anndakinden dk olamaz. Bu snr koullarnn olduu anlamna gelir.

Bylece:

Hangi frekanslar elde ettiimizi grmek iin birka deer deneyelim. Bir Ford Fiesta mar motoru aadaki yaklak parametrelere sahiptir: R = 0.04 L = 70H Kullanlan Mosfetlerin i direnlerini de dahil etmemiz gerekir. Diyelim ki 2 x 10m olsun bu da toplam direncin 0.06 olduunu gsterir.

Yzde Oran 1 5 10 20 50

Frekans 42 kHz 8.2 kHz 4 kHz 1900 Hz 610 Hz

Bu zel motor iin bir grafik izilebilir:

Yukardaki grafie baktmzda, sonu olarak hafif bir dalgalanmann 5 kHz kadar kk bir anahtarlama frekansyla gerekletii grlmtr. Ne yazk ki motor reticileri datasheetlerde genelde sarg endktanslarn yaymlamazlar. Bunu renmenin tek yolu lmektir. Bu lm satn almas g olan duyarl LCR kpr test donanm gerektiyor.

3. Hz Kontrol Devreleri:
ok basit bir devreyle balayalm. (aadaki ekle baknz) alan sarglarn endktans ve armatr sarglar bir araya konur ve La diye adlandrlr. Burada sarglarn ve fralarn direnci nemli deildir ve ekilde izilmemitir. Q1 Mosfettir. Q1 aktif olduunda akm alan ve armatr sarglarna ve motor arkna doru akar.Q1 kapatldnda indktre doru akan akm aniden kesilmez. Bundan dolay indktr gerilimi azalan akm armatre ve D1in tersine doru ayn ynde srer. Bu durum krmz okla aadaki ekilde gsterilmitir. Eer D1 yerinde olmazsa, ok byk bir gerilim Q1 karsnda oluur ve Q1i patlatr.

Baz teknik terimlerin tantlmas burada bize yardmc olabilir. Motor Src Terminoloji sayfas bazlarn tanmlamaktadr.

4. Rejenerasyon (Yenilenme) :
Bu devrede enerji sadece bataryadan motora doru tek bir ynde akar. Motorun hz istei aniden derse, robotun momentumu motoru ileriye srcektir ve motor jeneratr gibi davranacaktr. Yukardaki devrede g hibir yere gidemez. Bu bir sorun olmamasna ramen gcn bataryaya geri konmas istenilir. Buna dzeltici(yenileyici) frenleme denir ve bunun iin ekstra bileene (elemana) ihtiya duyulur. Aadaki devre yenileyici frenlemeye izin verir:

Bu devrede,Q1 ve D1 nceki devrede olduu gibi ayn grevi gerekletirir. Q2, Q1in faznn tersinde alr. Bu Q1 ak olduunda Q2 kapal ya da Q1 kapal olduunda Q2nin ak olduu anlamna gelir. Bu devrede robot yavalarken, Q1 kapal durumda ve motor jeneratr gibi davranr. Akm ak olan Q2ye doru ters olarak akabilir. Q2 kapatldnda akm endktans tarafndan beslenir ve akm D2den bataryaya doru geri akar. Yavalayan motordaki motorun akm grafii aada gsterilmitir:

Eer mar motorunu veya herhangi bir seri-alan motoru sryorsanz, yenileme ilemini yapmak zordur. Bir motoru jeneratr gibi altrmak iin, alan sargs tarafndan retilen bir manyetik alana sahip olmas gerekir. Seri (Dizi) motorda bu armatr sarmyla bir dizi iindedir. Bylece gerilim retmek iin, uygun bir akmn akmas gerekir. Akacak olan akm yke baldr yani rejenerasyon srasnda bu bir bataryadr. Bylece ne kadar bataryann arz edildiine ya da ne kadar akmn bataryaya girdiine baldr. Alternatif olarak sahte bir diren gsteren yk uygun bir anda anahtarlanabilir fakat bunlarn hepsi bir robot iin biraz karmaktr!

5. Ters evirme (Reversing):


DC motoru ters srmek iin armatrn besleme gerilimini ters evrilmeli ya da manyetik alan ters evrilmelidir. Seri (Dizi) motorda manyetik alan besleme geriliminden beslenir. Bylece gerilim ters evrildiinde alan da ters evrilmi olucak ve bu yzden de motor ayn ynde devam edecektir. Bunun iin her ikisinden birini yani ya alan sarglarnn beslemesini ya da armatr sarglarnn beslemesini anahtarlamalyz. kisini ayn anda anahtarlamamz gerekir. Alan sargsn rle kullanarak anhatarlamak iin bir yntem:

Rleler gsterilen yerde olduunda, akm yukarya dik olarak alan sargsna doru akacaktr. Motoru ters srmek iin rleler deitirilir. Sonra akm aaya dik olarak alan sargsna doru akmaya balar ve motor ters ynde almaya balar. Rleler yn ters evirmek iin ald zaman, motorun endktans ok yksek bir gerilim retir ve bu gerilim rle balantsnda kvlcm oluturur ve rleye zarar verir. ok yksek akmlar tayabilen rleler biraz pahaldr. Bu yzden bu iyi bir zm deildir. Daha iyi bir zm ise ya alan sarmnn ya da armatr sarmnn evresinde full-bridge devresi kullanmaktr. Biz bu devreyi armatr sarmnn etrafnda kullanacaz ve alan sarmlarn dizi eklinde brakacaz.

6. Full-Bridge Devresi (The full bridge circuit):


Full-bridge devresi aadaki ekilde gsterilmitir. Motorun her bir yan ya bataryann pozitif ucuna ya da negatif ucuna balanr. Motorun her bir tarafnda bulunan Mosfetlerden sadece biri herhangi bir zamanda ak olmas dikkat edilmelidir. Aksi takdirde batarya ksa devre olur ve tamamen yanar.

Motorun ileriye doru gitmesi iin, Q4 ak ve Q1nin sahip olduu PWM sinyali Q4e uygulanr. Akmn takip ettii yol krmz renkle ekilde gsterilmitir. Alan sarmna kar ters ynde bir diyotun bal olduuna dikkat ediniz. Bu kprde bulunan btn (4 tane) Mosfetlerin kapal olduu zaman alan sarmnda bulunan akm tamaya yarar.

Q4 devam ettirilir. Bylece PWM sinyali yokken akm alt dngnn evresinde Q3n iindeki diyoda doru akmaya devam eder:

Motorun geriye doru hareket etmesi iin, Q3 alr ve Q2nin sahip olduu PWM sinyali Q3e uygulanr:

Q3 devam ettirilir. Bylece PWM sinyali yokken akm alt dngnn evresinde Q4n iindeki diyoda doru akmaya devam eder:

Rejenerasyon iin, rnein motor geriye doru giderken, motor(imdi jeneratr gibi davranr), akm armatrnn sana, Q2nin diyoduna, Q3n diyodunun tersine ve bataryaya (bu sebeple batarya arz olur) doru zorlar:

6.1. Mosfetlerde Isnn Drlmesi :


Mosfetler yukardaki ekilde ak ve akm yukardan aaya doru akt zaman ok dk bir dirence sahip olurlar ve herhangi bir scaklkta ok zor harcanrlar. Akm aadan yukarya i diyoda doru akt zaman bunlara kar sabit bir gerilim vardrdiyoda den gerilim yaklak 0.8 Volttur. Bu biraz yksek bir g kaybna neden olur. Mosfetlerin bir zellii de Vgs 10-12 Volttan yksek olduu srece akm kaynaktan kanala olduu gibi kanaldan kaynaa doru da iletmelidir. Bu yzden eer Mosfetler ters evrilmi akm ak olan diyotlarna doru tayorsa daha az bir s harcanacaktr. Is motorun kendisi yerine tellerin iinde harcanacaktr. Bu ekstra anahtarlama TD340 full bridge srcs tarafndan gerekletirilir.

7. PWM Sinyallerinin retimi:


PWM sinyalleri birok yoldan elde edilebilir. Sizin radyo alcnzn bir PWM dalga eklini handest vericiden (iletici) almas mmkndr. Eer robot zerinde bir mikrodenetleyici varsa, bu dalga eklini retmesini salayabilir. Eer bir ift motordan fazlasna sahip iseniz, bu mikrodenetleyicinin kaynaklarnda ar yke sebep olabilir. Birka metod aada anlatlmtr:

7.1. Analog Elektronii


PWM sinyali DC sinyal ile gen dalga sinyalinin karlatrlmasyla oluur. DC sinyali, gen dalgann maksimum ve minimum gerilim seviyeleri arasnda olabilir.

gen dalga gerilimi DC seviyeden yksek olduu zaman, opamp k yksee srar ve dk olduu zaman, opamp k aaya der. Grafikte grld gibi eer DC seviye daha yukarya gittiinde, darbeler daha seyrekleecektir (zayflayacaktr). Aada buna rnek bir devre gsterilmitir. Burada bir sayc ve gen dalga retmek iin ar rezistr basama(weighted resistor ladder) kullanlmtr.( Aslnda bir testere dii retilecektir fakat bunun sonunda yine de bir PWM sinyali elde edeceksiniz ) Esas mmkn olmayan rezistr deerleri, (40k,80k) 20k rezistrleri ile meydana getirilebilir veya testere diini bir ekilde bozan fakat pek bir etkisi olmayan yakn deerler kullanlabilir.

74HC14 basit bir osilatr gibi davranan bir Schmit giri inverteridir(evirici). Yaklak osalnm(osilasyon) frekans: f = 1/(2.PI.R.C) retilen bu kare dalga 74HC163 ikili 4 bit saycy besler. Bunun tm nceden ayarlanan ve silinen girileri etkisiz hale getirilmitir bylece klar QA dan QD ye kadar ikili (binary) srada 0000 dan 1111 e kadar yuvarlanr ve tekrar 0000 deerine gelir. 0 V tan +5 V a kadar deien bu klar bir binary weighted toplayc kuvvetlendirici ve 80k, 40k, 20k ve 10k direnleri ile birlikte en soldaki LM324 opamp blm tarafndan beslenir. Kuvvetlendiricinin bu k gerilimi saycnn say deerine baldr ve aadaki tabloda Amp1 k eklinde gsterilmitir.Bunu takip eden opamp ise gerilimi pozitif yapmak ve lojik gerilim seviyelerine geri getirmek iin sadece gerilim deerini - ile arpar.Tabloda Amp2 k stununda da grebilirsiniz.

Sayc deeri

kili deer

Amp1 k (Volt)

Amp2 k (Volt)

0 1 2 3 4 5 6 7

0000 0001 0010 0011 0100 0101 0110 0111

0 -0.625 -1.25 -1.875 -2.5 -3.125 -3.75 -4.375

0 0.3125 0.625 0.9375 1.25 1.5625 1.875 2.1875

8 9 10 11 12 13 14 15

1000 1001 1010 1011 1100 1101 1110 1111

-5 -5.625 -6.25 -6.875 -7.5 -8.125 -8.75 -9.375

2.5 2.8125 3.125 3.4375 3.75 4.0625 4.375 4.6875

Son olarak en sadaki opamp, gerilimi istenilen giri gerilimi ile karlatr. Gerilim 0V ile 4.6875V arasnda deer alr. 0V %0 PWM oranna karlk gelir ve 4.6875V ise %100 PWM oranna karlk gelir. Bu istenilen gerilim -12V ile +12V arasnda deiim gsterebilir fakat sadece 0 ile 4.6875 arasndaki deerler PWM orann ayarlayacaktr.

7.2. PWM retici Yongalar (Chipleri):


DC seviyeyi PWM ka eviren mevcut ICler vardr. Bunlarn ou anahtar mod g beslemelerinde kullanlmas iin tasarlanmtr. Kulanlabilen baz rnekler: retici SGS Thomson Maxim IC SG1524,SG1525... MAX038 Normal Kullanm SMPS Sinyal retimi

Bir PWM retici bulunan Mosfet srcs alternatif olarak kullanlabilir. Ben piyasaya henz karlmayan sadece bir tanesini biliyorum. O da SGS Thomson TD340.

7.3. Saysal Metod:


Saysal metod artabilen bir saycy kapsar ve sayc deerini nceden yklenen register deeriyle karlatr. Yukarda anlatlan analog metodun basitce saysal bir versiyonu:

Register mikrodenetleyici tarafndan istenilen PWM seviyesiyle birlikte yklenmelidir. Eer seviye analog bir sinyal (radyo kontrol servoda olduu gibi) tarafndan kontrol

edilmek zorunda ise basit bir ADC ile yer deitirilebilir. Bu metod sadece robotunuzdaki mikrodenetleyici register kolayca ykleyebiliyorsa gerekten pratiktir.

7.4. Onboard (Yerleik) Mikrodenetleyici :


Eer bir Onboard (Yerleik) Mikrodenetleyici semi iseniz, seim ileminin bir blm PWM klar olup olmadn kapsar. ayet PWM klarna sahipse sinyallerin retim ilemi ok kolaylar. Hitachi H8S serileri kullanlabilir 16 PWM kna sahiptir fakat dier birok eitleri 2 ya da 3 ka sahiptir.

8. Yksek G Elektroniine Gei:


Elektronikte 2 taraf vardr.Dk G Taraf ve Yksek G Taraf. Dk G Elektronii baz onboard (yerleik) mikrodenetleyicileri,radyo kontrol alclarn ve PWM retelerini iermektedir. Yksek G Elektronii ise Mosfet srclerini,Mosfetlerin kendilerini veya pompa srclerini ierir.Basit olarak yksek akmlar anahtarlayan herhangi bir eyi ierir. Dk G Elektronik aygtlar g raylar zerindeki ani grlt artlarna hassas olabilir ve aksaklk yapabilir veya bozulabilir.Opto-zolatr veya Opto-Kuplr kullanarak dk g elektroniini yksek g elektroniinden izole etmek iyi bir fikirdir.

9. Radyo Kontrol Alcsna Gei:


Birok robot bilimcileri ticari radyo kontrol setlerini kullanmaktadr. Bunlarn alclar genellikle radyo sinyaline (PWM de olabilir) yant veren servolara baldr.

Servoya gitmeden nce radyo alcsndan kan PWM sinyaliyle balant kurulabilir ve bu sinyal Mosfet srcsnn giriini srmek iin kullanbilir.Her neyse bu size anahtarlama frekans seim ansn vermez. Altarnetif olarak potansiyometre PWM retecini beslemek iin bir gerilim retir. Eer servolarnz hakknda emin deilseniz ya da modifiye etmek istiyorsanz, Seattle Robotics Society sayfasnda bunlara bir tantm vardr. Daha ileri bir metod ise eer bordun zerinde bir mikrodenetleyici varsa, robot PWM sinyalini radyo alcsndan alr ve bu sinyali mikronun zamanlayc giriine balar.Mikrodenetleyici bu dalga eklini zebilmelidir ve analog ka orantl olarak bir deer retebilmelidir. Bir baka ileri metod ise seri haberleme verilerinin radyo kanal zerinden gnderilmesidir. Radyo kontrol eltakmnn iinde bir mikrodenetleyicinin bulunmasna ihtiya duyulacaktr. Mikrodenteleyici potlar ve eltakmnn zerindeki

anahtarlar okuyabilmelidir ve uygun komutlar UARTna gndermelidir. Bu radyo transmitteriyle balantldr. Alcda demodle edilen k robotun mikrodenetleyicisinin UARTna gnderilir ve veri zlr.

10. Akm Snrlandrlmas:


Akm snrlandrlmas kesinlikle ok hassas bir konudur. Eer motor durdurulursa, motor Mosfetleri ok abuk bozabilecek byk akmlar tayabilir. Burada anlatlan akm snrlandrlma ekli motorun tad akmn llmesidir ve eer bu deer eik deerinin zerinde ise kprdeki Mosfetler kapatlr. Eer bordun zerinde PWM orann oluturan bir mikrodenetleyici bulunuyorsa, bu bir avantaj salar. Eer yazlm(software) akm durumunu saptar ve fazla olduunu alglarsa PWM orann drr. Bu fonksiyonu gerekletiren devre aada verilmitir.

Devre sadece kprnn st ksmnda srlen Mosfetleri gsterir. Akm snrlandrlmas srasnda alt taraftaki Mosfetler kapanmaz. Her bir motor iin gereken yalnz bir alg rezistr vardr ve bu rezistrler bataryann pozitif ubiriminden balanmaldr. Circuit description The voltage dropped across the sense resistor is amplified by U1A, which is connected in a differential amplifier circuit. The gain of this is 480k / 1k which is 480. This is a very large gain

because the voltage dropped across the sense resistor will be very small. The output of the differential amplifier is then heavily low pass filtered by RxCx. This is because there will be a lot of noise coming from the motor, and we do not want to limit the current if we don't need to. D13 is present to make sure that no negative spikes can affect the following circuitry. U2B compares the filtered signal with a preset value (represented here by V5), and if the current is too high (i.e. the signal is greater than V5), U2B will turn Q1 and Q2 on which clamps the PWM signals from the PWM generator. This will force the MOSFET driver to turn the MOSFET off. Q1 must be repeated four times, one for each of the MOSFET driver channels, but all four transistors can be driven from U2B. D11, R14 and C4 make sure that the MOSFET doesn't turn back on straight away, but takes a few milliseconds. This stops the MOSFET being rapidly turned on and off. Diferansiyel Kuvvetlendirici devresinde balanan

10.1. The shunt resistor


The shunt resistor R7 in the cicuit must be a very low value if we want large currents to be able to flow, up to 100 Amps for example. It must not drop too much voltage, thereby robbing power from the motor, and it must be capable of dissipating the power without buring out when large currents are passed through. Some suitable resistors are available from Farnell, code 156-267. These are still too large a resistance (and too low power), so we can place eight in parallel. The power handling capabilty is then increased eightfold, and the resistance decreased eightfold. An alternative is to use a piece of wire of an appropriate thickness and length. This can be calculated using the data on this web site. A simulation of the current limiting part of this circuit is shown in the diagram below. The V5 threshold voltage was chosen to set a current limit of 30 Amps. The square wave is the PWM voltage (MOSFET gate voltage), and the slopey waveform is the drain (motor) current. The spikey bits at the top of the slopey waveform is when the current limiting is switching in and out.

There is an in-depth document here which describes sense resistors in detail.

Some circuits you may see sample the current going through the main power MOSFET by placing a much lower power MOSFET in parallel with it. There is a circuit on the 4QD site which does this here. This works OK, but the problem is the actual limiting current is dependant on the value of Rds(on) of the MOSFET. If Rds(on) was only half the value we were expecting it to be, then twice as much current would flow before the limiting circuit took effect. Also the Rds(on) value depends very much on the current that is passing through the MOSFET, and on the temperature. Any variation in Rds(on) will change the limiting current. The Rds(on) figure is quoted as a maximum value on the datasheet, but it is not a design-safe parameter. This means that it is not within defined limits which are published on the datasheet. For example, CMOS digital logic guarantees that the output voltage, Vo, will be between Vcc0.5v and Vcc, and that figure can be used to design circuits which rely on that figure. However, with Rds(on), we only know that it will be between 0 and the quoted value. We cannot rely on a minimum value of it, yet it is the minimum value which controls the current limit. Therefore, using a separate shunt resistor is a much safer method. One problem with the circuit presented above is that you may want to provide a larger current during acceleration, or in emergencies. This can be solved by disabling the current limiting using a separate line from any onboard microcontroller, or by adding a circuit which allows an over-current condition for just a short time. The amount of time that this is allowed must be carefully calculated to prevent damage to the MOSFETs, and must take into account the cooling system that you have provided. An alternative to using the op-amp differential amplifier circuit used above is to use an integrated current sense monitor IC. Several companies make these, I have used the Zetex ZXCT1010. Zetex's range of current monitors can be found here.

10.2. Current limited torque speed characteristics


If a DC motor is being driven by a speed controller with current limiting active, what happens to the torque speed characteristic graph? The DC Motors page describes the normal motor torque speed graph, and how the torque of a permanent magnet DC motor is proportional to the current. If the current is limited however, the torque must also be limited, at the value coincident with the limited current on the torquecurrent graph. The effect that this has on the torque speed graph is shown below:

As the load torque increases, the speed drops - we are following the line in the torque speed characteristic from the left hand side towards the right, drooping down. This is the same as the uncontrolled motor. The motor torque always equals the load torque when the motor is running at constant speed (this follows from Newton's first law - "An object in motion tends to stay in motion with the same speed and in the same direction unless acted upon by an unbalanced force." The motor torque and load torque must be balanced out if the speed is not changing). Let's call the current limit value iL and the equivalent torque value on the torque-current graph at this current is TL. When the load torque exceeds TL, the motor can no longer create an equal and opposite torque, and so the load will push the motor backwards in the opposite direction - we are now following the line as it drops downwards into negative speed. Let's take an example; an opponent's robot is more powerful than ours (or his current limit is set higher), and we are in a pushing match. As each pushes harder, our speed controller reaches its current limit first. Our robot is now pushing at a constant force (since the motor torque is now constant at its highest value). As the opponent pushes harder, our wheels start to rotate backwards, and the pair of robots accelerates backwards at a rate given by Newton's second law: F=ma or a=F/m where F is the difference between the forces of the two robots pushing, and m is the total mass of the two robots.

11. Feedback Speed Control


To stop a robot swerving in an arc when you want it to go forwards, you need to have feedback control of the motor speeds. This means that the actual speed of each wheel is measured, and compared with all the other wheels. Obviously to go in a straight line, the motor speeds must be equal. However, this does not necessarily mean that the speed demand for each motor should be the same. The motors will have different amounts of friction, and so a stiffer motor will require a higher speed demand to go as fast as a more free-running motor.

A block diagram of an analogue feedback speed controller is shown below

The speed demand is a DC voltage, which is fed to the PWM generator for motor A. This drives motor A at a speed dependant on the demand voltage. The speed of motor A is sampled using an optical encoder. This has a frequency output, which is proportional to the speed of the motor. If we assume that motor B is already running at some speed, then the optical encoder on its shaft will be producing a frequency also. The phase comparator compares the two frequencies, effectively comparing the speeds of the two motors. Its output is a signal which gets larger as the two input frequencies get further apart. If the two frequecies are the same, it has a zero output. The integrator adds the output of the phase comparator to whatever its output was before. For example, if the integrator output was previously 3 volts, and its input is 0 volts, then its output will be 3 volts. If its input changed to 1 volts, then its output would change to 2 volts. Lets assume that motor B is running slower than motor A. Then the output of the phase comparator will be positive, and the output of the integrator will start to rise. The speed of motor B will then increase. If it increased to a speed greater than that of motor A, then the output of the phase comparator would become negative, and the output of the integrator would start to fall, thereby reducing the speed of motor B. In this manner, the speed of motor B is kept the same as the speed of motor A, and the robot will go in a straight line (as long as its wheels are the same size!). This method can be expanded to use any number of wheels. One motor will always be the directly driven one (in this case motor A), and the others will have their speed locked to this one. Note that if the directly driven motor is faster, or more free-running, than the others, then when it is driven at its fastest speed (the PWM signal is always ON), then the other motors will never be able to keep up, and the robot will still swerve. It is best, therefore, to directly drive the slowest motor. An analogue feedback speed controller such as this is quite difficult to make, and keep stable. It is easier to perform this function using software in an onboard microcontroller....

11.1. Software feedback speed control

To perform the same function as described above in software requires that the software has digital representation of the speed of each wheel, and can finely control the width of the PWM signal sent to each wheel. To get the speed of each wheel, an optical encoder must be used as in the analogue method, but the output of it must be sent to the microcontroller. This is achieved using a counter, clocked by the speed controller, which the microcontroller can read, and can clear. At regular intervals, the microcontroller must read the counter, then clear it. The interval depends on the maximum speed of the robot, the diameter of the wheel, the number of slots in the speed encoders disc, and the number of bits of the counter. A complete design using this technique is being worked on and will be presented here when it is complete.

11.2. Speed encoders


To start with, we need a device that will measure the speed of the motor shaft. The best way to do this is to fit an optical encoder. This shines a beam of light from a transmitter across a small space and detects it with a receiver the other end. If a disc is placed in the space, which has slots cut into it, then the signal will only be picked up when a slot is between the transmitter and receiver. An example of a disc is shown below

A suitable encoder is available from Maplin, code CH18U for about 2 each

The encoder transmitter must be supplied with a suitable current, and the receiver biased as below:

This will have an output which swings to +5v when the light is blocked, and about 0.5 volts when light is allowed to pass through the slots in the disc. These voltages are comptible with normal digital circuitry. However, because this device is right next to a DC motor, which generates a lot of electrical noise (since it is switching high currents at the commutator into the inductive windings hence high voltages and sparks!), the output must be low-pass filtered. The phase comparator should have as little noise as possible at its inputs. The cutoff frequency for the filter is determined by how many slots are in the disc, and by how fast the disc (and hence the wheel) is intended to rotate. It is given by the equation

where sw is maximum speed of the wheel in rpm, and n is the number of slots in the disc. The filter can be made from a simple RC circuit as follows:

Then the R and C values chosen such that

For example, if the maximum wheel speed is 10rpm, and there are 12 slots in the disc, then RC = 0.08, so suitable values of R and C might be 8k2 and 10uF. An alternative way to measure the speed is using a magnetic sensing device. If your motor or gearing has steel teeth, then sensors are available that can detect and count these as they go by.

The Infineon TLE4942 is such a device. I will not go into this anymore since the datasheet at that link describes how to use the device. Allegro also make many magnetic devices for speed measurement. The Allegro Microsystems website is here

12. Links to other relevant pages


Basic guides to what speed controllers do 4QD manufacture speed controllers, and publish this basic technical guide: http://www.4qd.co.uk/faq/index.html SGS Thomson produced a good document about current limiting in a full bridge circuit. http://www.st.com/stonline/books/pdf/docs/1668.pdf DC motor driving including methods of speed regulation. http://www.st.com/stonline/books/pdf/docs/1656.pdf Driving DC motors http://www.st.com/stonline/books/pdf/docs/1704.pdf Information about MOSFETs International Rectifier have several application notes on MOSFETs and how to use them: Good ones are "Current Ratings of Power Semiconductors", "Paralleling HEXFET power MOSFETs", "Gate Drive Characteristics and Requirements for HEXFET power MOSFETs", and "The Do's and Don'ts of Using MOS-Gated Transistors", all of which are included at the following site: http://www.irf.com/technical-info/appnotes.htm Practical speed controller projects: The Open Source Motor Controller (OSMC) project. A project to make a high current speed controller using 4 paralleled MOSFETs in each bridge arm, and an HIP4081A driver/controller: http://groups.yahoo.com/group/osmc/ A converter for the above project to convert an analogue in signal into direction and PWM signals: Back to main index

You might also like