All Projects → dexterbg → Twizy-Virtual-BMS

dexterbg / Twizy-Virtual-BMS

Licence: LGPL-3.0 License
This is an Arduino library providing an emulation of the CAN communication protocol of the BMS (battery management system) on a Renault Twizy.

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Twizy-Virtual-BMS

SparkFun CAN-Bus Arduino Library
No description or website provided.
Stars: ✭ 132 (+131.58%)
Mutual labels:  arduino-library, can-bus
MCP CAN lib
MCP_CAN Library
Stars: ✭ 567 (+894.74%)
Mutual labels:  arduino-library, can-bus
diyBMSv4Code
Software for diyBMS v4
Stars: ✭ 128 (+124.56%)
Mutual labels:  bms, battery-management-system
ENNOID-BMS
Open-Source: Modular BMS based on LTC68XX & STM32 MCU for up to 400V EV battery pack
Stars: ✭ 132 (+131.58%)
Mutual labels:  bms, battery-management-system
foxbms-2
foxBMS 2, online documentation at https://docs.foxbms.org
Stars: ✭ 75 (+31.58%)
Mutual labels:  bms, battery-management-system
max1704x
Arduino library for the MAX17043 and MAX17044 LiPo Battery Fuel Gauge.
Stars: ✭ 16 (-71.93%)
Mutual labels:  battery, arduino-library
asysbus
Arduino System Bus
Stars: ✭ 23 (-59.65%)
Mutual labels:  arduino-library, can-bus
bat
Battery management utility for Linux laptops.
Stars: ✭ 107 (+87.72%)
Mutual labels:  battery, battery-management-system
battery-rul-estimation
Remaining Useful Life (RUL) estimation of Lithium-ion batteries using deep LSTMs
Stars: ✭ 25 (-56.14%)
Mutual labels:  bms, battery-management-system
retroTerm
An Arduino library for creating user interfaces in a terminal emulator, with mouse clickable widgets
Stars: ✭ 15 (-73.68%)
Mutual labels:  arduino-library
BatteryView
Simple battery shaped UIView
Stars: ✭ 49 (-14.04%)
Mutual labels:  battery
tesla-style-solar-power-card
Home assistant power card mimicking the one tesla provides for the powerwall app.
Stars: ✭ 103 (+80.7%)
Mutual labels:  battery
cpp-can-isotp
C++ implementation of CAN ISO 15765-2 also known as CAN ISO transport protocol. CPP CAN isotp.
Stars: ✭ 14 (-75.44%)
Mutual labels:  can-bus
Grove LED Bar
A powerful MY9221 LED driver
Stars: ✭ 29 (-49.12%)
Mutual labels:  arduino-library
Adafruit FT6206 Library
Arduino library for FT6206-based Capacitive touch screen
Stars: ✭ 28 (-50.88%)
Mutual labels:  arduino-library
esp32WS2811
Arduino library for ESP32 to drive WS2811 LEDs using the RMT peripheral
Stars: ✭ 22 (-61.4%)
Mutual labels:  arduino-library
107-Arduino-MCP2515
Arduino library for controlling the MCP2515 in order to receive/transmit CAN frames.
Stars: ✭ 35 (-38.6%)
Mutual labels:  arduino-library
impedance.py
A Python package for working with electrochemical impedance data
Stars: ✭ 102 (+78.95%)
Mutual labels:  battery
esp32-f9p-io-board
An IO-PCB (two motor-driver/H-bridge, CAN, RS232, ADS1115, relay, ethernet, ardusimple f9p compatible connector) with an ESP32 for 12V power, three 15V tolerant analog inputs, three 5V tolerant inputs.
Stars: ✭ 24 (-57.89%)
Mutual labels:  can-bus
esp-logger
An Arduino library providing a minimal interface to log data on flash memory and SD cards with ESP8266 and ESP32
Stars: ✭ 40 (-29.82%)
Mutual labels:  arduino-library

Twizy Virtual BMS

This is an Arduino library providing an emulation of the CAN communication protocol of the BMS (battery management system) on a Renault Twizy.

By reproducing the system interface of the original BMS, the Virtual BMS enables replacing the original by a custom battery without changing anything else on the Twizy.

Twizy Virtual BMS

The library provides an API to control power limits and charge current, so a wide range of batteries can be used. Even lead-acid is an option.

In the most simple case this can be used without any customization. The provided "SimpleBMS" example shows how to create a very basic battery monitoring by using the Arduino analog ports to measure the battery pack voltage and temperature.

