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

From Mech
Jump to navigationJump to search
Line 1: Line 1:
'''Winter Quarter 2014'''
'''Winter Quarter 2014'''


'''First day of class is '''
'''First day of class is Tuesday January 7.'''
* Section 20: Prof. Kevin Lynch, T Th, 11:00-12:20, Tech LR4
* Section 20: Prof. Kevin Lynch, T Th, 11:00-12:20, Tech LR4
* Section 21: Prof. Nick Marchuk, T Th, 12:30-1:50, Tech LR4
* Section 21: Prof. Nick Marchuk, T Th, 12:30-1:50, Tech LR4
* TAs: Alex Ansari, AlexanderAnsari2011 at u.northwestern.edu; Jian Shi, JianShi2011 at u.northwestern.edu
* TAs: Craig Shultz, craigshultz2012@u.northwestern.edu, and
* C Peer Instruction Sessions:
* C Peer Instruction Sessions: TBA
* '''Final demo''' (in lieu of final exam): (12:30-1:50 section) and (11-12:20 section) in LR4
* '''Final demo''' (in lieu of final exam): Monday Mar 17 3-5 PM(12:30-1:50 section) and Wednesday Mar 19 9-11 AM (11-12:20 section) in LR4
* Office Hours:
* Office Hours: TBA
**
**


