Benchmarking and optimisation of Simulink code using Real-Time Workshop and Embedded Coder for inverter and microgrid control applications

A. J. Roscoe, S. M. Blair, G.M. Burt

Research output: Chapter in Book/Report/Conference proceedingConference contribution book

11 Citations (Scopus)

Abstract

When creating software for a new power systems control or protection device, the use of auto-generated C code via MATLAB Simulink Real-Time Workshop and Embedded Coder toolboxes can be a sensible alternative to hand written C code. This approach offers the benefits of a simulation environment, platform independence and robust code. This paper briefly summarises recent experiences with this coding process including the pros and cons of such an approach. Extensive benchmarking activities are presented, together with descriptions of simple (but non-obvious) optimisations made as a result of the benchmarking. Examples include replacement of certain Simulink blocks with seemingly more complex blocks which execute faster. "S functions" are also designed for certain key algorithms. These must be fully "in-lined" to obtain the best speed performance. Together, these optimisations can lead to an increase in execution speed of more than 1.4x in a large piece of auto-generated C code. An example is presented, which carries out Fourier analysis of 3 signals at a common (variable) frequency. The overall speed improvement relative to the baseline is 2.3x, of which more than 1.4x is due to non-obvious improvements resulting from benchmarking activities. Such execution speed improvements allow higher frame rates or larger algorithms within inverters, drives, protection and control applications.
LanguageEnglish
Title of host publicationProceedings of the 44th International Universities Power Engineering Conference (UPEC), 2009
Place of PublicationPiscataway, NJ.
PublisherIEEE
Pages532-536
Number of pages5
ISBN (Print)978-1-4244-6823-2
Publication statusPublished - Sep 2009

Fingerprint

Benchmarking
Fourier analysis
MATLAB
Control systems

Keywords

  • power system measurements power system control power system protection
  • power electronics
  • motor drives
  • inverters

Cite this

Roscoe, A. J., Blair, S. M., & Burt, G. M. (2009). Benchmarking and optimisation of Simulink code using Real-Time Workshop and Embedded Coder for inverter and microgrid control applications. In Proceedings of the 44th International Universities Power Engineering Conference (UPEC), 2009 (pp. 532-536). Piscataway, NJ.: IEEE.
Roscoe, A. J. ; Blair, S. M. ; Burt, G.M. / Benchmarking and optimisation of Simulink code using Real-Time Workshop and Embedded Coder for inverter and microgrid control applications. Proceedings of the 44th International Universities Power Engineering Conference (UPEC), 2009 . Piscataway, NJ. : IEEE, 2009. pp. 532-536
@inproceedings{b2f2328c29fb47b1a9456b38834213f9,
title = "Benchmarking and optimisation of Simulink code using Real-Time Workshop and Embedded Coder for inverter and microgrid control applications",
abstract = "When creating software for a new power systems control or protection device, the use of auto-generated C code via MATLAB Simulink Real-Time Workshop and Embedded Coder toolboxes can be a sensible alternative to hand written C code. This approach offers the benefits of a simulation environment, platform independence and robust code. This paper briefly summarises recent experiences with this coding process including the pros and cons of such an approach. Extensive benchmarking activities are presented, together with descriptions of simple (but non-obvious) optimisations made as a result of the benchmarking. Examples include replacement of certain Simulink blocks with seemingly more complex blocks which execute faster. {"}S functions{"} are also designed for certain key algorithms. These must be fully {"}in-lined{"} to obtain the best speed performance. Together, these optimisations can lead to an increase in execution speed of more than 1.4x in a large piece of auto-generated C code. An example is presented, which carries out Fourier analysis of 3 signals at a common (variable) frequency. The overall speed improvement relative to the baseline is 2.3x, of which more than 1.4x is due to non-obvious improvements resulting from benchmarking activities. Such execution speed improvements allow higher frame rates or larger algorithms within inverters, drives, protection and control applications.",
keywords = "power system measurements power system control power system protection , power electronics, motor drives , inverters",
author = "Roscoe, {A. J.} and Blair, {S. M.} and G.M. Burt",
year = "2009",
month = "9",
language = "English",
isbn = "978-1-4244-6823-2",
pages = "532--536",
booktitle = "Proceedings of the 44th International Universities Power Engineering Conference (UPEC), 2009",
publisher = "IEEE",

}

