LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Battery charge/discharge cycle

Hi everyone,

 

I am an Aerospace Engineering student with very little ECE experience and really am out of my element here. I have to write a LabView VI that allows me to test the charge/discharge cycle of Lithium Ion batteries that I have assembeld on my battery board. I have a NI VirtualBench to carry out the tasks. 

 

The program needs to complete the following: 

1) Charge the batteries to 4.2V using a current of 1300mA. Then hold the batteries at a constant 4.2V until the current drops below 50mA.

2) Allow a 10 minute resting period.

3) Discharge the batteries at a current of 1300mA until the voltage drops to 3.0V.

4) Allow a 10 minute resting period. 

5) Repeat steps 1-4 once more and finish with another charge cycle.

6) Record temperature during the whole cycle (let's say every minute).

 

I was thinking I should make a charge VI and a discharge VI and then create a cycle VI that loops between the charge/discharge. However, I am new to LabView and am unsure on how to carry this out.

 

Any help will be greatly appreciated and rewarded with a Kudos.

 

Thanks in advance. 

0 Kudos
Message 1 of 4
(5,631 Views)

I was an ME student a few years ago, so I feel your pain. LabVIEW is easy, it just takes some time to get good at. Get used to using the debugging tools to figure your way through your program (probe, highlight execution, extra indicators). If you need help with the electrical wiring side of this, I'm sure you can find an EE student or a professor to help you there.

 

Your NI Virtual Bench can read Analog Inputs, send Analog Outputs, read Digital Inputs, and send Digital Outputs. The analog ins and outs are voltage values that you can use as measurements or controls respectively. The digital ins and outs are high/low triggers.

 

Here's an example that shows how to work with a Virtual Bench in LabVIEW.

 

You're on the right path with creating subVIs for the repeated processes. This eliminates code duplication to save you time in the end when you have to make a change. An alternative (if you can fit the code) is to have a case that you can trigger over and over again with the same code in it.

 

It sounds like you could do with a State Machine architecture.

The Simple State Machine template that ships with LabVIEW is really the best way for new developers to get familiar with LabVIEW while utilizing a semi-scalable architecture.

Here's a broad example of how a state machine works:

  • States: Init, Idle, Exit, DoThing1, DoThing2, DoThing3
  • Each state contains code that might take some time. Ideally, not too long because that's how long you code could be unresponsive.
  • The Idle state contains an event structure for all user interaction.
  • The front panel has a button that says "Do Thing 1".
  1. Loop Iteration 0: Application begins, first state is Init. The Init state does some initialization stuff and tells the application to go to the Idle state when finished.
  2. Loop Iteration 1: Application goes to Idle state. It sits there, waiting at the event structure.
  3. Time goes by, then user presses button "Do Thing 1". There is no code, or minimal code, within this event case. The output of this event state tells the application to go to the DoThing1 state.
  4. Loop Iteration 3: Application goes to DoThing1 state. There is code here that does some stuff. The output of DoThing1 state tells the application to go back to the Idle state.
  5. Loop Iteration 4: Application goes to Idle state where it waits at the event structure again.
  • Each of the states can tell the application to go to any state they want. Want to reinitialize? Go to the Init state again. Want to end the program? Go to the Exit state? Want each state to trigger another (like a sequence)? Have DoThing1 output DoThing2, which outputs DoThing3,  which outputs Idle.

 

"Give me six hours to chop down a tree and I will spend the first four sharpening the axe."  - Abraham Lincoln

 

Here are some free training tools primarily focused on LabVIEW and NI hardware to help get started.

NI Learning Center

NI Getting Started

-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)

-LabVEW Basics

-cRIO Developer's Guide

Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 2 of 4
(5,614 Views)

Thank you!

I will take a look at everything you have given me and try to write the program.

When I get stuck at something (because this will definitely happen) I will try to follow up with my code and an explanation of what i am trying to complete.

 

Thanks again!!

0 Kudos
Message 3 of 4
(5,596 Views)

Good luck. Make sure to come back and include your code, so we can see what you've tried and help you alter it to fit your needs.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 4 of 4
(5,582 Views)