A public repository for BMS algorithms for a NUCLEO BOARD.

Dependencies:   mbed

Hi Everyone!

Welcome to this repository from Howey's Research Group at the University of Oxford.

The code published here incorporates BMS algorithms for diagnosis functions such as SOC, SOH and Power estimation on a Kokam 53Ah Li-ion battery. This code was designed to work with a NUCLEO F401-RE board and to be tested with a dSPACE HIL Simulator. A short guide on how the set up works is available at https://bitbucket.org/ff95/bms .

The code is made up of three key parts. "Headers" and "Source" folders and the "main.cpp" file. As the code was generated by converting a Simulink model ( available on the BitBucket page), the headers and source code files generated by the conversion are in the corresponding "Headers" and "Source" folders. The "main.cpp" file sets up the ADC, the USB data transmission and starts the estimation (once a character "y" has been received by the computer it is connected to). It also transmits the data from the estimation via USB. Explanation on how to set up the communication with the board is available at BitBucket webpage, from where a MATLAB file can be downloaded which allows real time communication.

For any questions you can contact the author at federicomariaferrari@gmail.com .

The Simulink and Matlab files, together with a short guide, are all available at: https://bitbucket.org/ff95/bms.

Thanks for trying this out!

Federico

Committer:
fmferrari
Date:
Wed Dec 07 21:02:25 2016 +0000
Revision:
6:cb71171a7108
Parent:
5:dad47e5b9586
EKF Not working try 2;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
fmferrari 5:dad47e5b9586 1 //
fmferrari 5:dad47e5b9586 2 // Academic License - for use in teaching, academic research, and meeting
fmferrari 5:dad47e5b9586 3 // course requirements at degree granting institutions only. Not for
fmferrari 5:dad47e5b9586 4 // government, commercial, or other organizational use.
fmferrari 5:dad47e5b9586 5 //
fmferrari 5:dad47e5b9586 6 // File: rt_nonfinite.h
fmferrari 5:dad47e5b9586 7 //
fmferrari 6:cb71171a7108 8 // Code generated for Simulink model 'EKF'.
fmferrari 5:dad47e5b9586 9 //
fmferrari 6:cb71171a7108 10 // Model version : 1.1
fmferrari 5:dad47e5b9586 11 // Simulink Coder version : 8.11 (R2016b) 25-Aug-2016
fmferrari 6:cb71171a7108 12 // C/C++ source code generated on : Wed Dec 7 21:37:35 2016
fmferrari 5:dad47e5b9586 13 //
fmferrari 5:dad47e5b9586 14 // Target selection: ert.tlc
fmferrari 6:cb71171a7108 15 // Embedded hardware selection: Intel->x86-64 (Windows64)
fmferrari 5:dad47e5b9586 16 // Code generation objectives: Unspecified
fmferrari 5:dad47e5b9586 17 // Validation result: Not run
fmferrari 5:dad47e5b9586 18 //
fmferrari 5:dad47e5b9586 19
fmferrari 5:dad47e5b9586 20 #ifndef RTW_HEADER_rt_nonfinite_h_
fmferrari 5:dad47e5b9586 21 #define RTW_HEADER_rt_nonfinite_h_
fmferrari 5:dad47e5b9586 22 #include <stddef.h>
fmferrari 5:dad47e5b9586 23 #include "rtwtypes.h"
fmferrari 5:dad47e5b9586 24 #ifdef __cplusplus
fmferrari 5:dad47e5b9586 25
fmferrari 5:dad47e5b9586 26 extern "C" {
fmferrari 5:dad47e5b9586 27
fmferrari 5:dad47e5b9586 28 #endif
fmferrari 5:dad47e5b9586 29
fmferrari 5:dad47e5b9586 30 extern real_T rtInf;
fmferrari 5:dad47e5b9586 31 extern real_T rtMinusInf;
fmferrari 5:dad47e5b9586 32 extern real_T rtNaN;
fmferrari 5:dad47e5b9586 33 extern real32_T rtInfF;
fmferrari 5:dad47e5b9586 34 extern real32_T rtMinusInfF;
fmferrari 5:dad47e5b9586 35 extern real32_T rtNaNF;
fmferrari 5:dad47e5b9586 36 extern void rt_InitInfAndNaN(size_t realSize);
fmferrari 5:dad47e5b9586 37 extern boolean_T rtIsInf(real_T value);
fmferrari 5:dad47e5b9586 38 extern boolean_T rtIsInfF(real32_T value);
fmferrari 5:dad47e5b9586 39 extern boolean_T rtIsNaN(real_T value);
fmferrari 5:dad47e5b9586 40 extern boolean_T rtIsNaNF(real32_T value);
fmferrari 5:dad47e5b9586 41 typedef struct {
fmferrari 5:dad47e5b9586 42 struct {
fmferrari 5:dad47e5b9586 43 uint32_T wordH;
fmferrari 5:dad47e5b9586 44 uint32_T wordL;
fmferrari 5:dad47e5b9586 45 } words;
fmferrari 5:dad47e5b9586 46 } BigEndianIEEEDouble;
fmferrari 5:dad47e5b9586 47
fmferrari 5:dad47e5b9586 48 typedef struct {
fmferrari 5:dad47e5b9586 49 struct {
fmferrari 5:dad47e5b9586 50 uint32_T wordL;
fmferrari 5:dad47e5b9586 51 uint32_T wordH;
fmferrari 5:dad47e5b9586 52 } words;
fmferrari 5:dad47e5b9586 53 } LittleEndianIEEEDouble;
fmferrari 5:dad47e5b9586 54
fmferrari 5:dad47e5b9586 55 typedef struct {
fmferrari 5:dad47e5b9586 56 union {
fmferrari 5:dad47e5b9586 57 real32_T wordLreal;
fmferrari 5:dad47e5b9586 58 uint32_T wordLuint;
fmferrari 5:dad47e5b9586 59 } wordL;
fmferrari 5:dad47e5b9586 60 } IEEESingle;
fmferrari 5:dad47e5b9586 61
fmferrari 5:dad47e5b9586 62 #ifdef __cplusplus
fmferrari 5:dad47e5b9586 63
fmferrari 5:dad47e5b9586 64 } // extern "C"
fmferrari 5:dad47e5b9586 65 #endif
fmferrari 5:dad47e5b9586 66 #endif // RTW_HEADER_rt_nonfinite_h_
fmferrari 5:dad47e5b9586 67
fmferrari 5:dad47e5b9586 68 //
fmferrari 5:dad47e5b9586 69 // File trailer for generated code.
fmferrari 5:dad47e5b9586 70 //
fmferrari 5:dad47e5b9586 71 // [EOF]
fmferrari 5:dad47e5b9586 72 //