Line 45: Line 45:
Attendance at the first day of class is mandatory. By the first day of class, you should:
Attendance at the first day of class 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.
* 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.
* 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 $125 if you are starting from scratch; $75 if you already have the NUscope.
* Be prepared to buy your class kit, consisting of the portable nScope oscilloscope, the NU32 PIC32 development board, and lots of other goodies. Price $125 if you are starting from scratch; $75 if you already have the nScope.
<!-- * Be able to solve circuit problems similar to those on the practice problem set and last year's quiz at the bottom of [[ME_333_Circuits_Review_Material|this page]]. Be prepared for a quiz on this material in the second week of class. We will only spend one class period reviewing this material.-->
<!-- * Be able to solve circuit problems similar to those on the practice problem set and last year's quiz at the bottom of [[ME_333_Circuits_Review_Material|this page]]. Be prepared for a quiz on this material in the second week of class. We will only spend one class period reviewing this material.-->
<!-- * Buy your class kit [http://it.mccormick.northwestern.edu/matlab/student_license/login.php '''here''']. If you already have the oscilloscope and multimeter from this year's ME 233 offering, you should choose "ME 333 (w/o ME 233 equipment)" for the price of $75. If you do not have the oscilloscope and multimeter, you should choose "ME 333 (w/ ME 233 equipment)" for the price of $135. You will not be able to start the course until you have completed the purchase of your kit. If you decide to drop the course, you will be refunded the purchase price upon return of all the equipment in working shape. -->
<!-- * Buy your class kit [http://it.mccormick.northwestern.edu/matlab/student_license/login.php '''here''']. If you already have the oscilloscope and multimeter from this year's ME 233 offering, you should choose "ME 333 (w/o ME 233 equipment)" for the price of $75. If you do not have the oscilloscope and multimeter, you should choose "ME 333 (w/ ME 233 equipment)" for the price of $135. You will not be able to start the course until you have completed the purchase of your kit. If you decide to drop the course, you will be refunded the purchase price upon return of all the equipment in working shape. -->
Line 71: Line 71:
Required:
Required:


* [[Media:CrashCourseinC.pdf|A Crash Course in C]]: A brief introduction to the C programming language. Sample code from this appendix can be found [[ME333 Sample Code|here]].
* [[Media:CrashCourseinC.pdf|A Crash Course in C]]: A brief introduction to the C programming language. Sample code from this appendix can be found [[ME333 Sample Code|here]]. ([[Media:EssentialC.pdf|Essential C]] is also a very nice intro to C.)
* other readings (coming soon)
([[Media:EssentialC.pdf|Essential C]] is also a very nice intro to C)
<!--
* handouts associated with individual classes
* wiki info on [[Microchip PICs]]
* wiki info on [[Microchip PICs]]
* [[Media:PIC32MX5XX6XX7XX_Family_Data_Sheet.pdf|PIC32 Data Sheet]] (256 pages, 5 MB pdf)
* [[Media:PIC32MX5XX6XX7XX_Family_Data_Sheet.pdf|PIC32 Data Sheet]] (256 pages, 5 MB pdf)
Line 84: Line 84:
* MPLAB C32 Libraries Guide and MPLAB C32 User Guide, included under "doc" of your C32 compiler installation
* MPLAB C32 Libraries Guide and MPLAB C32 User Guide, included under "doc" of your C32 compiler installation
* Other C resources, such as [http://publications.gbdirect.co.uk/c_book/ online] as well as this [[Media:CBook.pdf|pdf version]] of "The C Book," and the classic [http://www.amazon.com/Programming-Language-2nd-Brian-Kernighan/dp/0131103628/ref=sr_1_1?s=books&ie=UTF8&qid=1294091625&sr=1-1 C Programming Language] reference book by Kernighan and Ritchie
* Other C resources, such as [http://publications.gbdirect.co.uk/c_book/ online] as well as this [[Media:CBook.pdf|pdf version]] of "The C Book," and the classic [http://www.amazon.com/Programming-Language-2nd-Brian-Kernighan/dp/0131103628/ref=sr_1_1?s=books&ie=UTF8&qid=1294091625&sr=1-1 C Programming Language] reference book by Kernighan and Ritchie
-->


== Grading ==
== Grading ==
Line 96: Line 97:


Here are a few guidelines/tips associated with homework submissions:
Here are a few guidelines/tips associated with homework submissions:
* Be neat and make sure your answers are easy to follow. Messy hard-to-follow assignments make TAs cranky, and you don't want cranky TAs grading your assignment!
* We expect the required files for each assignment to be compressed together in a zip file (no rar files).
* 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. And put all your source files and your documents including your answers to all the questions IN ONE FOLDER with the name "Lastname_Firstname_a#"(# is the assignment index number).
* 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. And put all your source files and your documents including your answers to all the questions IN ONE FOLDER with the name "Lastname_Firstname_a#"(# is the assignment index number).
Line 112: Line 114:
: '''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.
: '''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)
'''Class 1''' (T 1/8)
: '''Assignment 1 due''': Hand in paper versions of your solutions at the beginning of class. No blackboard today. Also, bring your laptop to class to demonstrate HelloWorld.c.
: '''Assignment 1 due''': Hand in paper versions of your solutions at the beginning of class. No blackboard today. Also, bring your laptop to class to demonstrate HelloWorld.c.
Line 140: Line 143:
* the [http://processing.org/download/ Processing language] for your operating system
* the [http://processing.org/download/ Processing language] for your operating system
* a terminal emulator program like [http://freeware.the-meiers.org/ CoolTerm]
* a terminal emulator program like [http://freeware.the-meiers.org/ CoolTerm]
<!-- if you are using Windows, the [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY] terminal emulator program -->
Also, download the [[Media:PIC32MX5XX6XX7XX_Family_Data_Sheet.pdf|PIC32 Data Sheet]] and the [[Media:61132B_PIC32ReferenceManual.pdf‎|PIC32 Reference Manual]].
Also, download the [[Media:PIC32MX5XX6XX7XX_Family_Data_Sheet.pdf|PIC32 Data Sheet]] and the [[Media:61132B_PIC32ReferenceManual.pdf‎|PIC32 Reference Manual]].


Line 242: Line 244:
: '''Class Topic''': RC servo motors and stepper motors
: '''Class Topic''': RC servo motors and stepper motors


-->

'''Final Demo''': Monday 3/18, 3-5 PM or Wednesday 3/20, 9-11 AM. Electronic submission by Wednesday 3/20, 11 AM.
'''Final Demo''': Monday 3/18, 3-5 PM or Wednesday 3/20, 9-11 AM. Electronic submission by Wednesday 3/20, 11 AM.


<!--
== NUScope ==
== NUScope ==
[[NUScope|NUScope instructions]]
[[NUScope|NUScope instructions]]
Line 251: Line 254:


[[Media:NuScope1-3.zip | (v1-3 for the smaller board)]]
[[Media:NuScope1-3.zip | (v1-3 for the smaller board)]]
-->


== FAQ ==
== FAQ ==

Revision as of 10:15, 29 November 2013

Winter Quarter 2014

First day of class is Tuesday January 7.

  • Section 20: Prof. Kevin Lynch, T Th, 11:00-12:20, Tech LR4
  • Section 21: Prof. Nick Marchuk, T Th, 12:30-1:50, Tech LR4
  • TAs: Craig Shultz, craigshultz2012@u.northwestern.edu, and
  • C Peer Instruction Sessions: TBA
  • Final demo (in lieu of final exam): Monday Mar 17 3-5 PM(12:30-1:50 section) and Wednesday Mar 19 9-11 AM (11-12:20 section) in LR4
  • Office Hours: TBA


Purpose of this Course

The purpose of this course is to provide tools that help you express your creativity. Maybe you want to build a robot, or a piece of kinetic art, or an automatic ball-throwing device to entertain your dog; maybe you've identified a market for a new smart product and you'd like to prototype the device. This course provides fundamentals of mechatronics to give you confidence to take on these projects. You are encouraged to take what you learn in this course and apply it in the project-based ME 433 Advanced Mechatronics course, Design Competition, or independent projects.

Approximate Syllabus

This course is for students that want to build microprocessor-controlled electromechanical devices.

To do this, 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 is mandatory. By the first day of class, you should:

  • Complete the reading and assignment 1, which is due the first day 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 nScope oscilloscope, the NU32 PIC32 development board, and lots of other goodies. Price $125 if you are starting from scratch; $75 if you already have the nScope.

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:

  • A Crash Course in C: A brief introduction to the C programming language. Sample code from this appendix can be found here. (Essential C is also a very nice intro to C.)
  • other readings (coming soon)

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. All homeworks should be submitted by 11 AM on the day it is due (i.e., before the first section of the day). Late homeworks will not be accepted.

Here are a few guidelines/tips associated with homework submissions:

  • Be neat and make sure your answers are easy to follow. Messy hard-to-follow assignments make TAs cranky, and you don't want cranky TAs grading your assignment!
  • 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. And put all your source files and your documents including your answers to all the questions IN ONE FOLDER with the name "Lastname_Firstname_a#"(# is the assignment index number).
  • 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. The draft notes from Winter Quarter 2013 are compiled into a single file here: ME 333 Winter 2013 Draft Notes.

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.

Final Demo: Monday 3/18, 3-5 PM or Wednesday 3/20, 9-11 AM. Electronic submission by Wednesday 3/20, 11 AM.


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.