1
0
mirror of https://github.com/sjlongland/cluster-powerctl.git synced 2025-09-13 12:03:14 +10:00
Commit Graph

18 Commits

Author SHA1 Message Date
037f3a16d6
setpoints: Drop solar to 4V, battery to 12.75V
Reduce the solar threshold so that we're at the point where the SSR can
work properly.  i.e. we're at first light.

The battery can discharge for an hour or two at this point, which will
give it a break from the charger just before sunrise.  This may trigger
the other charge controller to charge the battery during the day.

Drop the battery voltage just a fraction so we are past the "knee" of
the discharge curve at 12.8V.
2018-10-01 10:08:46 +10:00
e87ea6a0b8
setpoints: Drop solar voltage threshold. 2018-09-27 08:48:01 +10:00
a7c86401e7
powerctl.c: Re-Add LED blinking
Before when blinking LEDs I just XORed a bit-mask, that turns out to be
unwise as they blinked out of phase which was just annoying, but it is
still useful to have that "flashing" state to draw your attention to a
problem or to indicate a state.

- We use a single 8-bit register to hold things like the blink phase
  (which is XORed each cycle), and whether we have checked the ADCs.
- Temperature LEDs blink when fan is in "kick-start" state.
- Battery voltage LED now has three states:
  - On: battery is above minimum voltage (good)
  - Off: battery is low
  - Blinking: battery is critical (bad)
- In "solar" mode, mains charger LED will blink if we are in the
  "waiting for low voltage timeout" sub-state.
2018-09-22 14:23:00 +10:00
d6f926fae9
powerctl.c, setpoints.h: Tweak the state machine.
- Re-introduce the "critically low" threshold which kick-starts the
  charger immediately (like the "low" threshold does now).
- Add a charging time so we consider the charger to be "charging" for
  `T_CHARGE_S` seconds, then check to see the battery has reached the
  float voltage.
- Delay starting the charger until the battery has been low for
  `T_LOW_S` seconds to prevent the charger flapping in and out.
- Re-work the state machines so charging and discharging uses the same
  timer.
2018-09-22 13:50:33 +10:00
d33c69e80d
setpoints.h: Fine tune setpoints.
- Drop the minimum voltage down a touch so we're not flapping the mains
  charger in unnecessarily.

- Halve the boost time so that the sun has a better chance of keeping
  the battery up.
2018-09-22 12:30:53 +10:00
7e9520db3a
setpoints: Tweak solar and battery thresholds.
Raise battery minimum voltage threshold to account for inaccuracy in the
ADC readings (which can be as much as 500mV).  Lower the solar threshold
so that it doesn't flap when clouds pass over.
2018-09-17 22:52:13 +10:00
03161f8d8e
powerctl: Re-work controller logic. 2018-09-17 22:51:00 +10:00
dd0f371b7c
setpoints: Tweak default set points.
- Thermal setpoint: the SOIC version of the microcontroller reads a
  little higher than the DIP version, so make it a little more
  forgiving.
- Delta voltage can be a more forgiving too.
2017-03-19 14:52:57 +10:00
87d76972df
setpoints: Define an increment step to provide hysteresis.
By incrementing the battery voltage on compare, we ensure we are seeing
a steadily increasing voltage.  If we're not seeing that, then we flag
the warning.
2017-03-19 12:54:25 +10:00
dec958e9ca
setpoints: Swap timeouts around.
Got high and low frequency swapped, whoopsie!
2017-03-19 11:14:36 +10:00
0e58231224
setpoints: Add warning timeout.
If the charge isn't rising, we should wait before acting on it in case
it is temporary in nature.

It was hoped that the charger delay should be enough, but it seems it
still can flap.  We reset the warning if we see an improvement, or let
the timer expire if we don't.
2017-03-19 10:57:39 +10:00
cdb3bb6349
setpoints: Re-name constants to reflect new units, tweak values. 2017-03-19 09:41:23 +10:00
a427edff38
setpoints: Rename constants for consistency 2017-03-12 15:47:22 +10:00
5c57cd27ae
setpoints: Cosmetics 2017-03-12 14:40:20 +10:00
82eaf94aef
setpoints: Re-adjust setpoint definitions.
- Define timeouts in milliseconds for portability
- Define voltages using symbols in design documentation
2017-03-12 14:33:15 +10:00
301c9a9d43
Lengthen some timeouts.
We seem to be a bit too impatient waiting for the mains charger to kick
in, and too hasty for the fan.
2016-11-05 17:04:45 +10:00
d29d15308b
Add shutdown delay on "high" threshold.
We should delay our shutdown in case the charger decides to ramp down
itself.  Otherwise we can get the situation where a smart charger starts
high, tripping the high threshold immediately, leading to the controller
and charger oscillating between on and off.
2016-11-05 17:04:05 +10:00
d91ec8d786
Move setpoint definitions to separate header.
This will get copied over to setpoints.h, where the developer can
customise them.  If they do so, and I have to change things, the
Makefile will warn them of this.
2016-09-04 06:57:36 +10:00