{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

7encoder-atmel

# 7encoder-atmel - Encoder Laboratory Encode-1 DC Motor with...

This preview shows pages 1–3. Sign up to view the full content.

Encoder Laboratory Encode-1 © San José State University Department of Mechanical and Aerospace Engineering rev. 2.1 06OCT2007 DC Motor with Shaft Encoder Learning Objectives By the end of this laboratory experiment, the experimenter should be able to: Explain how an encoder operates and how it can be use determine rotational speed and angle of a motor shaft Use the IRL520 power MOSFET to control power devices Explain the concept of Pulse-Width Modulation to control the speed of a DC motor Interface the Atmel Atmega 128 microcontroller to an encoder Components Qty. Item 1 Atmel Atmega 128 microcontroller, STK500 and STK501 interface boards, and serial port cable. 1 1M Ω resistors 1 Solderless breadboard 1 1N4148 diode 1 IRL520 power MOSFET 1 DC motor with encoder Introduction In this lab you will investigate how rotational speed and rotational angle can be determined using a rotary encoder. A rotary encoder consists of a disk with alternating opaque and clear radial regions. In operation, a light source is positioned on one side of the disk, and a photosensitive device, such as a phototransistor is positioned on the other side of the disk. As the disk rotates, the passage of the opaque and clear regions of the encoder disk alternately block and allow light to impinge on the receiver, which produces corresponding voltage pulses. The rotational speed of the encoder disk can be determined by counting pulses during a known time period. The angle of rotation corresponds directly to the number of pulses, since the number of pulses per revolution is constant. We will also look at controlling the speed of a DC motor using the concept of Pulse-Width Modulation (PWM). Procedure Function Generator Output to Control Duty Cycle 1. Set up the function generator (FG) to output a 1 kHz square wave (remember to set the output termination to HIGH Z). Look at the signal on the ‘scope. 2. Set the amplitude to 8 V p-p 3. Offset the waveform by 4 V, so that you have a 0 to 8 V square wave. 4. Select the ‘% Duty’ function on the FG by pressing the Shift key, then the Offset key.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document