Commit Graph
79 Commits
Author SHA1 Message Date
Martin Jäger b3aada7d4e Merge pull request #31 from hogthrob/master
Fixed NMC battery configuration calculation
2019-06-20 07:43:39 +02:00
Hogthrob f26fdce41f Fixed NMC battery configuration calculation
Now num_cell multiplier is used in all required places.
2019-06-20 07:26:39 +02:00
Martin Jaeger 690e204a16 Solar, bat and load power added to data objects 2019-06-18 17:04:33 +02:00
Martin Jaeger 375fcee514 New ThingSet features pub and auth included 2019-06-18 14:20:14 +02:00
Martin Jaeger ead6f2bffb Several small fixes for MPPT-2410-LC
- Battery temperature set to 25 degC if no external sensor connected
- EEPROM selection added to PCB config file
- UEXT power supply enable added to UEXT init functions

Firmware still gets stuck when OLED display is enabled... Error still to be found!
2019-06-16 15:50:01 +02:00
Martin Jaeger 96d26b5c34 Fixing stalled MCU if solar is connected before battery
(the change in dcdc.cpp fixes the failed unit-test in previous commit, which didn't find min/max functions)
2019-06-16 14:46:54 +02:00
Martin Jaeger 15d5f0ee71 DC/DC startup delay added to allow voltages to stabilize 2019-06-16 13:24:49 +02:00
Martin Jäger 4ee2353678 Merge pull request #29 from hoijui/patch-1
README: move setup before flashing & formatting
2019-06-13 15:06:45 +02:00
hoijui 4e70fc8917 README: move setup before flashing & formatting
Makes it a bit more newb-friendly, I think (being a newb).
2019-06-13 14:55:22 +02:00
Martin Jaeger 36cccfb63d DC/DC start duty cycle adjusted to reduce stress
Previously, the DC/DC started at 90% of the solar panel OCV to be closer to the MPP (at around 80% of OCV). This creates stress on the MOSFETs due to high inrush currents. In addtion to that, a high power panel might not be derated fast enough, which caused issues in the 12V/10A charge controller connected to a 280W panel. This commit improves the situation and starts the MPPT slightly below the measured solar voltage with low power.
2019-06-13 11:51:31 +02:00
Martin Jaeger 0e91c834ac Faster load short circuit protection via LPTIM
The PWM charge controllers don't have a fuse and need a reliable load short
circuit protection implemented in the microcontroller. The comparator
monitoring the load current now triggers LPTIM connected to the load
disable pin. This allows to switch off the load with a defined time delay
and glitch filter.

During tests, switching off the load in an ISR triggered by COMP2 did
not lead to reliable delays (especially in case of wake-up from sleep),
hence this alternative solution using LPTIM was implemented.

The load switch functions were moved from hardware.cpp to load.cpp.
2019-06-12 09:45:19 +02:00
Martin Jaeger f0301625d7 PCB names updated according to new type convention 2019-05-29 21:49:50 +02:00
Martin Jaeger d13d5263b0 10A MPPT v0.6 PCB definition updated 2019-05-29 21:23:32 +02:00
Martin Jaeger 5a264e9332 Load short circuit protection using analog COMP2
- Immediate load cut-off in case of current > 2x rated current (still to be fine-tuned)
- Using built-in comparator of STM32 MCU
- Currently only supported by PWM charge controller PCB, as it doesn't have an internal fuse
2019-05-27 16:41:30 +02:00
Martin Jaeger 977002b0e7 Sign for discharged Ah counter corrected 2019-05-27 11:21:35 +02:00
Martin Jaeger dec36143dd 12V/24V detection added and bat_charger restructured 2019-05-23 22:16:41 +02:00
Martin Jaeger b742fe6671 Energy calculation for PWM CC fixed
- Correct negative sign for incoming solar current
- Current multiplied with PWM duty cycle to get average current
- Min/max calculation moved to log.cpp
2019-05-15 11:06:49 +02:00
Martin Jaeger 05ccfb4c65 Missing log.cpp added 2019-05-08 08:58:37 +02:00
Martin Jaeger 7c75548193 DC bus type introduced and unit tests added 2019-05-07 18:56:04 +02:00
Martin Jaeger d9f7103e97 Starting test-driven development (TDD) with Unity
- Using PlatformIO's embedded unit testing with native environment
- mbed-dependent .cpp files escaped with #ifndef UNIT_TEST
- First tests for charger module added under test/ directory
2019-05-04 11:31:37 +02:00
Martin Jaeger 90666d697b Refactoring of files and function names
- Files for interfaces connected via UEXT are stored in separate uext/ directory
- UEXT init and process function names independent of connected module
- LED function names adjusted to start with leds_
- main.cpp structure simplified
2019-05-03 10:33:49 +02:00
Martin Jaeger ba9baf49c5 Fix error in EEPROM CRC calculation 2019-05-03 08:58:26 +02:00
Martin Jaeger 3fbb6df468 ThingSet version updated and data_objects.cpp adjusted 2019-05-02 10:33:02 +02:00
Martin Jaeger ff53f6ff99 New revisions of PWM and MPPT 10A boards included 2019-05-02 10:27:16 +02:00
Martin Jaeger 2ac2d1c3ad Basic processer-in-the-loop (PIL) test features added 2019-05-02 10:22:51 +02:00
Martin Jaeger 213ebf8c17 Improved load overcurrent and overvoltage diagnosis and protection 2019-04-28 17:29:57 +02:00
Martin Jaeger ca9997ec83 Temperature compensation for charging target voltage added 2019-04-19 15:43:47 +02:00
Martin Jaeger 879d86e59e Comments for correct battery settings in config.h template added 2019-04-18 12:28:18 +02:00
Martin Jaeger eaea5e1af2 Error in high-side (solar) current calculation corrected and logging of Bat and MCU max temperatures added 2019-04-18 12:26:00 +02:00
Martin Jaeger e05fd95e17 Current compensation for load switch thresholds added 2019-04-18 09:23:58 +02:00
Martin Jaeger 666ca02baf Min/max recordings added to serial pub message 2019-04-17 08:18:44 +02:00
Martin Jaeger 73a205f60f Battery and low-side current calculation corrected 2019-04-17 08:16:39 +02:00
Martin Jaeger f02688e6c0 EEPROM fix: Don't store data after start-up 2019-04-03 13:06:22 +02:00
Martin Jaeger 627797ed36 PWM synchronized solar current/voltage measurement implemented 2019-04-01 20:09:27 +02:00
Martin Jaeger 18f7e43999 Flashing instructions for STM32L072 updated 2019-03-31 18:17:48 +02:00
Martin Jaeger 5d78e18005 EmonCMS integration via WiFi updated 2019-03-31 18:14:57 +02:00
Martin Jaeger 4cf8172090 DCDC state info added and charger state naming updated 2019-03-31 13:41:03 +02:00
Martin Jaeger 368ade0a82 External temperature sensor detection added 2019-03-26 15:32:50 +01:00
Martin Jaeger e80e33606b DCDC enable data object (input type) added 2019-03-25 18:16:31 +01:00
Martin Jaeger bb2ab2a9d5 Initialization of some rec data objects improved 2019-03-25 17:50:34 +01:00
Martin Jaeger 3d36e3224c Upgrade to new mbed framework and PlatformIO build system 2019-03-20 11:56:41 +01:00
Martin Jaeger 9510c05932 Data objects + energy calculation updated
- Battery charge/discharge energy is now tracked in addition to solar input and load output energy
- Min/max values of several measurements are stored
- EEPROM data objects list updated
2019-03-19 21:40:59 +01:00
Martin Jaeger 67a9341f74 Doxygen comments added to load and power port files 2019-03-19 10:23:36 +01:00
Martin Jaeger e94fd88a5e Implemented maximum voltage check for DC/DC 2019-03-19 10:11:52 +01:00
Martin Jaeger 6c9ea2ee84 Doxygen location adjusted and mentioned in README.md 2019-03-11 10:44:29 +01:00
Martin Jaeger 50f4378a8d Doxygen settings for Travis CI adjusted 2019-03-10 18:58:03 +01:00
Martin Jaeger 8190e99825 Initial version of PWM charge controller part added 2019-03-10 18:43:00 +01:00
Martin Jaeger e4a20fba85 Battery config updated and started with Doxygen added 2019-03-10 18:34:05 +01:00
Martin Jaeger e9c45702c8 LED timer frequency reduced and charlieplexing fixed to remove flickering 2019-03-10 17:25:23 +01:00
Martin Jaeger 4e0b7f2a12 Restructuring of data types (structs) and files
- dcdc_port_t renamed to power_port_t for future use in PWM charge controllers
- structs.h split into battery.h, log.h and charger.h
- bat_charger.cpp/h split into battery.cpp/h and charger.cpp/h
2019-03-10 17:19:44 +01:00