LabVIEW Programming - DOC - DOC

Document Sample
LabVIEW Programming - DOC - DOC Powered By Docstoc
					EE 4333 Fuel Cell Data Collection & FPGA Interface

Ahmed Saheb Texas Tech University Maymester June, 2005

Instructor Name: Dr. Parten

Group Member: Ryan Lewey

Table of Contents
Table of Contents............................................................................................2 Tables of Figures ............................................................................................3 Abstract .........................................................................................................4 Introduction....................................................................................................5 Fuel Cell .........................................................................................................5 Test Fuel Cell ..................................................................................................7 LabVIEW Programming ...................................................................................9 Temperature Sensor Program ..................................................................... 10 Pressure Sensor Program ........................................................................... 13 Humidity Sensor Program ........................................................................... 14 PWM Generator Program............................................................................ 15 FPGA Interface Board .................................................................................... 18 RESULTS ...................................................................................................... 25 CONCLUSION ............................................................................................... 26 REFERENCES ................................................................................................ 27

Tables of Figures
Figure 1:GM Equinox .......................................................................................5 Figure 2: Fuel Cell Operation ...........................................................................6 Figure 3: Fuel cell Compartment……………………………………………………………………7 Figure 4: Fuel Cell wiring .................................................................................7 Figure 5: Fuel Cell Sensors ..............................................................................8 Figure 6 - Temperature Schematic ................................................................. 10 Figure 7 - Setting up DAQ Assistant ............................................................... 11 Figure 8: Select Signal Block .......................................................................... 12 Figure 9: LabVIEW program for Temperature Sensor ...................................... 13 Figure 10: LabVIEW Program for Pressure Sensor ........................................... 15 Figure 11: LabVIEW program for Humidity Sensor .......................................... 15 Figure 12: Fuel Cell with load......................................................................... 16 Figure 13: PWM Program Block ...................................................................... 17 Figure 14 - PWM Front Panel ......................................................................... 17 Figure 15: FPGA Interface board .................................................................... 18 Figure 16: Low-pass Filters ............................................................................ 19 Figure 17: LPF Simulations ............................................................................ 19 Figure 18: Injector Circuitry ........................................................................... 21 Figure 19: Ignition Coil Circuit Output ............................................................ 22 Figure 20: Injector ........................................................................................ 23 Figure 21: Injector Control Circuit .................................................................. 24

Abstract
This paper describes the purpose of the fuel cell on the Equinox for the ChallengeX competition and the steps taken to obtain temperature and pressure readings from the hydrogen fuel cell and also the setup and programming of the FPGA and the FPGA interface board which will take in signals from various sensors on the engine and control the ignition and injection timing sequences.

Introduction
ChallengeX is a competition developed by the General Motors Corporation and the U.S. Department of Energy along with other major corporations. Its objective is to promote the development of a vehicle that is low on emissions of green house gasses while keeping the performance of the vehicle on par with international standards for performance and efficiency. This is a three year competition with specific goals for each year. The GM Equinox, a sports utility vehicle, is provided by GM to all the universities after the first year and must be reengineered in order to meet all of the specifications of the competition.

Figure 1:GM Equinox

Fuel Cell
The fuel cell that is to be used in the Equinox is a polymer exchange membrane (PEM) fuel cell by Hydrogenics. A hydrogen fuel cell has two inlets, one for hydrogen and the other for air. Hydrogen is allowed to flow through to the anode on one side of the fuel cell while the air flows to the cathode on the

other side. A platinum catalyst present at the anode splits the hydrogen into positively charged ions and negatively charged electrons. Only the positively charged ions are allowed to pass through the anode and a polymer electrolytic membrane (PEM) to the cathode on the other side. There they combine with oxygen in the air to form water and heat. The electrons of the hydrogen are forced to travel through an external circuit to the cathode. This is the power that the fuel cell generates and is used for operating any electrical device or charging of a battery. The Figure 2 shows the operation of a typical PEM fuel cell.

Figure 2: Fuel Cell Operation

The only waste product produced by the fuel cell is water which is why hydrogen is considered as the long term solution for replacing polluting fossil fuels.

Test Fuel Cell
A picture of the test fuel cell station present at the Advanced Vehicle Engineering Facility can be seen in the Figure 3. Figure 4 on the right shows the connection board to interface to a LabVIEW program and a voltage regulator circuit board to power the pressure and temperature sensors in the fuel cell system.

Figure 3: Fuel cell Compartment

Figure 4: Fuel Cell wiring

Air and hydrogen gases enter the fuel cell passing through their respected flow meters into two different heated bubblers. The purpose of the bubblers is to saturate the gases passing through them. De-ionized water is used for this purpose and also as a coolant for the entire fuel cell. A Conductivity Analyzer was used to measure the resistively of the de-ionized water. Signals from the temperature, pressure, and humidity sensors are connected to the NI-DAQ connections board which are taken in by the DAQ board installed inside the CPU of the computer.

There is three of each sensor for taking in readings from the hydrogen, air and coolant intakes. The wiring for all the sensors can be seen in the appendix. Figure 5 shows the temperature, pressure, and humidity sensors used in the fuel cell system. Humidity Temperature Pressure

