Lab 3 Final report: Embedded Systems Digital Potentiometer Subsystem TEAM: RAR

Similar documents
Lab 3: Embedded Systems

Digital-to-Analog Converter. Lab 3 Final Report

Embedded Test System. Design and Implementation of Digital to Analog Converter. TEAM BIG HERO 3 John Sopczynski Karim Shik-Khahil Yanzhe Zhao

EE 210 Lab Exercise #5: OP-AMPS I

BME 3512 Bioelectronics Laboratory Five - Operational Amplifiers

UNIVERSITI MALAYSIA PERLIS

BME/ISE 3512 Bioelectronics. Laboratory Five - Operational Amplifiers

EE 368 Electronics Lab. Experiment 10 Operational Amplifier Applications (2)

Data Conversion and Lab Lab 4 Fall Digital to Analog Conversions

Intro To Engineering II for ECE: Lab 7 The Op Amp Erin Webster and Dr. Jay Weitzen, c 2014 All rights reserved.

EE 300W Lab 2: Optical Theremin Critical Design Review

The Operational Amplifier This lab is adapted from the Kwantlen Lab Manual

When you have completed this exercise, you will be able to relate the gain and bandwidth of an op amp

DEPARTMENT OF ELECTRICAL ENGINEERING LAB WORK EE301 ELECTRONIC CIRCUITS

ECE ECE285. Electric Circuit Analysis I. Spring Nathalia Peixoto. Rev.2.0: Rev Electric Circuits I

CHAPTER ELEVEN - Interfacing With the Analog World

DEPARTMENT OF ELECTRICAL ENGINEERING LAB WORK EE301 ELECTRONIC CIRCUITS

ECE3204 D2015 Lab 1. See suggested breadboard configuration on following page!

LAB #10: Analog Interfacing

Michael Tang TA: Ketobi 7/18/13

THE PENNSYLVANIA STATE UNIVERSITY. Lab 2: Designing Optical Theremin Instrument. EE 300W Section 001. Nathaniel Houtz, Ji Eun Shin, Peter Wu 2/22/2013

ECE 363 FINAL (F16) 6 problems for 100 pts Problem #1: Fuel Pump Controller (18 pts)

ENSC 220 Lab #2: Op Amps Vers 1.2 Oct. 20, 2005: Due Oct. 24, 2004

Laboratory 4 Operational Amplifier Department of Mechanical and Aerospace Engineering University of California, San Diego MAE170

UNIVERSITI MALAYSIA PERLIS

ENGN Analogue Electronics Digital PC Oscilloscope

Practical 2P12 Semiconductor Devices

EE 210: CIRCUITS AND DEVICES

EE 230 Lab Lab 9. Prior to Lab

ECE4902 C Lab 7

EE 3305 Lab I Revised July 18, 2003

When input, output and feedback voltages are all symmetric bipolar signals with respect to ground, no biasing is required.

Lab: Operational Amplifiers

STATION NUMBER: LAB SECTION: RC Oscillators. LAB 5: RC Oscillators ELECTRICAL ENGINEERING 43/100. University Of California, Berkeley

Basic operational amplifier circuits In this lab exercise, we look at a variety of op-amp circuits. Note that this is a two-period lab.

INDIANA UNIVERSITY, DEPT. OF PHYSICS, P400/540 LABORATORY FALL Laboratory #6: Operational Amplifiers

UNIVERSITI MALAYSIA PERLIS

Each individual is to report on the design, simulations, construction, and testing according to the reporting guidelines attached.

LABORATORY EXPERIMENT. Infrared Transmitter/Receiver

Operational Amplifiers

Laboratory 8 Operational Amplifiers and Analog Computers

Rowan University Freshman Clinic I Lab Project 2 The Operational Amplifier (Op Amp)

DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE MASSACHUSETTS INSTITUTE OF TECHNOLOGY CAMBRIDGE, MASSACHUSETTS 02139

Data Conversion and Lab Lab 1 Fall Operational Amplifiers

EE320L Electronics I. Laboratory. Laboratory Exercise #3. Operational Amplifier Application Circuits. Angsuman Roy

University of California at Berkeley Donald A. Glaser Physics 111A Instrumentation Laboratory

Physics 303 Fall Module 4: The Operational Amplifier

Lab 4: Analysis of the Stereo Amplifier

ESE 150 Lab 04: The Discrete Fourier Transform (DFT)

UC Berkeley, EECS Department EECS 40/42/100 Lab LAB3: Operational Amplifier UID:

E84 Lab 3: Transistor

