Difference between revisions of "ME 333 Introduction to Mechatronics (Archive Winter 2013)"

From Mech
Jump to navigationJump to search
Line 8: Line 8:
* '''Final demo''' (in lieu of final exam): Monday March 18 3-5 PM (12:30-1:50 section) and Wed March 20 9-11 AM (11-12:20 section) in LR5
* '''Final demo''' (in lieu of final exam): Monday March 18 3-5 PM (12:30-1:50 section) and Wed March 20 9-11 AM (11-12:20 section) in LR5
* Office Hours:
* Office Hours:



== Approximate Syllabus ==
== Approximate Syllabus ==

Revision as of 21:37, 27 November 2012

Winter Quarter 2013

First day of class is Tuesday Jan 8

  • Section 20: Prof. Kevin Lynch, T Th, 11:00-12:20, Tech LR5
  • Section 21: Prof. Nick Marchuk, T Th, 12:30-1:50, Tech LR5
  • TAs: Alex Ansari, AlexanderAnsari2011 at u.northwestern.edu; Jian Shi, JianShi2011 at u.northwestern.edu
  • C Peer Instruction Sessions:
  • Final demo (in lieu of final exam): Monday March 18 3-5 PM (12:30-1:50 section) and Wed March 20 9-11 AM (11-12:20 section) in LR5
  • Office Hours:


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 do a lot of programming in this course! If you are certain you hate programming, then this is not the course for you. But knowing how to program is very useful for any modern engineer. The language we will use is C, a fairly low-level language that works well for microcontrollers, without being nearly as painful and low-level as assembly language. If you don't know C, that's not a problem, most students don't before taking ME 333; but you should plan to learn it, and rather quickly. You will have all the materials you need to start learning C before class starts, and the first assignment on C is due on the first day of class! The reason: even though we start out with C, that's not the main goal of this course. The main goal is to teach you about microcontrollers and mechatronics. Plus some students already have C background.

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 NU32 development board that breaks out the PIC32MX795F512L microcontroller.

It is essential you do the assigned reading in advance of class. Classes will begin with you turning in a short problem set related to the reading. (This includes the very first day of class!) Once a week we will have a short quiz. Most classes will be a combination of a brief review, Q&A, and working individually or in small groups on problems while the instructors help answer any questions.

Topics we will cover include:

  • introduction to C programming
  • 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

Checklist to Complete Before the First Day of Class

Attendance at the first day of class (Tuesday Jan 8) is mandatory. By the first day of class, you should:

  • Complete the reading and assignment 1, which is due the first day of class! In fact, the first two weeks of assignments are already posted, so you are welcome to complete them all over the break and coast through the first two weeks of class. The first assignments are designed to get you up to speed on the C programming language, which we will use throughout the course.
  • Have a laptop with at least 2 USB ports. Any operating system is fine. One port will be used to program and communicate with your PIC microcontroller, and the other will be used for your portable oscilloscope.
  • Be prepared to buy your class kit, consisting of the portable NUscope oscilloscope, the NU32 PIC32 development board, and lots of other goodies. Price TBD; last year's price was $135, but discounted if you already have the NUscope.

<--* If you are not already comfortable with the C language, or if you do not already have a C compiler installed on your laptop, this step is recommended before the first day of class. This will give you a headstart on learning C. If you don't complete this before the first day of class, you will need to do it before the second class. Download and install the GCC GNU compiler collection and the Netbeans IDE (Integrated Development Environment) following the instructions here. Verify that you can compile and run the sample programs at the end of that page. Read the comments in invest.c to find references to the Crash Course in C document and answer the questions to learn more about C. If you have problems installing a C compiler and running the programs, then you can still get a headstart before the first class by focusing on reading the C programs and the Crash Course in C manual to understand how they work.-->

Student Contract

By signing up for this course, you agree to complete the checklist above before the course starts. 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, and if you understand how the code works.

On our part (faculty and TAs), 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 Electronics Design or similar (EECS 221, 225) is required. You will be expected to analyze circuits with resistors, capacitors, inductors, diodes, transistors, and op-amps. You can find refresher material and a sample quiz at this page.

