2.Write a Verilog Program Called Lab11.V That Will Implement the Top-Level Design Shown

2.Write a Verilog Program Called Lab11.V That Will Implement the Top-Level Design Shown

EGR 240 Lab 11. April 4 - 7, 2006. Rev. A

EXPERIMENT: Motors, Generators, Solid-State Relays, and Pulse-Width Modulation.

Part A.

1.Createa directory C:\EGR240\<your name>. Using Aldec HDL create a project called Lab11 and add the following Verilog programs from the class website: binbcd4.v, hex7seg.v, counter12.v, and pwm.v.

2.Write a Verilog program called Lab11.v that will implement the top-level design shown in Figure 1.

Figure 1. Lab 11 Top-Level Design.

3.Simulate the top-level module, Lab11.v, for 500 ns by using the following stimulators:

S4:Formula,1 0 ns, 0 5 ns

Q[11]:Clock, 100 MHz

SW:Value, 1100

Make a printout of your waveform and have your lab instructor sign it.

Part B

  1. Using Xilinx ISE create a project called Lab11x (in your Lab11 folder) and add your filesLab11.v,binbcd4.v, hex7seg.v, counter12.v, and pwm.v to this project. Add a copy of the file Lab11.ucf (available on the class website) to this project.
  2. Select Lab11 and double-click the Generate Programming File process. Connect the PC printer port cable to the PLDT-3 board, then connect the 9V DC power module. Turn off all toggle switches. Double-click Configure Device (iMPACT) under the Generate Programming File process and download your program to the Xilinx chip.
  3. Set the switches first to 25% duty cycle, then 75% duty cycle and measure the pwm signal output of the PLDT-3 board using both the multimeter and the oscilloscope for both switch settings.

25% Duty Cycle / 75% Duty Cycle
Multimeter Vrms
Oscilloscope Vpk-pk (Vref)
  1. Before connecting the motor-generator unit, measure the resistance of the motor with the multimeter.

Motor resistance ______Ω

  1. Unplug the 9V DC power module. Using the breadboard, build the motor drive circuit shown in Figure 2.

Figure 2. Motor Drive Circuit.

Have your lab instructor check your circuit.

  1. Plug in the 9V DC power module and connect the pwm signal from HD3 pin 25 to the motor drive circuit on the breadboard. Set the toggle switches and measure the input to the motor and the output from the generator with the multimeter. Record the values in the following table. Observe the input voltage to the motor on the oscilloscope as the toggle switch settings are changed.

Toggle Switch
Settings / Motor Input
Voltage / Generator Output
Voltage
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111

Answer questions 37 – 40 on the class website for the week of April 11:

37.Using the value of the motor resistance that you measured in the lab, what would you estimate the stall current, Ia, to be?

38.Using the value of the motor resistance that you measured in the lab, what would you estimate the maximum power, Pd max, to be? Assume that the stall current is the value you found in Question 37 and that the no load current is 0.15 A. What will the current be when the power is Pd max?

39.Calculate the RMS voltage of the PWM signal that you measured with a duty cycle of 0.25. Compare this with the value that you measured with the multimeter.

40.Calculate the RMS voltage of the PWM signal that you measured with a duty cycle of 0.75. Compare this with the value that you measured with the multimeter.

1