Almabraxas/3B/power-management-strategy

< Almabraxas‎ | 3B


The rules of the game

How do you manage power on a battery-less, solar-powered autonomous (ro-)boat ?

The first point is that there is no battery in the Almabraxas roboats. If there is enough sun, they move. If there isn’t, they don’t. There are several reasons for that:

  • If we want to cross an Ocean, with a 200W solar panel boat, we "embark" for a several months journey, with potentially hundreds or even thousands of charge-discharge cycles. Even though batteries have made significant progress in term of durability and number of charge-discharge cycles, I didn’t want to bet too much on it.
  • By eliminating the battery, I felt I eliminated a possible point of failure (however, this point is amenable to discussion, see below).
  • By putting the electricity into a battery, and then taking it out of the battery for propulsion, we lose 10-15% of energy in the process.
  • I just wanted to try that way. I like the idea of a robot that has to sleep at night.

The power source

There are many good references on photovoltaic panels, so we'll only repeat here what's used in the next discussion.

A photovoltaic solar panel is essentially a current constant device, this is part of the photovoltaic effect, thus a typical I-V curve (current depending upon voltage) for a PV panel is like Fig 1, the red plain line.

If we short-circuit the solar panel, the current si the one on the left, usually called Isc (short-circuit I), and the voltage is 0 by definition. If we put a load between the rails of the solar panel with increasing reactance, the voltage increases, but the current doesn't vary much, thus the delivered power increases (same current with increasing voltage), up to a point where the solar panel can't keep up, and the current drops steeply. The corresponding power is like on the figure 2, thus there's a maximum power point.

Thus, to get the maximum juice from the solar panel, with have to maintain the power consumption around this maximum, a function called MPPT, for Maximum Power Point Tracking.

The maximum power point varies with illumination (see Figure 3), but the voltage not that much, and it's actually possible to build a not-so-bad MPPT just by tracking the corresponding voltage, although Almbraxas 3 uses a perturb-and-observe algorithm.

The net result is this: if we track the MPPT, and that the corresponding voltage is very low, we conclude that the illumination is so low that it cannot provide a significant amount of power.

It should be noted that this is not true of temperature: the available power decreases when the panel temperature increases, so we have to select a threshold that is low enough so that there's absolutely no chance the panel can provide any significant amount of energy when the voltage is below that threshold.

In our case, be it with the 25W panel or the 100W one, the maximum power at 25° C is 17.6V. I consider that at 12V (maximum power point of course), there isn't enough power for propulsion.

At the other end of the scale, with infinite resistance (open circuit), there is no current thus no power, and the voltage is maximum, a value usually called Voc (voltage open circuit). In the case of our panels, this is around 21V, thus the panel will provide a voltage with any value between 0 and 21V, depending on the illumination and the (tentatively) drawn power.

MPPT

We get more juice from our solar panels by using an MPPT algorithm, that is basically that we adjust the power drained from the solar panel to the available power.

In a typical home photovoltaic installation, you get an MPPT module that will do this kind of processing, by delivering the requested power on one hand, and storing the excess energy in a battery.

However, in the case of the Almabraxas boat, there’s no battery, by design. Thus, the system has to adapt the drawn power to the available power at any time, actually 1 hundreds times a second (100 Hz) in the case of Almabraxas.


There are two power consumers on board: the computer board together with its various sensors and telecommunication modules (called the ABOC, Almabraxas Boat On-board Computer) and the thrusters. The ABOC doesn’t draw much power, around 5W, and we have little control over its consumption if we want to keep it running. Thus, the power consumption control is made by adjusting the power requested by the thrusters. This control is performed by the ABOC itself in a task called the power manager.

Of course, to run the power manager task, the ABOC needs itself to be up and running. At its heart is an MCU (the STM32F4 in our case). The MCU needs a comfortable 4.5-5V voltage supply. Of course, the voltage supply by the solar panel is not only above 5 V, but varying, so there is a voltage regulator (a switching one in our case), between the raw power and the ABOC. This regulator requires a bit more than 5V, so we have to feed ABOC with more than 5V. The regulator (a RECOM R78) datasheet indicates that it needs at least 6.5V, experience shows that it performs well until close to 5V.

