Next revision | Previous revision |
en:microcontrollers [2010/02/04 15:36] – created raivo.sell | en:microcontrollers [2020/07/20 09:00] (current) – external edit 127.0.0.1 |
---|
====== Mikrokontrollerid ja robootika ====== | ====== Microcontrollers and Robotics ====== |
| |
===== Mikrokontrollerid ===== | ===== Microcontrollers ===== |
| |
[{{ :images:general:intel_p8048h.jpg?250|Maailma esimene mikrokontroller Intel 8048}}] | [{{ :images:general:intel_p8048h.jpg?250|First microcontroller in the world: Intel 8048}}] |
| |
Mikrokontroller on arvuti mahutatuna ühe kiibi peale (inglise keeles //computer-on-a-chip//). Tegu on integraalskeemiga, mis sisaldab nii mälu, protsessorit kui ka sisend-väljundliideseid. Mikrokontroller programmeeritakse täitma mingit kindlat ülesannet, nii et kui funktsionaalsust tahetakse muuta või täiendada, siis tuleb kiibile uus programm peale laadida. Mikrokontrollerid erinevad tavaarvutist (lauaarvuti, sülearvuti, server) mitme erineva aspekti poolest: | A microcontroller is basically a computer which is placed on a single integrated circuit chip. It consists of memory, a processor, as well as input-output interfaces. Microcontrollers are programmed to run a certain task, which means, if there is a need to change or enhance its functionality, one must install a new program on the chip. Features that differentiate microcontrollers from other computers (PC, laptop, server, etc.) are: |
| |
* Kõik funktsioonid on paigutatud ühe kiibi peale väiksemas ja kompaktsemas mahus. | * All functions are placed on a single chip in a smaller and more compact scale. |
* Programmeeritakse kindla ülesande täitmiseks. Funktsionaalsuse muutmiseks tuleb uus tarkvara peale laadida. | * It is programmed to perform a certain task; in order to change its functionality new software must be installed. |
* Väiksem voolutarve, kuna kõik füüsilised parameetrid on väiksemad ja vähem ressursinõudlikumad kui tavaarvutis. Väga tihti mikrokontrolleri arendajad rõhuvadki madalale voolutarbele, et mobiilsed lahendused suudaksid kauem aku pealt töötada. | * It consumes less power because all physical characteristics are smaller and less energy demanding than in a PC, laptop or server. Developers of microcontrollers concentrate on low energy demand so that mobile applications that use batteries can work longer. |
* Sihtotstarbelised sisendid ja väljundid. Mikrokontrolleritel on välja töötatud perifeeriad, et hõlbustada suhtlemist teiste mikrokontrollerite ja arvutitega (näiteid suhtluskanalitest USB, CAN, UART), aru saada füüsilistest reaalse maailma protsessidest (näiteks lüliti lülitus, temperatuuri mõõtmine) ja ise mõjutada ümbritsevat keskkonda (näiteks mootori käitamine, alarmsignaali käivitamine). | * Single purpose inputs and outputs. Microcontrollers have so called peripherals, which establish connections between a microcontroller and other microcontrollers or computers (e.g. USB, CAN, UART), help to understand the processes in the real physical world (e.g. switching actions, temperature measuring, etc. ) and help control conditions (e.g. control motor, trigger alert, etc.) |
| |
Mikrokontrollereid leidub väga palju seadmetes, mida inimesed igapäevaselt kasutavad, näiteks kodutehnika (mikrolaineahi, telekas), mänguasjad (Lego NXT, rääkivad nukud), sõiduvahendid (auto, tõstuk) jms. Nende laialdane kasutus on olnud võimalik tänu sellele, et oma programmeeritavuse ja laialdase funktsionaalsuse tõttu on seadmetele lihtne juurde lisada uusi omadusi ning muuta need intelligentsemateks. | Microcontrollers can be found in a variety of everyday items: household appliances (e.g. microwave ovens, TV-sets), toys (Lego NXT, talking dolls), vehicles (cars, hoists), etc. Microcontrollers’ wide usage has been possible because they are easy to program and have a wide range of functionalities; hence, it is very easy to add new features and upgrade the level of intelligence of the appliance they are in. |
| |
===== Robootika ===== | ===== Robotics ===== |
| |
Robootika on ala, mis ühendab endas teadmisi ja tehnoloogiat robotite ehitamiseks. Tehnoloogia kiire arengu tõttu on aga üha hägustumas mõiste robot kui inimest asendav automaat. Robotina ei saa võtta ainult humanoidrobotit, autotööstuse koosteliini robotkätt, lennuki autopilooti, närvivõrkudel põhinevat tehisintelligenti või lihtsat koristusrobotit, vaid juba ka arvutis jooksvat tarkvara, mis teeb inimese eest mingi töö ära (näiteks raporti koostamine). Roboteid luuakse teadupärast ju inimese asendadamiseks teatud ülesannete täitmisel. Selleks on mitmeid põhjuseid: töökeskkond on inimesele liiga ohtlik, tootmishinda tuleb alandada, et inimtööjõu eest ei peaks enam maksma, nüri ja üksluine töö põhjustab palju eksimusi inimese töös või uued juhtimissüsteemid on nii keerulised ja ajakriitilised, et inimene tuleb asendada automaatse otsustajaga. | Robotics is a science that combines the technology and knowledge necessary to build robots. Due to the fast development of technology, the term robot, as an automatic machine that replaces humans, is not so clearly defined anymore. A robot is no longer just a humanoid robot, robotic hand at an auto assembly line, autopilot in aircraft, artificial intelligence built of living neurons or simple cleaning robot; it is also computer software that completes tasks meant for humans (for example, compiles reports). It is known that robots are built to replace humans at certain tasks. There are many reasons for this: dangerous working conditions, cheaper production, monotonous work may cause humans to err, new systems are so complex and time-critical, that automatic systems can make better decisions than humans. |
| |
===== Mikrokontrollerid robootikas ===== | ===== Microcontrollers in Robotics ===== |
| |
Kuna robootika valdkond on väga lai, siis järgnevalt piiritleme seda kui hobirobootikat, kus süsteemid ei ole väga keerulised ning on võimetekohased ehitada ka üksiktegijal. Hobirobootikas on levinumad mikrokontrollerid järgmised: | Because of the breadth of robotics, we define it as hobby robotics; these systems are not too complex, and it is possible to build them by oneself. Common microcontrollers in hobby robotics are: |
| |
* Atmel AVR perekonna mikrokontrollerid (ATmega, ATtiny ja muud) | * Atmel AVR microcontrollers (ATmega, ATtiny, etc.) |
* Microchip Technology PIC perekonna mikrokontrollerid (PIC16, PIC24 ja muud) | * Microchip Technology PIC microcontrollers (PIC16, PIC24, etc.) |
* ARM tehnoloogial põhinevad mikrokontrollerid | * Microcontrollers based on ARM technology. |
| |
Väga tihti on kolmandad osapooled loonud arendusplaadid ja -keskkonnad eelnevalt mainitud mikrokontrollerite baasil. Kuna neid on palju, siis tasub välja tuua vaid tuntumad: Arduino (AVR-i baasil), BASIC Stamp (PIC-i baasil) ja Lego NXT (ARM-i baasil). Raamatus lähemalt käsitletavad Kodulabori arendusvahendid on loodud AVR ATmega128 mikrokontrolleri baasil. | |
| |
Kuna mikrokontrollereid ja nende baasil loodud arendusplaate on väga palju, siis tekib kindlasti küsimus, et kuidas see kõige sobivam leida. Laias laastus võib vaadeldavad omadused jagada nelja kategooriasse - hind, füüsilised parameetrid, arenduskeskkond ja klienditugi. Füüsilistest parameetritest tasub jälgida järgmisi: | Quite often third parties have created development boards and environments based on microcontrollers mentioned herein before. For example: Arduino (AVR), BASIC Stamp (PIC) and Lego NXT (ARM). The necessities for developing HomeLab that are described in this book are based on the AVR ATmega128 microcontroller. |
| A question arises from the large amount of microcontrollers and development boards available: how to find the most appropriate? Generally we can classify the following four properties: - price, physical characteristics, development environment and customer support. Notable physical characteristics are: |
| |
* protsessori töösagedus – määrab kiibi töökiiruse | * processor operating frequency - determines chip operating speed |
* programmimälu maht – kui suure mahuga programmi on võimalik kiibile peale laadida | * program memory capacity – determines the size of the program that can be installed on the chip |
* andmemälu maht – kui suures mahus andmeid on võimalik käsitletada programmis | * data memory capacity – how much data can be processed in the program |
* sisend-väljundviikude arv ja nende funktsioon – erinevatel väljaviikudel on erinevad võimalused | * number of input/output pins and their function – different pins have different possibilities |
* taimerite arv – oluline ajakriteeriumite täitmisel | * number of timers – important for application timing criteria |
* voolutarve – oluline mobiilsetes lahendustes | * energy consumption – important for mobile applications |
| |
| |
Arenduskeskkonna all mõeldakse PC arvuti tarkvara, mille abil saab teha järgmist: kirjutada ja kompileerida programmi, laadida programm mikrokontrollerisse ning siluda programmi töö käigus, et avastada võimalikke vigu. Siinkohal saabki määravaks see, kui mugav ja lihtne on kõiki neid toiminguid teha, kuna programmi väljatöötamise käigus on see põhiline töökeskkond. Siit jõuab ka neljanda kategooria - klienditoe - juurde ehk kui lihtne on saada abi ja toetust võimalike ettetulevate probleemide lahendamiseks. Kõiki neid nelja eespool mainitud kategooriat vaagides peakski sobiva arendusplaadi leidma. | Here the development environment is PC software, which allows creating and compiling programs, uploading programs to the microcontrollers and bridging in the programs during running in order to detect possible faults. How easy and comfortable it is to do all that becomes decisive because during the development phase of the program it will be the primary working area. All this leads to the fourth characteristic, which is customer support. It is important that receiving help and support for solving possible issues is made as easy as possible. By considering all four mentioned properties, it should be possible to find the development board needed. |