LABORATORY 4. Palomar College ENGR210 Spring 2017 ASSIGNED: 3/21/17

Optical Theremin Critical Design Review Yanzhe Zhao, Mason Story, Nicholas Czesak March

High Voltage Waveform Sensor

C H A P T E R 02. Operational Amplifiers

EE4902 C Lab 7

Lab 1: Non-Ideal Operational Amplifier and Op-Amp Circuits

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Circuits & Electronics Spring 2005

LAB 4: OPERATIONAL AMPLIFIER CIRCUITS

Experiment No. 4 The LM 741 Operational Amplifier

CHARACTERISTICS OF OPERATIONAL AMPLIFIERS - II

Analog I/O. ECE 153B Sensor & Peripheral Interface Design Winter 2016

Lab 6: Instrumentation Amplifier

EK307 Active Filters and Steady State Frequency Response

University of Pittsburgh

ECEN Network Analysis Section 3. Laboratory Manual

LINEAR APPLICATIONS OF OPERATIONAL AMPLIFIERS

Lab 2 Operational Amplifier

EE320L Electronics I. Laboratory. Laboratory Exercise #2. Basic Op-Amp Circuits. Angsuman Roy. Department of Electrical and Computer Engineering

ECE Lab #4 OpAmp Circuits with Negative Feedback and Positive Feedback

CHARACTERIZATION OF OP-AMP

Dedan Kimathi University of technology. Department of Electrical and Electronic Engineering. EEE2406: Instrumentation. Lab 2

DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE MASSACHUSETTS INSTITUTE OF TECHNOLOGY CAMBRIDGE, MASSACHUSETTS 02139

PROGRAMMABLE INTRACRANIAL SELF- STIMULATION (ICSS) CURRENT STIMULATOR

EXPERIMENT NUMBER 8 Introduction to Active Filters

LABORATORY 3 v1 CIRCUIT ELEMENTS

EE 3111 Lab 7.1. BJT Amplifiers

Circuit Layout Techniques And Tips (Part III of VI) by Bonnie C. Baker and Ezana Haile, Microchip Technology Inc.

t w = Continue to the next page, where you will draw a diagram of your design.

Single-phase Variable Frequency Switch Gear

University of Portland EE 271 Electrical Circuits Laboratory. Experiment: Op Amps

Laboratory 9. Required Components: Objectives. Optional Components: Operational Amplifier Circuits (modified from lab text by Alciatore)

WAVE SHAPING CIRCUITS USING OPERATIONAL AMPLIFIERS

Feed Forward Linearization of Power Amplifiers

The measurement of loop gain in feedback seismometers Brett M. Nordgren April 9, 1999 Rev.

Operational Amplifiers

BME 3512 Bioelectronics Laboratory Six - Active Filters

How to Wire an Inverting Amplifier Circuit

Lab Exercise 6: Digital/Analog conversion

LT Spice Getting Started Very Quickly. First Get the Latest Software!

Purpose: 1) to investigate the electrical properties of a diode; and 2) to use a diode to construct an AC to DC converter.

10: AMPLIFIERS. Circuit Connections in the Laboratory. Op-Amp. I. Introduction

Lab 9: Operational amplifiers II (version 1.5)

USER MANUAL FOR THE LM2901 QUAD VOLTAGE COMPARATOR FUNCTIONAL MODULE

Week 8 AM Modulation and the AM Receiver

PURPOSE: NOTE: Be sure to record ALL results in your laboratory notebook.

RF System: Baseband Application Note

ENGR 210 Lab 12: Analog to Digital Conversion

Common-Source Amplifiers

Assignment 11. 1) Using the LM741 op-amp IC a circuit is designed as shown, then find the output waveform for an input of 5kHz

Transcription:

Lab 3 Final report: Embedded Systems Digital Potentiometer Subsystem TEAM: RAR EE 300W, Section 6 Professor Tim Wheeler Rui Xia, Yuanpeng Liao and Ashwin Ramnarayanan

Table of Contents Introduction...2 Rationale......2 Implementation...3 Explanation of Code and Circuitry...4 Verification Testing...11 Validation Testing...19 Results from Integrated System...19 Discussion...2 0 Conclusion...24 Appendices...24 1

