Robotics Research Laboratory Louisiana State University.

Slides:



Advertisements
Similar presentations
Introduction to Micro-controllers Anurag Dwivedi.
Advertisements

Robotics Club, Snt Council2 The 3 Schools of Robotics: Mechanical Design – Types of motors – Material selection –
Indian Institute of Technology Hyderabad ROBOTICS LINE FOLLOWER HARI KISHAN TANDEY – ES12B1008 DILIP KONDAPARTHI – ES12B1010 SAI KARTIK – CE12B1015.
MICRO-CONTROLLER: A microcontroller is the brain of the robot: These are: 1. Integrated Circuits (ICs) 2. Programmable.
Robotics Research Laboratory Louisiana State University.
Robotics Research Laboratory Louisiana State University.
Potentiometer Electric circuit Cell or Battery Resistor Switch Bulb Earth/Ground LED.
L.
Timers in Hardware ECE152. Overview Why are timers important – Watchdog – Task switching – Accurate time of day Can use polling or interrupts.
Programming the ATmega16
Sensors And Micro-Controllers
Discovery Lab School of Computing & Information System Florida International University.
Robotics Research Laboratory Louisiana State University.
Robotics Research Laboratory Louisiana State University.
The Use of Microcontrollers
16-Bit Timer/Counter 1 and 3 Counter/Timer 1,3 (TCNT1, TCNT3) are identical in function. Three separate comparison registers exist. Thus, three separate.
Microcontroller Hands-on Workshop #3 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers November 7, 2009.
Segway Controller Notes. = connection on top layer of circuit board = connection on bottom layer of circuit board Ground Plane: Areas enclosed by the.
Slides created by: Professor Ian G. Harris Interrupts  Embedded systems often perform some tasks which are infrequent and possibly unpredictable Hang.
I/O Ports CS-280 Dr. Mark L. Hornick 1. CS-280 Dr. Mark L. Hornick 2 Ports are channels from the CPU to external hardware and software Atmega32 has: 4.
Lab 1 - Microcontrollers Complete the program template below being sure to select the correct parameters to meet the requirements (see the Microcontroller.
A Few Words From Dilbert
MCU: Interrupts and Timers Ganesh Pitchiah. What’s an MCU ?
Controlling the Outside World
Working with Arduino: Lesson #4: Servos EGN1007. Learning Goals Learning Goals: The student will be able to: 1.Build a complete circuit using the Arduino.
10/10/ Controlling YOUR ROBOT. 10/10/2015 Basic Stamp  Basic Stamp Input - output pins Interpreter Chip Power supply: 5 Volts voltage Memory: EEPROM.
Robotics Research Laboratory Louisiana State University.
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Hybrid I/O – Pulses.
Instrumentation & Control Engg. Section Electrical Engineering Department Ahmedabad , Gujarat.
Robotics Research Laboratory Louisiana State University.
Advanced uC Session Speaker : Chiraag Juvekar Jan 13, 2011 Speaker : Chiraag Juvekar Jan 13, 2011.
Pulse Width Modulation (PWM). 100% Pulse Width Modulation (PWM) 0% On the chipKIT there are 490 periods per second. Use analogWrite(pin, value) to control.
Counter/Timer/PWM. incoming Lab. Counter counter is a device which stores the number of times a particular event or process has occurred synchronous/asynchronous.
Microcomputers Final Project.  Camera surveillance is an important aspect of Robotics.  Autonomous robots require the use of servos for camera control.
AVR Programming: Digital I/O September 10, What is Digital I/O? Digital – A 1 or 0 Input – Data (a voltage) that the microcontroller is reading.
Timers and Interrupts Anurag Dwivedi. Let Us Revise.
Robotics Research Laboratory Louisiana State University.
Arduino Mega Arduino Mega 2560 Arduino Mega 2560.
PWM: Pulse Width Modulation © 2014 Project Lead The Way, Inc.Digital Electronics.
Introduction to AVR Name : 1) Abhishek Yadav ) Prakash Giri ) Kheni Niral ) Bhadresh Langadiya Branch.
Atmega328p Introduction for Digital and PWM Output Brion L Fuller II Robotics Club.
Istituto Tecnico Industriale A.Monaco EURLAB Moving a robot simple example program to control a DC-Motor Next - Press the button (left)
Sitarambhai Naranjibhai Patel Institute Of Technology & R.C.
Pulse-Width Modulation: Simulating variable DC output
Mobile and Vehicular Network Lab 2016 WNFA LAB1 Chung-Lin Chan VLC:CamCom.
Microcontroller basics Embedded systems for mortals.
1 Microcontrollers. 2 Programmers work in the virtual world Machinery works in the physical world Microcontrollers connect the virtual and physical world.
16-Bit Timer/Counter 1 and 3
Introduction to Motors, servos and steppers
Embedded Systems Programming Interrupts and Handlers
Why are Timer Functions Important?
Servos Elementary Robotics with Servos
Outline Introduction to Arduino UNO Programming environment setup GPIO
simple example program to control a DC-Motor
Application Case Study Security Camera Controller
Microcontroller basics
Introduction to Servos
COMP2121: Microprocessors and Interfacing
Arduino - Introduction
AVR Addressing Modes Subject: Microcontoller & Interfacing
Electric Motors.
Pulse Width Modulation (PWM) Motor Feedback - Shaft Encoder
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
The Arduino Microcontroller: Atmel AVR Atmega 328
Controlling YOUR ROBOT
DC motor and PWM.
Sensors and actuators Sensors Resistive sensors
Wave Generation and Input Capturing
Presentation transcript:

