Ulkoisen kirjaston integrointi osaksi Simulink-simulaatiota: Moottorinohjaimen software-in-the-loop –simulaattorin integrointi ohjaamaan mallinnettua dieselmoottoria
Mikkonen, Rasmus (2024)
Mikkonen, Rasmus
2024
Tekniikan ja luonnontieteiden kandidaattiohjelma - Bachelor's Programme in Engineering and Natural Sciences
Tekniikan ja luonnontieteiden tiedekunta - Faculty of Engineering and Natural Sciences
This publication is copyrighted. You may download, display and print it for Your own personal use. Commercial use is prohibited.
Hyväksymispäivämäärä
2024-09-20
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:tuni-202409138708
https://urn.fi/URN:NBN:fi:tuni-202409138708
Tiivistelmä
Erilaiset simulointityökalut ovat merkittävä osa nykyaikaista moottorinohjaimen tuotekehitysprosessia. Simulaation avulla voidaan testata ja kehittää moottorinohjaimen toiminnallisuuksia ilman oikeaa moottoria. Näin prosessissa säästetään aikaa ja rahaa sekä parannetaan turvallisuutta, sillä simulaation avulla moottori voidaan asettaa toimintapisteisiin, jotka reaalimaailmassa eivät olisi turvallisia tai edes mahdollisia.
Tässä työssä toteutettiin rajapinta ulkoisen kirjaston ja Matlabin välille sekä integroitiin ulkoisen kirjaston sisältämä moottorinohjaimen software-in-the-loop –simulaattori ohjaamaan olemassa olevaa dynaamista dieselmoottorimallia Simulinkissä. Rajapinnan avulla moottorinohjaimen parametrien sekä signaalien arvoja voidaan lukea sekä uudelleen kirjoittaa Matlabiin luotujen funktioiden avulla. Työssä tutkittiin erilaisia keinoja integroida C-kielellä toteutettuja ohjelmia ja funktioita osaksi Simulink-simulaatiota. Lisäksi esiteltiin software-in-the-loop –simulaation hyötyjä ja haittoja verrattuna model-in-the-loop –simulaatioon sekä esiteltiin sen hyötyjä osana tuotekehitysprosessia.
Toteutetun rajapinnan ja moottorimalli-integraation tuloksena ulkoisen kirjaston sisältämää moottorinohjaimen software-in-the-loop –simulaattoria voidaan simuloida Simulinkissä dynaamisen moottorimallin kanssa, jolloin jo käännettyä moottorinohjaimen ohjelmakoodia voidaan testata mallinnetulla moottorilla ilman hardware-in-the-loop –simulaattoria. Työn tuloksena tuotettiin moottorinohjaimen testauksen ja kehityksen avuksi simulaatioalusta. Various simulation tools are a significant part of the modern engine controller development process. Through simulation, the functionalities of the engine controller can be tested and developed without the need for a real engine. This approach saves time and money and improves safety, as simulation allows the engine to be placed in operating conditions that would be unsafe or even impossible in the real world.
In this work, an interface was implemented between an external library and Matlab, and the engine controller's Software-in-the-loop (SIL) simulator contained in the external library was integrated to control an existing dynamic diesel engine model in Simulink. Using this interface, the values of engine controller parameters and measurement channels can be read and written via functions created in Matlab. The study explored various methods for integrating programs and functions written in the C language into Simulink simulation. Additionally, the benefits and drawbacks of Software-in-the-loop simulation compared to model-in-the-loop (MIL) simulation were presented, along with its advantages as part of the development process.
As a result of the implemented interface and engine model integration, the engine controller's Software-in-the-loop simulator contained in the external library can be simulated in Simulink with the dynamic engine model. This allows the already compiled engine controller software code to be tested against the modeled engine without the need for Hardware-in-the-loop (HIL) simulation. As a result of the work, a simulation platform was produced to aid in the testing and development of the engine controller.
Tässä työssä toteutettiin rajapinta ulkoisen kirjaston ja Matlabin välille sekä integroitiin ulkoisen kirjaston sisältämä moottorinohjaimen software-in-the-loop –simulaattori ohjaamaan olemassa olevaa dynaamista dieselmoottorimallia Simulinkissä. Rajapinnan avulla moottorinohjaimen parametrien sekä signaalien arvoja voidaan lukea sekä uudelleen kirjoittaa Matlabiin luotujen funktioiden avulla. Työssä tutkittiin erilaisia keinoja integroida C-kielellä toteutettuja ohjelmia ja funktioita osaksi Simulink-simulaatiota. Lisäksi esiteltiin software-in-the-loop –simulaation hyötyjä ja haittoja verrattuna model-in-the-loop –simulaatioon sekä esiteltiin sen hyötyjä osana tuotekehitysprosessia.
Toteutetun rajapinnan ja moottorimalli-integraation tuloksena ulkoisen kirjaston sisältämää moottorinohjaimen software-in-the-loop –simulaattoria voidaan simuloida Simulinkissä dynaamisen moottorimallin kanssa, jolloin jo käännettyä moottorinohjaimen ohjelmakoodia voidaan testata mallinnetulla moottorilla ilman hardware-in-the-loop –simulaattoria. Työn tuloksena tuotettiin moottorinohjaimen testauksen ja kehityksen avuksi simulaatioalusta.
In this work, an interface was implemented between an external library and Matlab, and the engine controller's Software-in-the-loop (SIL) simulator contained in the external library was integrated to control an existing dynamic diesel engine model in Simulink. Using this interface, the values of engine controller parameters and measurement channels can be read and written via functions created in Matlab. The study explored various methods for integrating programs and functions written in the C language into Simulink simulation. Additionally, the benefits and drawbacks of Software-in-the-loop simulation compared to model-in-the-loop (MIL) simulation were presented, along with its advantages as part of the development process.
As a result of the implemented interface and engine model integration, the engine controller's Software-in-the-loop simulator contained in the external library can be simulated in Simulink with the dynamic engine model. This allows the already compiled engine controller software code to be tested against the modeled engine without the need for Hardware-in-the-loop (HIL) simulation. As a result of the work, a simulation platform was produced to aid in the testing and development of the engine controller.
Kokoelmat
- Kandidaatintutkielmat [9203]