+ All Categories
Home > Education > Tutorial Arach N!D

Tutorial Arach N!D

Date post: 13-Jul-2015
Category:
Upload: kameshsept
View: 185 times
Download: 0 times
Share this document with a friend
Popular Tags:
30
Transcript
Page 1: Tutorial Arach N!D
Page 2: Tutorial Arach N!D
Page 3: Tutorial Arach N!D
Page 4: Tutorial Arach N!D

Basic Principles Servos are DC motors with built in gearing and feedback control loop circuitry.

Page 5: Tutorial Arach N!D
Page 6: Tutorial Arach N!D

All servos have three wires: 2. Black or Brown is for ground.3. Red is for power (~4.8-6V). 4. Yellow, Orange, or White is the signal wire

(3-5V).

Page 7: Tutorial Arach N!D

Servos can operate under a range of voltages. Typical operation is from 4.8V to 6V. There are a few micro sized servos that can operate at less, and now a few Hitec servos that operate at much more.

unless you have a battery voltage/current/power limitation, you should operate at 6V

Page 8: Tutorial Arach N!D

The signal wire is what you use to command the servo

Page 9: Tutorial Arach N!D

The control wire is used to communicate the angle. The angle is determined by the duration of a pulse that is applied to the control wire. This is called Pulse Coded Modulation

The servo expects to see a pulse every 20 milliseconds (.02 seconds)

Page 10: Tutorial Arach N!D
Page 11: Tutorial Arach N!D

The length of the pulse will determine how far the motor turns. A 1.5 millisecond pulse, for example, will make the motor turn to the 90 degree position (often called the neutral position). If the pulse is shorter than 1.5 ms, then the motor will turn the shaft to closer to 0 degress. If the pulse is longer than 1.5ms, the shaft turns closer to 180 degress.

 Note: The times here are illustrative, and the actual timings depend on the motor manufacturer. The principle, however, is the same.

Page 12: Tutorial Arach N!D

Brain on robot itself {Microcontroller}. “winavr” is the software used to load the program into

the microcontroller.

Page 13: Tutorial Arach N!D

MicrocontrollerMicrocontrollerMicrocontrollers are "special purpose computers".

A microcontroller (or MCU) is a computer-on-a chip. Microcontrollers are dedicated to one task and run one specific program.

Any device that measures, stores, controls, calculates, or displays information is a candidate for putting a microcontroller inside.

The microcontroller includes a CPU, RAM, ROM, I/O ports, and timers like a standard computer.

Page 14: Tutorial Arach N!D

MicrocontrollerMicrocontrollerA microcontroller is an integrated chip that is often part of an embedded system. They are designed to execute only a single specific task to control a single system, they are much smaller and simplified so that they can include all the functions required on a single chip.

The program is stored in ROM (read-only memory) and generally does not change.

Page 15: Tutorial Arach N!D

MicrocontrollerMicrocontroller

Page 16: Tutorial Arach N!D

MicroprocessorSimilar to a Microcontroller.

Has only a CPU, no memory storage device or I/O ports, etc.,.

The CPU executes instructions that perform the basic logic, math, and data-moving functions of a computer.

External memory storage device is required.

Page 17: Tutorial Arach N!D

A microcontroller differs from a microprocessor, which is a general-purpose chip .

That is used to create a multi-function computer or device and requires multiple chips to handle various tasks.

A microcontroller is meant to be more self-contained and independent, and functions as a tiny, dedicated computer.

Page 18: Tutorial Arach N!D

MicrocontrollerMicrocontroller

Microcontrollers have become common in many areas, and can be found in home appliances, computer equipment, and instrumentation.

They are often used in automobiles, and have many industrial uses as well, and have become a central part of industrial robotics.

Because they are usually used to control a single process and execute simple instructions, microcontrollers do not require significant processing power.

Page 19: Tutorial Arach N!D

Microcontrollers are hidden inside a surprising number of products these days.

If your microwave oven has an LED or LCD screen and a keypad, it contains a microcontroller.

All modern automobiles contain at least one microcontroller. The engine is controlled by a microcontroller, as are the anti-lock brakes, the cruise control and so on..