Figure 5: Fuel Cell Sensors

The Temperature sensor works by changing the resistance using a variable resistor which is connected to a transmitter. The transmitter made by Omega Engineering Inc, have to be properly calibrated in order for them to give accurate readings. The resistance of the variable resistor for the model that we had varies from about 92 ohms to about 156 ohms. So, to calibrate them, these two resistance values have to be connected across pins 1 and 2 on the transmitter. These two resistance values correspond to the minimum and maximum current values sent by the transmitter which is 4 and 20mA. So as the temperature varies so does the resistance. This determines the current across

the circuit. This current is used to calculate the temperature. The current ranges from 4 -20mA. The pressure sensors measure the pressure of the hydrogen, air and water at the inlet of the fuel cell. These pressure sensors are made by American Sensor Technologies. They are powered by a 12 volt supply voltage and have an output voltage of 1-5 volts. The humidity sensors are made by Humirel. They require a 5 volt supply voltage and output a voltage signal of 1.2-3.5 volts. The humidity sensors however couldn’t be setup properly because its actual datasheet couldn’t be found anywhere and we were unable to which pin corresponded to which connection. This device doesn’t have reverse power protection and if wired incorrectly, it would seriously damage the device. Therefore it was concluded not to guess the connection for the chance that we may have destroyed it. However the wiring into the NI-DAQ board was completed and once the connections for the device are found it can easily be setup in LabVIEW.

LabVIEW Programming
This entire section was taken from the write-up done by myself and Ryan Lewey for the NI report and presentation at the ChallengeX competition in Detroit 2005.

Temperature Sensor Program
The first step one should take in programming a simple analog input measurement program is to use the DAQ Assistant module. This module aids in setting up the parameters you want to measure and selecting the analog input channels on the DAQ 6024E board. For our temperature sensing program we were interested in measuring the current generated from the temperature transmitter and translating that current into a specific temperature. The temperature transmitter is capable of generating a 4mA to 20mA current signal and in our case that translates to a temperature between 0 to 300 degrees Fahrenheit. Below is a schematic showing the basic setup for measuring voltage across a shunt resistor to ascertain the current flowing from the sensor.

Figure 6 - Temperature Schematic

Our program needs to measure the temperature for three different inputs; namely the hydrogen, air and coolant were of interest. To setup three distinct channels you must add and define your different channels using the DAQ Assistant. To do this first double-click the DAQ Assistant and click on the green plus sign to add a channel of your choice.

Figure 7 - Setting up DAQ Assistant

You can see that the Physical Channel column shows the inputs that are coming into the DAQ Board. Then you need to use the Select Signals block to distinguish between which channels you want to measure and display. The dialog box below shows the pop up box you will get once you double-click the Select Signals block.

Figure 8: Select Signal Block

You are now able to select the signal corresponding to the order of the signals in the DAQ Assistant. In this example, Signal 0 is selected and that corresponds to the ai3 input on the DAQ board. You will do this all for all three channels that you want to measure; so this means you will need three different Select Signal blocks. The rest of the program is fairly straight-forward since all you need are various multiplying, dividing, adding and subtracting blocks to implement the formula related to your measurements. Included in the “Tables” folder shows the math we used to come up with our linear equation for the current to temperature conversion. Our formula took into consideration an offset in order to target room temperature at 70 degrees Fahrenheit. Also our final LabVIEW program substituted current as voltage divided by resistance and thus we had to

multiple the incoming voltages by 83.81. At the end of our blocks there is a Write LabVIEW Measurement File block that allows you to export all of the collected data to a Microsoft Excel spreadsheet. If you double-click on this block you can select where you want the file saved to and alter many other parameters. The screen-shot below shows our entire program for temperature sensing in its entirety.

Figure 9: LabVIEW program for Temperature Sensor

Pressure Sensor Program

This program is very similar in setup to the temperature sensor program that we just described in detail. The same concept regarding the Select Signals block still applies to this program since we wanted to measure the pressures of

the hydrogen, air and coolant. The main difference in this program is that we were interested in measuring the incoming voltages rather than the incoming currents. In order to measure the voltages you must double-click on the DAQ Assistant and select an analog input and then voltage measurement. The formula we used for our linear equation can also be found in the “Tables” folder. There are no new programming techniques or blocks used in this program that were not used in the previous program. On the next page is the entire program in block diagram format. Humidity Sensor Program

Like the two previous programs the humidity sensor program follows the same setup and form. The block diagram for this program can be found on the page following the block diagram for the pressure sensors and the formula we used to calculate the humidity is also in the “Tables” folder.

Figure 10: LabVIEW Program for Pressure Sensor

Figure 11: LabVIEW program for Humidity Sensor

PWM Generator Program The fuel cell was then tested with a load to measure the amount of current generated. To serve as a load, we used five Power MOSFETs connected in parallel and were connected across the fuel cell. The schematic of the setup is shown in the block diagram below.

Figure 12: Fuel Cell with load

