Difference between revisions of "ME 333 Introduction to Mechatronics (Archive Winter 2012)"
Line 47: | Line 47: | ||
* communication by SPI, I2C, and RS-232 |
* communication by SPI, I2C, and RS-232 |
||
By class (note: DS = Data Sheet, RM = Reference Manual): |
|||
By class: |
|||
'''Class 1''' |
'''Class 1''' |
||
Line 67: | Line 67: | ||
: '''Quiz''': C syntax (from invest.c). |
: '''Quiz''': C syntax (from invest.c). |
||
: '''Topic''': Getting started with the PIC32 and NU32v2; hardware. |
: '''Topic''': Getting started with the PIC32 and NU32v2; hardware. |
||
: '''Reading''': [[NU32v2: Introduction to the PIC32]], DS p. 3 (summary), ch. 1, ch. 3.2.2; RM ch. 1 |
: '''Reading''': [[NU32v2: Introduction to the PIC32]], DS p. 3 (summary), ch. 1, ch. 3.2.2; RM ch. 1 |
||
'''Class 5''' |
'''Class 5''' |
Revision as of 18:02, 8 January 2011
Winter Quarter 2011
- Instructor: Prof. Kevin Lynch, kmlynch at northwestern.edu
- TA: Nelson Rosa, nelsonrosa2013 at u.northwestern.edu
- Mechatronics Lab Coordinator: Nick Marchuk, nick.marchuk at gmail.com
- Class Hours: T Th, 12:30-1:50 Tech LR5
- Office Hours for Nick Marchuk: daily, 4-5 PM, Mechatronics Lab, Ford B100
- Office Hours for Kevin Lynch: TTh 4-5 PM, Tech B221
- Circuits Q&A Session: Thurs Jan 6, 5 PM, Tech L150
Reading
Required:
- Essential C: A brief introduction to the C programming language
- PIC32 Data Sheet (254 pages, 5 MB pdf)
- PIC32 Family Reference Manual, by chapter. Lots of useful and detailed information on the PIC32 architecture and how the peripherals work, including detailed description of their SFRs. Only certain parts of certain chapters will be assigned.
- PIC32MX Peripheral Library (included as a .chm file under "doc" with your C32 compiler installation)
Useful, but not required:
- Programming 32-bit MIcrocontrollers in C: Exploring the PIC32 by Lucio Di Jasio. This is an easy to read and informative exploration of the PIC32.
- MPLAB C32 Libraries Guide and MPLAB C32 User Guide, included under "doc" of your C32 compiler installation
- Other C resources, such as online as well as this pdf version, and the classic C Programming Language reference book by Kernighan and Ritchie
Approximate Syllabus
ME 333 focuses on three topics: (1) general C programming; (2) Microchip PIC microcontroller architecture and C programming specific to the PIC (e.g., using the PIC's peripherals, such as analog inputs, digital I/O, counters/timers, comm ports, etc.); and (3) interfacing the PIC to sensors and actuators, some theory of sensor and actuator operation, and interface circuitry and signal processing.
You will bring your laptop to each class. As the quarter progresses, we will be handing out other equipment that you will need to bring to class, such as the NU32v2 development board that breaks out the PIC32MX795F512L microcontroller.
Most days we will begin class with a short quiz. Bring a sheet of paper you can turn in with your answer.
Topics we will cover include:
- introduction to C programming (here's a simple tutorial C program)
- quiz on circuits
- introduction to the PIC32 hardware, and programming the PIC32 in C
- digital I/O
- counters/timers and interrupts
- analog input
- sensor smorgasbord
- digital signal processing: filters and FFTs
- analog output and pulse-width modulation
- brushed permanent magnet DC motors: theory and control
- stepper motors and RC servo motors
- communication by SPI, I2C, and RS-232
By class (note: DS = Data Sheet, RM = Reference Manual):
Class 1
- Quiz: None.
- Topic: Course overview. Introduction to C via sample program invest.c.
- Reading: Sample program and Essential C (page numbers referenced in program comments).
Class 2
- Quiz: None.
- Topic: Continue with introduction to C via the sample program. MPLAB IDE.
- Reading: Sample program, Essential C, and using the MPLAB IDE simulator. Circuit prep problems found here.
Class 3
- Quiz: Circuits.
- Topic: Using the MPLAB IDE, simulating and debugging, and other programming topics.
- Reading: Using the MPLAB IDE simulator.
Class 4
- Quiz: C syntax (from invest.c).
- Topic: Getting started with the PIC32 and NU32v2; hardware.
- Reading: NU32v2: Introduction to the PIC32, DS p. 3 (summary), ch. 1, ch. 3.2.2; RM ch. 1
Class 5
- Programming assignment due
- Quiz: PIC32 and NU32v2 hardware.
- Topic: Sample PIC32 program, and connecting software to hardware using the peripheral library.
- Reading:
Important Information: Changes to ME 333 for Winter 2011
- ME 333 will be taught differently in 2011 than it has been in recent years. In particular, there will be no lab groups and no large final projects. Each student will be issued a PIC microcontroller and electronics, sensors, and actuators needed to complete the programming and interface assignments on his/her own. Every student will do a significant amount of programming. An example of an assignment is to write PIC software to control a motor based on encoder feedback.
- You need a laptop for this course. You will need to bring it to class. (There are some similarities to ME 233.)
- ME 333 assumes some familiarity with circuits, e.g., transistors and op amps. ME 233 is good preparation. EECS 221 or 225 should suffice, too.
If you are signed up for ME 333 and this does not sound like a course you want to take (e.g., you don't want to do a lot of programming), please unregister. If you would like to be on the waiting list, send me an email, kmlynch at northwestern.edu. If you are already on the waiting list (you received a mail from me) but would like to be off the waiting list, or if you don't have experience with circuits, please let me know, and I will take you off the waiting list.
Checklist to Complete Before the First Day of Class
Attendance at the first day of class is mandatory. If you will be unable to make the first day of class, please give up your seat in ME 333 now (unregister or email Prof. Lynch to be taken off the waitlist) so that another student can have it. By the first day of class, you should:
- Be able to solve circuit problems similar to those on the practice problem set at the bottom of this page. Be prepared for a short quiz on this material on the second day of class.
- Have a laptop with at least 2 USB ports running a Windows operating system (see FAQ below on using running Windows on a Mac). One port will be used to program and communicate with your PIC microcontroller, and the other will be used for your portable oscilloscope.
- Download and install the Microchip software described on this page. This free software will allow you to program your PIC microcontroller. Update, January 3, 2011: Here is information for Installing MPLAB X Beta 4, a cross-platform integrated development environment (IDE). This release is still missing some functionality as compared to Windows-only MPLAB 8.x, especially with respect to the simulator and debugger.
- Download and install Processing, free software that will allow you to develop GUIs and communicate with your PIC microcontroller. (Make sure you download the Windows version, so you can program your PIC and interact with it through Processing under the same OS.)
- Download and install the "setup executable" version of the FTDI drivers to allow your PC to communicate with your microcontroller through a serial port. (You can ignore the bug fix release.)
- Download and save PuTTY, a free terminal program (putty.exe) that will allow you to communicate with your microcontroller through the serial port. (You don't need to run PuTTY now, and can click "Cancel" if you happen to run it.)
- Make sure your laptop has Matlab installed.
On the first day of class, January 4, you should come to class with your laptop, ready to use all of the software mentioned above, since we will use it on the first day of class. If you are unable to meet the checklist (and downloading and installing the software may take you an hour, so plan ahead), you will be asked to drop the course to make space for someone else.
Student Contract
By signing up for this course, you agree to complete the checklist above before the course starts. You understand that ME 333 is being revised extensively, and there will be some uncertainties as the curriculum and equipment are ironed out. You understand that learning from classmates is encouraged, up to the stage of conceptualizing solutions. You understand that copying assignment solutions and program code plagiarism is not tolerated. You will report instances of code plagiarism you are aware of. Code plagiarism includes, but is not limited to:
- Allowing another student to copy your code.
- Copying another student's code, in whole or in part.
- Transforming copied sections of code to try to disguise their origin.
- Borrowing code from others not in the course, e.g., code found on the internet, without attribution. Borrowing code found on the internet is acceptable if the source is clearly indicated in your code comments.
On our part (faculty and TA), we commit to do our best to provide you a curriculum and set of experimental materials to get you up to speed on sophisticated mechatronics integration as quickly and efficiently as possible, while giving you a foundation in concepts needed to go further in future projects and courses.
Prerequisite
ME 233 Analog and Digital Electronics or similar (EECS 221, 225) is required. You will be expected to analyze circuits with resistors, capacitors, inductors, diodes, transistors, and op-amps on the first day of class. There will be a quiz on this material on the second day of class, but you are on your own to prepare for it. To see if you have the right background, or if you will need to freshen up before the quarter starts, do the practice problem set on this page.
FAQ
Q: Do I need to know the C language to take this course?
A: No. If you already know C, there is still plenty else in this course for you. If you already know C, know how to use microcontrollers for real-time control, and have a good understanding how common sensors and actuators work and how to interface to them, this course may not be for you. Consider taking ME 433 Advanced Mechatronics in the spring quarter.
Q: Is there any independent project at all?
A: There is no large independent project. There may be a small two-week project at the end of the course, but there will be no machining. For a significant project, do a quarter-long project in ME 433 Advanced Mechatronics, offered in the spring quarter. ME 333 is good preparation for ME 433.
Q: Do I need a PC laptop, or is a Mac fine? Any other requirements?
A: You need a laptop with 2 USB ports, and you need to be able to run a Windows OS. The Microchip MPLAB Integrated Development Environment runs only on Windows operating systems:
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469
I use a Mac with VirtualBox (free) to run Windows (which you have to pay for). You can get a full version of Windows 7 Pro using the Microsoft Student Deal for $64.95; see
http://www.it.northwestern.edu/software/microsoft/
http://www.microsoft.com/student/en/us/software/windows/default.aspx
You can get a wide variety of Windows software by becoming a student member of the IEEE for $32; see
http://www.ieee.org/membership_services/membership/students/students_software.html
ME 333 Winter 2010 (obsolete)
- ME 333 Circuits Review Material
- NUmechatronics youtube channel
- ME 333 final projects
- PCB Artist
- ME 333 Suggested Final Projects
- ME 333 end of course schedule
- ME 333 Lab Kits
- Processing (software allowing you to create GUIs on your PC and interface through your USB port)
- Labs from Winter 2010
- Ungraded study problems (be sure to attempt to solve the problems before looking at the solutions!)