Roscoe, AJ, Blair, SM & Burt, GM 2009, Benchmarking and optimisation of Simulink code using Real-Time Workshop and Embedded Coder for inverter and microgrid control applications. in Proceedings of the 44th International Universities Power Engineering Conference (UPEC), 2009 . IEEE, Piscataway, NJ., pp. 532-536.

Benchmarking and optimisation of Simulink code using Real-Time Workshop and Embedded Coder for inverter and microgrid control applications. / Roscoe, A. J.; Blair, S. M.; Burt, G.M.

Proceedings of the 44th International Universities Power Engineering Conference (UPEC), 2009 . Piscataway, NJ. : IEEE, 2009. p. 532-536.

Research output: Chapter in Book/Report/Conference proceedingConference contribution book

TY - GEN

T1 - Benchmarking and optimisation of Simulink code using Real-Time Workshop and Embedded Coder for inverter and microgrid control applications

AU - Roscoe, A. J.

AU - Blair, S. M.

AU - Burt, G.M.

PY - 2009/9

Y1 - 2009/9

N2 - When creating software for a new power systems control or protection device, the use of auto-generated C code via MATLAB Simulink Real-Time Workshop and Embedded Coder toolboxes can be a sensible alternative to hand written C code. This approach offers the benefits of a simulation environment, platform independence and robust code. This paper briefly summarises recent experiences with this coding process including the pros and cons of such an approach. Extensive benchmarking activities are presented, together with descriptions of simple (but non-obvious) optimisations made as a result of the benchmarking. Examples include replacement of certain Simulink blocks with seemingly more complex blocks which execute faster. "S functions" are also designed for certain key algorithms. These must be fully "in-lined" to obtain the best speed performance. Together, these optimisations can lead to an increase in execution speed of more than 1.4x in a large piece of auto-generated C code. An example is presented, which carries out Fourier analysis of 3 signals at a common (variable) frequency. The overall speed improvement relative to the baseline is 2.3x, of which more than 1.4x is due to non-obvious improvements resulting from benchmarking activities. Such execution speed improvements allow higher frame rates or larger algorithms within inverters, drives, protection and control applications.

AB - When creating software for a new power systems control or protection device, the use of auto-generated C code via MATLAB Simulink Real-Time Workshop and Embedded Coder toolboxes can be a sensible alternative to hand written C code. This approach offers the benefits of a simulation environment, platform independence and robust code. This paper briefly summarises recent experiences with this coding process including the pros and cons of such an approach. Extensive benchmarking activities are presented, together with descriptions of simple (but non-obvious) optimisations made as a result of the benchmarking. Examples include replacement of certain Simulink blocks with seemingly more complex blocks which execute faster. "S functions" are also designed for certain key algorithms. These must be fully "in-lined" to obtain the best speed performance. Together, these optimisations can lead to an increase in execution speed of more than 1.4x in a large piece of auto-generated C code. An example is presented, which carries out Fourier analysis of 3 signals at a common (variable) frequency. The overall speed improvement relative to the baseline is 2.3x, of which more than 1.4x is due to non-obvious improvements resulting from benchmarking activities. Such execution speed improvements allow higher frame rates or larger algorithms within inverters, drives, protection and control applications.

KW - power system measurements power system control power system protection

KW - power electronics

KW - motor drives

KW - inverters

UR - http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=5429517

M3 - Conference contribution book

SN - 978-1-4244-6823-2

SP - 532

EP - 536

BT - Proceedings of the 44th International Universities Power Engineering Conference (UPEC), 2009

PB - IEEE

CY - Piscataway, NJ.

ER -

Roscoe AJ, Blair SM, Burt GM. Benchmarking and optimisation of Simulink code using Real-Time Workshop and Embedded Coder for inverter and microgrid control applications. In Proceedings of the 44th International Universities Power Engineering Conference (UPEC), 2009 . Piscataway, NJ.: IEEE. 2009. p. 532-536