- Add data node ctrl/CtrlTarget_A for current-mode control
- Send out own value every 100 ms and apply received values
of CAN device with highest priority.
This state is enabled if the device receives a current target signal from
a device with higher priority via CAN. After not receiving the messages
for 1 second the state machine automatically goes back to normal operation.
The MPU must be disabled to allow writing the option bytes.
Also replacing flash_write_protection_set with direct register access
because it will be deprecated in Zephyr v2.6.
Reduce the recharge voltage threshold and consider it for transition
between trickle and bulk charging such that the trickle state is
maintained longer and batteries don't get recharged multiple times
per day.
This is also necessary for nanogrid interface control, which can try to
maintain a voltage between recharge and trickle voltage by exporting
excess solar energy towards the grid. If the battery voltage is maintained
at the trickle voltage, the solar input power might be reduced and not all
available power can be used.
If the device starts up with the battery voltage > bat_conf->voltage_recharge,
the charger state machine did not leave CHG_STATE_IDLE. However, the PWM solar
input still started charging the battery and stayed at bulk charging voltage
all the time.
Now we don't check the recharge limits if the CHG_STATE_IDLE was reached for
the first time, so that the state machine goes into CHG_STATE_BULK properly.
Also fixing some formatting and moving the state enum before Charger class.
Changed the sentence under 3. as suggested things don't seems to work. There seems to be no board to uncomment. But setting the default-envs variable to one of the board names, listed beneath without @x.x (did not try what happens if @0.7 is used)
The previous link http://libre.solar/docs/flashing was dead. https://learn.libre.solar/development/flashing_debugging.html might be the new location of the referenced documentation?
This makes clear that the timestamp is not the actual time, but the
seconds since the device started.
The timestamp is also not stored in NVM anymore, as the DayCount provides
information about the operating time of the device already. This way
it can be found out if there was a reset of the device based on its uptime.
- Increase PWM step size to see differences between each controller run
- Take ADC2 measurements (current sensors) synchronous to voltages
(previous approach with high-rate current measurement once per PWM
cycle only makes sense for cycle-by-cylce control, not for slow MPPT)
The controllers with fast ADC sampling speed were sometimes switched off
immediately after turn-on. Switching off at negative power flow is only an
additional safety measure. Normally the controller should switch off
reliably because of power_good_timestamp already.
Reason: We need to wait until the clock enable register is actually set before
we can consider the clock running. This caused an issue with the CRC
peripheral, which sometimes did not work correctly (always returned 0) right
after startup.
This commit switches to LL API, which includes a delay. Updating all occurences
of direct clock enabling via registers and not only the CRC peripheral.