Sie sind auf Seite 1von 6

MAPUA INSTITUTE OF TECHNOLOGY School of Electrical, Electronics and Computer Engineering

PRODUCT SORTER ECE182P - ROBOTICS AND MECHATRONICS

Presented by: Eustaquio, Carissa D. Ofiana, Glenda T.

Engr. Ramon G. Garcia

PRODUCT SORTER - ROBOTICS AND MECHATRONICS

Professor
DESCRIPTION OF PROJECT

Through the knowledge in programming the PIC16F877A, we were able to create a design that functions as a Product Sorter. The design sorts the product by its height, in our design; we have programmed it only with two specific range of height. The design consists of DC motor, servo motors and sensors that is being controlled by the microcontroller. In order to build a conveyor for the system, the DC motor was used, the servo motors serves as the sorter wherein it pushes the product into the designated container. The sensor was positioned to the specific height of products that will pass through the sensor. Signals from the sensor was amplified in order to produce a more efficient signal and passed through the relay for more accurate input bits. When a signal is being sent from the sensor, it will activate the relay and will send a positive signal for an input port on the microcontroller which activates the servo motors. There are two servo motors designated for the two sensors, whenever a signal is sent, both sorters will be pulled by the servo motors, but only one sorter will be pushed inside the container.

PRODUCT SORTER - ROBOTICS AND MECHATRONICS


PROGRAM LISTINGS
LIST P=PIC16f877A #include "p16f877A.inc" __CONFIG _CP_OFF & _WDT_OFF & _BODEN_ON & _PWRTE_ON & _XT_OSC & _LVP_OFF & _CPD_OFF ; Define variables used CBLOCK 0x20 Delay Delay1 Delay2 CNT1 CNT2 CNT3 ENDC ORG 0x00 init: banksel movlw movwf CLRF Banksel CLRF movlw movwf banksel loop: btfsc goto btfsc goto goto Mov0: bcf PORTB,2 movlw d'50' movwf CNT3 goto R0 R0: BSF PORTC,5 ;0 deg MOVLW d'1' ; set delay of approx 1.5ms CALL Delay_10x ; BCF PORTC,5 ; Turn them off, no more pulse MOVLW d'39' ; set delay of approx 18ms CALL Delay_10x ; DECfsz CNT3,f GOTO R0 ; Start over goto loop Mov902: movlw d'50' PORTB,7 Mov902 PORTB,6 Mov90 Mov180 ;PB1 = 1 -> Move0 PB1 = 0 Check PB0 ;PB1 = 1 Move0 ;PB0 = 1 -> Move180 PB0 = 0 -> Move90 ;PB0 = 0 Move90 ;PB0 = 1 Move180 ADCON1 0x06 ; all pins digital I/O ADCON1 PORTC TRISC TRISC ; All pins on porta are output h'00' TRISB PORTC

PRODUCT SORTER - ROBOTICS AND MECHATRONICS


movwf CNT1 bsf PORTB,2 goto R902 R902: BSF PORTC,5 MOVLW d'249' ; set CALL Delay_1x ; BCF PORTC,5 MOVLW d'18' ; set delay CALL Delay_10x ; DECfsz CNT1,f GOTO R902 ; Start over goto loop Mov90: bcf PORTB,2 movlw d'50' movwf CNT1 goto R90 R90: BSF PORTC,5 ;90 MOVLW d'249' ; set delay of approx 1.5ms CALL Delay_1x ; BCF PORTC,5 ; Turn them off, no more pulse MOVLW d'18' ; set delay of approx 18ms CALL Delay_10x ; DECfsz CNT1,f GOTO R90 ; Start over goto loop Mov180: movlw d'50' movwf CNT2 btfss PORTB,2 goto limangsegundo call call call call call Delay_1s Delay_1s Delay_1s Delay_1s Delay_1s ;90 delay of approx 1.5ms ; Turn them off, no more pulse of approx 18ms

limangsegundo: call Delay_1s call Delay_1s call Delay_1s call Delay_1s call Delay_1s goto R180 R180: BSF MOVLW CALL BCF MOVLW PORTC,5 d'5' Delay_10x PORTC,5 d'35' ;180 ; set delay of approx 1.5ms ; ; Turn them off, no more pulse ; set delay of approx 18ms

PRODUCT SORTER - ROBOTICS AND MECHATRONICS


CALL Delay_10x ; DECfsz CNT2,f GOTO R180 bcf PORTB,2 ; Start over goto loop ;Setup up the delay routines that may be used ;delay of 1ms for 4mHz clock Delay_1ms Movlw D'83' Delay_1x different delays Movwf Delay delay_loop Nop Nop Nop Decfsz Delay,f goto delay_loop return

;call here with W set allows

;delay of 10ms for 4mHz clock Delay_10ms movlw d'10' Delay_10x ;call here with W set allows different delays movwf Delay2 Delay_Loop_10ms Call Delay_1ms ; Call 1ms delay Decfsz Delay2,f goto Delay_Loop_10ms return Delay_1s movlw d'100' call Delay_10x movlw d'100' call Delay_10x movlw d'100' call Delay_10x movlw d'100' call Delay_10x movlw d'100' call Delay_10x movlw d'100' call Delay_10x movlw d'100' call Delay_10x movlw d'100' call Delay_10x movlw d'100' call Delay_10x movlw d'100' call Delay_10x return end

PRODUCT SORTER - ROBOTICS AND MECHATRONICS


PICTURES

Das könnte Ihnen auch gefallen