Robotics Research Laboratory Louisiana State University

 Digital Output ◦ 8 * 8 LED matrix ◦ Techniques for LEDs control on LED matrix  Basic I/O operation ◦ Define pins on PORTas either input or output (DDRx) ◦ Output control ( PORTx) ◦ Input read (PINx)  Digital input ◦ Button ◦ Button Flag

 Ex) bitwise operations Let’s assume that we add 4 buttons on PINA4 ~ 7 and 4 LEDs on PINA0~3 LED0  PIN0, LED1  1, LED2  2, LED3  3 button0  PIN4, button1  PIN5, button2  PIN6, button3  PIN7 DDRA = 0x0F (0b ): PINA0 ~3= output, PIN4~7 = input PORTA = 0xF0 (0b ) : pull up from PIN4 to 7 for input PINA = 0xF0 (0b ): initial status of PINA All LEDs are off, all buttons are released If LED2 is only need to be on  PORTA = PORTA | 0x04 ( 0b )  PINA == 0xF4 ( 0b ) Then, if only button2 is need to be read  PINA & 0x04 ( 0b ) Button2 released: PINA ( 0b ) & 0x40 ( 0b ) 0x40 (0b )

 Pulse-width Modulation ◦ What for ◦ How it works ◦ Applications ◦ How to make it  Servo Motor Control ◦ What is servo motor ◦ How it works ◦ Set position of servo head  Simple Hexabot ◦ Walking ◦ Turning ◦ Control hexbot

 What is it? ◦ Controlling power to inertial electrical devices ◦ Average voltage and current controlled by turning switch  What for? ◦ Modern electronic power switches ◦ The main advantage of PWM is that power loss in the switching devices is very low ◦ Relatively low cost

 Applications ◦ Fans ◦ Pumps ◦ Robotic Servo ◦ Stepper Motor ◦ Telecommunication

 How to make it? ◦ Digital Out (PINx) ◦ Special Function I/O Regiser (SFR/SFIOR) ◦ Using a main program  ns_spin( int delay_time ) ; TOGGLE_PIN(PINxx) ◦ Using interrupts  Timers  PORTB – PINB5 (OCA1), PINB6 (OC1B), PINB7 (OC2)  PORTE – PINE3 (OC3C), PINE4 (OC3B), PINE5 (OC3A)

 How to set position of servo head ◦ /home/csc2700/csc2700/10-PWM-dimLight-01 ICR3 = 40000u;// input capture register // pulse cycle (every 40 milli-second) TCNT3 = 0;// interrupt flag register // Set the WGM mode & prescalar TCCR3A = ( 1 << WGM31 ) | ( 0 << WGM30 ) |// timer control register ( 1 << COM3A1 ) | ( 1 << COM3B1 ) | ( 1 << COM3C1 ); TCCR3B = ( 1 << WGM33 ) | ( 1 << WGM32 ) | // timer control register TIMER3_CLOCK_SEL_DIV_8; DDRE |= (( 1 << 3 ) | ( 1 << 4 ) | ( 1 << 5 ));// I/O control register uint16_t count = 0; while (1){ OCR3A = count++;// 0 ~ (pulse width), PINE3 us_spin(200); }

 What is it? ◦ Robotic Arms, RC-Airplane, etc. ◦ Mechanical position change  How does it work? ◦ Position Reader (Potentiometer) ◦ DC-Motor ◦ PWM DC-Motor Controller ◦ Body Frame ◦ Gears ◦ Servo Head

 How to set position of a servo head ◦ /home/csc2700/csc2700/10-PWM-Servo-01 int count = 0; while (1){ switch (count++ % 4){ case(0): OCR3A = 1000; break;// OCR3A is PINE3, 1000 is 1ms == left (0 degree) case(1): OCR3A = 3000; break;// OCR3A is PINE3, 3000 is 3ms == middle (90 degree) case(2): OCR3A = 5000; break;// OCR3A is PINE3, 5000 is 5ms == right (180 degree) case(3): OCR3A = 3000; break;// OCR3A is PINE3 } ms_spin(1000); }

 How to make it ◦ ATmega128 Stamp Board ◦ Three servo motors ◦ 3 wires (18 or 19 gauge, 12’ * 3) ◦ Battery (V 5.0)

 Let’s make it walk ◦ /home/csc2700/csc2700/10-PWM-HexaBot-01/ int count = 0; while (1){ LED_OFF(COL0_3x3);LED_OFF(COL1_3x3);LED_OFF(COL2_3x3); switch (count++ % 4){ case(0): SetPWM( PWM_PINE3, RIGHT_FRONT); SetPWM( PWM_PINE4, LEFT_BACK); SetPWM( PWM_PINE5, MID_RIGHT); break; case(1): SetPWM( PWM_PINE3, RIGHT_BACK); SetPWM( PWM_PINE4, LEFT_FRONT); SetPWM( PWM_PINE5, MID_RIGHT); break; case(2): SetPWM( PWM_PINE3, RIGHT_BACK); SetPWM( PWM_PINE4, LEFT_FRONT); SetPWM( PWM_PINE5, MID_LEFT); break; case(3): SetPWM( PWM_PINE3, RIGHT_FRONT); SetPWM( PWM_PINE4, LEFT_BACK); SetPWM( PWM_PINE5, MID_LEFT); break; } ms_spin(100); } void SetPWM( uint8_t pwmNum, uint16_t pulseWidthUSec ){ uint16_t pulseWidthTicks = pulseWidthUSec * 2; // Convert to ticks; switch ( pwmNum ){ case PWM_PINE3: OCR3A = pulseWidthTicks; break; case PWM_PINE4: OCR3B = pulseWidthTicks; break; case PWM_PINE5: OCR3C = pulseWidthTicks; break; } } // SetPWM #define PWM_PINE3 0 #define PWM_PINE4 1 #define PWM_PINE5 2 #define MID_RIGHT1300 #define MID_LEFT1700 #define RIGHT_FRONT1700 #define RIGHT_BACK1300 #define LEFT_FRONT1300 #define LEFT_BACK1700

 What is a motion in robotics? ◦ Sequence of specific poses with duration ㄴ  What motions the simple hexabot can take? ◦ Forward ◦ Backward ◦ Left turn ◦ Right turn ◦ ???

 Create a LED brightness control program, which has a plus button and a minus button ◦ The plus button is for increasing brightness of LEDs ◦ The minus button is for decreasing brightness of LEDs  (bonus) make a simple hexabot control program using 4 buttons ◦ Forward button, backward button, left turn button right turn button