Reading

Required:

(Essential C is also a very nice intro to C)

  • handouts associated with individual classes
  • wiki info on Microchip PICs
  • PIC32 Data Sheet (256 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.
  • The old version of the PIC32 Family Reference Manual has many more pages than the chapter-by-chapter version linked above. It includes quite a lot of example code. Be warned though, Microchip was not very careful when writing the sample code; some of it contains syntax errors, or values in registers that are incorrect. Even with this being the case, this is still a very useful document.
  • PIC32MX Peripheral Library (included as a .chm file under "Program Files\Microchip\MPLAB C32\doc" with your C32 compiler installation)

Useful, but not required:

Grading

Grades will be approximately 40% quizzes and 60% assignments (including the final project). We will have short quizzes once a week at the beginning of class covering material on the previous assignment. Bring a sheet of paper you can turn in with your quiz answers. (Your lowest quiz score and homework score will be dropped.) We will have a final project and demo in lieu of a final exam.

All quizzes and assignments have equal weight, regardless of how many points they are graded out of. If one homework is graded out of 20 points, and the next out of 40, the formula for calculating your total grade for these two assignments would be 0.5*(score1/20) + 0.5*(score2/40).

Homework Submission

All homework will be submitted on Blackboard. Here are a few guidelines/tips associated with homework submissions:

  • We expect the required files for each assignment to be compressed together in a zip file (no rar files).
  • When asked to submit C code for a given programming assignment, we are only concerned with receiving the relevant source files, i.e., all *.c and *.h files. We do not want entire IDE/MPLAB X projects or executables/object files.
  • When writing your responses, please follow any instructions on how to write your response. For example, if we ask for a snippet of code, please do not submit your entire C program with header files and a main routine. We typically are only expecting a few lines of code that solves the problem.
  • When submitting written responses, we prefer PDF files, but will accept word documents (.doc, .docx), .txt, and .rtf files.
  • It helps both us and you if you format your code nicely. Clean looking code is easier for us to grade and easier for you to debug. Text editors with IDEs such as Netbeans and MPLAB X have tools for auto-formatting code. For example, highlighting a region and hitting Alt+Shift+f (Linux and Windows) will format that region according to your local formatting preferences.
  • When you compile your code, pay attention to any compiler warnings. They are there for a reason! You should be able to eventually get your code to produce no warnings. Often if a piece of code is not working, the warnings will give a clue as to why.


Schedule

All tutorial C code from "A Crash Course in C," as well as sample PIC32 code, can be found at this page: Sample Code for ME 333

Winter Break

Reading due for first class: pages 1-10 of A Crash Course in C
Assignment 1 due: problems 1-4, 6-8, 10-11, 14-15 of A Crash Course in C. Bring your laptop to class and demonstrate your HelloWorld.c program.

Class 1 (T 1/8)

Assignment 1 due: Hand in your solutions at the beginning of class.
Class Topic: Course overview and C programming
Reading for next class: pages 10-15 of A Crash Course in C
Assignment 2 out: problems 16-20, 23

Class 2 (Th 1/10)

Assignment 2 due
Class Topic: C programming continued
Reading for next class: pages 19-34 of A Crash Course in C (most of this is reference; the real goal is to fully understand the program invest.c)
Assignment 3 out: problems 24-26, 28-30, 32

Class 3 (T 1/15)

Assignment 3 due
Class Topic: C programming continued
Reading for next class: make sure you fully understand invest.c
Assignment 4 out: problem 33

Class 4 (Th 1/17)

Assignment 4 due
Class Topic: C programming conclusion


Final Demo: Monday 3/18, 3-5 PM (12:30-1:50 section) and Wednesday 3/20, 9-11 AM (11:00-12:20 section).

FAQ

Q: Do I need to know the C language to take this course?

A: No. But 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 an independent project?

A: There is no large independent project. There will be a 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: What kind of laptop do I need?

A: You need a laptop with at least 2 USB ports. Any operating system is fine.