CSE 171 Lab 11. November 21-23, 2005.

EXPERIMENT: DC Motors and Generators

PRE-LAB

  1. Study Lecture11.4, Motors.
  2. Download the files motor.v, PWM.v, capture.v, binbcd9.v, counter8.v, hex7seg.v, register.v, ShiftReg.v, and Lab11v.ucffrom the class website.
  3. Study these files and note how the filemotor.vimplementsthe top-level design for Lab 11 shown in Fig. 1. Note that we have added the modules PWM and capture to the volt meter experiment in Lab 10. The module PWM generates the pwm signal to drive the motor. The module capture produces a load signal for the Display Register only about once per second so as to keep the 7-segment displays from displaying multiple digits as the voltage from a noisy analog signal varies slightly.

LAB

Part 1: Simulation

  1. Create a subdirectory under C:\CSE171\<your last name> containing your last name. Start the Aldec simulator by double-clicking the Active-HDL 6.1 icon on the desktop. Create a new project, Lab11va, in the folder C:\CSE171\<your name>and give the Design Name as motor. Add copies of the files motor.v, PWM.v, capture.v, binbcd9.v, counter8.v, hex7seg.v, register.v, and ShiftReg.v to the project.
  2. Select motor.v as your top-level design and simulate the operation of the A/D converter by selecting the following signals to display in the waveform window: Clk4, Clr, Clk1, SW, pwm, Data, Q, Clock, S, Capture, load, D, P. Initialize the simulation and then assign the following stimulators:

Clk4: Clock – 100MHz

Clr: Formula – 1 0ns, 0 10ns

Clk1: Clock – 50KHz

Data: Clock – 1.25MHz

Run the simulation for 40 us. Adjust the magnification so that you can see a range of 0 – 40us on the waveform window. Detach this window by clicking the > symbol in the uper right corner of the window. Copy this window by pressing Alt-PrtSc and paste this waveform into a Word document. Add the following heading above the waveform.

Clk4 = 100MHz Clr = 1 0ns, 0 10ns Clk1 = 50KHz Data = 1.25MHz

3.Adjust the magnification so that you can see a range of 8.5 – 13 us on the waveform window. Copy this window by pressing Alt-PrtSc and paste this waveform into the same Word document.

Part 2: Synthesis

  1. Start the Xilinx Project Navigator by double-clicking the Project Navigator icon on the desktop. Create a new project, Lab11vx, in the folder C:\CSE171\<your name> and add copies of the files motor.v, PWM.v, capture.v, binbcd9.v, counter8.v, hex7seg.v, register.v, ShiftReg.vand Lab11v.ucfto the project.
  2. Generate a programming file for the motor.v module.

3.Using an ADC0831 chip and connecting wires, build the circuit shown in Fig.2 on the breadboard provided. Then, connect pins 33 and 34 of header HD4 on the PLDT-3 board to the clock signal CLK and the chip select signal CS respectively of the ADC0831 chip. Connect the data output signal DO of the ADC0831 chip to pin 32 of header HD3 on the PLDT-3 board. Connect pin 31 of header HD3 on the PLDT-3 board to the PWM input to the motor driver circuit shown in Fig. 3. Before applying power, ask your lab instructor to check your circuit.

4.Connect the PC printer port cable to the PLDT-3 board and connect the 9V DC power module. Download your program to the Xilinx chip.

5.Test the motor side of your circuit by making the following measurements. For each measurement set the toggle switches, SW, to FF (all on) and record in Table 1 below the 7segment voltage display value and the binary value of the display register shown in the red LEDs.

a.Connect the voltage input test lead to the TIP30 pnp emitter, E.

b.Connect the voltage input test lead to the TIP30 pnp base, B1.

c.Connect the voltage input test lead to the TIP30 pnp collector, C.

d.Connect the voltage input test lead to the 2N2907 pnp base, B2.

e.Connect the voltage input test lead to Pin 8 of the 7406.

f.Connect the voltage input test lead to the PWM signal (pin 9 of the 7406).

Table 1 – Experimental Observations – SW = FF

Test / 7-seg. Display / LED Display [D7..D0]
Binary / Decimal
a. TIP30 pnp emitter, E
b. TIP30 pnp base, B1
c. TIP30 pnp collector, C
d. 2N2907pnp base, B2
e. Pin 8 of the 7406
f. PWM (Pin 9 of the 7406)

6.Test the generator side of your circuit by connecting the voltage input test lead to the generator output and recording in Table 2 the 7-segment voltage display for different toggle switch settings.

Table 2 – Experimental Observations – Generator Output

SW hex (decimal) / 7-seg. Display / LED Display [D7..D0]
Binary / Decimal
FF (255)
FA (250)
F5 (245)
F0 (240)
EB (235)
E6 (230)
E1 (225)
C8 (200)
96 (150)
64 (100)
32 (50)
00 (0)

7.Demonstrate your motor-generator to your lab instructor and obtain your lab instructor's signature for your work.

8.Delete the directory C:\CSE171\<your name> that you created at the beginning of this lab, remove any other files or folders you put on the system and clean up your station.

Answer questions 41 – 44 on the class website for next week:

41.Explain the basic operation of a permanent magnet DC motor by describing the forces that act on the armature coil when current flows through the coil. Why don’t these forces cause the armature to accelerate and therefore speed up forever?

42.What is the purpose of a commutator in a DC motor? Explain how it works.

43.Explain how pulse-width modulation (PWM) is used to control the speed of a DC motor.

44.Show a plot of the DC voltage that you applied to the motor in the experiment as a function of the binary count input. Use the value you measured with the switch setting of FF and compute the DC value of the PWM signal for the other switch settings. On the same graph plot the voltages that you measured from the DC generator in the circuit. Explain the differences in values.

1