Difference between revisions of "ME 333 Readings, Videos, and Sample Code"

From Mech
Jump to navigationJump to search
Line 47: Line 47:
'''Videos''': none
'''Videos''': none


<!--
'''Sample Code''':
'''Sample Code''':
*'''Section 1.3''': [[Media:PIC32quickstart.zip|PIC32quickstart.zip]]
*'''Section 1.3''': [[Media:PIC32quickstart.zip|PIC32quickstart.zip]]
<!--
Individual files:
Individual files:
** [[Media:NU32bootloader.hex|NU32bootloader.hex]]
** [[Media:NU32bootloader.hex|NU32bootloader.hex]]
Line 88: Line 88:
# [http://www.youtube.com/watch?v=ZlJmjcGkTl4 '''The PIC32 executable build process'''] (4:26).
# [http://www.youtube.com/watch?v=ZlJmjcGkTl4 '''The PIC32 executable build process'''] (4:26).


<!--
'''Sample Code''':
'''Sample Code''':
* [[Media:Bootloader.zip|Bootloader.zip]]
* [[Media:Bootloader.zip|Bootloader.zip]]
-->

----
----


Line 100: Line 101:
# [https://www.youtube.com/watch?v=ovhNxIq9Kwo '''The NU32 library'''] (5:28).
# [https://www.youtube.com/watch?v=ovhNxIq9Kwo '''The NU32 library'''] (5:28).


<!--
'''Sample Code''':
'''Sample Code''':
*'''Section 4.5''':
*'''Section 4.5''':
Line 106: Line 108:
** [[Media:LCD.h|LCD.h]]
** [[Media:LCD.h|LCD.h]]
** [[Media:LCDwrite.c|LCDwrite.c]]
** [[Media:LCDwrite.c|LCDwrite.c]]
-->

----
----


Line 134: Line 136:
# [http://www.youtube.com/watch?v=40YZFMw2nBs&feature=youtu.be '''PIC32 interrupt code example'''] (4:10)
# [http://www.youtube.com/watch?v=40YZFMw2nBs&feature=youtu.be '''PIC32 interrupt code example'''] (4:10)


<!--

'''Sample Code''':
'''Sample Code''':
* [[Media:INT_core_timer.c|INT_core_timer.c]]
* [[Media:INT_core_timer.c|INT_core_timer.c]]
* [[Media:INT_ext_int.c|INT_ext_int.c]]
* [[Media:INT_ext_int.c|INT_ext_int.c]]
* [[Media:INT_timing.c|INT_timing.c]]
* [[Media:INT_timing.c|INT_timing.c]]
-->

----
----


Line 151: Line 153:
# [http://youtu.be/hgeACkWSYxc '''PIC32 program with digital I/O and change notification'''] (9:02)
# [http://youtu.be/hgeACkWSYxc '''PIC32 program with digital I/O and change notification'''] (9:02)


<!--
'''Sample Code''':
'''Sample Code''':
* [[Media:DIO_sfrs.c|DIO_sfrs.c]]
* [[Media:DIO_sfrs.c|DIO_sfrs.c]]
* [[Media:DIO_plib.c|DIO_plib.c]]
* [[Media:DIO_plib.c|DIO_plib.c]]
-->
----
----


Line 166: Line 170:
# [http://youtu.be/Y5MaR-D7YuM '''Example PIC32 timer interrupt program'''] (5:08)
# [http://youtu.be/Y5MaR-D7YuM '''Example PIC32 timer interrupt program'''] (5:08)


<!--
'''Sample Code''':
'''Sample Code''':
* [[Media:TMR_5Hz.c|TMR_5Hz.c]]
* [[Media:TMR_5Hz.c|TMR_5Hz.c]]
* [[Media:TMR_external_count.c|TMR_external_count.c]]
* [[Media:TMR_external_count.c|TMR_external_count.c]]
* [[Media:TMR_pulse_duration.c|TMR_pulse_duration.c]]
* [[Media:TMR_pulse_duration.c|TMR_pulse_duration.c]]
-->