Page 20: Tutorial Arach N!D

Integrated CircuitsIntegrated Circuits

It is also known as IC, microcircuit, microchip, silicon chip, or chip. An integrated circuit is a miniaturized electronic circuit that has been manufactured in the surface of a thin substrate of semiconductor material. They may contain a few hundreds of electronic components to a few millions. Made up of Capacitors, Inductors, Transistors, Resistors, etc.

Page 21: Tutorial Arach N!D
Page 22: Tutorial Arach N!D

Integrated CircuitsIntegrated Circuits Integrated circuits are used for a variety of devices, including microprocessors, audio and video equipment, and automobiles. Integrated circuits are often classified by the number of transistors and other electronic components they contain:

7)SSI (small-scale integration): Up to 100 electronic components per chip 8)MSI (medium-scale integration): From 100 to 3,000 electronic components per chip 9)LSI (large-scale integration): From 3,000 to 100,000 electronic components per chip 10)VLSI (very large-scale integration): From 100,000 to 1,000,000 electronic components per chip 11)ULSI (ultra large-scale integration): More than 1 million electronic components per chip

Page 23: Tutorial Arach N!D
Page 24: Tutorial Arach N!D

Data SheetsData Sheets

Millions of different ICs. Each IC has a specific function. Data sheet contains the specifications of each IC For example: - Pin diagram of the IC showing the various input and output pins and the power supply pins - Range of power supply - Current limitations - Operating Temperature ranges. - Graphs describing the various characteristics.

Page 25: Tutorial Arach N!D

You need to program the microcontroller in its PWM mode.

Page 26: Tutorial Arach N!D
Page 27: Tutorial Arach N!D

OC0 output compare match output for counter0,OC0 pin is output pin for PWM mode function. Pin PB3 can be used in case of Atmega 16 for this purpose.

OC2[for counter 2],OC1A and OC1B [for counter1]pins are also output pin for PWM mode function.

Timer/counter0 is a general purpose , single compare unit, 8 bit Timer/counter unit. It's feature also includes Glitch free, phase correct PWM.

The double buffered Output compare register [OCR0] is compare with Timer/counter value at all times. The result of compare can be used to generate PWM output on the OC0.› Fast PWM mode(WGM01:0=3): Provides high frequency PWM wave form generation

option.{for more information please read datasheet}

› Phase correct PWM(WGM01:0=1):provide high resolution phase correct PWM wave form generation option.

Page 28: Tutorial Arach N!D

/*this code will generate PWM of dutycycle of (dutyx100/255) here duty =128 on pin OC0 (for uc m16 it is PB3) use this code to control the speed of DC motor*/ //FAST PWM (see the Datasheet)

#ifndef sbi #define sbi(ADDRESS,BIT) (ADDRESS |= (1<<BIT)) #endif #ifndef cbi #define cbi(ADDRESS,BIT) (ADDRESS &= ~(1<<BIT)) #endif

#include<avr/io.h>

void set_output_oc0 (uint8_t duty) { /* turn on output pin OC0 */ //non inverted cbi(TCCR0,COM00); sbi(TCCR0,COM01); /* Set the duty cycle for in between 0-255 */ OCR0 = duty; } void enable_PWM0(void) { DDRB = (1<<PB3); //see the datsheet for OC0 pin number for Mega16 it is PB3 cbi(PORTB,PB3); //fast PWM waveform generation mode sbi(TCCR0,WGM00); sbi(TCCR0,WGM01); //set prescaler value 1024 sbi(TCCR0,CS00); cbi(TCCR0,CS01); sbi(TCCR0,CS02); OCR0=0x80; } int main(void) { enable_PWM0(); set_output_oc0(0x80); //0x80=128 change this value to get different duty cycle while(1); //write your other code }

Page 29: Tutorial Arach N!D
Page 30: Tutorial Arach N!D

K Jeshwanth Durga Sagar [email protected]

+919678883623/+919505268836

K Satyadeep [email protected] +919957887814

Niteesh Kumar [email protected] +919678883577

Pradeep Kumar [email protected] +919678883554


Recommended