This report has been submitted for assessment towards a Bachelor of Engineering Degree in Electrical and Electronic Engineering in the Department of Engineering and Design, London South Bank University. The report is written in the authors own words and all sources have been properly cited. Authors signature:
Abstract
The idea of the project is to develop a product which is capable of fluctuating the input voltage to a user defined output voltage. To achieve this, the hardware parts of the product was designed according to the concept of a synchronous buck converter, which converts a fixed input voltage into a regulated output voltage which is equal to or lower than the input voltage. The main problem encountered in designing the hardware was to operate it at a high frequency as mentioned in the specification. Since the components used cannot handle high frequency, the operating frequency of the whole product was brought down to a low value. The hardware part was then interfaced with the PC using an Arduino UNO development board which will allow the user to define the output voltage in a specified period in order to generate a sample of test waveforms. The product was tested by altering the duty cycle to observe the output voltage which was not exactly same as the expected value due to the mismatch of the operating frequency between parts of the hardware and this resulted in the failure to generate test waveforms. Also a research was conducted on similar products that exist in the market and a brief comparison was then made between products.
Introduction
The most common issue seen in cars is normally caused by disturbances in the car battery which is due to the faulty conditions arising when the car is in crank mode. This can result in damage to all the electronic components working in multiple buses such as FM/AM radio, speedometer, etc. To overcome this problem, automotive manufacturing industries have to ensure that their products are tested for tolerance to faulty conditions before they are fitted inside the car. Replicating similar faulty conditions on a test bench can be a problem due to the unavailability of proper instruments. The idea of this project is to come up with a product which is capable of replicating the faulty conditions on test bench by generating waveforms which can then be tested on the electronic components in the car to improve their tolerance. The waveforms need to be generated to test the faulty conditions are crank waveform, voltage drop out waveform, ramp up and ramp down waveform. The outcome product from this project would be able to create all these waveforms and also repeat them in sequence. [1] The Low Cost High Current Waveform Generator (LCHCWG) provides the user with four benefits mentioned below: The capability to generate waveforms with a high transient current of 0-50A which can then be tested across the device under test (DUT). The ability to generate waveforms with high voltage range, normally from 0 to 12V. This will allow the user to create a wide range of waveforms similar to the faulty conditions. The ability of the hardware part of the product to interface with PC via user-friendly software which makes it easier for the user to vary the output voltage. The capability to produce stable output.
The designed product LCHCWG is based on the concept of a synchronous buck converter which consists of two gate driven mosfets, an inductor and
Project Aim
The aim of this project is to identify a way of producing a cost-effective product which is capable of generating waveforms used to test the tolerance of car components.
Project Objectives
Generation of waveforms used for testing tolerance of electronic components in car. Research on similar products that already exists in the market. Production of a cost-effective hardware which is capable of fluctuating input voltage. Interfacing the hardware to the PC using user friendly software. Comparison between the market product and the outcome product from this project.
Deliverables
Progression, Interim and Final reports. The presentation talk. Simulating waveforms similar to faulty conditions such as crank waveform, voltage drop out waveform, ramp up and ramp down waveform with the help of a synchronous buck converter. Controlled variation of voltage over a time period with the help of an Arduino UNO development board. Generate very fast output transitions of high currents, thus exceeding the transient performance of power supplies.
Figure 2: Circuit when Q1 is on When Mosfet Q1 is switched off and Mosfet Q2 is turned on, the supply is removed from the circuit and all the energy in the inductor is then passed to the capacitor and the load. At this point, the voltage across the inductor equals
Figure 3: Circuit when Q1 is off and Q2 is on When the inductor is in steady state, the average current flowing through it is equal to the average output current as the average current in the capacitor is zero. In synchronous buck converter, there are two different types of operations: continuous and discontinuous conduction mode, where continuous conduction mode is the most preferred mode of operation. In discontinuous conduction mode, current in the inductor reaches zero due to all the energy stored in the inductor being transferred to the capacitor before mosfet Q1 is turned on again. In continuous conduction mode, the mosfet Q1 is turned on again before the current in the inductor reaches zero. [3]
The first step is to calculate the inductor ripple current ( ) which is often estimated to be 20% to 40% of the output current of the buck converter. .eq1. Where = Maximum output Current
The next step to then to determine the inductor value. A higher inductor value will allow larger maximum current output as the ripple current of the converter is reduced. Therefore, a smaller inductor will give a smaller solution size. It is often recommended to use an inductor with higher current rating than the
The last step is to calculate the value of the capacitor for the filter. It is required to use a capacitor with low Effective Series Resistance (ESR) value as it will reduce the output voltage ripple. In most cases, ceramic capacitors are preferred. For a converter with internal compensation, the output capacitor value has to be adjusted in the ratio of L and C whereas for a converter with external compensation, the equation shown below is used to adjust the value of the capacitor for a desired output voltage ripple: .eq3. Where = Ripple output voltage; ripple current. [4] = Switching frequency; = Inductor
Figure 4: Structure of a basic mosfet, nMOS and pMOS. A mosfet can be used as a digital switch where the gate terminal is similar to a switch on the wall. At a high gate voltage, the mosfet acts as a closed switch
Figure 6: Direction of the magnetic field. [6] One of the main properties of the inductor is dependent on the number of turns of conductor used. The more the number of turns coiled around the core, the more magnetic fields are produced. The magnetic field is also proportional to the cross-sectional area of the coil i.e. the larger the cross-sectional area the more the magnetic field produced. The equation used to calculate the inductance of an inductor is shown below:
= Relative permeability, 1 (Due to the presence of air core). A = Cross-sectional area of the coil. l = Length of the coil. N = Number of turns of the coil. [6] The behaviour of an inductor is very different when an AC current flows through it. The magnetic field produced when the AC current flows through it cuts the conductor winding and therefore producing an induced voltage which hinders any current change. When there is a rise in the current, an electromotive force is produced in the opposite direction which then hinders the current to rise. The behaviour of an inductor to current change is shown below in figure 7: [6]
Figure 7: The behaviour of an inductor to current change. [6] When a DC current is applied across an inductor, no magnetic field is produced and as a result, no induced voltage is generated. Therefore, an inductor only allows a DC current to flow through it. The behaviour of an inductor under DC current is shown below in figure 8:
Figure 9: A schematic diagram of the Schmitt trigger and the input and output waveforms. The main function of a Schmitt trigger is to produce a stable level-crossing switch. [7]
10
Figure 11: A schematic diagram of a NPN transistor. [9] There are two different types of junction transistor: NPN and PNP. In this report, the main focus is on the NPN transistor. In an NPN transistor, the middle layer is P-type whereas the outside layer is N-type. In order for the NPN transistor to operate, the base voltage has to be more positive than the emitter voltage and the collector voltage has to be more positive than the base voltage. This allows electrons to flow from the emitter to the base and therefore electricity will flow through the transistor.
11
Figure 12: A picture of dielectric used in between a two conducting plates in a capacitor. [10] When a capacitor is connected across a battery with voltage V, a capacitance of C and a current of I is produced. The electrons flow from the metal plate which is connected to the negative side of the battery to the metal plate which is connected to the positive part of the battery. The charging equation of a capacitor is shown below: dQ = C dV and I = C dV/dt. Where: dQ = Minute change in charge. dV = Minute change in voltage. The figure 13 below shows a circuit where a capacitor is connected across a battery. [10]
Figure 13: A capacitor connected across a battery. [10] When two capacitors C1 and C2 are connected across a battery of voltage V, the voltage is distributed between C1 and C2 depending on the capacitance. The current I remains the same throughout the series circuit. Total voltage, V = V1 + V2. Total capacitance, C total =
12
When two capacitors are connected in parallel across a battery of voltage V, the voltage across the capacitors remain same whereas, the charge flowing through the capacitor is distributed between C1 and C2. Total charge, Q = Q1 + Q2. Total capacitance, C total = C total = C1 + C2. The total capacitance for a circuit with n capacitors connected in parallel:
13
Technical approach
Scope of the project
The scope of the project is to design a waveform generating unit which is capable of producing power disturbances waveform such as random cranking waveform, fast transient burst, multi-step Square waves, ramp waveform, etc. One possible way of achieving the project is by using Buck Converters [4] where the input voltage from the battery supply is regulated to give output voltage which ranges from 0 to input voltage. Using Pulse Width Modulation technique, the user is capable of creating any desired waveforms by changing the level of the voltage over a period of time. Moreover, in order to make the product user friendly, microcontroller based control is introduced in to the product. The development board used to control the buck converters is Arduino Uno. The main feature of the board is the capability to have six PWM outputs which can be used to control the Buck Converters [5].
at a
14
Figure 14: Arduino SMD development board. [11] The step by step procedure to generate the high frequency PWM waveform is described below: The Arduino Uno software is installed on laptop from the official website of Arduino. The library for timer1 is downloaded from http://arduino.cc/playground/Code/Timer1. The maximum PWM frequency that can be achieved from Timer 1 is 1 MHz and the PWM waveform can be varied from a duty cycle range of 128 - 1024 bits.
Approach 1
The code used to generate high frequency PWM is compiled and uploaded into the Arduino board. The code used to generate high frequency PWM is shown below: # include TimeOne.h // select TimerOne in the Arduino Uno board. void setup () { pinMode (10, OUTPUT); // select digital pin 10 and use it as an output Timer1.initialize (1); // set the period of the PWM waveform in us. Timer1.pwm (10, 512); // set the duty cycle of the PWM waveform from pin 10. } void loop (){
15
Figure 15: Code in the Arduino software window. The PWM waveform obtained from the Arduino board was distorted at a higher frequency. As a result, the period of the PWM waveform was increased to 100 us. The waveform observed is shown below in figure 16:
16
Approach 2
Approach 2 involves generating two out of phase PWM signals from pin 9 and pin 10 of the Arduino board. The code shown below is capable of generating two PWM waveforms: one at 70% duty cycle and another at 30% duty cycle. int pinA = 9; // introducing a variable pin A. int pinB = 10; // introducing a variable pin B. void setup() { pinMode (pinA, OUTPUT); // set pin A to be output. pinMode (pinB, OUTPUT); // set pin B to be output. } void loop() { digitalWrite (pinA, LOW); // set pin A to low (0V). delayMicroseconds (70); // set a delay of 70 us. digitalWrite (pinA, HIGH); // set pin A to high (5V). delayMicroseconds (1); // set a delay of 1 us. digitalWrite (pinB, LOW); // set pin B to low (0V). delayMicroseconds (30); // set a delay of 30 us. digitalWrite (pinB, HIGH); // set pin B to high (5V).
17
18
Approach 1
In this circuit, a Schmitt trigger is used to generate two synchronous waveforms and it works in conjunction with approach. It is used to generate PWM waveform from the Arduino board. The schematic diagram of the Schmitt trigger used is shown below in figure 18:
19
Figure 18: A schematic diagram of CD40106B Hex Schmitt Trigger. [13] Pin 1 of the Schmitt trigger is connected to the output from the Arduino development board (pin 10). The input to the Schmitt trigger is a Pulse Width Modulated (PWM) waveform with a period of 100 us. Pin 14 of the Schmitt trigger is connected to the supply voltage of 5V from the Arduino board while pin 7 is connected to the ground. The output from pin2 is an inverted PWM waveform with a period of 100 us. Pin 2 and pin 3 are connected together in order to obtain a waveform from pin 4 which is the same as the input waveform. As a result, two waveforms are generated which are out of phase or opposite to each other. The measurements of the waveforms shown above are carried out using a TDS 2004B Four Channel Oscilloscope. Channel 1 is connected to pin 4 of the Schmitt trigger whereas channel 2 is connected to pin 2. Once connected, the Autoset button on the oscilloscope is pressed in order to observe the waveforms shown below in figure 19:
20
Approach 2
The circuit used to generate synchronous waveforms works in conjunction with approach 1 used to generate PWM waveform from Arduino board and it consists of two main components: transistor and optocoupler. A PWM (Pulse Width Modulated) waveform is applied to the input of the circuit. The waveform is fed into the base of a BC547 NPN transistor which output an in phase 5V peak to peak PWM waveform at the emitter side of the transistor. The 5V peak to peak waveform is then passed to two separate BC547 NPN transistors, both of which are connected to pins 2 and 3 of ISD74 High Density Phototransistor Optically Coupled Isolators which contains two separate optocoupler. A schematic diagram of High Density Phototransistor Optically Coupled Isolators is shown below in figure 20:
Figure 20: A schematic diagram of ISD 74. [8] Pins 1 and 4 of the LED part of the device are connected to a 12V supply. Pins 6 and 7 of the phototransistor part of the optocoupler are connected to the positive 12 V rail whereas pin 8 is connected to the source of a mosfet and pin 5 is connected to the ground rail. The output waveform from pin 7 is an inverted 12V peak to peak PWM waveform and the output waveform from pin 5 is a 12V peak to peak PWM waveform which is in phase with the input waveform. A schematic diagram of the circuit is shown below in figure 21:
21
1 K 1 K
330
470 12V
12V
Optocoupler
330 1 K
1 K
Figure 21: Circuit to generate two synchronous waveforms A picture of the original circuit described above is shown in figure 22:
22
Figure 22: Shows picture of the mosfet driver circuit with transistor and optocoupler.
Approach 3
The third approach involves a much simpler mosfet driver circuit which works with the code from approach 2 of the generation of PWM waveform. It consists of two transistors with their base voltage being supplied from pin 9 and pin 10 from the Arduino board. The gate signals to the Mosfets are provided from the collector side of the transistors which means the output waveforms are inverted compared to the input waveforms from the Arduino board. The two outputs from the mosfet driver circuit are 11V PWM waveform to drive the mosfet connected to the positive supply and 5V PWM waveform to drive the mosfet connected to the ground. A schematic diagram of the circuit is shown below in figure 23:
23
1K
2K2
1K
2K2 100uF 1K
Figure 23: A schematic diagram of the circuit for approach 3. Mosfets The mosfets used in the development of the buck converter are STP14NF10, N-channel. The maximum voltage that are allowed across drain and source is 100V, the on time resistance across drain and source is 0.13 and the maximum pulsed drain current is 60A.[14] The mosfets are being triggered by applying two 5V and12V peak to peak TTL signals which are complementary to each other on the gates of the mosfets. The maximum gate-source voltage for this type of mosfets is +/- 20V. The duty cycle and the period of the signals can be varied using the software that interface with the software development board (Arduino Uno Board). Heat sinks are attached to the mosfets in order to prevent the mosfets from getting too hot. The switching frequency of the mosfets is determined using the calculation shown below:
24
5V 6V
11V
5V
0V
25
The different values of inductance required for the nominal output voltage range is shown below in figure 25: Inductance calculation Vin 12 12 12 12 12 12 12 12 12 12 Vout 0 1 2 3 4 5 6 7 8 9 D 0 0.083333 0.166667 0.25 0.333333 0.416667 0.5 0.583333 0.666667 0.75 Fsw 240000 240000 240000 240000 240000 240000 240000 240000 240000 240000 I ripple 15 15 15 15 15 15 15 15 15 15 L 0 2.5463E-07 4.62963E07 0.00000062 5 7.40741E07 8.10185E07 8.33333E07 8.10185E07 7.40741E07 0.00000062 5 L in uH 0 0.255 0.463 0.625 0.741 0.81 0.833 0.81 0.741 0.625
26
0.9 0.8 0.7 0.6 L in uH 0.5 0.4 0.3 0.2 0.1 0 0 1 2 3 4 5 6 7 Vout 8 9 10 11 12
Figure 25: The inductance calculation for different output voltage or duty cycle. It can be seen that the maximum inductance value required for the buck converter is 0.833 uH. The approaches taken to design the windings and length of the inductor coil are described below:
Approach 1
The first approach used to design an air-cored inductor is by using the Wheeler formula.
Where: L is inductance in uH. N is the number of turns. D is the diameter of the coil in inches. L is the length of the coil in inches. [15]
27
Approach 2
The next approach used to design the coil of an air cored inductor is by using the basic inductance formula. The number of turns required to achieve the desired inductance of 0.833 uH is determined using equation 6:
Inductance required, L = 0.833uH. Permeability of free space, = 4 Relative permeability, = 1 (Due to the presence of air core)
The radius of the coil is assumed to be r = 0.0381m. The cross sectional area of the coil = The length of the coil is assumed to be l = 0.0178 m. = 0.00456 .
28
1.61
Therefore, it will take 1.6 turns to get an inductance of 0.833uH with a coil length of 0.0178m and a cross sectional area of 0.00456 The formula used above is valid for determining the size of any air cored coil i.e. both power and RF inductors.
The wire was then winded around a 0.0762 m in diameter base and taped together so that the windings are as close as possible. A picture of the inductor is shown below in figure 26:
29
Therefore, using equation 3 from the theoretical background the output capacitance for the filter can be calculated:
30
The above calculation shows that a capacitive value of 156 uF is required to filter out a waveform with a ripple current of 15A and a ripple voltage of 50 mV.
Total ripple current of the capacitor bank = 7 3.4 = 23.8 A. Therefore, 7 capacitors are connected in parallel to achieve a capacitive value of 154 uF which is very close to the desired value of 156 uF and the capability to handle a ripple current of 23.8 A to that of 15A. A picture of the capacitor bank is shown below in figure 27:
31
Figure 27: A picture of the capacitor bank for the buck converter.
32
33
DC
34
Figure 29: Tap changer circuit. [17] The main issue with the tap changer solution was the high number of taps required to be able to change the input DC voltage to 320 different levels which will make the product expensive and bulky. At the same time, it is difficult to create an interface between the tap selectors of the tap changer with the software development board. As a result, this method was rejected due to the failure of generating fast transient waveforms.
Solution 2
The other alternative solutions considered for this project was the use of a resistor bank to fluctuate the voltage level in the battery. Each resistor in the resistor bank is connected on parallel to a solid state switch which is being controlled from the input/ output pins on the software development board. This method is based on the principle of potential divider circuit where the output voltage depends on the value of the resistor across the load. A circuit diagram of the solution is shown below in figure 30:
35
12V
SOFTWARE
Figure 30: The circuit diagram of the resistor bank and the sold state switch solution. The main issue with this solution was that the resistors in the resistor bank can get hot when connected to a 12 V supply and will result in power dissipation from the resistors which will bring down the efficiency of the entire system and this will drain the power from the battery which is not suitable. To overcome this problem, the resistors must be attached to large heat sinks but it will make the product expensive to manufacture and also heavy to carry around. Considering all the above drawbacks, solution 2 was rejected.
36
37
38
Time (us)
Figure 31: A comparison of expected logic voltage (coloured red) and actual voltage (coloured green). From the graph it is seen that the actual logic voltage from pin 10 of the Arduino board is 0.3V off the expected logic voltage. This has an insignificant effect as a logic voltage of 0 4.7V peak to peak is enough to drive any mosfet driver circuit. 2. An analysis was then done of the two continuous out of phase PWM waveform obtained from the Mosfet Driver Circuit which is a Schmitt trigger. Since the two PWM waveforms generated were continuous waveforms, a part of the waveforms i.e. four pulses were analysed and the measurements taken using the oscilloscope are tabulated below:
Time (us)
0 1 1.999 2.001 3
39
A graph of the expected and actual voltage of two out of phase PWM waveforms from pin 2 and pin 4 of the Schmitt trigger is shown below in figure 32:
6 5
Voltage
4 3 2 1 0 1 3 5 7 9 11 13 15 17 19 21 23 25
Time (us)
Figure 32: Comparison of the expected and actual waveforms from pin 2 (coloured violet and blue) and pin 4 (coloured red and green) of Schmitt trigger.
40
Duty Cycle Expected output voltage(V) Actual Output voltage (V) % 10 1.2 1.28
41
The graph in figure 33 below shows the relationship between the duty cycle and the output voltage.
12 10
Figure 33: The relationship between the duty cycle and the output voltage. From the graph, it is seen that there is significant difference between the expected and the actual output voltage for each duty cycle. The difference between them varies from 0.08 1.6 V. The main reason for this is that the inductor and the capacitor of the buck converter are designed for the switching frequency defined in the specification of the project whereas the mosfets are switched at a much lower frequency as the waveforms at the gates of the mosfets get distorted at the specified frequency. This will result in losses across the inductor and the capacitor as the charging and discharging time of the filters (inductor and capacitor) is much lower than the switching time of the mosfets.
42
43
Reference
[1] ADD2. Low Voltage Tester Ground Offset Vehicle Battery Simulator, Version 3, p.1-20. [2] V. Madhuravasal; S. Venkataraman; C.G. Hutchens. Buck-Converter Design for Power in Plus 275??C Environments. IEEE Transactions on Aerospace and Electronic Systems, 2012, 48 (1), pp. 304 312. [3] M.Ponugubati. DC-DC Converters. Lecture delivered in Power Systems, Energy Converters and Drives, Unit code: EEC_6_491_1213. London Southbank University, 2012/13. [4] B. Hauke. Basic calculation of a Buck Converters Power stage. [ Aug 2012]. [Online] Available from: http://www.ti.com/lit/an/slva477a/slva477a.pdf [ Accessed 25Apr 2013]. [5] J. Segura, C. Hawkins. CMOS Electronics: How It Works, How It Fails. Wiley-IEEE Press, 2004. [Online] Available from: http://ieeexplore.ieee.org/xpl/articleDetails.jsp?tp=&arnumber=5237840&cont entType=Books+%26+eBooks&refinements%3D4291944823%26searchField %3DSearch_All%26queryText%3Dhow+capacitor+works [Accessed 25 Apr 2013]. [6] Murata Manufacturing Co. Basic Facts about Inductors [Lesson 1] Overview of inductors - "How do inductors work?", 12 Dec 2010. [Online] Available from: http://www.murata.com/products/emicon_fun/2010/12/inductor_en15.html [Accessed 25 Apr 2013]. [7] R. Nave. The Schmitt Trigger, [no date]. [Online] Available from: http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/schmitt.html [Accessed 08 Apr 2013]. [8] ISOCOM Components. High density Phototransistor Optically Coupled Isolator, [no date]. [Online]. Available from: http://docseurope.electrocomponents.com/webdocs/0265/0900766b802655bc.pdf [Accessed 14 Apr 2013]. [9] S. Portz. Transistor, [no date]. [Online]. Available from: http://www.physlink.com/education/askexperts/ae430.cfm [Accessed 14 Apr 2013].
44
45
Appendix
Approach 1 software code
46
47
48
49
Interface with PC
Current = 70A
Voltage = 0-32V
Development interface
User Interface
Current
Voltage
Cable
70A
Project Planning
Installation Process
Rated 70A
Accuracy Programming Language: using an environment based on the original Arduino IDE Graphical Interface
Easy to Use
50
Gantt chart
Milestone 1: Submission of progression report Milestone 2: Christmas break Milestone 3: Submission of interim report. Milestone 4: End of project.
51