Pulse width Modulation - Introduction to Electronics | ECE 110, Lab Reports of Electrical and Electronics Engineering

Material Type: Lab; Class: Introduction to Electronics; Subject: Electrical and Computer Engr; University: University of Illinois - Urbana-Champaign; Term: Unknown 1989;

Typology: Lab Reports

Pre 2010

Uploaded on 03/16/2009

koofers-user-bkf-1
koofers-user-bkf-1 🇺🇸

4.5

(2)

10 documents

1 / 9

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Laboratory #9 – pulse width modulation (revisited)
Grade
Pre-lab: /0
Lab: /12
Total: /12
Objectives
* Learn how PWM module works
* Understand how to use PWM in car design
* Learn how to use logic analyzer
* Learn about sequential circuits
* Learn how to program Car Board
* Learn how to use Car Board
Lecture References
Orange Book
* 9.19-9.21- Binary Number System
* 9.21-9.22- Synchronous Counter
* 11.1-11.2- Storing Information
* 1.2-11.11- Flip-flop’s (FF’s)
* 11.14-11.16- Counters
Transparencies
* Burnet Handouts 15,16,17- Sequential Circuits (Flip-flop’s and Counters)
* Haken Set 3- pg. 2-16
Mallard
* Homework 11- Digital Numbers
* Homework 12- Comparators
* Homework 13- Flip-flops
* Homework 14- Counters
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Pulse width Modulation - Introduction to Electronics | ECE 110 and more Lab Reports Electrical and Electronics Engineering in PDF only on Docsity!

Laboratory #9 – pulse width modulation (revisited) Grade Pre-lab: / Lab: / Total: / Objectives

  • Learn how PWM module works
  • Understand how to use PWM in car design
  • Learn how to use logic analyzer
  • Learn about sequential circuits
  • Learn how to program Car Board
  • Learn how to use Car Board Lecture References Orange Book
  • 9.19-9.21- Binary Number System
  • 9.21-9.22- Synchronous Counter
  • 11.1-11.2- Storing Information
  • 1.2-11.11- Flip-flop’s (FF’s)
  • 11.14-11.16- Counters Transparencies
  • Burnet Handouts 15,16,17- Sequential Circuits (Flip-flop’s and Counters)
  • Haken Set 3- pg. 2- Mallard
  • Homework 11- Digital Numbers
  • Homework 12- Comparators
  • Homework 13- Flip-flops
  • Homework 14- Counters

EXPERIMENT #9 – PWM pulse width modulation

At this point you should have a basic, workable design – a circuit that will navigate the track through most turns, will detect the presence of a split, and will stop on a white piece of paper. From now until the design challenge you should focus on improvements to your circuit so that it navigates every turn, and every split. Your design must be robust enough that it performs well even though the vehicles are all different, even though the table used for the challenge track has a slightly different reflectivity, even though ... You get the idea. During this lab you will experiment with a sequential circuit that can be using to control the speed of the motors. In lab 3 you experimented a little with pulse width modulation (PWM) to drive the motors. Instead of relying variable resistor to vary the motor speed we will supply the motor maximum voltage/current for a limited period of time – a period set by the duty cycle of the signal. The longer the motor is provided with current during each period of the square wave, the faster the motor runs. A block diagram of the pulse width modulator is shown in the figure below. It consists of an oscillator (74LS624)

  • this provides the clock pulse that runs the counter, a counter (74LS169) – this circuit simply counts from 0 to 15 over and over, and the digital comparator (74LS85) - the heart of the device (you will figure out what it does during this lab). The counter supplies one set of inputs to the comparator and the user supplies the other set - it is these user supplied inputs (labeled the A inputs) that will be used to determine the duty cycle of the resulting square wave. The PWM accepts inputs from sensors directly OR from logic that uses the sensor data in a more sophisticated algorithm. The output of the PWM comes from the digital comparator on the PWM module – either pin 5 (A>B) or pin 7 (A<B). As you experiment with the circuits you will see the difference between the two signals. Whichever output you choose, it can be applied directly to the CA, or CAB (as in the figure below) module or it can combined with more logic.

EXPERIMENT

