01-30-2010 06:11 PM
I was recently given a project to build a battery charger using
LabView and a NIElvis board. I think I have the hardware built to
specs. We are charging two banks of 6 NiCd AA batteries (12 total).
I am using the +12V and -12V var. Supplies on the elvis board one for
each bank of batteries. I have the appropriate drivers to get LabView
to control the var. supplies. I have been using the DAQassistant to
read in analog channels from the elvis board, with some trouble. The
main problem I'm having is building the vi to do all the things I want
it to....
I have written so psuedo-code to represent what I need.
Start Run time.
power supplies off.
check voltage across batt pack(analog channel 0+ /0-)
write voltage to file.if voltage less than 8.9V
check temp of battery pack(analog chan 1+ / 1-)
write temp to file.if temp less than 120F
check total elapsed time
write time to file.if time less than 4hours
Output voltage from variable power supply so that current is 450mA.
check current in circuit(analog channel 2+ / 2-)write current to file.
if current is not equal to 450mA
change variable voltage supply to obtain 450mA
Cycle back to power supply off. (TOP)else
Go to hourly toping charge. indefinitely
Also need to monitor time, temp, and voltage once per hour
Write data to file.else
Go to 10 min cool down with power supply off.
After cool down, Go to (Top) power supply offelse
Go to hourly toping charge. indefinitely
Also need to monitor time, temp, and voltage once per hour
Write data to file.
So far I basically put all of this code inside of a while loop. I check the voltage and enter a case structures from there... I do need to implement both packs at once... I thought of a flat sequence with two frames inside the while loop. One for each voltage supply. I have had trouble with the DAQassistant reading in from 6 channels. Voltage, temp (which i use a 200ohm thermistor with a 100kohm resistor in series with it and measure the voltage across the the 100k resistor. I then use a couple of the formula boxes and compare the temp from the formula with the numeric constant 120F), and current. I also don't know how to delay time between each case structure. I just need to write these "checks" to file once a min. So in theory if i left the charger charging over night I could view the file the next morning. If something went wrong I would be able to see some clue of what it might have been in the file. I would like to write all of this data to an excel document in some pretty format if possible. maybe like........
Pack 1Sorry this seems like a big request, I have spent about a week pulling my hair out to get this far. I just need some programing suggestions.
Time Voltage Temp Current
Data data data data
01-30-2010 11:41 PM
I have attached the code I have written so far. I am snowed in today, so i wasn't able to use the DaqAssistant or Variable supplies in my VI. I wont have access to the Elvis station until maybe Monday?? If some one could look at my project i would greatly appreciate it.
Thanks
01-31-2010
09:38 AM
- last edited on
07-09-2024
12:03 PM
by
Content Cleaner
Without going too much into detail about your current code, if I were doing this I would set up a multiple-loop system. I would keep the data collection, process control, and data logging as separate loops. A queue can be used by the data collection process to accumulate data. The process control loop can get the data as it needs it, and the data logging can be set to log at whatever rate you need.
I would look into a master/slave design pattern, which are discussed here. As for the process control a state machine sounds like what you're looking for. The design patterns are very robust and easy to implement, even for new users.
Quick points: