Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| learn:courses:unit-6:start [2017/03/27 22:59] – Martha | learn:courses:unit-6:start [2022/10/04 11:38] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Unit 6: Analog I/O and Process Control ====== | + | ====== Unit 6: Analog I/O and Process Control ====== |
| + | [[{}/ | ||
| === Unit 6 Labs === | === Unit 6 Labs === | ||
| - | * [[https:// | + | * [[/ |
| - | * [[https:// | + | * [[/ |
| === Download This Document === | === Download This Document === | ||
| - | * {{ : | + | {{ : |
| Line 15: | Line 17: | ||
| ===== 2. Objectives ===== | ===== 2. Objectives ===== | ||
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| ---- | ---- | ||
| ===== 3. Basic Knowledge ===== | ===== 3. Basic Knowledge ===== | ||
| - | | + | |
| * Basic circuit theory | * Basic circuit theory | ||
| * Fundamentals of programming with C | * Fundamentals of programming with C | ||
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| ---- | ---- | ||
| Line 38: | Line 40: | ||
| ===== 4. Equipment List ===== | ===== 4. Equipment List ===== | ||
| ==== 4.1. Hardware ==== | ==== 4.1. Hardware ==== | ||
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| + | - [[https:// | ||
| In addition, we suggest the following instruments: | In addition, we suggest the following instruments: | ||
| - | | + | |
| ==== 4.2. Software ==== | ==== 4.2. Software ==== | ||
| The following programs must be installed on your development workstation: | The following programs must be installed on your development workstation: | ||
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| ---- | ---- | ||
| ===== 5. Project Takeaways ===== | ===== 5. Project Takeaways ===== | ||
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| ---- | ---- | ||
| Line 109: | Line 112: | ||
| The //Analog Control Input// on the Basys MX3 processor board will be used as the variable input control. Figure 7.1 shows that the potentiometer is connected to PORT B pin 2 of the PIC32MX370. To use the PIC32 analog input connected to the potentiometer, | The //Analog Control Input// on the Basys MX3 processor board will be used as the variable input control. Figure 7.1 shows that the potentiometer is connected to PORT B pin 2 of the PIC32MX370. To use the PIC32 analog input connected to the potentiometer, | ||
| - | {{ : | + | {{ : |
| //Figure 7.1. Analog Input Control schematic diagram.// | //Figure 7.1. Analog Input Control schematic diagram.// | ||
| + | |||
| Considering that the PIC32 ADC is connected to a potentiometer under manual control, the speed at which the analog voltage can change is relatively low. In Lab 6a and 6b we will run the PIC32 ADC at a high rate of speed so that the most recent ADC conversion will accurately reflect the current potentiometer setting. As Fig. 7.2 illustrates, | Considering that the PIC32 ADC is connected to a potentiometer under manual control, the speed at which the analog voltage can change is relatively low. In Lab 6a and 6b we will run the PIC32 ADC at a high rate of speed so that the most recent ADC conversion will accurately reflect the current potentiometer setting. As Fig. 7.2 illustrates, | ||
| Line 200: | Line 204: | ||
| === 7.2.2. Analog Output: Pulse-width Modulation === | === 7.2.2. Analog Output: Pulse-width Modulation === | ||
| - | In [[https:// | + | In [[/ |
| | | ||
| Lab 5 discussed the details of how to set up a PWM output using the output compare special function of the PIC32 processor. However, Lab 6a and 6b will require that we set up two PWM outputs that all use a common timer if the motor is to be capable of reversing direction. After initializing the timer to be used with the output compare and initializing the two output-compare channels, the PWM duty cycle of each individual channel is easily changed using the instruction // | Lab 5 discussed the details of how to set up a PWM output using the output compare special function of the PIC32 processor. However, Lab 6a and 6b will require that we set up two PWM outputs that all use a common timer if the motor is to be capable of reversing direction. After initializing the timer to be used with the output compare and initializing the two output-compare channels, the PWM duty cycle of each individual channel is easily changed using the instruction // | ||
| Line 217: | Line 221: | ||
| Figure 7.10 shows the electric model of a permanent magnet brushed DC motor, such as the one shown in Fig. 7.3. The torque of the motor is proportional to the armature current labeled //Ia//. The armature winding resistance, Ra, and winding inductance, //La//, are fixed. The back electromotive force (EMF) is proportional to the speed of the motor. | Figure 7.10 shows the electric model of a permanent magnet brushed DC motor, such as the one shown in Fig. 7.3. The torque of the motor is proportional to the armature current labeled //Ia//. The armature winding resistance, Ra, and winding inductance, //La//, are fixed. The back electromotive force (EMF) is proportional to the speed of the motor. | ||
| - | {{ : | + | {{ : |
| //Figure 7.10. Electric model of a brushed DC motor.// | //Figure 7.10. Electric model of a brushed DC motor.// | ||
| Line 225: | Line 229: | ||
| The motor driver IC on the Basys MX3 processor platform is shown in Fig. 7.11. The motor wires used for power input and tachometer output are identified in Fig. 7.12. A 5.0 V external power supply is required to be connected to J11, marked as VBAR on the Basys MX3 processor board. A jumper must be used on JP1 to connect the 5V power, VBAR, to the motor supply, VM. | The motor driver IC on the Basys MX3 processor platform is shown in Fig. 7.11. The motor wires used for power input and tachometer output are identified in Fig. 7.12. A 5.0 V external power supply is required to be connected to J11, marked as VBAR on the Basys MX3 processor board. A jumper must be used on JP1 to connect the 5V power, VBAR, to the motor supply, VM. | ||
| - | {{ : | + | {{ : |
| //Figure 7.11. Basys MX3 Motor driver circuit.// | //Figure 7.11. Basys MX3 Motor driver circuit.// | ||
| + | |||
| {{ : | {{ : | ||
| Line 332: | Line 337: | ||
| Thus, the control signal is proportional to the integral of the error signal, and in part, directly to the magnitude of the error signal itself. Because of this, this approach to control is referred to as PI (proportional-integral) control. A distinct advantage of PI control is that using it results in zero steady state error for a first order plant (G1(s) = k/s). Now computers can’t solve equations in the continuous domain, therefore we must transform to a discrete domain that allows us to use samples of continuous signals. Eq. C.8 is the transformation from continuous to discrete time domain that is based upon rectangular integration. Ts is the interval between samples of the input. | Thus, the control signal is proportional to the integral of the error signal, and in part, directly to the magnitude of the error signal itself. Because of this, this approach to control is referred to as PI (proportional-integral) control. A distinct advantage of PI control is that using it results in zero steady state error for a first order plant (G1(s) = k/s). Now computers can’t solve equations in the continuous domain, therefore we must transform to a discrete domain that allows us to use samples of continuous signals. Eq. C.8 is the transformation from continuous to discrete time domain that is based upon rectangular integration. Ts is the interval between samples of the input. | ||
| - | $$s = ( \frac{1-z^{-1}}{T_s} ) \qquad (Eq. C.8)$$ | + | $$s = \bigg( \frac{1-z^{-1}}{T_s} |
| Completing the appropriate computations after substituting Eq. C.8 into Eq. C.7, we end up with a discrete time equation shown in Eq. C.9. | Completing the appropriate computations after substituting Eq. C.8 into Eq. C.7, we end up with a discrete time equation shown in Eq. C.9. | ||
| Line 385: | Line 390: | ||
| + | ---- | ||
| + | |||
| + | [[{}/ | ||
| + | [[{}/ | ||
| + | [[{}/ | ||
| + | [[{}/ | ||
| {{tag> | {{tag> | ||

