PRESENTATION ON
PIC18F4520
&
ROBOTICS
BySiddhant Chopra
MICRO CONTROLLER ??
•

Microcontroller is a small (micro) single-chip
computer designed to perform a specific function,
an...
BASIC ARCHITECTURE OF MCU
• CPU: Processing Module.

RAM: for storing DATA.

ROM: for storing the app. program.

Ports:...
BASIC DIFFERNCE BETWEEN
MP & MC

•

Clock rate of MPs are of the order of GHz.
Where as ........

MCU is a more self-conta...
WHY PIC HAS BEEN PICKED ?
•
•
•
•
•
•
•
•
•
•

Wide range: More than 200 MCUs in the product portfolio.
Available in 8 ,16...
FEATURES OF 18F4520
TYPES OF ARCHITECTURE

Von Neumann Architecture
Harvard Architecture
VON NEUMANN ARCHITECTURE
•
•

•

Single memory for storing both
program and data.
It has single bus which is multiplexed
t...
HARVARD ARCHITECTURE
•
•

•

Separate memory banks for
program and data storage.
It has a RAM for data storage
and separat...
BLOCK DIAGRAM
• operation of accumulator
is scratch pad operation operation.
PIN DIAGRAM
PORT PINS
•
•
•
•
•

•
•

•

Port A is a 8 pin bi directional port
5 analog / 6 digital pins
Port B is a 8 pin bi directio...
PROGRAMMING
PATTERN ON LEDs
IN ASSEMBLY LANGUAGE

IN C LANGUAGE

List p=18F4520, f =inhx32
#include <p18F4520.inc>
COUNTERL
EQU
COUNTE...
7 SEGMENT DISPLAY
LISTP=18F4520
#INCLUDE<P18F4520.INC>
D1 EQU 0X20
D2 EQU 0X21
ORG 0X00
GOTO START
START
MOVLW 0X00
MOVWF ...
DELAY SECTION
Contd.
DELAY
MOVLW 0X01
MOVWF D1
POL
MOVLW .1
MOVWF D2
POOL
DECFSZ D2,F
GOTO POOL
DECFSZ D1,F
GOTO POL
RETUR...
Counter using 2 seven segment
displays segment displays
LIST P=18F4520
#INCLUDE<P18F4520.INC>
D1 EQU 0X20
D2 EQU 0X21
ORG ...
Delay section
DELAY
MOVLW 0X01
MOVWF D1
POL
MOVLW .1
MOVWF D2
POOL
DECFSZ D2,F
GOTO POOL
DECFSZ D1,F
GOTO POL
RETURN
SUB section
SUB
MOVLW B'00111111'
MOVWF PORTD
CALL DELAY
MOVLW B'00000110'
MOVWF PORTD
CALL DELAY
MOVLW B'01011011'
MOVWF ...
Program of PWM
List p=18F4431, f =inhx32
#include <p18F4431.inc>
;This is a header file for PIC18F452
org
00000h
goto
STAR...
PROGRAM OF TIMER 0
5 SECOND DELAY ,TIMER0,16BIT
LIST P=18F4520 , f = inhx32
#include <p18F4520.inc>
ORG 0X00
GOTO MAIN
MAI...
ToCON Register
Other programs done are
•
•
•
•

LCD
Stepper motor
Washing machine for fixed number of time
Washing machine for fixed numb...
ROBOTICS
EVOLUTION OF ROBOT
•

Robotics brings together several very different engineering areas and
skills.

•

The word robot com...
Mechanism of Robotics
•
•
•
•

Locomotion system
Power supply system
Actuators
Control system
– Open loop
– Closed loop
Locomotion system
• Locomotion is nothing but the movement or the ability to
move from one place to another. So,
• Robot l...
Mechanism to achieve Locomotion
• Wheeled robots – These robots are quite energy
efficient and simple to control.
• other ...
Wheeled robot
Legged robot
Main issue in legged locomotion
Stability is the main issue in legged locomotion.
Stability can be divided into the
1) Sta...
Static stability criterion
•

Static stability means that the robot is stable, with no need of motion
at every moment of t...
Dynamic stability criterion
•

Most two legged walking machines are dynamically stable for
several reasons Human like robo...
Legged configuration
•