The Power MOSFETs were powered by a PWM signal sent into the gate. For this purpose, a PWM signal generating program was made using LabView. This program allows the duty cycle and frequency of the signal to be changed. The DAQ Assistant was setup for “Counter Output” on channel CTR 0 OUT. However, the DAQ Assistant block had to be opened and edited to allow changing the values for frequency and duty cycle from the front panel rather than having to double click the DAQ Assistant block every time any changes on the signal were needed. The inputs of DAQ Assistant were changed from a constant value to a user input value. Also, another change was to relate the high and low of a signal to duty cycle and frequency.

The screen shot of the PWM block is shown below followed by the front panel of the program.

Figure 13: PWM Program Block

Figure 14 - PWM Front Panel

FPGA Interface Board The purpose of this particular board is to act as the interface between the engine and the NI controller which will replace the current Motec engine control unit (ECU). The purpose of the ECU is to monitor many sensors placed near the engine and based on these input give out necessary control signals back to the engine based on that feedback.

Figure 15: FPGA Interface board

Some of these sensors include data on air temperature, engine temperature, throttle position and manifold pressure. The signals sent by these sensors have noise in them and require filtering which is done through this interface board. This board was designed by a group and had it sent to be built professionally. It has a third-order low pass filter to accomplish the filtering. The figure below shows the schematics of the filters on the board with the simulation results below that.

Figure 16: Low-pass Filters

Figure 17: LPF Simulations

The FPGA will also send signals to activate the injectors and ignition coils through this board. These signals however need some conditioning. The reason for this is that the NI FPGA can give out a maximum of 5 V while 12 V are needed to activate the ignition coils. Therefore it is necessary to amplify the signal. This was done by using a LM324 IC. It is built with four operational amplifiers set up in a Schmitt Trigger configuration. The inverting input has a constant value of approximately 3 V, therefore the non-inverting input voltage must be greater than 3.3 V in order for the output to be 12 V supplied to the ignition coils. Since the signal from LabVIEW is 5 V this setup works for our requirements. There was, however, a small error on the original ignition coil schematic that has to be corrected before we can obtain the 12 V output signal. The R5 resistor, on the left in figure 18 was connected straight to the inverting input. R5 and R7 are supposed to be setup in a voltage divider configuration which can be seen on the right of the figure.

Figure 18: Injector Circuitry

The same circuit was built on a bread board with the resistor in the right place and we were able to obtain the amplified signal. Below are the results we received on an oscilloscope with an output close to 12 V with a 5 V input signal going to the non-inverting input.

Figure 19: Ignition Coil Circuit Output

In the future the R5 resistor needs to be shorted and a 10 k ohm can be added to form a voltage divider that goes to all four ignition coil circuits. There is also a control circuit designed specifically for firing the four injectors on the engine. The injectors require 4 A to open them up and 1 A to hold them open. This was achieved by using a Darlington pair transistor to

output these high currents.

Figure 20: Injector

The injectors are powered with 12 V with the signal to activate them coming through the interface board. The National Semiconductor LM1949 chip was used to control the input currents to the injectors. Figure 14 shows the injector control schematic.

Figure 21: Injector Control Circuit

This circuit was successfully tested by inputting a 5 V pulse width modulated signal created by LabVIEW into the Vin on the LM1949. On the output of the Darlington pair transistor we hooked up an injector and powered it with 12 V from an external power supply. When the circuit was switched on, we were able to hear clicking inside the injector which signified that it was opening and closing. The Zener diode connected from the collector on the Darlington pair to ground protects the circuitry from voltage spikes generated from the coil inside the injectors while the transistor is switching.

RESULTS
Once all of the sensors on the fuel cell were tested and LabVIEW monitoring code completed, it was tested with a load to try and measure the current and voltage that could be generated. To act as the load, we use the power Mosfets that were explained of earlier in the paper. We changed the duty cycle of the PWM thus changing the resistance across the fuel cell. We had the shunt reisitor in series with these Mosfet. The data collected can be seen on the excel spreadsheet seen below.

CONCLUSION
There was a lot of work needed to be done on this project and different issues involved. The setup of the fuel cell has been completed and is ready for any future testing needed. The sensors responded to changes in pressure and temperature and seemed to be accurate. However, as was mentioned earlier, we were never able to get the humidity sensors to work because of the lack of proper documentation for the pin connections. We made different programs for the different sensors on the fuel cell however were not able to build a program to monitor all the sensors at the same time. We completely tested all of the individual components on the FPGA interface board and found them all to work as needed except for the ignition coils. Once the resistor is taken care of, this board can fully be used for the purpose it was built for.

REFERENCES
1. Parten, Dr. Micheal 2. Lewey, Ryan 3. Chase Richards 4. Robert Walton 5. National Semiconductor. “LM1949 Injector Drive Controller”, < http://www.national.com > (5/25/04).

6. National Semiconductor. “LM324 Low Power Quad Operational Amplifiers”, < http://www.national.com > (5/25/04).


				
Jun Wang Jun Wang Dr
About Some of Those documents come from internet for research purpose,if you have the copyrights of one of them,tell me by mail vixychina@gmail.com.Thank you!