Aircraft SimulationSimulating an aircraft in VisualCommander can be done in many ways. There are three main components to a user-interactive simulation:
In this example, the aircraft dynamics are simulated using the DSim simulation engine. User-control is conducted with a Saitek X52 USB joystick. A custom-built display plugin is used to obtain data from the joystick. The same display plugin is also used to display the 3D motion of the aircraft. We'll also show you some other graphics tools and how to set up your own data pages.
A fully functional aircraft interface is provided with VisualCommander. Screenshots of the 2 windows are shown below.
Click on a link to learn more.
A data source is included with the package that interacts with the Saitek Pro flight controller. The data source is embedded within the X52Scene display plugin, which also serves as the 3D graphics display. It is described in more detail in the section below.
Click on a link to learn more.
The X52Scene display plugin will display an aircraft, terrain and a skybox. When you drag and drop the display onto your data page you can select the models for each using the configure drop down menus.
To configure the X52Scene plugin, first drag a copy to your interface from the Tools menu. Remember you can hit CMD+R to pull up the Tools menu. With the plugin in your interface window, CNTRL+click and select "Configure". This pulls up the following window:
The pulldown menus for Terrain, Vehicle, and Skybox allow you to associate the texture map of your choice with each entity. To replicate the built-in Aircraft interface, choose "terrain", "Globalhawk" and "SkyboxT" as shown in the figure. If you are simulating an underwater vehicle, a special underwater terrain and water-box are provided.
The 3 text entry fields allow you to specify which DSim variables are linked to the stick and throttle commands. The X52Scene plugin reads 3 different pilot controls: horizontal stick displacement, vertical stick displacement, and throttle setting. As the figure shows, the throttle setting is linked to: aircraft|pilot:throttle. This is the full path to the DSim variable, and can be read as the "throttle" variable in the "pilot" model for the "aircraft" session.
This display also enables you to toggle on/off a view of the past trajectory, by pressing the "T" key. The controls at the bottom of the configuration window allow you to set the color and length of the displayed path.
You can write your own simulation and use the X52Scene plugin to read stick and throttle data into your simulation. You can use whatever variable names you wish, because you can specify the unique path by configuring the instance of the X52Scene plugin in your VisualCommander interface.
Click on a link to learn more.
The aircraft flight dynamics model is simulated in DSim. The dynamics are a point mass model with the following states:
and the following controls:
A feedback control law is also provided, designed to track ground speed, heading, and altitude. The reference speed, heading, and altitude can be commanded directly from VisualCommander. Alternatively, the joystick can be used, which commands velocity, turn rate and climb rate. A pilot interface integrates the rate commands to generate a smooth heading and altitude command for the controller to track. A block diagram is shown below to illustrate the flow of data within the simulation.
Click on a link to learn more.