However the MCU is not the only module on the ABOC, there are also a GPS module that seems to be a bit more demanding, not counting the satellite modem which is a power hungry beast.

Also, it should be noted that the ABOC is not a buck boost converter. If the solar panel can't provide 6V, it can provide almost no power, and there's no point in trying to boost the voltage in these conditions.

UVLO

The solar panel provided voltage may very well be below 5 or 6V, depending on the illumination. What if the voltage is so low that the ABOC can't run properly, or worse, if the voltage oscillates around the 5-6V value ?

We will fall into a condition known as brown-in, where the value of the voltage is just above the voltage necessary for the MCU to power up, but the power up action draw some power lowering the voltage, the MCU finally can't start, and the voltage oscillates for some time around this value.

This can have a lot of detrimental effects, to the point of erasing the flash memory of the MCU for example (I witnessed that first hand).

To avoid that, we need a circuitry that will cleanly cut power if it's below some threshold, a threshold well above the voltage necessary for the MCU to run. This device is called an UVLO (UnderVoltage Lock Out). Of course, this can't be performed by the MCU, since this is at a point where it can't run properly.

In our case, we cut the power below 7V, which is well above the MCU running point, but low enough so that we don't have any power available for propulsion, thus we don't "waste" power by powering down the system while we would have enough power to go on.

The voltage in the case where we draw, say, a constant 5W won't drop in a matter of microseconds from 7V to 5.5V (where the system would still run), because the available power is really the illumination, and even if you throw a sheet of cardboard on the solar panel, the drop won't be absolutely instantaneous, and even a few milliseconds are enough for the MCU to cleanly shutdown.

Need for a reserve (supercapacitor)

However this isn't the end of the story. We cut the power below 7V, so we know the MCU is working properly when we shut it down, at also as enough power (for a few microseconds at least) to power up.

But there are subsystems in the boat that are slow to start, in particular the ESCs need 7s to start. So if we're around 7V, there is a risk the system is always starting, waiting the ESC to initialize, then we run out of power, it stops (cleanly, thanks to the UVLO), then starts again, but not long enough for the ESCs to initialize, and so on.

This is particularly true if, say, a cloud pass in front of the sun to the point we don't have 7V for a few seconds. If there's a temporary lack of light, we would prefer the ABOC to hold on as long as possible, so we don't have to reinitialize anything.

To achieve this, we need a power reserve to hold at least for a few dozens of seconds, should the sun fails us.

But wait, didn't we say that we didn't want any battery from the start ?

Yes, we did, but we've to be a bit more pragmatic here, meaning adding a small reserve so we can hold on for a few seconds to a few minutes in that kind of situation.

The reserve is provided by a bank of supercapacitors. In our case, there are 9 100F 2,7V capacitors in series, for a total of around 10F for 24V.

However, by introducing the supercapacitor bank, we introduce two new problems that we examine now.

  • the capacitors need some time to charge, so we can no longer starts at 7V and hope that if the illumination fails us, we'll have some time, because the capacitors react much more quickly that the geometric process of covering the solar panel or the sun being clouded.
  • the supercapacitors will disturb the MPPT algorithm in a way described below, so we've to protect against that.

Starting only when enough power is available

The supercapacitors take some time to charge, depending on the voltage and the charge that may already be present. If we power up at 7V, while the charge of the supercapacitors is significantly lower, they'll actually drag the power down by absorbing available energy, so we have to give them some "room", actually some time and voltage to charge above 7V.

As stated above, the thrusters are started above 12V, so if the computer starts from a complete shutdown, actually there is no point in starting before 12V. On the other way, when the power is going down and not enough power is available to run the thruster, we try to hold on until 7V, to avoid the computer power up time penalty.

The startup / shutdown voltage depends on the direction of the voltage variation, that is, with have some hysteresis. This is provided by a Schmitt trigger. The Schmitt trigger is built with some op-amps (AS358). They are working at 3V, well below a voltage that could start the computer.

Difficulty with a simple op-amp Schmitt trigger

