Académique Documents
Professionnel Documents
Culture Documents
AKHILA.S
HARINI.M
KIMEERA.T
NEHA.P
SAI PRATYUSHA.A
(08241A0257)
(08241A0268)
(08241A0270)
(08241A0278)
(08241A0293)
CERTIFICATE
This is to certify that the major project report entitled 3 - PHASE
Mr. P. M. Sharma
Examiner
HOD,
GRIET
Hyderabad
Mr. M. Chakravarthy
EEE Associate Professor
Dept. of EEE
GRIET
2
External
ACKNOWLEDGEMENT
Finally, I express my sincere gratitude to all the members of faculty and friends
who contributed through their valuable advice and helped in completing the project
successfully.
AKHILA. S(08241A0257)
HARINI. M (08241A0268)
KIMEERA.T (08241A0270)
NEHA. P (08241A0278)
SAI PRATYUSHA. A (08241A0293)
ABSTRACT
With the increasing use of computers the usage of and need for digital signal
processing has increased. To use an analog signal on a computer, it must be digitized
with an analog-to-digital converter. Therefore, the first stage in many DSP systems is to
convert the real world smooth analog signals into digital form. This project deals with
sensing these analog signals (3-phase voltages and currents) and displaying them on the
virtual scope of the DSP.
The voltages and currents are sensed by using the voltage transformers and
current transformers. Since the Analog-to-Digital Converter of the DSP can only work on
DC voltage of magnitude 0-3 V, the analog signals thus given to the DSP must be in this
range. For this purpose, the secondary voltages of these transformers (i.e., sinusoidal
voltages of 3V RMS) are given to the op-amp through a potential divider circuit. A DC
offset is also given to the op-amp such that the output has the lowest peak of 0 V.
The voltages and currents sensed can be used for various applications like closed loop
DC buck-boost convertor, speed control of 3-phase induction motor, energy meter etc.
CONTENTS
LIST OF TABLES
LIST OF FIGURES
CHAPTER 1
10
INTRODUCTION
10
CHAPTER 2
11-17
11
11
11
12
13
2.6 Memory
14
16
17
CHAPTER 3
18-26
18
18
20
5
25
CHAPTER 4
27-31
CIRCUIT DESCRIPTION
4.1 Circuit
27
29
4.3 Simulation
29
CHAPTER 5
32-39
HARDWARE DESCRIPTION
5.1 Components used
32
5.1.1 Transformers
32
33
5.1.3 Diodes
33
33
34
5.1.6 Load
34
5.1.7 DSP
35
35
36
5.3 Output
38
CHAPTER 6
40-41
40
40
41
REFERENCES
42
APPENDIX A
43-46
APPENDIX B
47-54
APPENDIX C
55-56
APPENDIX D
57-60
APPENDIX E
61-62
LIST OF TABLES
Table 1: eZdsp F2812 connectors
17
61
62
62
62
LIST OF FIGURES
Fig.2.1: Architecture of eZdsp F2812
12
13
14
15
16
17
19
20
Fig.3.3: ADCTRL1
21
Fig.3.4: ADCTRL2
22
8
Fig.3.5: ADCTRL3
23
Fig.3.6: ADCMAXCONV
24
Fig.3.7: ADCCHSELSEQ
24
25
26
28
28
29
30
31
32
33
34
Fig.5.4: eZdspF2812
35
36
37
Fig.5.7: Board
38
39
39
9
Chapter 1
INTRODUCTION
10
Memory
Peripherals
12
The C28x design supports an efficient C engine with hardware that allows the C compiler to
generate compact code. Multiple busses and an internal register bus allow an efficient and
flexible way to operate on the data. The architecture is also supported by powerful addressing
modes, which allow the compiler as well as the assembly programmer to generate compact code
that is almost one to one corresponded to the C code.
The C28x is as efficient in DSP math tasks as it is in system control tasks that
typically are handled by microcontroller devices. This efficiency removes the need for a second
processor in many systems.
13
A program read bus (22 bit address line and 32 bit data line)
A data read bus (32 bit address line and 32 bit data line)
A data write bus (32 bit address line and 32 bit data line)
2.6 MEMORY:
The memory space on the C28x is divided into program and data space. There are different types
of memory available that can be used as both program or data space. They include
Flash memory
Single access RAM (SARAM), expanded SARAM
Boot ROM which is factory programmed with boot software routines or standard tables
used in math related algorithm.
address reach of 4G words (1 word = 16 bits) in data space and 4M words in program space.
Memory blocks on all C28x designs are uniformly mapped to both program and data space.
This memory map shows the different blocks of memory available to the program and
data space.
15
16
17
3.1 INTRODUCTION
The eZdspF2812 consists of a 12-bit analog-to-digital converter with 16 analog
input channels. The analog input channels have a range from 0 to 3 volts. Two input
analog multiplexers are used, each supporting 8 analog input channels. Each multiplexer
has its own dedicated sample and hold circuit. Therefore, sequential, as well as
simultaneous sampling is supported. Also, the ADC system features programmable auto
sequence conversions with 16 results registers. Start of conversion (SOC) can be
performed by an external trigger, software, or an Event Manager event.
18
19
The block diagram of the ADC module in cascaded mode is shown in Fig.3.2.
20
Upper byte
Lower byte
Fig.3.3 ADCTRL1
The control register ADCTRL2 is explained in Fig.3.4.
21
Upper byte
Lower byte
Fig.3.4 ADCTRL2
22
Fig.3.5 ADCTRL3
23
Fig.3.6 ADCMAXCONV
Fig.3.7 ADCCHSELSEQ
24
25
26
CIRCUIT DESCRIPTION
27
The block diagram for sensing one voltage signal is shown in fig. 4.1
4.3 SIMULATION:
The circuit shown above gives a DC sinusoidal output which has a peak-to-peak
value of approximately 2.3V. The circuit can be simulated in Multisim software and the
output can be verified. The circuit, when connected in the Multisim software, looks as
shown in Fig.4.4.
29
The output of the simulation done in the Multisim software is shown in Fig.4.5.
30
31
HARDWARE DESCRIPTION
32
5.1.3 Diodes:
The diodes used in the circuit are 1N4007. These diodes are used to produce a DC
offset voltage. The cutoff voltage for a 1N4007 diode is 0.7V. Using two diodes in series,
an offset of 1.4V is generated. The diodes are connected to a DC voltage of 12V. In order
to limit the current to its maximum value, a resistance of 100 ohms is used in series with
the diodes.
33
The dual opamp LM1458N is chosen as both summation and inversion operations are
required. The two inputs, i.e., the sinusoidal input and the DC offset are given to pin 2,
the inverting input of opamp A. The output of this opamp obtained at pin 1 is an inverted
sum of the two inputs. This is then given as an input to the inverting input terminal (pin
6) of opamp B. The final output obtained at pin 7 is the required DC sinusoidal signal.
The dual opamp HA17458 can also be used in the place of LM1458N.
5.1.6 Load:
To sense the 3-phase supply currents, loads must be connected in each phase. The
loads used in this project are lamp loads. Four lamps of 200W each are placed in each
phase. The current sensed by this load is 2.4A.
34
5.1.7 DSP:
The Digital Signal Processor circuit used is F2812, which contains the processor
TMS320C28x. The DSP is shown in Fig.5.4.
Fig.5.4 eZdspF2812
35
36
are to be placed on the board in such a way that the routing is possible without any
overlap. Double-layer routing is used in this Project. The PCB is then manufactured on the
basis of this board layout. The board is shown in the figure below:
37
Fig.5.7 Board
5.3 OUTPUT
The outputs obtained from the PCB are given to the input pins of the ADC of the
DSP. The ADC is programmed using the Code Composer Studio software to accept the
inputs and convert them into digital values. The code is written to send the inputs into the
input channels of the ADC, subtract the offset given to the signals, place the converted
values in the output buffers and display the acquired signals in the virtual scope. It can be
seen in the virtual scope that the phase difference between two phase voltages or currents
is 1200.
The signals displayed in the virtual scope are shown in Fig.5.6 and 5.7.
38
As the CCS 3.1 is an alien software to us, the loading and executing the program
was also a challenging job. It was overcome with the help of our project guide.
Loads which gave an output of 2.4A in the secondary of the transformer were also
difficult to obtain. Initially, a 0.5HP 3-phase induction motor was used but due to
insufficient secondary current, it has been replaced by four lamp loads of 200W in
each phase with the help of the faculty.
41
REFERENCES
Websites:
[1].http://www.kanecomputing.co.uk/ezdsp_f2812.htm
[2].http://www.kanecomputing.co.uk/code_composer_studio_v3.3.htm
[3].http://cnx.org/content/m11686/latest/
[4].http://c2000.spectrumdigital.com/ezf2812/docs/ezf2812_techref.pdf
Textbooks :
[1] R. Lyons, "Understanding Digital Signal Processing ", 2nd, Prentice Hall PTR.,
2004.
[2] S. W. Smith, "The Scientist and Engineer's Guide to Digital Signal Processing",
2nd, California Technical Publishing, 1999.
42
APPENDIX A
Program:
Watch Variables:
Voltage1[256]
Voltage2[256]
voltage3[256]
current2[256]
current3[256]
Program:
#include "DSP281x_Device.h"
#include "DSP281x_Examples.h"
#include "IQmathLib.h"
43
int16 Vbs[256];
int16 power[256];
main()
{
InitSysCtrl();
SysCtrlRegs.HISPCP.all = 0x3;
EDIS;
DINT;
InitPieCtrl();
IER = 0x0000;
IFR = 0x0000;
InitPieVectTable();
EALLOW;
PieVectTable.ADCINT = &adc_isr;
EDIS;
InitAdc();
PieCtrlRegs.PIEIER1.bit.INTx6 = 1;
IER |= M_INT1;
EINT;
ERTM;
LoopCount = 0;
ConversionCount = 0;
AdcRegs.ADCMAXCONV.all = 0x0005;
AdcRegs.ADCCHSELSEQ1.bit.CONV00 = 0x0;
AdcRegs.ADCCHSELSEQ1.bit.CONV01 = 0x1;
AdcRegs.ADCCHSELSEQ1.bit.CONV02 = 0x2;
AdcRegs.ADCCHSELSEQ1.bit.CONV03 = 0x3;
AdcRegs.ADCCHSELSEQ2.bit.CONV04 = 0x4;
44
AdcRegs.ADCCHSELSEQ2.bit.CONV05 = 0x5;
AdcRegs.ADCTRL2.bit.EVA_SOC_SEQ1 = 1;
AdcRegs.ADCTRL2.bit.INT_ENA_SEQ1= 1;
EvaRegs.T1CMPR = 0x0080;
EvaRegs.T1PR = 0xFFFF;
EvaRegs.GPTCONA.bit.T1TOADC = 1;
EvaRegs.T1CON.all = 0x1042;
while(1)
{
LoopCount++;
}
}
interrupt void adc_isr(void)
{
Voltage1[ConversionCount] = (AdcRegs.ADCRESULT0 >>4) - offset;
Voltage3[ConversionCount] = (AdcRegs.ADCRESULT2 >>4) - offset;
Voltage2[ConversionCount] = - Voltage1[ConversionCount] - Voltage3[ConversionCount];
current1[ConversionCount] = (AdcRegs.ADCRESULT3 >>4) - offset;
current2[ConversionCount] = (AdcRegs.ADCRESULT4 >>4) - offset;
current3[ConversionCount] = - current1[ConversionCount] - current2[ConversionCount];
power[ConversionCount] =-( _IQmpy(Voltage1[ConversionCount],current1[ConversionCount]) +
_IQmpy(Voltage2[ConversionCount],current2[ConversionCount]) +
_IQmpy(Voltage3[ConversionCount],current3[ConversionCount]));
if(ConversionCount == 255)
{
ConversionCount = 0;
}
45
else ConversionCount++;
Vas[ConversionCount] = Voltage1[ConversionCount];
Vbs[ConversionCount] = _IQmpy((Voltage1[ConversionCount] +
_IQmpy(_IQ(2),Voltage3[ConversionCount])),_IQ(0.57735026918963));
AdcRegs.ADCTRL2.bit.RST_SEQ1 = 1;
AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1;
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
return;
}
46
APPENDIX B
CODE COMPOSER STUDIO
Code Composer Studio (CCStudio) Integrated Development Environment (IDE) is a
key element of the eXpressDSP Software and Development Tools strategy from Texas
Instruments. CCStudio delivers all of the host tools and runtime software support for
TMS320 DSP and OMAP based realtime embedded applications. CCStudios easy to
use IDE allows DSP designers of all experience levels to move quickly through each
phase of the application development process including design, code and build, debug,
analyze and tune. The familiar tools and interfaces allow users to get started faster and
become productive immediately. The IDE includes DSP/BIOS support, real-time analysis
capabilities, debugger and optimization tools, C/C++ Compiler, Assembler, Linker,
integrated CodeWright editor, visual project manager and a variety of simulators and
emulation drivers. The developer can take advantage of timesaving, stress relieving
productivity tools that get their applications to market quicker and take advantage of
sophisticated debug tooling allowing them to find and fix real time issues.
The tuning and optimization features enable developers to produce highly
efficient applications taking full advantage of the device capabilities. Expected extension
of a source file is .ASM for assembly and .C for C programs. The concept of COFF tools
is to allow modular development of software independent of hardware concerns. An
individual assembly language file is written to perform a single task and may be linked
with several other tasks to achieve a more complex total system. Writing code in modular
form permits code to be developed by several people working in parallel so the
development cycle is shortened. Debugging and upgrading code is faster, since
components of the system, rather than the entire system, is being operated upon. Also,
new systems may be developed more rapidly if previously developed modules can be
used in them.
Code developed independently of hardware concerns increases the benefits of
modularity by allowing the programmer to focus on the code and not waste time
47
managing memory and moving code as other code components grow or shrink. A linker
is invoked to allocate systems hardware to the modules desired to build a system.
Changes in any or all modules, when re-linked, create a new hardware allocation,
avoiding the possibility of memory resource conflicts.
Projects
Code Composer works with a project paradigm. Essentially, within CCS a project for
each executable program is created. Projects store all the information required to build
the executable. For example, it lists things like: the source files, the header files, the
target systems memory-map, and program build options
48
Project settings:
The project information is stored in a .PJT file, which is created and maintained by CCS.
To create a new project, select the Project:New menu item.
Along with the main Project menu, we can also manage open projects using the rightclick popup menu. Either of these menus allows to Add Files to a project. We can also
drag-n-drop files onto the project from Windows Explorer
Type Lab2 in the project name field and make sure the save in location is:
C:\C28x\LABS\LAB2. This will create a .pjtfile which will invoke all the necessary tools
(compiler, assembler, linker) to build the project. It will also create a debug folder that
will hold immediate output files.
3. Project Add Files to Project in the same lab exercise. Change the files of type to
view C source files (*.c) and select Lab2.c and click OPEN. This will add the file Lab2.c
to the newly created project.
4. Add Lab2a.cmd to the project using the same procedure. This file will be edited during
the lab exercise.
5. Next, add the compiler run-time support library. To the
project(C:\ti\c2000\cgtools\lib\rts2800_ml.lib).
6. In the project window on the left click the plus sign (+) to the left of Project. Now,click
on the plus sign next to Lab2.pjt. The Lab2a.cmd file is listed.Click on Source to see the
current source file list (i.e. Lab2.c).
Project Build Options
7. There are numerous build options in the project. The default option settings are
sufficient for getting started.
Click: Project Build
Options
8. Select the Linker tab. The .out and .map files are created. The .out file is the
executable code that will be loaded into the DSP. The .map file will contain a linker
report showing memory usage and section addresses in memory.
9. Set the Stack Size to 0x200. Select OK and then close the Build Options window.
putting the TYPE = DSECT modifier after its allocation, the linker will ignore
this section and not allocate it.
13.Place the sections defined on the slide into the appropriate memories via the
Sections{}area.
15. Code Composer Studio can automatically load the output file after a successful build.
On the menu bar click: Option Customize and select the Program Load Options
tab, check Load Program After Build, then click OK.
16. Click the Build button and watch the tools run in the build window. Check for
errors. When an error occurs, scroll the build window at the bottom of the Code
Composer Studio screen until the error message (in red) is seen, and double-click the
error message. The editor will automatically open the source file containing the error, and
position the mouse cursor at the correct code line.
17. Fix the error by adding a semicolon at the end of the "z = x + y" statement. For future
knowledge, realize that a single code error can sometimes generate multiple error messages at
build time.
18. Rebuild the project (there should be no errors this time). The output file should automatically
load. The Program Counter should be pointing to _c_int00 in the Disassembly Window.
19. Under Debug on the menu bar click Go Main. This will run through the C-environment
initialization routine in the rts2800_ml.lib and stop at main() in Lab2.c.
Set the properties format to Hex TI style. This will give more viewable data in the
window. Click OK to close the window property selection screen. The memory window
will now open. You can change the contents of any address in the memory window by
double-clicking on its value. This is useful during debug.
21. Open the watch window to view the local variables x and y.
Click: View Watch Window on the menu bar.
Click the Watch Locals tab and the local variables x and y are already present. The
watch window will always contain the local variables for the code function currently
being executed.
(Note that local variables actually live on the stack. You can also view local variables in a
memory window by setting the address to SP after the code function has been entered).
22. We can also add global variables to the watch window if desired. To add the global
variable z, click the Watch 1" tab at the bottom of the watch window. In the empty
box in the "Name" column, type z. No ampersand is used here. Check that the watch
window and memory window both report the same value for z. Changing the value in
one window also changes the value in the other window.
52
53
54
APPENDIX C
SOFTWARE USED EAGLE
EAGLE is an EDA program by CadSoft for creating printed circuit boards. The name is
an acronym formed from Easy Applicable Graphical Layout Editor. CadSoft Eagle and
the company in September 2009, Premier Farnellsells, a supplier of electronic
components. The software consists of several components: Layout Editor, Schematic
Editor, Auto router and an extensible component database. It is available for the
platforms Microsoft Windows, Linux and MacOSX.
55
It exists for non-commercial use; a free version on a schematic sheet, half Euro card
mm 80 mm and two signal layers is limited to 100.
The schematic editor can be used by a special component library for programming a
MicroSPS.
56
APPENDIX D
SOFTWARE USED - MULTISIM
NI Multisim is an easy-to-use schematic capture and simulation environment that
engineers, students, and professors can use to define and simulate circuits. This article
shows you how to capture and simulate a simple circuit in Multisim.
This tutorial takes less than 30 minutes to complete and consists of 50 short steps.
The example circuit in the article is an amplifier circuit. This noninverting operational
amplifier configuration consists of one active component (the operational amplifier) and
two passive resistor components that will be used to complete the feedback network to
provide gain in this circuit.
step 1: Open Multisim
57
58
5.Run a simulation :
59
60
APPENDIX E
DATA SHEETS:
DATA SHEET OF LM1458N:
61
Table 3
Table 4
Table 5
62