Pulse Width Modulation - more robust speed control So far the only way we can control the speed of the vehicle is to control the value of the variable resistor attached to the vehicle. As you found when you played with the different navigational circuits that some of the designs - the tape following design in particular - are very sensitive to the speed. In fact the tape following designs will not work without much additional circuitry, and lots of sensors OR the pulse width modulator (PWM). The most important contribution of the pulse width modulator is that of providing a larger range of control at the slower speeds. Because the pulse width modulator pulses the motor with maximum voltage the torque provided is much greater than the torque generated by applying a smaller voltage to the motors provided usng the variable resistor. Because the maximum torque is achieved even when the motor is running slowly, the car can run at VERY slow speeds with the PWM. a) investigate the workings of the Pulse Width Modulator - First we will look at how the PWM works using the digital designer's friend – the logic analyzer. You could monitor the output signals with the oscilloscope since they are time varying, periodic signals, but the oscilloscope only has two channels and is not optimized to interface with TTL logic. A logic analyzer on the other hand has 16 channels and can be programmed to interface with several types of logic (TTL, CMOS ...). ------------------ SETTING UP THE PWM With the vehicle on its stand and the power off, place the PWM module on the protoboard below the CA, and connect pin 8 to ground and pin 16 to Vcc both supplied by the battery through the logic voltage. ------------------ SETTING UP THE LOGIC ANALYZER The logic analyzer (see photo) allows you to monitor 15 time-varying digital signals that are not necessarily periodic. The probe is a ribbon cable with a connector on one end that plugs into the logic analyzer (lower right) and 16 probes on the other end that attach to points in the circuit under test. To connect to points in the circuit we will be using either a 14- or 16-pin test clip to make the signals more accessible. These test clips attach to individual chips - every pin on the test clip should touch only one pin on the IC. Make sure that the clip is firmly seated - ask the TA to check it the first time. You should be able to see why we need these test clips - it is much easier to attach the logic probes to the leads on the test chip than to the chip itself. Once the test clip is in place the individual probes can be attached to the leads and the signals monitored. Attach the logic analyzer to the oscillator (74LS624) - Since the pulse width modulator (PWM) is a sequential circuit it needs a clock pulse to transition from one state to the next. In this circuit the rising edge of a clock

pulse (square wave with 50% duty cycle) is used to change the state of the counter so that it continuously cycles through 0-15. Carefully squeeze the 14-pin test clip and clip it to the oscillator (74LS624) - the chip on the right as viewed from above. The pins on the logic probe are numbered just like the chip. Find the ground pin on the oscillator chip and connect the logic probe with the black label to it - this provides a ground reference for the other signals. Connect the probe with the brown label to pin 6.

  1. Turn on the logic analyzer and the vehicle and you should see the clock on the screen of the logic analyzer. Draw the clock and estimate its period. Is this period short/long enough to drive the motors and respond quickly enough to changes in sensor output? What would determine the period for this application? Attach the logic analyzer to the counter – The counter, as the name suggests is to simple count from 0 to 15 over and over and over ... With the power off on the vehicle, connect the 16-pin test clip to the counter (74LS169A) and connect the black wire to ground (pin 8). Connect the logic probes as specified in the table below.
  2. Once the probes are connected you should see the clock as supplied by the oscillator and the four outputs from the counter. Sketch these timing diagrams in your notebook. Do they look like the ones you drew for prelab?
  3. Each of the 4 signals coming from the counter is a periodic square wave. How do the periods of each of these signals compare with the period of the clock pulse? To specify the duty cycle of the square wave output to the PWM, 4 signals need to be supplied. They represent
  1. Put the switch into different positions and describe how the signal from pin 5 of the PWM is related to the switch settings.
  2. To use the PWM in your design you need to choose which output you will use – either the A>B output from pin 5, or the A<B output from pin 7.

-- Controlling the speed of the vehicle Make certain that both PWMs and MUXs are connected to both motors so that you can control with the switch on the MUX module the speed of both motors. To do this you need only use the output of pin 5 from the PWM to drive the CA modules. The CA is then hooked up to the motors in the standard way. Initially set all of the switches on a lowest setting - lets say 0010 (only switch 2 is UP), turn the variable resistor on the car all the way down so that it is at its lowest value - you want the PWM to provide all the speed control.

  1. Are the motors running? If not increase the setting of the switches one step up (or down) at a time until the motors running. Place the vehicle on a table. Does it run? Again if not slowly increase the setting until it does. For most vehicles the car should run, though painfully slowly, at a setting of about 0010.
  2. Experiment with different settings of the switches to change the speed of the motor. What might be a good range for navigating the track?
  3. Now set the switch to the highest value 1111 - all switches UP. Put the car on the stand and try to - by adjusting the variable resistor knob on the back of the try to set the wheels turning at the same speed as they were when you set the switches to the lowest position where the car would move when set on the table. This needs only be approximate. The point that I would like you to get is that even though the wheels are moving at the same slow speed when the speed is controlled by the variable resistor the motor does not have enough torque to move the vehicle when it is on the table.