A difficulty in building a power control circuitry is that it is powered by the voltage it is supposed to monitor, so this must be done carefully. While in theory, it should be possible to build the Schmitt trigger with a single op amp, in practice it proved very difficult to achieve, with a tendency of the voltage to lock-in around the threshold voltage instead of cleanly switching between 0 and full voltage. So I opted for a 2-stages device: two voltage comparators (also built with op amps) compare the input voltage to the 7 and 12V thresholds and provide a "logical" signal (0 or full voltage) of the comparison. These signals are then combined by a resistor adder and fed to the input of the Schmitt trigger. By conditioning the input signal that way, we separate the calculation of the Schmitt trigger's resistor values, and the voltage comparator values, which is much more robust and more flexible if we want to change the thresholds.

The voltage reference is provided by a 3.3V Zener diode.

Not disturbing the MPPT with the capacitors bank

There is a second problem with the supercapacitors. The MPPT algorithm works that way: the voltage and current are continuously sampled. At every 100 Hz cycle, the power is computed, and the ABOC changes the requested power in a direction, for example it increases it. If power actually delivered increases, the process goes on in the same direction. If the power actually delivered decreases, the direction is reversed.

The supercapacitors disturb this algorithm, because, let's say for example that we start at 17V, and the supercapacitors are fully charged at 17V. Let's further assume that the available power decreases (the lighting decreases), and thus the voltage should decrease (remember that the PV is essentially a constant current process). However, the supercapacitor will provide the missing voltage, tricking the ABOC into thinking that the available energy isn't decreasing.

Putting it all together: the strategy

Fig. 6 (click to enlarge)

The all strategy is summarized in figure 6.

There are 2 controllers:

  • The power control unit (PCU)
  • The ABOC, when it's running

There are 3 things to control:

  • The ABOC itself, when powered off, starts above 12V, when running, stops below 7V. This is controlled by the PCU.
  • the backup power (supercapacitor bank): to cut when MPPT is running, also controlled by the PCU. Provide power when voltage is below 11.5V (and actually maintains that voltage if the solar panel can't provide more).
  • the thrusters,run above 12V, and the MPPT algorithm is active. This is controlled by the ABOC.

(Almost) No power

Below 2.5V, the PCU can't work properly, but the ABOC can't run anyway.

Power up

So, when the power is going up, the sequence is as follows (the voltage is measured between the solar panel terminals, more exactly the solar panel ground and a schottky diode on the positive terminal), assuming the capacitor bank is empty:

  • Below 2.5V, not much happens, the capacitors start charging
  • At 2.5V, the PCU is active and insures that the ABOC (and ESC) are shut
  • At 11.5V, the PCU prevents the capacitor from providing power (they are still charging, given their voltage is below the solar panel's)
  • At 12V, the PCU activates the ABOC and the ESCs. The ESCs need 7s to boot (the ABOC about 0.1s). The ABOC then controls the energy injection in the thrusters through the ESCs, according to the MPPT algorithm.

Above 12V

When above 12V, the system is nominal, the thrusters are powered according to the MPPT algorithm, run by the ABOC. Note that the capacitors may store energy until their voltage reaches the solar panel voltage, but are prevented by the PCU from providing energy to the system and thus don't disturb the MPPT algorithm.

Power decreasing

Now let's say the power goes down, and the solar panels can't provide any energy.

  • Below 12V, the thrusters are shut down by the ABOC, the control loop runs at 100Hz, so it may take 10ms.
  • Below 11.5V, the capacitors start providing energy (and forces voltage) under the control of the PCU. Actually, it acts as a switching regulator, so the voltage provided is 11.5V, while the voltage in the capacitor is above. When the voltage in the capacitors goes below 11.5V, it continues to drop.

During this phase, the ABOC is running (and consumes about 3W). If the solar energy is back during this phase, that is above 12V, the ABOC starts the thrusters immediately, that is in 10ms max.

  • Below 7V, the PCU shuts down the ABOC and the ESCs, and they will get power back only when voltage is above 12V.
  • If we go below 2.5V, the PCU can't guarantee anything, but we're back to square one, and the ABOC can't wake up anyway.