If you'd like to contribute a specific BMS adaptation, please fork and add your code in the examples folder.

Installation

To download, click the DOWNLOADS button in the top right corner, download the ZIP file. Start the Arduino IDE, select menu Sketch → Include Library → Add .ZIP library, select the ZIP file and click OK. Try out the examples included.

You will also need these libraries:

To get the smallest possible ROM & RAM footprint, set TWIZY_DEBUG_LEVEL to 0 and DEBUG_MODE of the MCP_CAN library to 0. This reduces the core memory usage of the VirtualBMS library to (currently) 8338 bytes ROM and 403 bytes RAM.

Documentation

Hardware requirements

  • Battery: you will need battery cells capable of producing enough voltage and current for the Twizy. You don't need to exactly match the original voltage and power range. The SEVCON G48 series can operate with input voltages from 19.3 to 69.6 V. The Twizy SEVCON is by default configured for a range of 39 to 65 V, but that can be modified (see SEVCON configuration). In standard configuration, the Twizy will draw up to ~330 A or 16 kW from the battery, and recuperate at up to ~70 A or 3.5 kW. If your battery cannot cope with this, you can either use the Virtual BMS to lower the limits or modify the SEVCON configuration.

    Pascal is using Nissan Leaf cells, which offer a very good combination of capacity, availability and price. Błażej is using cheap 120 Ah lead acid batteries (price ~400 Euro for a complete set). Klaus will use chinese prismatic cells adding up to ~12 kWh.

    Note: Klaus offers to organize a bulk order of high capacity prismatic 3.2V LiFePO4 cells in the range of 330€ down to 260€/kWh. For a high performance large capacity setup with 48V 240 Ah (double of the standard battery capacity) a total price only for the battery pack between 2800 and 3200€ seems possible. Each buyer would have the risk in case of failures and should add some spare cells. For details please contact Klaus at [email protected].

  • BMS: using a BMS is optional for lead acid batteries but strongly recommended for lithium based batteries. You may pick any BMS, but you should focus on those that can be connected to the Arduino to query the battery state. Our recommendation is picking a good BMS capable of early balancing, monitoring the coulomb (Ah) consumption and calculating the real SOC.

    Note: Pascal is developing a fully integrated BMS solution supporting various cell & chemistry configurations and containing the complete Twizy interface. The BMS should be available by the end of 2017. Pricing is expected to be around 350 Euro. Using this BMS will both simplify custom battery integration and reduce points of failure. You won't need an Arduino when using this BMS. For details please contact him at [email protected].

  • Arduino: to run the Twizy Virtual BMS you will need some Arduino and some MCP CAN interface. A wide range of hardware options is available. The code perfectly fits into an Arduino Nano leaving enough memory to implement quite complex custom logics. You should pick an MCP 2515 SPI CAN module with at least 16 MHz clock rate. IRQ connection is optional.

    Note: Michael offers to customize the Virtual BMS for individual applications and BMS integration. For details please contact him at [email protected].

  • Connection: see the part list for relais and connectors needed.

  • Battery case: you can use the original Twizy battery case, available as a replacement part from Renault (see part list).

    Note: Lutz Schäfer offers to build individual custom battery cases offering more space. For details please contact him at [email protected].

Compliance

As the Virtual BMS (as well as the OVMS and other Twizy tools) is based on re-engineering of the CAN protocol, a 100% compliance cannot be reached. There are still unknown fields and codes, look for question marks in the CAN object dictionary for details. Unknown parts may have an effect under special conditions that could not be produced during analysis.

Having said that, the BMS protocol emulation has successfully been tested and is actually being used in real Twizys, enabling the full standard operation using custom batteries.

If you encounter any kind of issue, please send us all details including a full CAN trace for analysis.

Projects using this library

Authors

This library has been created and is maintained by Michael Balzer ([email protected] / https://dexters-web.de/).

The CAN & hardware protocol decoding and reengineering has been done by a joint effort of (in reverse alphabetical order):

Special thanks to Klaus Zinser [email protected] for support and to Błażej Błaszczyk [email protected] for prototype implementation and testing!

Btw: we're all available for consulting, integration and customization jobs.

Donations

paypal

Donations to support our efforts and further development are very welcome.
Please send donations via Paypal to: [email protected]
Thanks! :-)

Donors will be honored in our Hall of Eternal Fame, please add a comment to your donation if you'd rather stay anonymous.

License

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110- 1301 USA

Have fun!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].