Martin Jäger
3c0bc41164
Add ADC2 channel configuration for STM32G4 board
...
Some changes regarding DMA setup and data alignment were necessary to
store all values from ADC1 and ADC2 in the same adc_readings array.
2020-02-20 11:07:02 +01:00
Martin Jäger
d40dafd8d9
Rename V_SOLAR/BAT pins to more generic V_HIGH/LOW
2020-02-20 11:06:44 +01:00
Martin Jäger
8539fa3557
MPPT 2420 HPX: Add reset after flashing
2020-02-19 14:44:51 +01:00
Martin Jäger
0c20545f88
Differentiate between src and sink droop res again
...
Necessary for improved load disconnect switch behavior.
2020-02-19 14:34:40 +01:00
Martin Jaeger
6af8e6d93d
Improve load voltage limits setup and update
2020-02-19 14:34:40 +01:00
Martin Jaeger
cdb9183c11
Fix load overvoltage limit
...
The setting is now based on LoadOutput menber overvoltage and not
on the bus voltage bounds, which are used for charging setpoint.
2020-02-19 14:34:40 +01:00
Martin Jaeger
68e0336279
Add debounce counter for UV error detection
...
This prevents switching off the load output due to short undervoltage
events during startup of pumps etc. when the battery is at low SOC.
2020-02-19 14:34:40 +01:00
azeemshatp
b717dea6d1
Implement ADC 1 & 2 using low level APIs
...
ADC2 works for STM32G431RB processor using LL drivers.
Keep the changes in the MPPT 'boards' folder for possible future use with
zephyr drivers.
2020-02-19 14:33:49 +01:00
JordanSilverman
30968e471c
Check incoming battery conf
2020-02-17 19:47:51 +01:00
Martin Jaeger
08974169ab
Use new Zephyr 2.2 GPIO driver API features
...
Enable and disable pins are now handled the same using _set function
instead of _write and using ACTIVE_HIGH/LOW setting in dts.
2020-02-13 18:35:42 +01:00
Martin Jaeger
c4d4372953
Fix board files for Zephyr 2.2 compatibility
...
Warning: These changes break compatibility with previous v2.1.
2020-02-13 17:30:19 +01:00
azeemshatp
9b2162b12e
Fix ADC-DMA support for STM32G431
...
Added additional clock setting for DMA and enabled DMAMUX.
2020-02-12 11:12:55 +01:00
Martin Jaeger
14249492a3
Improve full charge detection and topping control
...
The battery is only full if the topping voltage is still reached AND the
current is below cut-off threshold at the same time. This was not always
detected correctly with previous 2s target voltage monitoring interval.
In addition to that, a new timer was introduced to count seconds at target
voltage and improve full charge detection due to timeout.
2020-02-10 12:47:32 +00:00
Martin Jaeger
5f1d76ef74
Dedicated setup.cpp to clean up main.cpp
...
Also includes update of timestamp calculation in Zephyr.
2020-02-08 11:08:58 +01:00
Martin Jaeger
7940acccf4
Zephyr: STM bootloader activation added
2020-02-07 17:36:19 +01:00
Martin Jaeger
5dda805dab
Zephyr: ThingSet reset function added
2020-02-07 17:24:07 +01:00
Martin Jaeger
43f90eea7c
Move voltage control parameters to DcBus class
...
The sink and source voltage boundaries for droop control and battery
charge voltage management are now part of the DcBus class.
Also added source and sink current margins, which will be used by the
DC/DC for control targets instead of port current limits, which were
difficult to synchronize before.
2020-02-07 12:03:25 +01:00
Martin Jaeger
a7d6dbc3b5
Let PWM switch class inherit from PowerPort
...
First step of unifying different ports connected to one bus. At a later
step, also the load and charger classes should inherit from PowerPort
class to make overall charge controller structure more clean.
2020-02-07 12:00:59 +01:00
Martin Jaeger
f0e99cd80f
Voltage replaced by DcBus ptr in PowerPort class
...
Preparation to separate current and voltage measurements and control
parameters into DcBus and PowerPort classes. This will help to
manage current from different sources (grid, solar) going towards
one bus and control the battery voltage. It will also help to align
multiple charge controllers in parallel, communicating via CAN bus.
2020-02-07 11:55:51 +01:00
Martin Jaeger
86bfce8a0c
Zephyr: Added solar voltage enable switch
2020-02-05 18:06:17 +01:00
Martin Jaeger
20fbefc19b
Zephyr: DAC using LL added for STM32L0 and STM32F0
2020-02-05 18:06:11 +01:00
Martin Jaeger
c31f8d5014
Fix PlatformIO debug error in ext.cpp
...
Without this dummy implementation of std::__throw_bad_alloc() the
linker was throwing errors.
2020-02-05 18:06:06 +01:00
Martin Jaeger
83d7c36778
Zephyr: MPPT 1210 HUS 0v7 board added
2020-02-05 18:05:55 +01:00
Martin Jaeger
3a8103457f
Add type-checking to data objects map
2020-01-31 14:50:32 +01:00
Martin Jaeger
1b6a7f82d7
Zephyr: CAN support added
...
So far, only publishing messages are supported (no RX yet).
Logging is switched on again, but with minimal output only (suitable
for small F0 MCUs). CAN is activated by default for MPPT 2420 LC.
2020-01-30 16:54:58 +01:00
Martin Jaeger
e078b87553
Zephyr: MPPT 2420 LC board added
2020-01-29 11:03:09 +01:00
Martin Jaeger
81c0764f2c
Fix DMA memory access violation (wrong length setting)
2020-01-28 15:28:46 +01:00
Martin Jaeger
8c3a6b7160
Zephyr: EEPROM for STM32L0 working
2020-01-28 14:23:47 +01:00
Martin Jaeger
eed8c9114c
Coding style updated/fixed
...
Indentations of class definitions and preprocessor statements were not
uniform throughout the code. This commit cleans up indentations as well
as the order of include statements.
Style conventions see: https://github.com/LibreSolar/coding-style
2020-01-28 13:20:01 +01:00
Martin Jaeger
c04081fc8a
Make Serial and OLED configurable via Kconfig
2020-01-28 12:13:54 +01:00
Martin Jaeger
05292c12ba
ADC & DMA renamed to DAQ (data acquisition)
2020-01-27 15:13:53 +01:00
Martin Jaeger
dc394cc198
DC/DC: HS MOSFET fail-safe protection enabled
2020-01-27 15:12:15 +01:00
Martin Jaeger
a457c2cc9b
Fix DC/DC startup condition check
2020-01-27 14:41:48 +01:00
Martin Jaeger
24f751b2e5
Initial support of MPPT 2420 HPX board
...
- Some flags changed to make the firmware compile for new STM32G431 MCU
- Zephyr board definition added
- Serial, OLED display and LED working
- ADC compiling, but not yet working
2020-01-23 14:41:44 +01:00
Martin Jaeger
d5ce578aeb
Zephyr: DMA setup via LL instead of registers
2020-01-23 09:51:58 +01:00
azeemshatp
64bd1930b0
Support continuous integration test in Windows.
...
The 'check.bat' file is introduced to support continuous integration test locally in windows environment. The batch file may be run from Windows command prompt.
2020-01-23 08:06:13 +01:00
azeemshatp
f830389c33
Implemented Thingset Serial functionality in Zephyr framework.
...
Implemented using UART driver APIs.
2020-01-23 08:06:13 +01:00
Martin Jaeger
41b4607cc7
Fix additional bug in load unit-test
2020-01-20 15:22:21 +01:00
Martin Jaeger
69747a588d
Fix initialization bug in load unit-test
2020-01-20 10:41:48 +01:00
Martin Jaeger
10f7d44bdf
Zephyr: Load output added
...
Overcurrent protection in PWM charge controller not yet working for Zephyr.
2020-01-18 16:30:37 +01:00
Martin Jaeger
d5ea6b5653
Zephyr: Custom DTS binding for GPIO switch
...
Previously, the LED binding was abused. DTS is now much cleaner.
2020-01-18 15:56:57 +01:00
Martin Jaeger
0c01c3d013
Fixed wrong initialization of static Wh counters
2020-01-16 20:21:08 +01:00
Martin Jaeger
a76b92c27b
time(NULL) replaced with uptime() in helper files
...
Reason: Zephyr does not support time(NULL). This way it is portable.
2020-01-16 20:04:37 +01:00
Martin Jaeger
632eb5a4f7
Zephyr: ADC HAL replaced with LL
2020-01-16 16:21:21 +01:00
Martin Jaeger
27bb53bbeb
Zephyr: ADC based on STM HAL working
2020-01-16 12:24:25 +01:00
Martin Jaeger
cb988639ce
Zephyr: Added PWM 2420 LUS board
2020-01-09 13:56:02 +01:00
Martin Jaeger
04f0d42970
Zephyr board names unified with mbed code
2020-01-07 09:38:10 +01:00
Martin Jaeger
90f4c9af00
ThingSet and OLED libs added as git submodules
2020-01-07 07:40:46 +01:00
Martin Jaeger
e1915ab501
Releases mentioned in README.md
2020-01-06 19:27:13 +01:00
Martin Jaeger
16ca793bb3
Port configuration based on Kconfig implemented
2020-01-06 19:16:44 +01:00