----
----


Line 182: Line 187:
# [http://youtu.be/xhdiiYYF-zY '''Using output compare to create an analog output'''] (3:09)
# [http://youtu.be/xhdiiYYF-zY '''Using output compare to create an analog output'''] (3:09)


<!--
'''Sample Code''':
'''Sample Code''':
* [[Media:OC_PWM_sfrs.c|OC_PWM_sfrs.c]]
* [[Media:OC_PWM_sfrs.c|OC_PWM_sfrs.c]]
Line 187: Line 193:
* [[Media:OC_analog_out.c|OC_analog_out.c]]
* [[Media:OC_analog_out.c|OC_analog_out.c]]
* [[Media:OC_signal.m|OC_signal.m]]
* [[Media:OC_signal.m|OC_signal.m]]
-->

----
----


Line 212: Line 218:
# [http://youtu.be/JvlPeWEU5i8 '''The PIC32 analog-to-digital converter'''] (6:47)
# [http://youtu.be/JvlPeWEU5i8 '''The PIC32 analog-to-digital converter'''] (6:47)


<!--
'''Sample Code''':
'''Sample Code''':
* [[Media:ADC_Read2.c|ADC_Read2.c]]
* [[Media:ADC_Read2.c|ADC_Read2.c]]
* [[Media:ADC_max_rate.c|ADC_max_rate.c]]
* [[Media:ADC_max_rate.c|ADC_max_rate.c]]
-->
----
----



Revision as of 01:12, 25 January 2015

Readings, videos, exercises, and sample code for ME 333 Introduction to Mechatronics.

If you have questions about the readings or videos, you can post them (anonymously if you wish) for possible discussion in the next class, or use the Canvas discussion group for an online discussion

You can download the most updated version of the class readings here.

Appendix: A Crash Course in C

Reading: A Crash Course in C, C Compilers

Videos:

  1. Writing your first program in C, HelloWorld.c (5:09). Chapter A.1. Exercises: 1.
  2. Differences between C and MATLAB (7:30). Chapter A.2. Exercises: 2, 3.
  3. Binary and hexadecimal (Base 2 and 16) (4:47). Chapter A.3.1. Exercises: 4, 6.
  4. Data types (5:30). Chapter A.3.1. Exercises: 8, 10.
  5. Using the data types (3:49). Chapter A.3.1. Exercises: 11.
  6. Representations of data types (5:15). Chapter A.3.1. Exercises: 12, 13.
  7. Pointer basics (5:54). Chapter A.3.2. Exercises: 14, 15.
  8. Sample program: printout.c (5:55). Chapter A.4. Exercises: 16 (not covered in video, reading only) 17, 18.
  9. Sample program: datasizes.c (2:57). Chapter A.4. Exercises: 9.
  10. Sample program: overflow.c (2:43). Chapter A.4. Exercises: 19.
  11. Sample program: typecast.c (5:43). Chapter A.4. Exercises: 20.
  12. invest.c, part 1/5: intro to a typical C program (4:18). Chapter A.4. Exercises: 23.
  13. invest.c, part 2/5: overview (3:58). Chapter A.4. Exercises: 24, 25.
  14. invest.c, part 3/5: sections 1-4: program comments, preprocessor commands, new data type definitions, and global variables (4:48). Chapter A.4. Exercises: 26.
  15. invest.c, part 4/5: sections 5-6: helper function prototypes and the main function (4:40). Chapter A.4.
  16. invest.c, part 5/5: section 7: helper functions (7:42). Chapter A.4. Exercises: 28-30, 32, 33 (some material covered in reading only).
  17. Header files and libraries (9:31).

Sample Code:

Microchip Documentation:

Microchip PIC32MX795F512L


Chapter 1: Quickstart

Reading: Chapter 1

Videos: none



Chapter 2: Looking Under the Hood: Hardware

Reading: Chapter 2