If a robot has k legs the number of possible events N is, accordant to [1],
N=(2k-1)!
In case of a...
Power supply system
• Suitable power source is needed to run the robots.
• Mobile robots are most suitably powered by batt...
Actuator
• An actuator is a type of motor for moving or controlling a
mechanism or system. It is operated by a source of
e...
Desired
Action





Controller
Contro
ller

Actuator
Actuat
or

There is no error correction. No way to
check if the ac...
Desired
Action

Controller

Actuator

Feedback

O/P
Escape
Obstacle

Controller

DC
Motors

Infrared
Receiving
Module

Turned
away
from
obstacl
e
INTERFACE WITH OTHERS
•

Robotics is a versatile,
multi-disciplinary field,
spanning a number of
scientific and engineerin...
APPS. OF ROBOTICS
•
•
•
•
•
•
•

Edutainment
Educational Robots, Robot Toys, Entertainment, Robotic Art
Outdoor Robotics
L...
Guide robot
in a hosp.

Machine-gun equipped
robot developed by
Samsung
Robot waiter
in Hong-Kong
restaurant
Pipeline
Insp...
MECHANICAL ASSEMBLING
PROJECT
Robocar using Arduino Board
•

It is a robot that can be
steered in any direction just like you
drive your car. Wireless s...
Transmitter of Robocar
Program of sensing directions from
accelerometer
const int groundpin = 18;
const int powerpin = 19;
const int xpin = A3;
c...
Receiver of Robocar
COMPONENTS USED
•
•
•
•
•
•
•

Arduino Board
Accelerometer
Micro Controller (PIC 16F877A & Atmega328)
Encoder IC (HT12E)
T...
WORKING
APPLICATIONS
• Industries
• Home automation
ANY QUESTIONS ???
Pic18 f4520 and robotics
Pic18 f4520 and robotics
Pic18 f4520 and robotics
Pic18 f4520 and robotics
Pic18 f4520 and robotics
Pic18 f4520 and robotics
Upcoming SlideShare
Loading in...5
×

Pic18 f4520 and robotics

840

