{"id":51244,"date":"2023-07-21T08:53:43","date_gmt":"2023-07-21T12:53:43","guid":{"rendered":"https:\/\/blogs.sw.siemens.com\/simcenter\/?p=51244"},"modified":"2026-03-26T06:47:49","modified_gmt":"2026-03-26T10:47:49","slug":"hil-simulation-framework-uav","status":"publish","type":"post","link":"https:\/\/blogs.sw.siemens.com\/simcenter\/hil-simulation-framework-uav\/","title":{"rendered":"HiL and realistic environment simulations for your UAV"},"content":{"rendered":"\n<p>To ensure the safe operation of autonomous unmanned aerial vehicles and advanced air mobility vehicles, the flight control systems with their autonomous flight functions such as detect-and-avoid and localization functions need to be extensively validated for diverse flight scenarios and operational conditions. Therefore, a digital twin is highly valuable as part of an efficient development process that ensures a safe product.<\/p>\n\n\n\n<p>Within the MARLOC project, we have investigated a simulation framework based on Simcenter Amesim and Simcenter Prescan software for the development and validation of flight controllers with localization capabilities for autonomous air systems. To evaluate the localization capabilities accurately, a realistic flight trajectory needs to be simulated. To accomplish this, we have created a hardware-in-the-loop (HiL) simulation framework where a physical Pixhawk flight controller was integrated with the digital twin.<\/p>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Simulation framework<\/h2>\n\n\n\n<p>The overall architecture of the HiL simulation developed is shown in Figure 1. Simcenter Amesim was used to model flight dynamics together with propulsion systems. While Simcenter Prescan was used to create the virtual environment and model the camera sensors attached to the vehicle. A ROS network was used to establish communication between the simulation software and the flight controller hardware. In order to start the simulation, a set of waypoints are specified and sent to the Pixhawk via the QGroundControlStation software which is running on a separate laptop. The flight controller will then try to steer the vehicle following a trajectory connecting these waypoints. The aircraft dynamics will be simulated in Simcenter Amesim based on the input given to the motors of the UAV model by the Pixhawk. The new position will be computed and sent to Simcenter Prescan to update the location of the aircraft in the environment. While the aircraft flies, the camera sensor simulated in Simcenter Prescan will produce the camera feed that will be later forwarded to a pose estimation algorithm running on the flight computer.<\/p>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"402\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/HiLSchemePicture-1024x402.png\" alt=\"HiL Scheme Picture\" class=\"wp-image-51245\" srcset=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/HiLSchemePicture-1024x402.png 1024w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/HiLSchemePicture-600x236.png 600w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/HiLSchemePicture-768x302.png 768w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/HiLSchemePicture-1536x603.png 1536w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/HiLSchemePicture-2048x804.png 2048w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/HiLSchemePicture-900x353.png 900w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Figure 1. HiL architecture.<\/figcaption><\/figure><\/div>\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Use case<\/h2>\n\n\n\n<p>The digital twin model of the drone developed in Simcenter Amesim is shown in Figure 2. This model was created based on an existing drone from FlandersMake research institute, partner in the MARLOC project. Considering the size, mass and inertia properties, propeller and motor parameters obtained from experimental testing, the physical dynamics of the unmanned vehicle are rigorously modeled.<\/p>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"643\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/Amesim-1024x643.png\" alt=\"Simcenter Amesim drone model from FlandersMake UAV\" class=\"wp-image-51246\" srcset=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/Amesim-1024x643.png 1024w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/Amesim-600x377.png 600w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/Amesim-768x482.png 768w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/Amesim-900x565.png 900w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/Amesim.png 1339w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Figure 2. Simcenter Amesim drone model from FlandersMake UAV.<\/figcaption><\/figure><\/div>\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>The cosimulation block will specify the data exchange with the other components in the framework. In this manner, on the right side of the block, Simcenter Amesim receives from the Pixhawk flight controller the four throttle inputs to the motor models. On its left side are determined the states computed in Simcenter Amesim, based on the commanded throttle, to be sent through the framework.<\/p>\n\n\n\n<p>Another aspect of the framework is the environment model. In order to create realistic camera images and fly in the same environment specified by the trajectory in QGroundControl, a model of the London Bridge area, shown in Figure 3, was created. This environment was developed using satellite data available from OpenStreetMaps to create the buildings and to apply the texture over the 3D model.<\/p>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"445\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/Prescan-1024x445.png\" alt=\"Simcenter Prescan London Bridge environment model\" class=\"wp-image-51247\" srcset=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/Prescan-1024x445.png 1024w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/Prescan-600x261.png 600w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/Prescan-768x334.png 768w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/Prescan-900x391.png 900w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/Prescan.png 1104w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Figure 3. Simcenter Prescan London Bridge environment model.<\/figcaption><\/figure><\/div>\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Figure 4 shows the waypoints that were specified, creating a trajectory for the Pixhawk to fly around the London Bridge area using QGroundControl software which runs on the Ground Control laptop. Matching with the 3D model created in Simcenter Prescan, the trajectory that the vehicle will follow and the images generated by the camera will be consistent with the real environment.<\/p>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"480\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/QGroundControl-1024x480.jpg\" alt=\"Waypoints specified in QGroundControl around the London Bridge area\" class=\"wp-image-51248\" srcset=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/QGroundControl-1024x480.jpg 1024w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/QGroundControl-600x281.jpg 600w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/QGroundControl-768x360.jpg 768w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/QGroundControl-900x422.jpg 900w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/QGroundControl.jpg 1100w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Figure 4. Waypoints specified in QGroundControl around the London Bridge area.<\/figcaption><\/figure><\/div>\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>In the simulation, the drone model was able to follow the trajectory by receiving the steering commands from the flight controller. The results obtained are shown in Figure 5, where the resulting trajectory followed by the UAV is marked as a dashed black line on top of the trajectory specified by the waypoints in QGroundControl.<\/p>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/PixhawkTrajectory-1024x892.png\" alt=\"Waypoints specified in QGroundControl with the actual trajectory followed during simulation\" class=\"wp-image-51249\" width=\"474\" height=\"412\" srcset=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/PixhawkTrajectory-1024x892.png 1024w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/PixhawkTrajectory-600x523.png 600w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/PixhawkTrajectory-768x669.png 768w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/PixhawkTrajectory-1536x1338.png 1536w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/PixhawkTrajectory-900x784.png 900w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/PixhawkTrajectory.png 1998w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><figcaption class=\"wp-element-caption\">Figure 5. Waypoints specified in QGroundControl with the actual trajectory followed during simulation.<\/figcaption><\/figure><\/div>\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">In conclusion&#8230;<\/h2>\n\n\n\n<p>It has been demonstrated that the simulation framework can be used to integrate real hardware such as a flight controller to test its functionality. The main challenge, which was for the UAV model in Simcenter Amesim to compute flight data that was compliant with the operation of the flight controller at the required rates, was successfully achieved. Additionally, diverse sensors can be simulated in Simcenter Prescan in order to validate autonomous functions such as detecting and avoiding or simultaneous localization and mapping algorithms.<\/p>\n\n\n\n<p>In future work, the trajectories obtained from the HiL simulation will be used to evaluate a visual simultaneous localization and mapping (SLAM) algorithm under different weather conditions.<\/p>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>You might be interested in&#8230;<\/strong><\/p>\n\n\n\n<div class=\"wp-block-media-text alignwide is-stacked-on-mobile\" style=\"grid-template-columns:25% auto\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" decoding=\"async\" width=\"643\" height=\"362\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/2023-07-21-11_00_38-Urban-air-mobility-future-_-Advanced-air-mobility-_-Siemens-_-Siemens-Software.png\" alt=\"\" class=\"wp-image-51262 size-full\" srcset=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/2023-07-21-11_00_38-Urban-air-mobility-future-_-Advanced-air-mobility-_-Siemens-_-Siemens-Software.png 643w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/2023-07-21-11_00_38-Urban-air-mobility-future-_-Advanced-air-mobility-_-Siemens-_-Siemens-Software-600x338.png 600w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/2023-07-21-11_00_38-Urban-air-mobility-future-_-Advanced-air-mobility-_-Siemens-_-Siemens-Software-395x222.png 395w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<p><strong>Urban air mobility<\/strong><\/p>\n\n\n\n<p>Fly it before you build it: design aircraft while targeting certification<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/webinars.sw.siemens.com\/en-US\/urban-air-mobility-performance-engineering\" target=\"_blank\" rel=\"noreferrer noopener\">Watch the webinar<\/a><\/div>\n<\/div>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-media-text alignwide is-stacked-on-mobile\" style=\"grid-template-columns:25% auto\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" decoding=\"async\" width=\"643\" height=\"362\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/2023-07-21-11_02_47-Aerospace-Engineering-Podcasts.png\" alt=\"\" class=\"wp-image-51263 size-full\" srcset=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/2023-07-21-11_02_47-Aerospace-Engineering-Podcasts.png 643w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/2023-07-21-11_02_47-Aerospace-Engineering-Podcasts-600x338.png 600w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/2023-07-21-11_02_47-Aerospace-Engineering-Podcasts-395x222.png 395w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<p><strong>eVTOL design and engineering; It\u2019s time to talk!<\/strong><\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/resources.sw.siemens.com\/en-US\/e-book-urban-air-mobility-podcasts?bc=eyJwYWdlIjoiM1poaXhZcUlpM2htRVF4SWg3Sm8zQyIsInNpdGUiOiJ3ZWJpbmFycyIsImxvY2FsZSI6ImVuLVVTIn0=\" target=\"_blank\" rel=\"noreferrer noopener\">Get the ebook<\/a><\/div>\n<\/div>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-media-text alignwide is-stacked-on-mobile\" style=\"grid-template-columns:25% auto\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" decoding=\"async\" width=\"643\" height=\"362\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/2023-07-21-11_03_54-VTOL-Aircraft-_-Certification-_-Siemens-Software.png\" alt=\"\" class=\"wp-image-51264 size-full\" srcset=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/2023-07-21-11_03_54-VTOL-Aircraft-_-Certification-_-Siemens-Software.png 643w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/2023-07-21-11_03_54-VTOL-Aircraft-_-Certification-_-Siemens-Software-600x338.png 600w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/2023-07-21-11_03_54-VTOL-Aircraft-_-Certification-_-Siemens-Software-395x222.png 395w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<p><strong>Accelerate VTOL aircraft verification and certification<\/strong><\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/webinars.sw.siemens.com\/en-US\/vtol-aircraft?bc=eyJwYWdlIjoiM1poaXhZcUlpM2htRVF4SWg3Sm8zQyIsInNpdGUiOiJ3ZWJpbmFycyIsImxvY2FsZSI6ImVuLVVTIn0=\" target=\"_blank\" rel=\"noreferrer noopener\">Watch the webinar<\/a><\/div>\n<\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>For a UAV to fly safely, its autonomous flight functions and localization capabilities must be flawless. Read this blog to learn through a use case how to implement a HiL simulation framework into your development process.<\/p>\n","protected":false},"author":94285,"featured_media":51267,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spanish_translation":"","french_translation":"","german_translation":"","italian_translation":"","polish_translation":"","japanese_translation":"","chinese_translation":"","footnotes":""},"categories":[1],"tags":[86,16],"industry":[125,127],"product":[50920,590,511],"coauthors":[63614],"class_list":["post-51244","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news","tag-simulation","tag-system-simulation","industry-aerospace-defense","industry-aircraft-airframes","product-simcenter","product-simcenter-amesim","product-simcenter-prescan"],"featured_image_url":"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2023\/07\/Main-picture-1-scaled.jpg","_links":{"self":[{"href":"https:\/\/blogs.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/posts\/51244","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/users\/94285"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/comments?post=51244"}],"version-history":[{"count":5,"href":"https:\/\/blogs.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/posts\/51244\/revisions"}],"predecessor-version":[{"id":69050,"href":"https:\/\/blogs.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/posts\/51244\/revisions\/69050"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/media\/51267"}],"wp:attachment":[{"href":"https:\/\/blogs.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/media?parent=51244"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/categories?post=51244"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/tags?post=51244"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/industry?post=51244"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/product?post=51244"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/coauthors?post=51244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}