Update documentation (docs folder)
Outdated information removed and a new firmware structure overview added.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# Libre Solar Charge Controller Firmware
|
||||
|
||||
## Charge controller basic concepts
|
||||
|
||||
[charger-concepts.md](charger-concepts.md)
|
||||
|
||||
## Firmware module overview
|
||||
|
||||
[module-overview.md](module-overview.md)
|
||||
|
||||
## API documentation
|
||||
|
||||
The documentation auto-generated by Doxygen can be found [here](https://libre.solar/charge-controller-firmware/).
|
||||
|
||||
## Further information
|
||||
|
||||
[Zephyr Project documentation](https://docs.zephyrproject.org/latest/)
|
||||
|
||||
[Zephyr / West cheatsheet](zephyr-cheatsheet.md)
|
||||
@@ -0,0 +1,43 @@
|
||||
# Charge controller concepts
|
||||
|
||||
## Bus and port structure
|
||||
|
||||
In order to handle multiple different types of charge controllers, the power flow in the charge controller is abstracted using the two base components DC bus and Power Port:
|
||||
|
||||
- A **DC bus**, which is a connection of two or more electrical circuits such that the electric potential at each connection point can be considered equal. This can be achieved either by connecting each participant very close to each other or by using large copper cross-section such that voltage drop introduced by current flow is negligible. The voltage control targets of the bus can only be set by one of the connected ports.
|
||||
|
||||
- A **Power port**, which connects a DC bus with an internal or external device or sub-circuit. A port usually contains a current measurement. Its voltage is determined by the DC bus it is connected to. A port can also contain a switching element.
|
||||
|
||||
The following image gives an overview of the maximum set of features for a charge controller currently considered in the firmware. It contains two DC buses: High-voltage side (typically solar panel or wind turbine) and low-voltage side (typically determined by battery voltage). Most of the power ports are connected at the low voltage side (12V or 24V).
|
||||
|
||||

|
||||
|
||||
The image also shows the direction of positive current flow.
|
||||
|
||||
## Charger state machine
|
||||
|
||||
For general information about battery charging, please check out the [battery chapter at learn.libre.solar](https://learn.libre.solar/system/battery.html#charge-methods).
|
||||
|
||||
The charger module in the firmware has the following states:
|
||||
|
||||
### 0. Standby
|
||||
|
||||
Initial state of the charge controller. If the solar voltage is high enough and the battery is not full, charging in CC mode is started.
|
||||
|
||||
### 1. Bulk stage
|
||||
|
||||
This first charging stage adds about 70 percent of the stored energy. The battery is charged with a constant current (CC), typically the maximum current the charger can supply. In case of a solar charge controller, this is where the Maximum Power Point Tracking (MPPT) takes place. As a result, the terminal voltage increases until the peak charge voltage limit is reached and topping phase is entered.
|
||||
|
||||
### 2. Topping stage
|
||||
|
||||
During the topping (sometimes also called boost or absorption) the remaining 30 percent of the energy is continued being charged at a constant voltage (CV) while gradually decreasing the charge current until the battery is fully charged.
|
||||
|
||||
### 3. Equalization stage
|
||||
|
||||
An additional equalization charging is beneficial for flooded lead-acid batteries only. It can be considered as a periodic controlled overcharge that brings the cells to the same charge level and removes the sulphation by increasing the voltage to a higher value than the peak charge voltage limit. The current during equlization is controlled at a very low value.
|
||||
|
||||
### 4. Trickle stage
|
||||
|
||||
The trickle or float charging stage is the final phase upon the completion of the absorption or equalization phase which maintains the battery at full charge. During this stage, the charge voltage is reduced and held constant. The current reduces to a very low value.
|
||||
|
||||

|
||||
@@ -1,20 +0,0 @@
|
||||
# Charger state machine
|
||||
|
||||
The charge management has the following states:
|
||||
|
||||
### Standby
|
||||
Initial state of the charge controller. If the solar voltage is high enough and the battery is not full, charging in CC mode is started.
|
||||
|
||||
### CC / bulk charging
|
||||
The battery is charged with maximum possible current (MPPT algorithm is active) until the CV voltage limit is reached.
|
||||
|
||||
### CV / absorption charging
|
||||
Lead-acid batteries are charged for some time using a slightly higher charge voltage. After a current cutoff limit or a time limit is reached, the charger goes into trickle or equalization mode for lead-acid batteries or back into Standby for Li-ion batteries.
|
||||
|
||||
### Trickle charging
|
||||
This mode is kept forever for a lead-acid battery and keeps the battery at full state of charge. If too much power is drawn from the battery, the charger switches back into CC / bulk charging mode.
|
||||
|
||||
### Equalization charging
|
||||
This mode is only used for lead-acid batteries after several deep-discharge cycles or a very long period of time with no equalization. Voltage is increased to 15V or above, so care must be taken for the other system components attached to the battery. (currently, no equalization charging is enabled in the software)
|
||||
|
||||

|
||||
@@ -1,29 +0,0 @@
|
||||
# MPPT charger firmware structure
|
||||
|
||||
## Important remarks
|
||||
|
||||
- Do **not** use mbed Ticker class, as it disturbs the timer settings and might cause the charge controller to crash. In addition to that, it contains a lot of overhead and is not very efficient. Timers are programmed bare metal.
|
||||
|
||||
- The PWM signal generation for the DC/DC controller inside the charge controller is done in the file half_bridge_xxx.cpp and dcdc.cpp. Most of the dangerous functions which could turn your MOSFETs into magic smoke are implemented here, so don't touch it unless you know what you're doing.
|
||||
|
||||
## Toolchain and flashing instructions
|
||||
|
||||
See the Libre Solar website for a detailed instruction how to [develop software](http://libre.solar/docs/toolchain) and [flash new firmware](http://libre.solar/docs/flashing).
|
||||
|
||||
|
||||
## Timer configuration
|
||||
- mbed us_ticker (cannot be changed)
|
||||
- TIM2 for STM32F0
|
||||
- TIM21 for STM32L0
|
||||
- PWM generation for DC/DC half bridge (50-70 kHz)
|
||||
- TIM1 for STM32F0 (advanced timer)
|
||||
- TIM3 for STM32L0 (standard timer)
|
||||
- ADC and DMA (1 kHz)
|
||||
- TIM15 for STM32F0
|
||||
- TIM6 for STM32L0
|
||||
- DC/DC control function (10 Hz)
|
||||
- TIM16 for STM32F0
|
||||
- TIM7 for STM32L0
|
||||
- LED light control
|
||||
- TIM17 for STM32F0
|
||||
- TIM22 for STM32L0
|
||||
@@ -0,0 +1,582 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="600"
|
||||
height="170"
|
||||
viewBox="0 0 158.75 44.97918"
|
||||
version="1.1"
|
||||
id="svg5625"
|
||||
inkscape:version="0.92.4 5da689c313, 2019-01-14"
|
||||
sodipodi:docname="charge-controller-structure.svg"
|
||||
inkscape:export-filename="/home/martin/test.png"
|
||||
inkscape:export-xdpi="200.1694"
|
||||
inkscape:export-ydpi="200.1694"
|
||||
style="enable-background:new">
|
||||
<defs
|
||||
id="defs5619">
|
||||
<marker
|
||||
inkscape:stockid="DotS"
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="DotS"
|
||||
style="overflow:visible"
|
||||
inkscape:isstock="true">
|
||||
<path
|
||||
id="path16850"
|
||||
d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(0.2,0,0,0.2,1.48,0.2)"
|
||||
inkscape:connector-curvature="0" />
|
||||
</marker>
|
||||
<marker
|
||||
inkscape:stockid="DotM"
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="DotM"
|
||||
style="overflow:visible"
|
||||
inkscape:isstock="true">
|
||||
<path
|
||||
id="path16847"
|
||||
d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(0.4,0,0,0.4,2.96,0.4)"
|
||||
inkscape:connector-curvature="0" />
|
||||
</marker>
|
||||
<marker
|
||||
inkscape:stockid="DotM"
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker7066-2"
|
||||
style="overflow:visible"
|
||||
inkscape:isstock="true">
|
||||
<path
|
||||
id="path7064-7"
|
||||
d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(0.4,0,0,0.4,2.96,0.4)"
|
||||
inkscape:connector-curvature="0" />
|
||||
</marker>
|
||||
<marker
|
||||
inkscape:stockid="DotM"
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker7066-2-9"
|
||||
style="overflow:visible"
|
||||
inkscape:isstock="true">
|
||||
<path
|
||||
id="path7064-7-1"
|
||||
d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(0.4,0,0,0.4,2.96,0.4)"
|
||||
inkscape:connector-curvature="0" />
|
||||
</marker>
|
||||
<marker
|
||||
inkscape:stockid="DotM"
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker7066-2-7"
|
||||
style="overflow:visible"
|
||||
inkscape:isstock="true">
|
||||
<path
|
||||
id="path7064-7-0"
|
||||
d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(0.4,0,0,0.4,2.96,0.4)"
|
||||
inkscape:connector-curvature="0" />
|
||||
</marker>
|
||||
<marker
|
||||
inkscape:stockid="DotM"
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker7066-2-3"
|
||||
style="overflow:visible"
|
||||
inkscape:isstock="true">
|
||||
<path
|
||||
id="path7064-7-6"
|
||||
d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(0.4,0,0,0.4,2.96,0.4)"
|
||||
inkscape:connector-curvature="0" />
|
||||
</marker>
|
||||
<marker
|
||||
inkscape:stockid="DotM"
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker7066-2-7-6"
|
||||
style="overflow:visible"
|
||||
inkscape:isstock="true">
|
||||
<path
|
||||
id="path7064-7-0-2"
|
||||
d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(0.4,0,0,0.4,2.96,0.4)"
|
||||
inkscape:connector-curvature="0" />
|
||||
</marker>
|
||||
<marker
|
||||
inkscape:stockid="DotM"
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker7066-2-7-6-1"
|
||||
style="overflow:visible"
|
||||
inkscape:isstock="true">
|
||||
<path
|
||||
id="path7064-7-0-2-8"
|
||||
d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(0.4,0,0,0.4,2.96,0.4)"
|
||||
inkscape:connector-curvature="0" />
|
||||
</marker>
|
||||
<marker
|
||||
inkscape:stockid="DotM"
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker7066-2-7-9"
|
||||
style="overflow:visible"
|
||||
inkscape:isstock="true">
|
||||
<path
|
||||
id="path7064-7-0-20"
|
||||
d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(0.4,0,0,0.4,2.96,0.4)"
|
||||
inkscape:connector-curvature="0" />
|
||||
</marker>
|
||||
<marker
|
||||
inkscape:stockid="DotM"
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker7066-2-7-9-9"
|
||||
style="overflow:visible"
|
||||
inkscape:isstock="true">
|
||||
<path
|
||||
id="path7064-7-0-20-2"
|
||||
d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(0.4,0,0,0.4,2.96,0.4)"
|
||||
inkscape:connector-curvature="0" />
|
||||
</marker>
|
||||
<marker
|
||||
inkscape:stockid="DotM"
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker7066-2-7-9-9-3"
|
||||
style="overflow:visible"
|
||||
inkscape:isstock="true">
|
||||
<path
|
||||
id="path7064-7-0-20-2-6"
|
||||
d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(0.4,0,0,0.4,2.96,0.4)"
|
||||
inkscape:connector-curvature="0" />
|
||||
</marker>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="1"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="2.0000001"
|
||||
inkscape:cx="290.19529"
|
||||
inkscape:cy="110.23898"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="true"
|
||||
showguides="false"
|
||||
inkscape:snap-grids="true"
|
||||
inkscape:snap-to-guides="true"
|
||||
inkscape:window-width="1916"
|
||||
inkscape:window-height="1156"
|
||||
inkscape:window-x="1920"
|
||||
inkscape:window-y="20"
|
||||
inkscape:window-maximized="0"
|
||||
units="px"
|
||||
scale-x="2">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid6225"
|
||||
spacingx="2.6458333"
|
||||
spacingy="2.6458333"
|
||||
dotted="false" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata5622">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>Martin Jäger</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer2"
|
||||
inkscape:label="Ebene 2"
|
||||
style="display:inline"
|
||||
transform="translate(0,-261.70842)" />
|
||||
<g
|
||||
inkscape:label="Ebene 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-261.70842)">
|
||||
<rect
|
||||
style="display:inline;fill:none;fill-opacity:1;stroke:#6b6b6b;stroke-width:0.26458335;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;enable-background:new"
|
||||
id="rect6825"
|
||||
width="113.77083"
|
||||
height="26.458336"
|
||||
x="29.104166"
|
||||
y="269.6459"
|
||||
ry="0.076052353" />
|
||||
<rect
|
||||
style="display:inline;fill:none;fill-opacity:1;stroke:#005e85;stroke-width:0.26458332;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;enable-background:new"
|
||||
id="rect6825-9-8-36-1"
|
||||
width="50.270832"
|
||||
height="5.2916832"
|
||||
x="87.3125"
|
||||
y="280.22925"
|
||||
ry="0.01521052" />
|
||||
<path
|
||||
style="display:inline;fill:none;stroke:#000000;stroke-width:0.26458332;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker7066-2);enable-background:new"
|
||||
d="M 68.79166,282.87508 H 58.208333"
|
||||
id="path6950-0"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<rect
|
||||
style="display:inline;fill:none;fill-opacity:1;stroke:#005e85;stroke-width:0.26458332;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;enable-background:new"
|
||||
id="rect6825-9-8-36-1-2"
|
||||
width="26.458338"
|
||||
height="5.2916832"
|
||||
x="34.395832"
|
||||
y="280.22925"
|
||||
ry="0.01521052" />
|
||||
<path
|
||||
style="display:inline;fill:none;stroke:#000000;stroke-width:0.26458332;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker7066-2-9);enable-background:new"
|
||||
d="m 79.375001,282.87509 h 10.58333"
|
||||
id="path6950-0-2"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="display:inline;fill:none;stroke:#000000;stroke-width:0.26458332;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker7066-2-7-6);enable-background:new"
|
||||
d="m 39.687503,298.75008 -10e-7,-15.875"
|
||||
id="path6950-0-9-6"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="display:inline;fill:none;stroke:#000000;stroke-width:0.26458332;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker7066-2-7);enable-background:new"
|
||||
d="m 52.916666,290.8126 -10e-7,-7.9375"
|
||||
id="path6950-0-9"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.26458332;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 52.916669,290.8126 1.5875,2.11666"
|
||||
id="path2655"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 52.916669,293.45843 v 5.29166"
|
||||
id="path2657"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="display:inline;fill:none;stroke:#000000;stroke-width:0.26458332;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker7066-2-7-6-1);enable-background:new"
|
||||
d="m 95.249999,298.75008 v -15.875"
|
||||
id="path6950-0-9-6-7"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="display:inline;fill:none;stroke:#000000;stroke-width:0.26458332;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker7066-2-7-9);enable-background:new"
|
||||
d="m 105.83333,290.8126 v -7.9375"
|
||||
id="path6950-0-9-3"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.26458332;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 105.83333,290.8126 1.5875,2.11666"
|
||||
id="path2655-7"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 105.83333,293.45843 v 5.29166"
|
||||
id="path2657-5"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="display:inline;fill:none;stroke:#000000;stroke-width:0.26458332;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker7066-2-7-9-9);enable-background:new"
|
||||
d="m 119.0625,290.8126 v -7.9375"
|
||||
id="path6950-0-9-3-8"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.26458332;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 119.0625,290.8126 1.5875,2.11666"
|
||||
id="path2655-7-9"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 119.0625,293.45843 v 5.29166"
|
||||
id="path2657-5-7"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="display:inline;fill:none;stroke:#000000;stroke-width:0.26458332;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker7066-2-7-9-9-3);enable-background:new"
|
||||
d="m 132.29166,290.8126 v -7.9375"
|
||||
id="path6950-0-9-3-8-2"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.26458332;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 132.29166,290.8126 1.5875,2.11666"
|
||||
id="path2655-7-9-9"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 132.29166,293.45843 v 5.29166"
|
||||
id="path2657-5-7-3"
|
||||
inkscape:connector-curvature="0" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#005e85;fill-opacity:1;stroke:none;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
x="41.576717"
|
||||
y="278.35446"
|
||||
id="text3483"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3481"
|
||||
x="41.576717"
|
||||
y="278.35446"
|
||||
style="fill:#005e85;fill-opacity:1;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none">hv_bus</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#005e85;fill-opacity:1;stroke:none;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
x="108.93037"
|
||||
y="278.27698"
|
||||
id="text3487"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3485"
|
||||
x="108.93037"
|
||||
y="278.27698"
|
||||
style="fill:#005e85;fill-opacity:1;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none">lv_bus</tspan></text>
|
||||
<g
|
||||
id="g3517"
|
||||
transform="matrix(1.3333333,0,0,1.3333336,12.347285,-124.27817)"
|
||||
style="stroke-width:0.74999994">
|
||||
<rect
|
||||
ry="0.022815673"
|
||||
y="301.39612"
|
||||
x="42.333282"
|
||||
height="7.9374866"
|
||||
width="7.9375014"
|
||||
id="rect6825-9-8-1"
|
||||
style="display:inline;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.19843747;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;enable-background:new" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path7008"
|
||||
d="m 42.33328,309.33361 7.9375,-7.9375 v 0 0 0"
|
||||
style="display:inline;fill:none;stroke:#000000;stroke-width:0.19843747px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;enable-background:new" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.29765621;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 43.920782,303.77737 h 1.984375"
|
||||
id="path7786"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.29765621;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 43.920782,302.58674 h 1.984375"
|
||||
id="path7788"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.29765621;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;enable-background:new"
|
||||
d="m 46.698908,308.14294 h 1.984375"
|
||||
id="path7786-1"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.29765621;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;enable-background:new"
|
||||
d="m 46.698908,306.95231 h 1.984375"
|
||||
id="path7788-9"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||
x="93.662498"
|
||||
y="304.04181"
|
||||
id="text8274"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan8272"
|
||||
x="93.662498"
|
||||
y="304.04181"
|
||||
style="stroke-width:0.26458332">lv</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||
x="101.59998"
|
||||
y="304.04181"
|
||||
id="text8278"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan8276"
|
||||
x="101.59998"
|
||||
y="304.04181"
|
||||
style="stroke-width:0.26458332">load</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||
x="114.30003"
|
||||
y="304.04181"
|
||||
id="text8282"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan8280"
|
||||
x="114.30003"
|
||||
y="304.04181"
|
||||
style="stroke-width:0.26458332">pwm</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||
x="129.1167"
|
||||
y="304.04181"
|
||||
id="text8286"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan8284"
|
||||
x="129.1167"
|
||||
y="304.04181"
|
||||
style="stroke-width:0.26458332">usb</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||
x="47.095833"
|
||||
y="304.04181"
|
||||
id="text8290"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan8288"
|
||||
x="47.095833"
|
||||
y="304.04181"
|
||||
style="stroke-width:0.26458332">dump</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||
x="38.099998"
|
||||
y="304.04181"
|
||||
id="text8294"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan8292"
|
||||
x="38.099998"
|
||||
y="304.04181"
|
||||
style="stroke-width:0.26458332">hv</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||
x="69.453125"
|
||||
y="275.73135"
|
||||
id="text8298"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan8296"
|
||||
x="69.453125"
|
||||
y="275.73135"
|
||||
style="stroke-width:0.26458332">dcdc</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||
x="8.9222355"
|
||||
y="303.98309"
|
||||
id="text8548"><tspan
|
||||
sodipodi:role="line"
|
||||
x="8.9222355"
|
||||
y="303.98309"
|
||||
style="stroke-width:0.26458332"
|
||||
id="tspan8550">Power Ports:</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;display:inline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332;enable-background:new"
|
||||
x="29.10416"
|
||||
y="268.05841"
|
||||
id="text1902"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan1900"
|
||||
x="29.10416"
|
||||
y="268.05841"
|
||||
style="stroke-width:0.26458332">Charge Controller</tspan></text>
|
||||
<path
|
||||
style="display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;enable-background:new"
|
||||
d="m 63.499999,282.87509 1.058323,0.66147 2.4e-5,-1.32291 z"
|
||||
id="path1050-1"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;enable-background:new"
|
||||
d="m 84.666666,282.87509 -1.058323,-0.66147 -2.4e-5,1.32291 z"
|
||||
id="path1050-1-3"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;enable-background:new"
|
||||
d="m 39.687499,288.16675 0.66147,-1.05832 -1.32291,-2e-5 z"
|
||||
id="path1050-1-6"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;enable-background:new"
|
||||
d="m 52.916669,288.16675 0.66147,-1.05832 -1.32291,-2e-5 z"
|
||||
id="path1050-1-6-1"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;enable-background:new"
|
||||
d="m 95.249999,288.16675 0.661475,-1.05832 -1.322915,-2e-5 z"
|
||||
id="path1050-1-6-1-0"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;enable-background:new"
|
||||
d="m 105.83333,288.16675 0.66147,-1.05832 -1.32291,-2e-5 z"
|
||||
id="path1050-1-6-1-0-6"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;enable-background:new"
|
||||
d="m 119.0625,288.16675 0.66147,-1.05832 -1.32291,-2e-5 z"
|
||||
id="path1050-1-6-1-0-6-3"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;enable-background:new"
|
||||
d="m 132.29167,288.16675 0.66147,-1.05832 -1.32291,-2e-5 z"
|
||||
id="path1050-1-6-1-0-6-2"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
@@ -0,0 +1,81 @@
|
||||
# Firmware modules
|
||||
|
||||
## Data Acquisition
|
||||
|
||||
Files: daq*.h/cpp
|
||||
|
||||
Handles current and voltage measurement through the ADC with direct memory access (DMA). As a reference for current measurement, a digital-analog-converter (DAC) is used and also configured in this module.
|
||||
|
||||
The measurements are filtered and afterwards stored in the different sub-component objects.
|
||||
|
||||
## DC/DC converter
|
||||
|
||||
Files: dcdc.h/cpp
|
||||
|
||||
High-level functions to control the DC/DC converter. This module does not directly access any hardware. The PWM signal for the half bridge is generated in a separate module (see below).
|
||||
|
||||
## Data Objects for ThingSet protocol
|
||||
|
||||
Files: data_objects.h/cpp
|
||||
|
||||
The charge controller uses the [ThingSet protocol](https://thingset.github.io/) for communication with external devices. Internal data that should be exposed via the protocol is defined in the Data Objects module.
|
||||
|
||||
## Device status
|
||||
|
||||
Files: device_status.h/cpp
|
||||
|
||||
Stores global error flags and system-level measurements that are not specific to one sub-component.
|
||||
|
||||
## EEPROM
|
||||
|
||||
Files: eeprom.h/cpp
|
||||
|
||||
Stores data in ThingSet protocol format in the internal or external EEPROM (depending on the board).
|
||||
|
||||
## Half bridge
|
||||
|
||||
Files: half_bridge.h/cpp
|
||||
|
||||
Generates the synchronous PWM signal for the half bridge in the DC/DC converter. Depending on the MCU, either the advanced timer TIM1 or the basic timer TIM3 is used.
|
||||
|
||||
## LEDs
|
||||
|
||||
Files: leds.h/cpp
|
||||
|
||||
Provides higher-level access to different LEDs (e.g. blinking and flickering). Internally, charlieplexing is used to optimize power consumption and needed pin numbers.
|
||||
|
||||
## Load Output
|
||||
|
||||
Files: load*.h/cpp
|
||||
|
||||
Load output and USB charging output functions. Hardware-access is defined in load_drv.cpp file.
|
||||
|
||||
## Power Port and DC bus
|
||||
|
||||
Files: power_port.h/cpp
|
||||
|
||||
Contains DcBus and PowerPort classes. See [charger concepts](charger-concepts.md) for further details.
|
||||
|
||||
## PWM Switch
|
||||
|
||||
Files: pwm_switch.h/cpp
|
||||
|
||||
Only used for PWM solar charge controllers. This module is currently not yet separated into hardware-level and high-level functions.
|
||||
|
||||
## Timer configuration in mbed firmware
|
||||
|
||||
- mbed us_ticker (cannot be changed)
|
||||
- TIM2 for STM32F0
|
||||
- TIM21 for STM32L0
|
||||
- PWM generation for DC/DC half bridge (50-70 kHz)
|
||||
- TIM1 for STM32F0 (advanced timer)
|
||||
- TIM3 for STM32L0 (standard timer)
|
||||
- ADC and DMA (1 kHz)
|
||||
- TIM15 for STM32F0
|
||||
- TIM6 for STM32L0
|
||||
- DC/DC control function (10 Hz)
|
||||
- TIM16 for STM32F0
|
||||
- TIM7 for STM32L0
|
||||
- LED light control
|
||||
- TIM17 for STM32F0
|
||||
- TIM22 for STM32L0
|
||||
@@ -0,0 +1,20 @@
|
||||
# Zephyr cheat sheet
|
||||
|
||||
## West commands
|
||||
|
||||
Initial board selection
|
||||
|
||||
west build -b <board-name>
|
||||
|
||||
Flash with specific debug probe (runner), e.g. J-Link
|
||||
|
||||
west flash -r jlink
|
||||
|
||||
Report of used memory (RAM and flash)
|
||||
|
||||
west build -t rom_report
|
||||
west build -t ram_report
|
||||
|
||||
User configuration using menuconfig
|
||||
|
||||
west build -t menuconfig
|
||||
Reference in New Issue
Block a user