Coder Social home page Coder Social logo

bms-fw's Introduction

bms-fw

Battery Management System - Firmware written for TMS570LS1227

bms-fw's People

Contributors

amneetm avatar danrobren avatar devixluvic avatar mkamalel avatar rafguevara14 avatar xinglu-wang avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jellohuang

bms-fw's Issues

Update thermistor state machine

Query the thermistor status and determine what state it should be in from the following:
THERMISTOR_GOOD, // Thermistor working properly
THERMISTOR_LOST_COMS, // Communication dropped with thermistor board
THERMISTOR_STARTUP, // Initialization state
THERMISTOR_TEMPERATURE_FAULT, // Less than 3 cells over 60 degrees
THERMISTOR_CRITICAL_FAULT // Shutdown tier fault

HV Shutdown Board Interface

  • BMS_FLT is the input pin on the HV Shutdown Board coming from the BMS master that indicates a fault that should shutdown the HV system
    TODO: How long to keep the pin on for?
    TODO: what GIO pin BMS_FLT corresponds to on BMS master
    TODO: what criteria are to put BMS back in running state after a fault occurs

State of charge estimation research

Research into the different methods of state of charge estimation and coming up with a method that can realistically be integrated into embedded C code. In our system we have the voltage of each cell as well as total current available to us.

1D: Implement relevant tasks and their logic

Most of this will be categorizing how to distribute the task(s) amongst all the sensor reads being done. Hopefully, most of the reading logic is taken care of in the drivers and the structure/skeleton of the task/queue system is done in 4A

Integrate CAN into BMS

There has been a lot of work done on CAN, contact Elena and Xinglu. We need to finalize and fully test the CAN comms and setup the periodic messaging and message processing

Test balancing of BMS

Relates to integrating charging. Balancing only operates during charging state so task needs to be activated conditionally on the state of the BMS. Then we need to test if it works.

1B: Read HV current and voltage

Make sure the current running through the HV board is within range and if not, shutdown signal is sent to the VCU. Further explanations can be found in each test case

1A: Read IMD sensor

In case the HV and/or LV systems do not function as intended, the IMD sensor will detect this and the BMS is also responsible for reading the same signal and initiating shut down. Input frequency and/or duty cycle and expect BMS to output same values.

BMS Slaves Test Setup

The BMS Slave chip is the LTC6811.

LTC6811 Data Sheet: https://www.analog.com/media/en/technical-documentation/data-sheets/LTC6811-1-6811-2.pdf

The battery is 96S 5P lithium ion. This means there are 96 cells in series and 5 in parallel. Therefore the battery votlage is 96 times the individual cell voltage and the capacity in amp*hours (Ah) is five times that of an individual cell. The cells we use have a minimum votlage of 3.1 volts when fully empty and 4.2 volts when full. Therefore the battery is 297.6 V empty and 403.2 V fully charged.

We cannot allow the cells to go above or below these maximum/mimimum voltages for safety reasons. It is the BMS master's job to measure the voltage of the entire battery, but the BMS slaves measure the votlage of the individual cells. Not every cell of the 96S 5P battery is being measured; each slave channel will connect to a bank of 5 cells in parallel and measure their temperature and voltage collectively.

Not every cell has the same internal resistance due to manufacturing variance, therefore they will discharge at different rates. Over multiple charge cycles, this effect can compound such that cell voltages are very different from eachother, even though the total battey voltage appears normal.

This is why we do balance charging. Every charge cycle, it is the BMS slaves' job to make sure all the cell voltages are equal. The BMS slaves report these cell votlages (and temperatures) back to the BMS master such that it can make decisions about whether to trigger an HV shutdown.

The BMS salve board is not finished as of 23/05/2024, but its functionality can be emulated much like the ADS7044 ADC which measures the total battery voltage This ADC communicates over SPI and its functionality was emulated using an SPI module on the launchpad itself. The goal is to do the same for the BMS slaves such that the code can be tested and ready for integration when the BMS slave board is complete.

4A: Define APIs between modules

This task mainly focuses on refactoring at the module level and *defining responsibilities for modules.

  • we should decentralize initialization code and dissolve it into separate modules where there is a single owner

Output:

  • Task skeletons
  • Queue modules

Adding timeouts to BMS Slave Communication

Right now if a message isn't processed properly the code will just hang in a loop waiting for it to finish. We want to implement a timeout such that if after 1 ms or so there is no message received then move on to the rest of the code. We also want the logic of if you timeout multiple times in a row then acknowledge that the comms are down.

Requirements Tracing for FSAE 2024

With the new rules released, we need to do a re-evaluation of the current BMS system and figure out what is still applicable vs what needs to be updated.

  • Read Accumulator sections in FSAE 2024 rulebook
  • Create UML diagram of BMS interactions
  • Define unit tests

Integrate charger into BMS codebase

This involved doing the following things:

  • Integrating the code
  • Having checks to switch into charging mode because the battery charges outside the car, so customize which faults to activate based on BMS state

Implementing watchdog timer

We want to use the watchdog timer to make sure that the system is still up running. The watchdog timer will accomplish this by requiring to be pet periodically or else it would reboot the MCU.

Add in logic to convert BMS Slave AUX voltage to temperature

We are getting the voltage of the AUX ports back from the BMS Slaves. There will be thermistors connected to those ports and we need to convert the voltage we read into a temperature. Refer to the thermistor board code for an example on the conversion logic.

4D: Cleanup state machine

The state machine is really messy on there rn. For health monitoring, you probably don’t even need one. For battery management, you probably do but…it’s still messy. Let’s clean it up.

Output:
Explicit diagram characterizing the state machine (Mealy or Moore)

Handle temperature faults

We want to have something checking temperature fault flags and trigger shutdown of the car if necessary

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.