Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
learn:courses:unit-6-lab6a:start [2017/04/04 11:59] – [7.1. Analog Speed Control] Martha | learn:courses:unit-6-lab6a:start [2021/10/13 15:23] (current) – Arthur Brown | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Lab 6a: Open-loop Process Control ====== | ====== Lab 6a: Open-loop Process Control ====== | ||
+ | [[{}/ | ||
=== Download This Document === | === Download This Document === | ||
- | * {{ : | + | {{ : |
===== 1. Objectives ===== | ===== 1. Objectives ===== | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
Line 17: | Line 18: | ||
===== 2. Basic Knowledge ===== | ===== 2. Basic Knowledge ===== | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
Line 28: | Line 29: | ||
===== 3. Equipment List ===== | ===== 3. Equipment List ===== | ||
==== 3.1. Hardware ==== | ==== 3.1. Hardware ==== | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
In addition, we suggest the following instruments: | In addition, we suggest the following instruments: | ||
- | | + | |
- | | + | |
==== 3.2. Software: ==== | ==== 3.2. Software: ==== | ||
The following programs must be installed on your development workstation: | The following programs must be installed on your development workstation: | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
Line 53: | Line 54: | ||
===== 4. Project Takeaways ===== | ===== 4. Project Takeaways ===== | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | |
Line 64: | Line 65: | ||
[[https:// | [[https:// | ||
- | {{ : | + | {{ : |
//Figure 5.1. Open-loop motor control block diagram.// | //Figure 5.1. Open-loop motor control block diagram.// | ||
+ | |||
---- | ---- | ||
Line 80: | Line 82: | ||
The potentiometer labeled the Analog Input Control (R134) on the Basys MX3 trainer board, as shown in Fig. 7.1, will be used as the input for controlling the motor speed. The potentiometer wiper terminal is connected to the PIC32MX370 processor Port B pin 2. Using the PIC32 analog-to-digital converter (ADC) is rather straightforward with the aid of the example code provided by the MPLAB X Help for the XC32 Peripheral Libraries. Listing B.1 in Appendix B shows how to initialize an ADC channel to continuously sample and convert analog data. Listing B.2 is example code to read the most recent ADC conversion and call functions to set the motor direction of rotation and speed. The motor control is discussed in section 7.4 below. | The potentiometer labeled the Analog Input Control (R134) on the Basys MX3 trainer board, as shown in Fig. 7.1, will be used as the input for controlling the motor speed. The potentiometer wiper terminal is connected to the PIC32MX370 processor Port B pin 2. Using the PIC32 analog-to-digital converter (ADC) is rather straightforward with the aid of the example code provided by the MPLAB X Help for the XC32 Peripheral Libraries. Listing B.1 in Appendix B shows how to initialize an ADC channel to continuously sample and convert analog data. Listing B.2 is example code to read the most recent ADC conversion and call functions to set the motor direction of rotation and speed. The motor control is discussed in section 7.4 below. | ||
- | {{ : | + | {{ : |
//Figure 7.1. Analog Input Control schematic diagram.// | //Figure 7.1. Analog Input Control schematic diagram.// | ||
- | {{ : | + | |
==== 7.2. Motor Speed Indication ==== | ==== 7.2. Motor Speed Indication ==== | ||
Section 7.2.1 of the Unit 6 tutorial describes the details of measuring the period of the pulse output of a digital tachometer. Listing B.3 and B.4 of this text present the code for initializing the input capture to generate an interrupt on every positive transition and the interrupt service routine that computes the period between successive captures. Since the period measurement is instantaneous, | Section 7.2.1 of the Unit 6 tutorial describes the details of measuring the period of the pulse output of a digital tachometer. Listing B.3 and B.4 of this text present the code for initializing the input capture to generate an interrupt on every positive transition and the interrupt service routine that computes the period between successive captures. Since the period measurement is instantaneous, | ||
Line 97: | Line 100: | ||
In this lab we will be using a [[https:// | In this lab we will be using a [[https:// | ||
- | {{ : | + | {{ : |
//Figure 7.2. DC Motor with digital tachometer.// | //Figure 7.2. DC Motor with digital tachometer.// | ||
Line 103: | Line 106: | ||
- | {{ : | + | {{ : |
//Figure 7.3. Basys MX3 Motor driver circuit.// | //Figure 7.3. Basys MX3 Motor driver circuit.// | ||
+ | |||
**Table 7.1. Motor driver IC7 connection to PIC32 processor.** | **Table 7.1. Motor driver IC7 connection to PIC32 processor.** | ||
- | ^ Function | + | ^ Function |
| AIN1 | 10 | RB3 | Motor Supply + | Red | | | AIN1 | 10 | RB3 | Motor Supply + | Red | | ||
| BIN1 | 8 | RE9 | Not Used - Set to zero | | | | BIN1 | 8 | RE9 | Not Used - Set to zero | | | ||
Line 189: | Line 193: | ||
- Phase 2 Construction | - Phase 2 Construction | ||
- Attach the workstation monitor and launch the terminal emulator application. | - Attach the workstation monitor and launch the terminal emulator application. | ||
- | - Port in the LCD code from [[https:// | + | - Port in the LCD code from [[/ |
- | - Port the UART code from [[https:// | + | - Port the UART code from [[/ |
- Modify the background task to update the LCD and UART once each 250 ms. | - Modify the background task to update the LCD and UART once each 250 ms. | ||
Line 207: | Line 211: | ||
- Plot the motor speed vs. percent PWM as demonstrated in Fig. 8.3. All motors have different power-speed characteristics. | - Plot the motor speed vs. percent PWM as demonstrated in Fig. 8.3. All motors have different power-speed characteristics. | ||
- | {{ : | + | {{ : |
//Figure 8.1. H-Bridge inputs for CW motor rotation for 60% PWM.// | //Figure 8.1. H-Bridge inputs for CW motor rotation for 60% PWM.// | ||
- | {{ : | + | {{ : |
//Figure 8.2. H-Bridge inputs for CCW motor rotation for 60% PWM.// | //Figure 8.2. H-Bridge inputs for CCW motor rotation for 60% PWM.// | ||
+ | |||
{{ : | {{ : | ||
Line 458: | Line 463: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | [[{}/ | ||
+ | [[{}/ | ||
+ | [[{}/ |