Published on

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
840
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
190
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Pic18 f4520 and robotics

  1. 1. PRESENTATION ON PIC18F4520 & ROBOTICS BySiddhant Chopra
  2. 2. MICRO CONTROLLER ?? • Microcontroller is a small (micro) single-chip computer designed to perform a specific function, and the specific function is to control (controller) objects, processes or events. • It is dedicated to one task, or a set of closely related task. It is similar to a personal computer, it has similar components built on to a single chip: CPU, Memory (ROM and RAM), I/O ports, Serial ports, Timer, ADC.
  3. 3. BASIC ARCHITECTURE OF MCU • CPU: Processing Module.  RAM: for storing DATA.  ROM: for storing the app. program.  Ports: For interfacing with the outside world.  Timer: Allows the MCU to perform tasks for certain time periods.  ADC: Allows the MCU to accept analogue input data for processing.
  4. 4. BASIC DIFFERNCE BETWEEN MP & MC • Clock rate of MPs are of the order of GHz. Where as ........ MCU is a more self-contained (CPU, RAM, ROM, I/O ports, and timers) and independent and functions as a tiny computer dedicated to a specific task to control a single system... • Clock rate of MCs are of the order of MHz
  5. 5. WHY PIC HAS BEEN PICKED ? • • • • • • • • • • Wide range: More than 200 MCUs in the product portfolio. Available in 8 ,16 and 32 bit in analogue as well as Digital Signal Controller family. RISC based architecture Pin out compatibility Software compatibility, Simple Instruction Set Peripheral compatibility Easy migration across product families. Common and easy to use development tools. Extensive support - Information is available in wide range and depth. Available in all package types
  6. 6. FEATURES OF 18F4520
  7. 7. TYPES OF ARCHITECTURE Von Neumann Architecture Harvard Architecture
  8. 8. VON NEUMANN ARCHITECTURE • • • Single memory for storing both program and data. It has single bus which is multiplexed to be used as both address bus and data bus. The content of RAM can be used for both program storage as well as variable storage. Single bus
  9. 9. HARVARD ARCHITECTURE • • • Separate memory banks for program and data storage. It has a RAM for data storage and separate ROM for program storage. Has two sets of buses. One can simultaneously access these buses. Program address bus Data address bus
  10. 10. BLOCK DIAGRAM • operation of accumulator is scratch pad operation operation.
  11. 11. PIN DIAGRAM
  12. 12. PORT PINS • • • • • • • • Port A is a 8 pin bi directional port 5 analog / 6 digital pins Port B is a 8 pin bi directional port 8 digital pins/5 analog pins Port C is a 8 pin bi directional port 8 digital pins Port D is a 8 pin bi directional port 8 digital pins Port E is a 4 pin port 3 pin bi directional 3 analog / digital pins Pin 1 Digital input pin Pin 13 & 14 are digital I/O digital pins if not used for XT Osc Total availability 13 analog pins 35digital pins 1 digital input pin Pin 39 & 40 (PORTB) are used for programming/debugging.
  13. 13. PROGRAMMING
  14. 14. PATTERN ON LEDs IN ASSEMBLY LANGUAGE IN C LANGUAGE List p=18F4520, f =inhx32 #include <p18F4520.inc> COUNTERL EQU COUNTERH EQU ORG 0x0000 GOTO START START CLRF PORTB CLRF TRISB LOOP BSF PORTB,0 CALL DELAY BSF PORTB,0 BSF PORTB,1 CALL DELAY MOVLW 0X07 MOVWF PORTB CALL DELAY MOVLW 0X0F MOVWF PORTB CALL DELAY DELAY MOVLW 0XC4 MOVWF COUNTERH S1 MOVLW 0XFF MOVWF COUNTERL DECFSZ COUNTERL , 1 GOTO$ - 1 DECFSZ COUNTERH,1 GOTOS1 RETURN END #include<p18F4520.h> void delay(void); void main() { TRISB=0x00; PORTB=0x00; while(1) { PORTB=0x00; delay(); } } void delay(void) { unsigned char I,j; for(i=0;i<255;i++) for(j=0;;j<255;j++) } ;This is a header file for PIC18F452 0X00 0X01 ;Reset Vector ;Clear PORTB output latches ;Load value to make PORTB output port ;Turn on LED on RB0 ;Call delay routine ;Turn on LED on RB0 ;Turn on LED on RB1
  15. 15. 7 SEGMENT DISPLAY LISTP=18F4520 #INCLUDE<P18F4520.INC> D1 EQU 0X20 D2 EQU 0X21 ORG 0X00 GOTO START START MOVLW 0X00 MOVWF PORTC MOVWF TRISC ;selecting PORTC as output port LOOP MOVLW B'00111111‘ ;code for displaying 0 on display MOVWF PORTC CALL DELAY MOVLW B'00000110‘ ;code for displaying 1 on display MOVWF PORTC CALL DELAY MOVLW B'01011011‘ ;code for displaying 2 on display MOVWF PORTC CALL DELAY MOVLW B'01001111‘ ;code for displaying 3 on display MOVWF PORTC CALL DELAY GOTO LOOP Contd.
  16. 16. DELAY SECTION Contd. DELAY MOVLW 0X01 MOVWF D1 POL MOVLW .1 MOVWF D2 POOL DECFSZ D2,F GOTO POOL DECFSZ D1,F GOTO POL RETURN END
  17. 17. Counter using 2 seven segment displays segment displays LIST P=18F4520 #INCLUDE<P18F4520.INC> D1 EQU 0X20 D2 EQU 0X21 ORG 0X0000 GOTO START START MOVLW 0X00 MOVWF TRISD MOVWF TRISC MOVWF PORTD MOVWF PORTC LOOP MOVLW B'00111111' MOVWF PORTC CALL SUB CALL DELAY MOVLW B'00000110' MOVWF PORTC CALL SUB CALL DELAY MOVLW B'01011011' MOVWF PORTC CALL SUB CALL DELAY MOVLW B'01001111' MOVWF PORTC CALL SUB CALL DELAY GOTO LOOP
  18. 18. Delay section DELAY MOVLW 0X01 MOVWF D1 POL MOVLW .1 MOVWF D2 POOL DECFSZ D2,F GOTO POOL DECFSZ D1,F GOTO POL RETURN
  19. 19. SUB section SUB MOVLW B'00111111' MOVWF PORTD CALL DELAY MOVLW B'00000110' MOVWF PORTD CALL DELAY MOVLW B'01011011' MOVWF PORTD CALL DELAY MOVLW B'01001111' MOVWF PORTD CALL DELAY MOVLW B'01100110' MOVWF PORTD CALL DELAY MOVLW B'01101101' MOVWF PORTD CALL DELAY MOVLW B'01111101' MOVWF PORTD CALL DELAY MOVLW B'00000111' MOVWF PORTD CALL DELAY MOVLW B'01111111' MOVWF PORTD CALL DELAY MOVLW B'01101111' MOVWF PORTD CALL DELAY GOTO SUB RETURN END
  20. 20. Program of PWM List p=18F4431, f =inhx32 #include <p18F4431.inc> ;This is a header file for PIC18F452 org 00000h goto START START CLRF PORTC MOVLW 0X63 MOVWF OSCCON CLRF TRISC ; PORTC AS OUTPUT MOVLW .25 ;FREQUENCY IS 38 KHZ MOVWF PR2 ;TIME PEROID OF 26 US MOVLW .13 ; FOR DUTY CYCLE OF 50% MOVWF CCPR1L ; SET THE CCP FOR PWM MOVLW 0X0C MOVWF CCP1CON ;SETTING FOR THE PRESCALER OF TIMER 2 MOVLW 0X00 MOVWF T2CON ;THE TIMER IS ON BSF T2CON,2 GOTO $ ;KEEP THE controller BUSY END
  21. 21. PROGRAM OF TIMER 0 5 SECOND DELAY ,TIMER0,16BIT LIST P=18F4520 , f = inhx32 #include <p18F4520.inc> ORG 0X00 GOTO MAIN MAIN CLRFINTCON ;PRIORITY overflow ,int flag MOVLW B'00000110' ;Disable Timer0:16 bit,int clock. MOVWF T0CON ;Prescaler 1:128 CLRFTRISB LOOP BSF PORTB,0 ;LED ON CALLDELAY BCF PORTB,0 ;LED OFF CALL DELAY GOTO LOOP DELAY MOVLW 0X67 MOVWF TMR0H MOVLW 0X69 MOVWF TMR0L BSF T0CON,7 BTFSS INTCON , TMR0IF GOTO $-1 BCF INTCON , TMR0IF BCF T0CON,7 RETURN END
  22. 22. ToCON Register
  23. 23. Other programs done are • • • • LCD Stepper motor Washing machine for fixed number of time Washing machine for fixed number of rotations • Traffic lights
  24. 24. ROBOTICS
  25. 25. EVOLUTION OF ROBOT • Robotics brings together several very different engineering areas and skills. • The word robot comes from the Czech word "robota", meaning "forced labor.“ • A robot is an electro-mechanical device that can perform autonomous or preprogrammed tasks. Modern defination of Robot is A robot is a machine designed to execute one or more task repeatedly, with speed and precision.
  26. 26. Mechanism of Robotics • • • • Locomotion system Power supply system Actuators Control system – Open loop – Closed loop
  27. 27. Locomotion system • Locomotion is nothing but the movement or the ability to move from one place to another. So, • Robot locomotion is the collective name for the various methods that robots use to transport themselves from place to place.
  28. 28. Mechanism to achieve Locomotion • Wheeled robots – These robots are quite energy efficient and simple to control. • other forms of locomotion (legged locomotion) may be more appropriate for a number of reasons e.g. traversing rough terrain, moving and interacting in human environments. • A major goal in this field is in developing capabilities for robots to autonomously decide how, when, and where to move.
  29. 29. Wheeled robot Legged robot
  30. 30. Main issue in legged locomotion Stability is the main issue in legged locomotion. Stability can be divided into the 1) Static stability criterion 2) Dynamic stability criterion.
  31. 31. Static stability criterion • Static stability means that the robot is stable, with no need of motion at every moment of time. • Static stability is given, when the centre of mass is completely within the support polygon and the polygon’s area is greater than zero. • To achieve statically stable walking a robot must have a minimum number of four legs, because during walking at least one leg is in the air. • Statically stable walking means that all robots’ motion can be stopped at every moment in the gait cycle without overturning.
  32. 32. Dynamic stability criterion • Most two legged walking machines are dynamically stable for several reasons Human like robots have relatively small footprints, because of this the support polygon is almost a line which is even reduced to a single point during walking. Therefore the robot must actively balance itself to prevent overturning In face of that the robots’ centre of mass has to be shifted actively between the footprints. But the robots exact centre of mass is hard to predict due to the high dynamic of walking (for example because of the force which is imparted to whole robot when one leg swings forward) .
  33. 33. Legged configuration • If a robot has k legs the number of possible events N is, accordant to [1], N=(2k-1)! In case of a bipedal walking machine (k=2) the number of possible events is N=(2k-1)! = (2*2-1)! = 3! = 6 So there are six possible different events, these are 1. Lift left leg 2. Release left leg 3. Lift right leg 4. Release right leg 5. Lift both legs together 6. Release both legs together • In case of k=6 legs there are already 39916800 possible events
  34. 34. Power supply system • Suitable power source is needed to run the robots. • Mobile robots are most suitably powered by batteries. • The weight and energy capacity of the batteries may become the determinative factor of its performance.
  35. 35. Actuator • An actuator is a type of motor for moving or controlling a mechanism or system. It is operated by a source of energy, typically electric current, hydraulic fluid pressure, or pneumatic pressure, and converts that energy into motion. • An actuator is the mechanism by which a control system acts upon an environment.
  36. 36. Desired Action    Controller Contro ller Actuator Actuat or There is no error correction. No way to check if the actuator was able to take the desired action Simple system to design, not very reliable Requires regular calibration of the system O/P
  37. 37. Desired Action Controller Actuator Feedback O/P
  38. 38. Escape Obstacle Controller DC Motors Infrared Receiving Module Turned away from obstacl e
  39. 39. INTERFACE WITH OTHERS • Robotics is a versatile, multi-disciplinary field, spanning a number of scientific and engineering areas where the latest knowledge and techno-logical advances contribute to the growth of Robotics.
  40. 40. APPS. OF ROBOTICS • • • • • • • Edutainment Educational Robots, Robot Toys, Entertainment, Robotic Art Outdoor Robotics Land, Sea, Air, Space Wheeled Mobile Robot Advanced production systems Industrial robotics Adaptive robot servants and intelligent homes Indoor Service Robots, Ubiquitous Robotics Network Robotics Internet Robotics, Robot ecology Health Care and Life Quality Surgical Robotics, Bio-Robotics, Assistive Technology Military Robotics Transportation Intelligent Weapons, Robot Soldiers, Super-humans robots in a hospital
  41. 41. Guide robot in a hosp. Machine-gun equipped robot developed by Samsung Robot waiter in Hong-Kong restaurant Pipeline Inspection robot Painting Robots
  42. 42. MECHANICAL ASSEMBLING
  43. 43. PROJECT
  44. 44. Robocar using Arduino Board • It is a robot that can be steered in any direction just like you drive your car. Wireless steering senses the motion and transmits corresponding instruction to control the robot through RF communication.
  45. 45. Transmitter of Robocar
  46. 46. Program of sensing directions from accelerometer const int groundpin = 18; const int powerpin = 19; const int xpin = A3; const int ypin = A2; const int zpin = A1; // analog input pin 4 -- ground // analog input pin 5 -- voltage // x-axis of the accelerometer // y-axis // z-axis (only on 3-axis models) void setup() { // initialize the serial communications: Serial.begin(9600); pinMode(groundpin, OUTPUT); pinMode(powerpin, OUTPUT); digitalWrite(groundpin, LOW); digitalWrite(powerpin, HIGH); } void loop() { // print the sensor values: Serial.print(analogRead(xpin)); // print a tab between values: Serial.print("t"); Serial.print(analogRead(ypin)); // print a tab between values: Serial.print("t"); Serial.print(analogRead(zpin)); Serial.println(); // delay before next reading: delay(100); }
  47. 47. Receiver of Robocar
  48. 48. COMPONENTS USED • • • • • • • Arduino Board Accelerometer Micro Controller (PIC 16F877A & Atmega328) Encoder IC (HT12E) Transmitter & Receiver Module Decoder IC (HT12D) Motor Driver IC (L293D) Accelero meter Arduino Board
  49. 49. WORKING
  50. 50. APPLICATIONS • Industries • Home automation
  51. 51. ANY QUESTIONS ???
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×