State University of New York at Binghamton Watson School of Engineering and Applied Science Department of Computer Science CS-424 / CS-580A Microcontrollers and Robotics Spring, 2009 Lecture: M,W, 2:20-3:20 P.M., FA-244 Laboratory: F, 1:10-4:10 P.M, LNG-210 Professor Richard R. Eckert EB-N6, 777-4365 (office), 777-4802 (CS Department) Email: reckert@binghamton.edu Web Site: http://www.cs.binghamton.edu/~reckert/ Office Hours: W 10-11:30 A.M., R 1-2:30 P.M. Class Listserv: CS424-L@listserv.binghamton.edu Course Assistant: Ryan Zielinski CA's email: rzielin1@binghamton.edu CA's office hours: M 12:15-2:15, R 3:30-5:30 p.m.
COURSE DESCRIPTION: Embedded microcontroller systems in hardware control: Architectures and instruction sets for microprocessors and microcontrollers; memory and I/O port organization; serial and parallel I/O; timers; interrupts; ADC; DAC. Robotics: Hardware; software; motion control; interaction control; actuators and sensors; trajectory planning; behavior control; navigation; robot reasoning; image processing and vision systems; operating systems and programming languages; multitasking; robot intelligence architectures; robot kinematics and dynamics. Laboratory: Supervised laboratory work involves microcontroller programming, interfacing, hardware control experiments; the design and building of mobile, autonomous, microprocessor-controlled robots and their software control systems. Students work in teams. Prerequisites: CS-210, CS-220 or their equivalents. MOTIVATION: An important application of computer science is that of using embedded microcomputers to control hardware systems. These are ubiquitous in electronic devices found almost everywhere in modern society, and, in particular, in embedded control systems and robots used in industry, science, and defense. Many modern devices -- as common as microwave ovens or automobiles, to machines that automate and control the positioning of electronic components on printed circuit boards, to pilot-less airplanes used to spy on and/or deliver weapon systems to potential enemy targets, to something as exotic as the Mars Sojourner Rover robot -- use embedded microprocessors to control hardware. It is important that computer science students have the opportunity to learn about these devices, how they work, and how to design and program them. This course emphasizes those aspects of microprocessor-based control systems and robotics that are most closely related to computer science. These include the architectures and instruction sets of microcontrollers; interfacing a microcontroller with memory and I/O; I/O techniques (serial, parallel, interrupt-driven, digital to analog conversion, analog to digital conversion); microcontroller programming languages and techniques; use of timers in responding to and controlling real-time situations; multitasking. The fundamentals learned will be applied in the context of designing, building, and programming autonomous, mobile robots whose motors and sensors are controlled by a microprocessor-based system. The robot will be programmed to perform such “intelligent” tasks such as following a path, avoiding obstacles, seeking and retrieving objects, and communicating with other robots. Several concepts from the fields of artificial intelligence and computer vision will be investigated and applied where appropriate. Student-designed robots will participate in a competition at the end of the semester. TEXTBOOKS: John B.Peatman, "Embedded Design with the PIC18F452 Microcontroller", Prentice Hall (Pearson Education, Inc.), 2003, ISBN 0-13-046213-6 (Required). Baum, Gasperi, Hempel, Villa, "Extreme Mindstorms: "An Advanced Guide to LEGO Mindstorms", Apress, 2000, ISBN 1-893115-84-4 (Recommended). Bagnall, "Core LEGO Mindstorms Programming", Prentice Hall PTR, 2002, ISBN 0-13-009364-5 (Recommended). EVALUATION (CS-424): Lab Exercises......................................40% Term Examinations (2)..............................40% Final Project (Robotics Competition)...............20% EVALUATION (CS-580A): Lab Exercises......................................38% Term Examinations (2)..............................38% Final Project (Robotics Competition)...............18% Final Paper.........................................6% LABORATORY: There will be a three-hour weekly scheduled laboratory. Students will work in groups of three. All students are expected to attend the lab. Attendance will be taken. Laboratory exercises in the first half of the course will consist of experiments involving hardware control that use a microcontroller trainer (the QuikFlash board), a microcontroller prototyping board (the QuikProto Board), a microcontroller programmer (The EPIC Plus PICmicro MCU Programmer), and several hardware devices. Students will design and build hardware circuits on the prototype board that are interfaced with the trainer and write software to control those circuits. In the second part of the course students will build robots and write software to control them and make them perform different tasks. The LEGO Mindstorms Robotics Invention System RCX and "Open-Robot" will be used. Generally there will be a short lab report required; these will be due on the date specified. If turned in late, the grade will be reduced by 5% per day up to a maximum of one week. Under no circumstances will assignments be accepted more than one week late. ANY NON-ORIGINAL WORK (WORK FOUND TO BE COPIED) WILL BE GROUNDS FOR AN F IN THE COURSE! EQUIPMENT: Each team of students will be provided a parts kit for the lab exercises to be performed during the first half of the course. The kits will be used in conjunction with the QuikFlash Microcontroller and the QuikProto boards, also available in the lab. For the second part of the course, each team will be issued a LEGO Mindstorms Robotics Invention Systems kit and an "Open-Robot. Each student will sign a statement indicating that he/she and his/her teammates are responsible for the kits and will return them, complete with all parts and in good condition, at the end of the semester. TENTATIVE COURSE SCHEDULE (Weekly Topics): Week Lecture Material Lab Exercise 1 Introduction to Robotics and Use of Microchip's MPLAB Microcontrollers; Microcontroller Architectures & Instruction Sets (Notes, P-1,2,3) 2 Microcontroller Instruction Sets Using the QuikFlash trainer & and Program Development QuikBug debugger; A PIC 18F452 (Notes, P-3,4,5) program that controls switches, LEDs, & timers 3 Control of Alphanumeric LCD Displays Programming the QuikBoard's LCD (Notes, P-7); External Memory Interface Display 4 Microcontrollers: Digital I/O Ports A PIC 16F84 Digital Control (Notes, P-11) solution: hardware & software; Using the EPIC Plus PICMicro MCU Programmer 5 Pulse Width Modulation; A/D, D/A Conversion; Controlling a motor with a PIC Motor Control (Notes, P-8,10) microcontroller 6 Sensors; Timers/Interrupts A/D conversion and robot sensors (Notes, P-5,9,13) 7 Serial I/O, UARTs The QuikFlash/LEGO robot platform (Notes, P-18) Designing and building a first robot: an obstacle avoider (PIC-Brick) 8 Introduction to LEGO Mindstorms and the RCX, Continuation of PIC-Brick Programming the RCX; building robots with LEGO bricks; NQC 9 Programming the RCX using NQC; multitasking, Mindstorms Tutorial, building Roverbot, timers, sounds, IR communication, programming it to follow a line and logging data avoid obstacles 10 Spring Break --- 11 More NQC; Microsoft .NET Interface for LEGO A robot that explores, finds, picks up Mindstorms (using Visual Studio C#, VB) up, and returns objects 12 Guest Lectures on the BIObot Robot A remotely programmable robot (Abe Howell); Robot communications, (Open-Robot) Telerobotics 13 Behavior Control Architectures Open-Robot Embedded Control 14 Robot Navigation and Reasoning, Programming Final project: Design your own robot the RCX using Java for a robotics competition. Students work in teams 15 Robot Vision Control; the LEJOS Java Vision Competition preparation Interface 16 Exam Week The Competition REFERENCES ON RESERVE IN THE LIBRARY: -Bagnall, Brian, Core LEGO Mindstorms Programming, Prentice Hall PTR, 2002, ISBN 0-13-009364-5. -Baum, Dave, Definitive Guide to LEGO Mindstorms, Second Edition, Apress, 2003, ISBN 1-59059-063-5. -Ferrari, Gombos, Hilmer, Stuber, Porter, Waldinger, Laverde, Programming LEGO Mindstorms with Java, Syngress, 2002, ISBN 1-928994-55-5. -Peatman, Embedded Design with the PIC18F452 Microcontroller, Prentice Hall, 2003, ISBN 0-13-046213-6. -Abel, Peter, IBM PC Assembler Language & Programming, Fifth Edition, Prentice Hall, 2001, ISBN 0-13-030655-X. -Antonakos, The Pentium Microprocessor, Prentice Hall, 1997, ISBN 0-02-303614-1. -Auslander, Ridgely, Ringgenberg, Control Software for Mechanical Systems, Prentice Hall, 2002, ISBN 0-13-786302-0. -Baum, Gasperi, Hempel, Villa, Extreme Mindstorms: An Advanced Guide to LEGO Mindstorms, Apress, 2000, ISBN 1-893115-84-4. -Brey, Barry, The Intel Microprocessors: 8086/8088, 80186/188, 80286, 80386, 80486, Pentium, and Pentium Pro Processor: Architecture, Programming, and Interfacing, Fifth Edition, Prentice Hall, 2000, ISBN 0-13-995408-2. -Erwin, Benjamin, Creative Projects with LEGO Mindstorms, Addison-Wesley, 2001, ISBN 0-201-70895-7. -Ferrari, Ferrari, Hempel, Building Robots with LEGO Mindstorms, Syngress, 2002, ISBN 1-928994-67-9. -Fulcher, John, An Introduction to Microcomputer Systems: Architecture & Interfacing, Addison-Wesley, 1989, ISBN 0-201-41623-9. Gaonkar, Ramesh S., Fundamentals of Microcontrollers and Applications in Embedded Systems, Thomson Delmar Learning, 2007, ISBN 1-4018-7914-4. -Irvine, Kip R., Assembly Language for Intel-Based Computers, Third Edition, 1999, Prentice Hall, ISBN 0-13-660390-4. -Lewis, Daniel W., Fundamentals of Embedded Software, Prentice Hall, 2002, ISBN 0-13-061589-7. -Mackenzie, I. Scott, The 8051 Microcontroller, Macmillan, 1992, ISBN 0-02-373650-X. -Malvino, Digital Computer Electronics: An introduction to Microcomputers, Second Edition, McGraw Hill, 1983, ISBN 0-07-039901-8. -Martin, Fred G., Robotic Explorations, Prentice Hall, 2001, ISBN 0-13-089568-7. -Mazidi & Mazidi, The 80x86 IBM PC & Compatible Computers ( Volumes I & II): Assembly Language, Design and Interfacing, Third Edition, Prentice Hall, 2000, ISBN 0-13-016568-9. -McComb, Gordon, The Robot Builder’s Bonanza, Second Edition, McGraw-Hill, 2001, ISBN 0-07-136296-7. -Miller, Gene H., Microcomputer Engineering, Second Edition, Prentice Hall, 1999, ISBN 0-13-895368-6. -Nelson, Nagle, Carroll, Irwin, Digital Logic Circuit Analysis & Design, Prentice Hall, 1995, ISBN 0-13-463894-8. -Niku, Saeed B., Introduction to Robotics: Analysis, Systems, Applications, Prentice Hall, 2001, ISBN 0-13-061309-6. -Predko, Myke, Programming and Customizing PICmicro Microcontrollers, Second Edition, McGraw-Hill, 2002, ISBN 0-07-136172-3. -Rafiquzzaman, Fundamentals of Digital Logic and Microcomputer Design, Third Edition, Rafi Systems, 2000, ISBN 0-9664980-3-8. -Triebel & Singh, The 8088 and 8086 Microprocessors: Programming, Interfacing, Software, Hardware, and Applications, Third Edition, Prentice Hall, 2000, ISBN 0-13-010560-0. -Uffenbeck, John, The 80x86 Family: Design, Programming, and Interfacing, Third Edition, 2002, Pearson Education, 2002, ISBN 0-13-025711-7. -Wakerly, Digital Design: Principles & Practices, Second Edition, Prentice Hall, 1994, ISBN 0-13-211459-3. -Williams, Gerald, Digital Technology, SRA, 1986, ISBN 0-574-21605-7.