DOC PREVIEW
SJSU ME 106 - ServoEncoderLab

This preview shows page 1-2-3 out of 10 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Encoder LaboratoryBuild your own Continuous Rotation ServoLearning ObjectivesBy the end of this laboratory experiment, the experimenter should be able to:- Explain how an encoder operates and how it can be used determine rotational speed and angle of a motor shaft- Explain the concept of Pulse-Width Modulation (PWM) to control the speed of a DC motor- Interface the Arduino microcontroller to an encoder- Explain how to use an encoder with quadrature to obtain the direction of rotation- Explain the difference between free-spin stopping of a motor and dynamic braking- Design a simple continuous rotation servo. ComponentsQty. Item1 Arduino with USB cable1 DC motor mounted in laser-cut acrylic stand with encoder wheel and optical encoder pickupon the front and magnetic encoder with quadrature on the rear1 Motor driver board (L298-based, such as item 251080674810 from http://stores.ebay.com/Chip-Partner-Store) 1 Servo motor adapter boardIntroductionIn this lab you will learn 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. It operates by placing a light source on one side of the disk, and a photosensitive device such as a phototransistor on the other side. 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, producing an alternating stream of voltage pulses. The rotational speed of the encoder disk can be determined by counting pulses over a known period of time. The angle of rotation corresponds directly to the number of pulses, since the number of pulses per revolution is constant.You will also be using a magnetic encoder built into the rear of the motor to construct a continuous rotation servo (CRS). A CRS might be useful for such things as CNC (computer numerically controlled) machinery, incremental movement of a conveyor belt, and countless of other applications where rotatingover a limited range of fixed angles is not an option. You will investigate some of the challenges and advantages of a closed loop system for precise motion control. Hardware and SetupMotor with EncoderThe mechanical hardware of this lab is shown in Figure 1, and consists of a DC motor with a gearhead to reduce the speed and increase the available torque. Roughly a third of the motor assembly length is in the gearhead. There is a magnetic encoder built into the tail end of the motor that uses a Hall effect sensor to determine the rotation angle of the motor shaft. When a current flows through a conductor, the presence ofa transverse magnetic field causes a transverse voltage to appear. This effect was discovered by physicist Edwin Hall in 1859 and bears his name. The encoder on the tail end of the motor has a permanent magnet -San José State University Department of Mechanical and Aerospace Engineering rev. 1.2.2 11MAR2013Page 1 of 10Encoder Laboratoryattached to the motor shaft, which rotates relative to the Hall sensors, which produce voltage signals corresponding to the angle of rotation. The encoder signal uses what is called ‘quadrature’ encoding, which allows not only the speed of rotation to be measured, but also the direction of rotation. Figure 2 demonstrates an example of quadrature output.Figure 1: Motor with Encoder. The hardware setup consists of a permanent magnet DC motor (PMDC), gearhead, magnetic encoder (integral to the motor), external encoder disk, and slotted opto-interrupterFigure 2 Encoder Quadrature Signal. Encoders typically output two digital signals that are 90 degrees out of phase. The quadrature signal allows the direction of rotation to be determined.A quadrature signal allows the direction of rotation to be determined if the signal level on one channel is checked when a rising edge occurs on the other channel. Using the example in Figure 2, if the motor is spinning clockwise, the voltage level of channel A will be low when a rising edge occurs on channel B. When the motor spins counterclockwise, the voltage level of channel A will be high when a rising edge occurs on channel B. The way this phase offset is produced is by having two sensors, which are offset in such a way so that the opaque and clear regions of the encoder disk pass by the sensors slightly offset from each other and produce a 90 degree phase shift. This 90 degree offset gives four distinct regions when the encoder is rotated as shown in Figure 2. This particular encoder produces 16 pulses per rotation.The encoder that is located on the front of the motor consists of a laser-cut opaque acrylic disk that contains 120 windows. As the encoder rotates, pulses are produced using an opto-interrupter rather than magnetically as with the encoder on the end of the motor. What advantage might there be to having theencoder located on the motor side of the gearhead instead of at the output shaft of the gearhead (in other words so that it would rotate at the speed of the armature rather than at the speed of the output shaft of the gearhead)?-San José State University Department of Mechanical and Aerospace Engineering rev. 1.2.2 11MAR2013Page 2 of 10Encoder LaboratoryMotor driver boardFigure 3: Motor Driver Board. The board uses an L298 Dual-H bridge chip that is capable of driving 2 A continuous current up to a maximum power of 25 W.The method that we will be using for driving the motor as well as interfacing with the Arduino is a motor board containing an H-bridge (L298). As you learned in the previous lab, an H-bridge is useful for bi-directionally driving high-current devices such as motors with a control signal from the Arduino pins. To drive the H-bridge, a high signal (or a PWMed signal) on the enable pin is required as well as supplying signals of opposing polarity on the two input drive pins.The Maxon motors used in this lab have a 2x5 female header for accessing the motor power, encoder logicpower, and the two channels of the encoder. The pinout is detailed in Figure 4.Figure 4: Motor Pinout-San José State University Department of Mechanical and Aerospace Engineering rev. 1.2.2 11MAR2013Page 3 of 10Encoder LaboratoryNotice that in Figure 4 the power for the motor (12V) is in very close proximity to the logic power of the encoder (5V). It is critical that you do not have the 12V wires touch the 5V wires; this could result in permanent damage to the motor encoder or motor driver board! A wiring


View Full Document

SJSU ME 106 - ServoEncoderLab

Download ServoEncoderLab
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view ServoEncoderLab and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view ServoEncoderLab 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?