Open

Energy

Profiler

Toolset

Drive innovations in the field of low-power technologies

The combined testing of hardware and software has been successfully done, completing Milestone 6.

Milestone 6 - crucial hardware and software meeting point. It involved testing and integration, during which various issues were identified and resolved.
Milestone 6 - crucial hardware and software meeting point. It involved testing and integration, during which various issues were identified and resolved, including the unexpected challenge of excessive noise from the STM32’s internal ADC, which led us to switch to the external ADS9224R ADC. This milestone also featured the development of software drivers and tools, significantly enhancing system functionality and providing valuable open-source results.

Milestone 6 has been one of the most demanding phases of the project to date, primarily focused on testing the hardware and software functionalities developed earlier. It served as a crucial integration point for both components of the project. During this phase, we identified and resolved various hardware and software issues. Some challenges were predicted while others occurred unexpectedly and had to be managed on the fly.

One of the most difficult and unexpected challenges was reducing ADC noise. Our initial plan was to use the internal ADC of the STM32 microcontroller as the primary ADC for our system. However, testing revealed excessive noise levels from the internal ADC, making it unsuitable for our needs. We switched to the external ADS9224R ADC to address this, which required additional work to handle its non-standard communication protocol. Once integrated, this external ADC significantly reduced noise levels, leading to improved performance.

We developed a software driver to interface the ADS9224R ADC with the STM32 platform and released it as an open-source resource for the community. To share insights from this integration process, we published a blog post that outlines the challenges we faced and how we resolved them. The driver’s source code is available in our official Firmware GitHub repository at:

Source\ADFirmware\CM7\Core\Drivers\Platform\AnalogIN\ADS9224R.

Milestone 6 also involved developing microcontroller software to emulate various discharge profiles, a critical step for validating overall system functionality. To assist with PCB bring-up, we enhanced the microcontroller firmware and updated the OpenEPT GUI with a new command set to support current and future hardware configurations. Additionally, to simplify offline data analysis and the review of collected data samples, we implemented a data analysis toolset within the OpenEPT GUI application.

These tasks included writing new source code as well as upgrading existing code to accommodate new features. The following sections will provide a detailed overview of the achievements from this milestone.

The MCU firmware has been upgraded to enable the generation of various discharge profiles and to verify the functionality of energy consumption monitoring.

This sub task involves expanding the firmware functionality to support DAC control. The newly implemented DAC driver is located in our official Firmware GitHub repository at:

Source\ADFirmware\CM7\Core\Drivers\Platform\AnalogOUT

The service responsible for receiving commands from the control command service and executing the logic for discharge control is called DPControl (Discharge Profile Control). The source code for DPControl can be found in our official Firmware GitHub repository at:

Source\ADFirmware\CM7\Core\Middlewares\Services\DPControl

To enable the generation and management of different discharge profiles through the OpenEPT GUI application, two new firmware commands have been added:

device dac enable set: Used to enable or disable the DAC.
device dac value set: Used to set the DAC value.

A test scenario demonstrating the generation of various discharge profiles is shown in this video.

In this scenario, commands such as device dac enable set and device dac value set are sent via the OpenEPT GUI console, prompting the device to generate the specified discharge profile. Voltage and current are monitored in real-time during this process. Further details about the test case can be found in the related news.

Data analysis toolset

This is mostly a new feature that is implemented inside OpenEPT GUI application. It consists of the two parts:

  1. Data analyzer for offline data analysis
  2. Data statistics for real time data analysis

Following video published on the official project YouTube channel, demonstrates how the developed features operate using real data. In the video, a test scenario is analyzed that involves using a platform with an ESP32 Wi-Fi module—a module commonly used in IoT systems—to measure power consumption. More details about this test case can be found in a publish news.

Data analyzer window

This feature was added to facilitate easier offline analysis and comparison of different consumption profiles. Before starting data acquisition, the user needs to enable the option to save data samples to a file and define the name of the consumption profile. Once the acquisition is complete, all previously collected data from various discharge profiles can be analyzed. This functionality is integrated into a dedicated window within the OpenEPT GUI, as illustrated in Figure 1.

Figure 1. Data analyzer window

Code that corresponds to the developed feature is located in our official GUI GitHub repository at:

Source\Windows\Data Analyzer

Data statistic windows

In addition to offline analysis, during the evaluation of system performance, we determined that providing online sample analysis would be highly beneficial. This feature allows for real-time tracking of voltage, current, and consumption deviations while data acquisition is active. For battery-powered systems, it also provides runtime information about cumulative energy consumption over time. This functionality is similarly integrated into a dedicated window, with its layout presented in Figure 2.

Figure 2. Data statistics window

Code that corresponds to the developed feature is written in the following files in our official GUI GitHub repository at:

Source\Windows\Device\datastatistics.cpp
Source\Windows\Device\datastatistics.h

PCB Bringup test

The primary focus of this subtask was on hardware debugging and setting up the infrastructure to streamline future hardware testing. This effort involved two main steps:

  1. Upgrading the firmware and OpenEPT GUI to support various commands and features that interact with the hardware and test specific hardware functionalities.
  2. Reviewing the hardware and making necessary modifications for the new PCB, which will be produced as part of Milestone 8.

On the firmware side, several updates were implemented in both the firmware and the OpenEPT GUI application. The software modifications are the following

Figure 3. New commands

This upgrade is implemented between lines 442 and 565 within a file located on the following path in our official Firmware GitHub repository:

Firmware\ADFirmware\CM7\Core\Middlewares\Services\Control\control.c

SM2 - The control list for OpenEPT GUI console commands has been updated to include support for these additional commands.

This modification can be found in a file located at the following path in our official GUI GitHub repository:

Source\Windows\Console\consolewnd.cpp

SM3 - The system service has been upgraded to support RGB control

The RGB diode is managed using Timer 1 PWM channels, and this timer is now controlled by the system service. The modifications for this functionality were made on the firmware side, with the code changes implemented between lines 59-66, 103-128, and 286-300 in a file located at the following path in our official Hardware GitHub repository:

Source\ADFirmware\CM7\Core\Middlewares\Services\System\system.c

After these functionalities from the software side are implemented, detailed hardware testing is performed. List of the changes made in the hardware that will be implemented within a future Milestone 8, is available on the following path in our official Firmware GitHub repository:

Source\RevisionList\HardwareModification.csv

Author
Haris Turkmanović
Teaching Assistant, Embedded Software Architect and Project Manager
Since 2018, I have worked at the Department of Electronics and Digital Systems, Faculty of Electrical Engineering, University of Belgrade. Since 2019, I have also served as a teaching assistant while pursuing doctoral studies, focusing on embedded systems, including IoT, distributed systems, battery-powered platforms, and optimized embedded software.
© 2024 Open Energy Profiler Toolset. All Rights Reserved.