Power Modes and Handling

One of the most fundamental tasks of the ACU6 Base System is the handling of and switching between different power modes in the system. The different modes are switched between to ensure a good trade-off between system functionality and power savings.

Power Modes

The system has four different power modes, and a number of different transitions between them are possible.

digraph "power-modes-transitions" { graph [nodesep=1, pad=0.5]; node [shape=ellipse, margin=0.2]; Running -> Standby [label="Suspend"]; Standby -> Running [label="Wake-up"]; Running -> Hibernate [label="Hibernate"]; Hibernate -> Running [label="External power restored"]; Running -> Sleep [label="Shutdown"]; Sleep -> Running [label="Restart"]; Running -> Running [label="Reboot", headport="n", tailport="n"]; }

Power modes and transitions

Running

is the normal power mode where the system is fully powered on, running at full speed with all peripherals active. This mode naturally consumes the most power, but it is also the only mode where the system can perform any of the functions it is made for, such as communicating with other units via CAN or sending data over the cellular connection.

Standby

can also be referred to as suspend(-to-ram). In this mode the execution of the User VM and the system services are suspended, but external peripherals such as CAN transceiver and modem is kept on and can be used as wake-up sources.

If the cellular connection is requested before the system enters standby it will stay connected and any received data will cause the system to wake up.

Sleep

is the lowest power consumption mode while still being able to wake up on, for example, CAN and RTC. In this mode most external peripherals including the cellular modem will be totally powered off and the processor enters the lowest possible sleep state.

Wake-up from this mode is only possible using local wake-up sources such as the on-switch, RTC or reception of CAN traffic if CAN has been configured as a wake-up source. When waking up from sleep the system performs a full reset and boot, so from the User VMs perspective it looks like a normal power-on boot.

Hibernate

This power mode can only be entered when running on backup battery. When the system transitions into hibernate the backup battery is electrically disconnected from the system. The system can only come back to running mode when external power is restored.

The purpose of the hibernate mode is to conserve as much energy as possible in the backup battery. For example if the unit is without external power for prolonged periods of time.

Power Mode Transitions

The ACU6 Base System will automatically switch between the different power modes to reduce the power consumption and to protect system components.

The most common transition is the one from Running to Standby, commonly referred to as suspending the system. Every time the ACU6 Base System determines that there are no software or hardware component requesting the system to stay Running it will initiate an automatic switch to Standby. It is important to remember that just becuase code it is executing in the User VM it does not mean that the system will be kept Running. To control the behaviour see more below at Requesting Power Resource.

There is also a timer that will keep the whole system running for a limited time after each boot to allow time for user code and services to start and determine if they should request resourc, including power resources.

Conversely the opposite is also true. Even if the User VM does not request the system to continue to operate in the Running mode, there might be services within the ACU6 Base System that requests the system to keep running. This can for example be the Software Update service or Cellular Data that requires the system to stay up until it reaches a point where suspending the system execution is acceptable.

Transitioning from Running to Sleep can either be initiated by the user written code using the Power, or automatically if the main power supply is removed or turned off while the application has requested to run on backup battery power but not requested a power resource.

Transitioning from Running to Hibernate is automatically triggered under the following conditions:

  • If main power is is removed or turned off and the system has not requested to run on backup battery power.

  • If the system is operating on backup battery, but the backup battery runs out of power. In this case the system will make an unconditional switch to Hibernate to protect the battery from excessive discharging.

Requesting Power Resource

As indicated in the Power Mode Transitions section above, the way that user code and services can affect power transitions is by requesting of the power resource. As long as there is at least one power resource requested the ACU6 Base System will not transition to the Standby state. The API used is described in the section Power.

The user code is fully free to decide when and if to request the power resource to inhibit the switch to Standby state, and it is very hard to give a general recommendation. However, in principle the user code ought to request power any time it performs “hard to divide” operations.

Example Usage

An illustrative example of using power requests could be an application that uses the RTC to wake up once an hour, get a GNSS fix, sends it to a remote backend service and then goes back to sleep. When waking up it does probably make sense to request the power resource until a location is received from the location service, otherwise it is not guaranteed that the system will be awake long enough to get a fix at all.

If it is advisable to keep the power while reporting the location to the backend depends on the overall requirements and specification for the system. If the system needs to report positions as-soon-as-possible, then most probably the power request should be kept until the report has successfully been sent to the backend. On the other hand, if the system only performs “best effort” reporting it could release the power resource before reporting the position. In that case the system might suspend and the report might be sent much later, for example the next time it wakes up while waiting for a fix.

Backup Battery

The ACU6-Pro device is equipped with a backup battery, sometimes called a BuB, to handle sudden loss of the main power, and to allow for limited operation in cases where the main power is not available.

The backup battery has been selected have enough capacity to handle the system in Running mode for a short while, allowing enough time for both ACU6 Base System services and User VM to do a controlled shutdown, including communicating the shutdown to remote backend systems.

When in Running mode the default policy is that the ACU6 Base System initiates a controlled shut-down if main power is lost, however both ACU6 Base System services and user code can request the system to stay Running (or in Standby) by requesting a back up battery resource from BUB (BackUp Battery). As long as a backup battery resource has been requested the system can switch between Running and Standby as documented above meaning that to force the system to stay in Running state on backup battery both a backup battery resource and a power resource must be requested.

When the backup battery is engaged the system will continuously monitor the state of charge of the battery and if it gets too low the system will automatically enter Hibernate state, with all wakeup sources except connection of main power set as disabled.