Engee documentation
Notebook

KPM RHYTHM: we are conducting HIL testing of the STM32 with the SNE control system

We have already said more than once: if you are creating a microcontroller to control expensive power equipment, the HIL-testing stage on a digital model is mandatory. This demo project clearly shows how the Engee development environment, the STM32 microcontroller and the KPM RHYTHM real-time complex work together to bring this task to life.

image.png

In this example, I, acting as an engineer who has virtually no experience programming microcontrollers, will show how to implement an energy storage management system (EES) on a microcontroller STM32, as well as perform its HIL testing in hard real time using the complex KPM RHYTHM.

The management object: a model of an autonomous diesel power plant with SNE (model plant.engee).

Management system: an algorithm for smoothing the load on the DSU using the SNE (model control_system.engee).

The problem of alternating load for diesel generator sets

Diesel power plants are the basis of electricity supply to remote facilities, including oil and gas producing enterprises. In such power systems, the load is sharply variable, which leads to:

  • low coefficient of installed capacity utilization (KIUM)
  • increased fuel consumption
  • accelerated wear of equipment
  • triggering of technological protections
  • decrease in the quality of electricity.

To solve these problems, SNES are used with the function of smoothing load surges.

image.png

Model of a diesel power station with an energy storage unit at KPM RHYTHM

Model энергосистемы implemented in the Engee environment, it operates in real time on the KPM RHYTHM complex. The principle of operation of the model is built as follows:

  1. The diesel generator operates on a dynamically changing load.

  2. The current load signal is transmitted via DAC from KPM RHYTHM to the STM32 microcontroller, where the developed SNE control algorithm is executed.

  3. The SNE, in turn, receives the control signal from the STM32 via the [ADC] channel (https://engee.com/helpcenter/stable/ru/ritmex-gp-lc-45/gp-lc-4x-adc.html ).

image.png

After launching this model on KPM RHYTHM, you can interactively view graphs of activated signals, receiving and analyzing information about the operation of the power system.

STM32 Energy Storage management System model

System Model управления The SNAP is quite simple:

  1. ADC The STM32 receives the load power signal in the power system model
  2. Next, the signal is duplicated via one of the control channels. One of the signals passes through an aperiodic link of the first order, in which a time constant is set that affects the smooth transmission of load power from the SNE to the DSU. At the output of the aperiodic link, a signal of the "desired" DSU power is obtained.
  3. When adding the load signal and the smoothed load signal, a signal of the required power from the SNE is obtained.
  4. This signal can be either positive or negative. A positive value corresponds to power output (discharge), a negative value corresponds to power consumption (charge).
  5. We transmit this signal to DAC STM32.
image.png

Test bench: STM32 and KPM RHYTHM

Untitled Project5.gif

Simulation results

Consider the power graphs in the power grid. When adding/dropping 0.5 MW of load, the DSU changes its power smoothly with the time constant set in the smoothing algorithm.

image.png

In addition, the use of the SNE control algorithm to smooth load surges/drops reduced the frequency deviation from 0.65 Hz (without SNE) to 0.2 Hz with 0.5 MW load surges and drops.

Conclusions

Using the STM 32 support package and KPM RHYTHM Support package Without a single (!) line of code, it was possible to implement an energy storage management system on the STM32 microcontroller and test it in real time on a digital model of a diesel power plant using KPM RHYTHM.

Useful links