Power management for the ESP32-S3 based teaching robot Dezibot⁴ (2025)
As part of my Master’s thesis, I analysed the power consumption of the Dezibot4, a teaching robot developed at HTWK Leipzig, based on the ESP32-S3 microcontroller from Espressif.
The goal was to prevent previously observed instability, which was caused by the power supply, a coin cell rechargeable battery, being unable to provide sufficient current during load peaks. As the robot did not implement any hardware measures to prevent this, and a hardware revision was neither feasible within the scope of the thesis, nor desired by the supervising professor, I implemented a software-based solution.
What follows is a simplified explanation.
This solution consists of three parts:
Power consumption analysis and modelling
To gain an overview over the initial situation, I created a measurement setup using a shunt resistor and an oscilloscope to measure the current consumption of the robot with high temporal resolution. This allowed me to identify load peaks and their causes, as well as to create a model of the current power consumption based on the robot’s activities, as managed by the software side.
Example: Current flow through an WS2812B RGB LED set to a non-white colour (1 mV = 1 mA)
Runtime modelling and accounting of power usage
To keep track of the current state of the robot during runtime, a class called
PowerManagerwas developed, providing tools for general modelling of the robot’s power state, such as battery charge and power supply state.In addition,
PowerManagerwraps a second class, thePowerScheduler, which uses the aforementioned measurements to keep track of all power-consuming components of the robot, such as motors, LEDs and sensors, as well as their current state. Based on this, it can estimate a current power consumption of the robot without actual facilities for measurement.Example of current flow as modelled by the PowerScheduler
Runtime intervention and information in the user program
The overview gained in the first two steps is then used to modify runtime behaviour. A classical power management is not applicable in this context, as the actual program running on the robot is written by the user via the Arduino IDE.
To get around this, the Dezibot library, the intended abstraction layer for users of this robot, has been modified to cooperatively coordinate power usage with the
PowerScheduler. In the case of there not being enough power budget left over to safely run the intended action, the user is informed through the (default UART) serial output of the ESP32, and the action not carried out. In typical usage, this means that informative messages appear in the serial monitor of the Arduino IDE instead of the robot displaying unexpected and difficult to understand behaviour (e.g. resets or crashes), which would be detrimental to the intended use case.Example of such output:
9:21:21.767 -> [ 15441][W][PowerScheduler.cpp:167] waitForCurrentAllowance(): [Power] Task 0x3fcec210 timed out waiting for 12.000000 mA of power;currently allocated: 155.925003 mA;total available (norm/max): 120.000000/240.000000 mA 9:21:21.798 -> [ 15460][W][MultiColorLight.cpp:41] setLed(): [MultiColorLight] Power to set LED RGB TOP RIGHT to color 0x0096002B not granted in time. Skipping.