Introduction As the complexity of today s computer system grows, we can no long use a single system to meet the requirement. At this time, we need to utilize embedded system to break the main function into several subsystems. The purpose of this lab is to integrate the four subsystems together and analyze the function of a black box. The four subsystems contain digital-to-analog converter subsystem (D2A), digital potentiometer subsystem (Digipot), analog to digital converter subsystem (A2D) and keypad subsystem. D2A subsystem and Digipot subsystem will generate and input a waveform into the black box. The output of the black box will be analyzed and sampled by the A2D subsystem. Users can control the entire embedded system using the keypad subsystem. By comparing the input and output of the black box, we can analyze the behavior of the black box. Our team is assigned to build the digital potentiometer subsystem. Digitpot subsystem is used to scale the output of D2A subsystem and input the scaled waveform into the black box. The output amplitude of the digital potentiometer subsystem is selected by the keypad subsystem. It is crucial to generate a desired and consistent input to the black box because we need to compare the input and output of the black box. Rationale Theory of Operation In digital potentiometer subsystem, we need to scale the DAC subsystem output (0-3.3V) to have a voltage range of 0 to +1, 2, 3, 4, or 5 V. Digital potentiometer is the most important part in our subsystem because we need it to change the gain of the amplifier and thus scale the input waveform. The digital potentiometer works as an analog potentiometer. The wiper position Dn of the DigiPot selects the two resistors values RA and RB. RA = RAB * (256 Dn) / 256 and RB = (RAB * Dn) / 256. RA + RB = RAB = 50kΩ for MCP41050 DigiPot. We choose to place RA between the input and inverting terminal, and RB on the feedback path. Once we change the wiper position 2

based on the C++ code, the gain of the inverting amplifier will also change to our desired value. In our C++ code, the subsystem outputs different scaled amplitudes using 5 case statements. Theory of Interfaces Mebed is connected to PC to load C++ code to our circuit. We use SPI to communicate the mbed to the DigiPot. The connections used were MOSI (Master-Out Slave-In) and SCLK (clock). PuTTY can send and receive messages from the mebed using USB port. CAN bus connects our subsystem and the keypad subsystem so that the commands received from keypad subsystem will send to our subsystem. Implementation Circuitry: Our subsystem should scale and map a 0 to 3.3V input from DAC to a 0 to 1V, 2V, 3V, 4V and 5V by selection. The selection of output range will be made via mbed according to the can message from the keypad subsystem. An inverting amplifier circuit model with a voltage divider is chosen. 3

Single-supply, programmable, inverting gain amplifier using a digital potentiometer Vin is the subsystem input and Vref is connected to ground. The gain equation is now Vout = - Vin(Rwb/Rwa) Variable gain Rwb / Rwa allows us to output a range no matter it is larger or smaller than the input voltage. A second inverting amplifier with gain of 1 is added at Vout to produce a positive output. In experiment, we found that the resistors used in the second amplifier should be much larger than the resistors in the first one to make an output waveform without any clipping. We chose 2M ohm which is much larger than 50 k ohm (Rab). Also, a 10k ohm resistor is added at Rb to stabilize the performance when Rwb is low. 4

Circuit design Our equation is now: Vout = Vin((Rwb+10k)/Rwa) Where Vin = 3.3V, Vout = 1V, 2V, 3V, 4V, 5V, Rwb + Rwa = 50k ohm. By solving the equation, we get the resistance values of Rwb for different outputs. Output (V) Rwb resistance (ohm) 1 3.95 k 2 12.64 k 3 18.57 k 4 22.87 k 5 29.73k The hex wiper position is calculated by the equation 5

Dn = 256 * Rwb / Rab where Rab = 50 k. Adjustments are made to the calculated values based on experiments. The final wiper positions are: Output (V) Hex wiper position 1 0x14 2 0x21 3 0x31 4 0x33 5 0x46 Code: An LPC 1768 mbed microcontroller will be coded with C language to realize the following functions: 1. It gets the CAN-bus message from keypad subsystem via MCP 2551 CAN transceiver to determine desired digital potentiometer output 2. It writes corresponding hex wiper position values to MCP 41050 digital potentiometer. In the code, the can message will be read and stored by this line CANMessage msg; We used an if statement to test if there is any message received by the mbed and show in LEDs: if(can2.read(msg)) { 6

printf("message received: %d\n", msg.data[0]); led2 =!led2; } Then, a case statement is used to determine the desired wiper position to the digipot. For each case, a wiper position is selected and a message is printed to show the case And the following lines will write the selected wiper position: cs = 0; spi.write(0x13); z = setvoltage(msg); spi.write(z); cs = 1; 7