Videos:

  1. Introduction to the PIC32 microcontroller (5:10).
  2. Introduction to the PIC32 architecture (6:02).
  3. The PIC32 physical memory map (5:20).
  4. Introduction to the NU32 development board (4:03).

Sample Code: none


Chapter 3: Looking Under the Hood: Software

Reading: Chapter 3

Videos:

  1. The PIC32 virtual memory map (5:24).
  2. Understanding simplePIC.c (5:42).
  3. Digging through PIC32 header files (7:12).
  4. The PIC32 executable build process (4:26).

Chapter 4: Using Libraries

Reading: Chapter 4

Videos:

  1. The NU32 library (5:28).

Chapter 5: Time and Space

Reading: Chapter 5

Videos:

  1. Timing PIC32 code and the disassembly file (8:27).
  2. The PIC32 memory map file (7:15).

Sample Code:


Chapter 6: Interrupts

Reading: Chapter 6

Videos:

  1. Overview of interrupts on the PIC32 (4:29).
  2. PIC32 interrupt SFRs (6:22).
  3. The PIC32 shadow register set (1:25).
  4. Seven steps to using an interrupt with the PIC32 (3:47)
  5. PIC32 interrupt code example (4:10)

Chapter 7: Digital Input and Output

Reading: Chapter 7

Videos:

  1. Intro to digital I/O on the PIC32 (6:24)
  2. Change notification on the PIC32 (1:18)
  3. PIC32 program with digital I/O and change notification (9:02)

Chapter 8: Counters / Timers

Reading: Chapter 8

Videos:

  1. Intro to PIC32 counter/timers (5:59)
  2. PIC32 timer SFRs (5:55)
  3. Using PIC32 timers to generate interrupts (3:34)
  4. Example PIC32 timer interrupt program (5:08)

Chapter 9: Output Compare

Reading: Chapter 9

Videos:

  1. Introduction to the PIC32 output compare (5:30)
  2. A PWM program on the PIC32 (3:12)
  3. Using output compare to create an analog output (3:09)

PID Control

Reading: None required, but you can check out the wikipedia article if you like.

Videos:

  1. Introduction to PID control (4:28)
  2. Improving the basic PID control algorithm (2:33)
  3. PID control of a mass-spring-damper (4:10)
  4. P, PI, and PD variants of PID control (2:42)
  5. Empirical PID gain tuning (7:08)

Sample Code: None.


Chapter 10: Analog Input

Reading: Chapter 10

Video:

  1. The PIC32 analog-to-digital converter (6:47)

Chapter 11: Brushed Permanent Magnet DC Motors

Reading: Chapter 11

Video:

  1. Intro to brushed permanent magnet DC motors, part 1/2 (4:31)
  2. Intro to brushed permanent magnet DC motors, part 2/2 (7:10)
  3. Brushed DC motor equations (6:53)
  4. Brushed DC motor speed-torque curve (5:59)
  5. DC motor output power (2:05)
  6. Friction in DC motors (0:55)
  7. A DC motor data sheet (4:34)

Chapter 12: Motor Sizing

Reading: Chapter 12

Video:

  1. Introduction to gears (4:12)
  2. Gear efficiency (2:40)
  3. Types of gears (3:47)

Chapter 13: Motor Control

Reading': Chapter 13

Video:

  1. Driving DC motors, part 1/3: Flyback diodes (7:03)
  2. Driving DC motors, part 2/3: PWM (3:05)
  3. Driving DC motors, part 3/3: H-bridges (4:22)
  4. A professional motor control system (6:55)

UART


SPI Communication


I2C Communication


USB


Input Capture


Comparator


Watchdog Timer


Storing Data in Flash Memory


Power Saving


Real-time Clock and Calendar


Controller Area Network (CAN)


Direct Memory Access


Sensors and Signal Conditioning


Digital Signal Processing


Chapter 26: DC Motor Control


Chapter 27: Brushless Motor Control


Chapter 28: Stepper Motors and RC Servos


Chapter 29: Connecting to an Android Device