Embedded system & robotics


Published on

Published in: Engineering, Technology, Business

Embedded system & robotics

  1. 1. Submitted By:-Aryan Raj Department of Electronics & Communication College:- IET , Alwar Branch:-ECE Sem :-7th Roll No.:-10EIAEC020 Guided By: -Vineet Sharma Technology Head HP Summer Training, Noida
  2. 2. Content  Introduction to Embedded System  Types of Embedded System  Properties & Application of Embedded System  Microcontroller  IDE & Programmer  I/O Ports  LCD Interfacing  Analog to Digital Converter  Timers  Communication  Interrupt  Introduction to Robotics  History of Robotics  Law of Robotics  Motor & Motor Drivers  Sensors
  3. 3. External process Human interface Embedded system Sensors , actuators INTRODUCTION TO EMBEDDED SYSTEM  Embedded system is a scaled down computer which is design to perform a specific task/operation.  An Embedded system is a software program on a hardware chip designed for specific purpose and can also contain some moving parts. Basic flow diagram for Embedded system :-
  4. 4. TYPES OF EMBEDDED SYSTEM  NON-REAL TIME EMBEDDED SYSTEM :- It is one in which there is no deadline , even if fast response or high performance is desired or preferred. Some application are :- • Security System • Mobile & PDA • Alarm System • Automobile System • Digital Camera  REAL TIME EMBEDDED SYSTEM :-where deadline is to be met. Some application are :- • Sensor System in Nuclear Plants • Missile Defense System • Flight Control System • Anti-collision System in Automobile
  5. 5. PROPERTIES OF EMBEDDED SYSTEM  Small in size  Low cost  High accuracy  Easy to design  Low power required  Portable  Efficient APPLICATION OF EMBEDDED SYSTEM  Security system  Cell phone  Automobile system  Memory storage device  Calculators  Printer  Mouse  Alarm system  Digital Camera  Environment monitoring system  Flight control system  Engine control system………….. etc. ………
  6. 6. MICROCONTROLLER A Microcontroller is a programmable digital processor with necessary peripherals. It is complex sequential digital circuit meant to carry out job according to the program. Sometimes analog I/O interface makes a part of microcontroller circuit of mixed mode. Classification :-  Embedded(self-contained) 8-bit Microcontroller  16 to 32 bit Microcontroller  Digital Signal Processor Features :-  Built-in monitor Program  Built-in Program Memory  Facility to Interface External Memory  Interrupts  Analog I/O  Serial I/O  Timers Internal Structure of Microcontroller Pin Configuration
  7. 7. IDE & Programmer  IDE (Integrated Development Environment) is used for developing code for microcontroller. It is also known as Compiler. Some Compiler are :- • WINAVR (AVRGCC for window) • Code Vision AVR • AVR Studio  Programmer basically consist of two parts :-  Software(to open .hex file on your computer) • AVR dude • AVR Studio • Pony Prog (Serial , Parallel) • ATProg  Hardware(to connect microcontroller) • USB-ASP(USB)
  8. 8. I/O PORTSI  Input Output function are set by three registers for each PORT.  DDRX(Data Direction Register) :- Set whether a pin is Input or Output of PORTX. * To make input set bit 0 * To make output set bit 1 For DDRB=0xD1(In hexadecimal) *DDRX :- To set PORTX as I/O with a byte *DDRX.y :- To set yth pin of PORTX as I/O with a bit.  PORTX(PORTX Data Register) :- This register set the value to corresponding port. For PORTA=0xC6  PINX(Data Read Register) :-This register is used to read the value of a PORT. 0 for Low input & 1 for High Input. PORT-B PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0 Function Output Output Input Output Input Input Input Output DDRB 1 1 0 1 0 0 0 1 PORT-A PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0 Value High High Low Low Low High High Low PORTA 1 1 0 0 0 1 1 0
  9. 9. LCD INTERFACING  We need to interface an LCD to our microcontroller so that we can display output. LCD are widely used in mobile , robotics , DVD player etc… Types of LCD :- • Text Display • Graphics Display Block diagram :- Printing Function :-  lcd_clear()  lcd_gotoxy(x,y)  lcd_putchar(char c)  lcd_putsf(constant string)  lcd_puts(char arr)  itoa(int val , char arr[])  ftoa(float val , char decimal_place , char arr[]) Microcontroller Data RAM Code RAM ROM Data Register Command Register Busy
  10. 10. ANALOG TO DIGITAL CONVERTER  ADC is used to convert physical quantity like temperature , pressure , etc into electrical domain i.e. voltage.  A 8-bit ADC has a range of 0-255.  ADC=Vin*255/Vref (8-bit) ADC=Vin*1023/Vref (10-bit) Input Voltage Output Voltage 0v 0 2.5v 127 5v 255 Function for getting ADC :- • Unsigned char read_adc(Unsign char adc_input) • read_adc(3) (for PA3) Analog Input Sampling Quantizing Digital Output
  11. 11. TIMER  Timer is a register which is used to measure time interval. Timers have resolution of 8 or 16 bits. Its value increase/decrease automatically at a predefined rate (supplied by user) and this operation doesn’t need CPU’s intervention. Timers in Atmega 16 :-  Timer 0, 8-bit  Timer 1, 16-bit consisting of two 8-bit parts , A & B  Timer 2, 8-bit Timer Mode :-  Normal :- A timer running in normal mode will count up to its maximum value. When it reaches this maximum value, it issue an overflow interrupt and reset the value of timer to its original value. So, f(timer)=f(clock)/256  PWM :- Pulse width modulation mode is used to generate pulse with Fixed frequency(F) and variable Duty cycle(D). F=Ft/256 D=OCR0/255 (non inverted) D=(255-OCR0)/255 (inverted)  CTC :- Clear timer on compare match mode is to generate pulse with fixed Duty cycle(D) and variable frequency(F) F=ft(OCR0+1)2 D=0.5
  12. 12. COMMUNICATION  Communication is a technique to transfer data from one system to another. Different Communication technique :- Simplex Half duplex Full duplex Modes of data transfer :-  Synchronous Transmission  Asynchronous Transmission  Parallel Transmission  Serial transmission:- 1.) Serial Peripheral Interface 2.) Universal Synchronous Asynchronous Receiver Transmitter 3.) USB  SPI Function :- spi(1byte data); char c=spi(0); putchar(); getchar(); putsf(); A B One transmission at a time Bidirectional transmission Unidirectional transmission  USART MOSI MASTER MISO Tx SCK MOSI MISO Slave SCK Rx SS Rx Tx Gnd Tx Rx Gnd0
  13. 13. INTERRUPT  A special event requires the CPU to stop normal program execution and perform some service related to the event.  An interrupt is a signal that stop the current program forcing it to be execute another program immediately.  Maskable Interrupt :- Can be ignored by CPU  Non-maskable Interrupt :-Can’t be ignored by CPU  Hardware Interrupt :- External Interrupt. There are three external interrupt in Atmega 16 :- INT0 (Pin 16), INT1 (Pin 17), INT2 (Pin 3)  Overflow Interrupt :- When the timer register overflow  Compare Match Interrupt :- When value of timer become equal to a certain predefined value. Steps of Interrupt Programming :- 1. Initializing the interrupt vector table 2. Writing the interrupt service routine 3. Enabling the interrupt
  14. 14. INTRODUCTION TO ROBOTICS  Robotics is the science of designing and building robots suitable for real-life application in automated manufacturing and other non-manufacturing environment. What is Robot :-  A re-programmable, multifunctional manipulator designed to move material, parts, tools, or specialized devices through various programmed motions for the performance of a variety of tasks.  The word “ROBOT” is derived from the word ROBOTA which means ‘compulsory labor’. Essential characteristics :-  Mobility  Programmability  Sensors  Mechanical capability  Flexibility Essential parts :-  Robot chassis and actuators  Electronics  Pour source  Intelligence
  15. 15. HISTORY OF ROBOTICS  One of the first robots was the Clepsydra or Water clock, which was made in 250 B.C. It was created by Ctesibius of Alexandria, a Greek physicist and inventor.  The earliest remote control vehicles were built by Nikola Tesla in 1890’s. Tesla is best known as inventor of A.C electrical power, radio, induction motor, tesla coils, and other electrical devices.  Other early robots (1940’s-50’s) were Grey Walter’s “Elsie the tortoise” and the Jhons Hopkins “beast”. “Shakey” was a small unstable box on wheels that used memory and logical reasoning to solve problem and navigate its environment. It was developed by the Stanford Research Institute in Palo Alto, California in the 1960’s.  The General Electric Walking Truck was a large(3,000 pounds) four legged robot that could walk up to 4 miles an hour. The walking truck was the first legged vehicle with a computer-brain, developed by Ralph Moser at General Electric Corp. in the 1960’s.  The first industrial robot were probably the “Unimates” , created by George Devol and Joe Engleberger in the 1950’s and 60’s. Engleberger started the first robotics company, called “Unimation” , and has been called the “father of Robotics”.
  16. 16. LAW OF ROBOTICS Isaac Asimov’s three law of robotics :-  A robot may not injure a human being or through inaction, allow a human being to harm them.  A robot must obey the orders given it by human beings except where such order would conflict with the first law.  A robot must protect its own existence as long as such protection does not conflict with the first or second law. ROBOT Autonomous Manual
  17. 17. MOTOR AND MOTOR DRIVERS  Motor is a device which convert electrical energy into mechanical energy. It is used to give movement and design control system. Some motor used in Embedded system and Robotics:-  Geared DC Motor  Stepper Motor  Servo Motor H-Bridge :-  It is an electronics circuit which enables a voltage to be applied across a load in either direction.  With an H-Bridge, a microcontroller, logic chip, or remote control can electronically command to motor to go forward, reverse, brakes, and coast. Motor Driver :- S1 S2 S3 S4 Result 1 0 0 1 Rotate in one direction 0 1 1 0 Rotate in opposite direction 0 0 0 0 Coasts(free run) 1 0 1 0 Brakes 1 0 1 0 Brakes Vin M S4 S1 S2 S3
  18. 18. Sensors  A sensor is a device that measures a physical quantity and convert it into a signal which can be read by an observer and instrument. Some Sensors are :-  Temperature Sensor :-  Used to measure temperature intensity  Some temperature sensors are LM35, DS1621, & Thermistor.  Light Sensor :-  Used to measure light intensity  Some light Sensor are LDR, photo diode, photo transistor, TSOP1738.  IR (Analog) Sensor :-  It consist of An Infra Red emitting diode as transmitter & a Photodiode as receiver.  Output varies from 0-5v depending upon the amount of IR received.  Output can be taken to a microcontroller either to its ADC or LM 339 can be used as a comparator.  IR (Digital) Sensor :-  It is logic 1 when IR below a threshold is falling on it and logic 0 when it receive IR above threshold. TSOP 1738 is a digital IR sensor.  It only respond to IR falling on it at a pulse rate of 38 kHz so it have high immunity against ambient light.  No comparator is required and range of sensor can be varied by varying the intensity of IR emitting diode.