cs=0 will select the chip first. The position 0x13 is the selected command bit. The selected wiper position is written next. Finally, cs = 1 would deselect the chip. Verification Test: Our subsystem, digipot, is responsible to map the output of Digital-to-Analog Converter system (0 3.3V, 1Hz or 10 Hz solenoid or square wave) to a waveform of different amplitude (0 0-1V, 2V, 3V,4V or 5V). And the output amplitude is selected by keypad via a local CAN bus. And the output of our system will be directly sent to the black box. Our module and interface connection: 8

Testing Method: 9

We used a function generator outputting a sinusoidal wave spanning 0 to +3.3 V to mimic the function of DAC subsystem. The Can bus message is set in code for output range selection. The output waveform is observed with an oscilloscope. The plots of the oscilloscope are recorded for different cases: 10

1V: 2V: 11

3V: 4V: 12

5V: Validation test: 13

Most of our result waveform almost exactly matched the desired amplitude. And all the percentage errors are no more than 10% Desired voltage(v) Actual voltage(v) Percentage Error (%) 1 1.056 5.6 2 2.14 7 3 3.08 2.67 4 4.03 0.75 5 5.16 3.2 Our subsystem successfully fulfills the requirements. Our subsystem receives command from keypad, converts the output of DAC and output a waveform to the black box. The accuracy of subsystem s output can directly affect the observation of the black box behavior. Digipot is an indispensable part in the whole system. Result from integration: We didn t finish integration, But we tried to use our part and oscilloscope to identify the black box. We tried various kind of input to the black box. By observe the reading from oscilloscope (ADC subsystem), we determined the behavior of the black box. Firstly, the output of black box does not depend on the input frequency. The output is the same for both 1Hz and 10Hz. We also observe that the output amplitude is no more than 1V in any case. Trying different input value, we observed that the gain is about 0.1. The black box behavior can be express as: 14

Vout = 1V- 0.1 Vin Our group thinks that the black box is an inverting amplifier with a 1 volt offset. Vout = - Vin (1k/10k) + 0.91*(1 + 1k/10k) Discussion The design that we chose met the requirements by using one MBED microcontroller, one digital potentiometer, two op amps and one CAN transceiver. The utility of this design is in the usage of the digital potentiometer as a resistor on the op amp design whose resistance can be changed as needed. This is better than the alternatives of using a lot more components and breadboard space. The team used the provided Agilent function generator to generate our input signal. We also used the two power supplies provided to us to get our +15V,-15V and +5V supply. The team initially faced a non working circuit simply because the ground was not shared. Eventually, after following the proper wiring, the circuit began functioning to a certain degree. In the beginning, the circuit produced nothing but noise. This was corrected when we debugged our circuit to find that the voltage input was not getting through to the 15

MBED. After rewiring, we obtained a periodic function and resembled a wave. This was due to incorrect resistor values as we found out later on. After, the values were changed, the code had to be changed in the case structures for the HEX values. Finally, after the final debugging we were able to obtain our sine wave. This entire process took up the entirety of our time. Thus, the team was unable to work with the other teams for a significant amount of time. The teams were unable to link the CAN buses together to get a common voltage signal through them and control the black box using the keypad. This is the result of time management and communication issues both within and outside the team. This would be the main area of improvement for the group moving forward. Finally, the teams tried identifying what was in the black box. We were successfully able to get the 1 Volt offset answer correct but were unable to calculate the slope. The final waveform function was: Y = -0.1X + 1 V Future areas of improvement would involve proper communication amongst the team members in order to manage time efficiently. A lot of work was required to be done outside the given lab period of time which was not used properly. Value Statement: In this lab, we are required to communicate with other groups to accomplish an integrated project. This is the first time we encounter this setting. However, we can certainly imagine that this kind of scenario is far from rarely happen in an engineer s career. We were a little confused at the beginning. This resulted in the failure that we could not finish the integration. This experience greatly enhances our communication skill and prepares us for the inevitable. Technically, this is also the first time for most of us to use LCP 1768 mbed and an online compiler. Being able to work with various languages and compilers is a great contributor to a successful career. This lab shows us a continuously learning process example and gives us some experience about it. 16

Conclusion Team RAR successfully completed the DigiPot subsystem that received the input signal and could control the resistor values in 5 different cases. The teams were unsuccessful in integrating the subsystems together whose entire purpose was to divide the work instead of loading all of it on one program. The utility of this project goes into security and control systems. The CAN buses enables us to integrate multiple subsystems into one giant process. This allows for continuous improvement to a given process and simultaneously makes debugging much easier for the engineers. Appendixes Appendixes A: Gantt chart Appendixes B: Bill of materials 17

Appendixes C: mbed code 18

19

Appendixes D: Block diagram 20