Building Graphical Aircraft Design Tools
From the series: Aerospace
Zachary Lietzau, Embry-Riddle Aeronautical University
To enable rapid development of model airplanes, Zachary Lietzau of Embry-Riddle Aeronautical University used MATLAB® to develop an app that enabled his team to quickly iterate model aircraft designs. The benefits of using apps in MATLAB include the ability to use MATLAB toolboxes to run complicated calculations and visualize results in an interactive environment.
Many MATLAB products have built-in apps. Apps can also be downloaded from File Exchange or developed by users—just like how Zachary built the app in this video. MATLAB App Designer is an environment for building MATLAB apps. It provides a drag and drop environment to lay out the visual components of a user interface as well as an environment to enter computational algorithms to program app behavior.
User-developed apps can be packaged into a single file that can be distributed to others if the users have access to all the products used in the app. This is particularly useful to student competition teams as apps can be built and shared with future teams to help maintain legacy tools and minimize the time needed to redesign tools from year to year. Documentation can be added to the apps to ensure seamless transition to other team members.
Download the app from MATLAB Central's File Exchange.
Published: 1 Nov 2017
Hello, everyone, and welcome to another episode of the MATLAB and Simulink Robotics Arena. In today's episode, we're going to talk about building interactive design tools using MATLAB. And to join me to help us learn about this topic, I've got Zachary Lietzau from the Embry-Riddle Aeronautical University. Hello, Zachary, welcome to the Robotics Arena. Would you like to go ahead and introduce yourself and tell us why you are the best person for this job?
Well, I met Connell at an AIAA Design, Build, Fly competition. And I have developed a tool that our team relied on pretty heavily to design an aircraft while going to school at Embry-Riddle. And so, I'd like to share the code I developed and talk about how we turned it into a useful application.
Oh, that's good to know. And thank you for taking the time out to come and share your work with us. So moving on, for today's agenda, Zach is going to talk about the background, and why he built this tool, and also the motivation. Following which, he's going to talk about how he went about developing the tool over the course of four or five years at Embry-Riddle. Followed by a quick software demonstration, and then we will do some key takeaways and point you guys to some resources that you could use to do better at your competitions. So now, I'm going to hand it over to Zach and let him take it away.
OK, thanks. So I'll start with a little background. I've laid out a couple general methods for analyzing aircraft stability and control. And from top to bottom here, they sort of outline the cheapest to most expensive, and roughly accurate to most accurate methods available.
And so, from analytical methods or semi-empirical models, you can get most of the information that you want about an aircraft without going into more advanced computational methods or wind tunnel tests. And so, my focus is going to be on the 80% to 90% accurate solution that you can obtain from simplified models, and how you can use models such as that to gain an intuitive understanding of aircraft design.
So when we started out with this code, I had been developing it as sort of a DATCOM GUI. Digital DATCOM is software that was developed by the Air Force in the '80s. And it was intended to compile as much useful information as was available at the time in analyzing aircraft stability and control.
And so, the software is used commonly at Embry-Riddle for stability and control modeling. And the real drawback of the code is the user interface. And so, that's where I began.
I developed a MATLAB code that would input and output DATCOM, or develop the input files and read the output files of Digital DATCOM. And I made it an intuitive interface where you could manipulate geometric parameters and see the effect that they had on aircraft stability and control.
So Zach, just to stop you right there for a quick minute, when you talk about importing Digital DATCOM, these are all base MATLAB files. I would say, one of the reasons why you would go on to building an app is so that you can use base MATLAB functionality, but at the same time, make it more interactive and intuitive. And it helps you, it helps you share this code to other users among your team.
Yeah, definitely. And so, the MATLAB functionality was huge because I wanted a tool that had an easy user interface. Something that I could manipulate easily and see the outcome of various input parameters. And so, that's where MATLAB came in. As a simple user interface that I could read input and outputs of this program, Digital DATCOM.
And then, eventually, it developed into a tool where I could really understand the effect that different inputs were having by seeing their real-time-- seeing the calculations performed real time.
Perfect.
And so, as the development continued, like I said, it started out just as, essentially, as a user interface for DATCOM. And so, much of the code is based on Digital DATCOM terminology, but it quickly developed from there into a more usable tool on the fly. Where the calculations were actually done in MATLAB, and they were very rapid calculations, really useful things to know about an aircraft that were handled by MATLAB very easily. And I found that using this method, we could quickly see the effect that different parameters had and do rapid trade studies. And really, it turned into a useful tool for optimizing a design with a given set of input parameters or requirements.
And so, just to outline a few calculations that ended up being done quite a lot throughout the use of this code, we started with general empirical or semi-empirical equations that can just be used to rapidly get a rough answer for an aircraft's lift or moment coefficient, look at stability-- longitudinal stability, or lateral or directional stability of an aircraft. And these equations actually run through very, very quickly while we're manipulating parameters. They essentially happen in real time. And you can watch different stability coefficients change while we're varying inputs.
And then, larger calculations, like the first one I have listed here, a 2-D airfoil analysis using a vortex panel method. It comes down to solving a system of 200 to 300 equations. And MATLAB handles it almost instantly. And so, MATLAB was really critical in solving these calculations fast so that we could have this user interface that was-- as a useful tool for an intuitive analysis of an aircraft.
So right here, I'll show you what the app is going to look like when you open it for the first time. And so, what it presents you with is this conventional aircraft configuration that you can now manipulate parameter by parameter. And so, over on the left, you have tabs associated to each plan form. And you can see, as we click on different components, it's going to select that respective tab.
And then, you can adjust these parameters by either typing in a value if you know it, or my favorite thing to do is just to scroll and see the parameter change real time. And so, now I'm scrolling down, and I can actually see the effect it has in tapering the wing. We can do the same thing with the horizontal tail, vertical tail, or just input values. And I found this to be a really intuitive method for manipulating an aircraft's geometry.
When we get to the fuselage, this was an area where I spent a lot of time in developing this GUI, the graphical interface for manipulating the fuselage. Because there's so many general geometric configurations you can have. And I really wanted to make it as quick and simple as possible. Because often, CATIA models, when you're doing a full fuselage, can take hours. And so, I just wanted to get a rough idea.
And so, I developed this controller where you can select points, or lines, or you can even draw profiles. You can select groups of points by holding down Shift or center clicking. And it really gave a quick way to give a profile. And you can see the effect it's having on the aircraft in the main screen here.
And so, for example, as I lift up this bottom profile of the fuselage, you can see that's going to actually reduce the height overall. And so, we'll save that. And we can come back and edit it whenever we want.
And another thing I'll do is manipulate the radius now, or the half-width of each section. And so, if I just click Circularize Cross Section, it'll take each of these individual stations and set it equal to the height. And lastly, we have this parameter over here where we can manipulate the cross section from a continuous function of a super ellipse.
And so, as you can see, as we scroll this higher, we get more of a rectangle. Scroll it lower, and we actually get more of the shape of an SR-71. And again, this was just a very fast way to change the cross-sectional shape of an aircraft fuselage. And the whole idea here was to make it as intuitive and as quick as possible, so that you could quickly see the effect that these changes had on the aircraft.
Awesome. So, Zach, also in your app, I see a small little area on the bottom left that says Stability. Are you actually running stability calculations in the background? And does it auto update itself as you're manipulating the actual physical features of the fuselage?
Exactly. Yeah, so if we click on the Stability tab, we'll see that the Lift curve slope and Moment slope here have been calculated for the aircraft. And we can actually look at the output and compare that against these real-time calculations. And so, if I click DATCOM here, it's going to write DATCOM into a file. I'll call it My First Plane.
And when I click OK, it's actually going to run the DATCOM executable. And then, using the DATCOM Import function from the Aerospace toolbox, it's going to read in those DATCOM outputs. And it'll actually compare the Lift curve slope and the Moment slope against the predictions I have here.
So we'll give that a second. And it'll load in the for006 file that DATCOM outputs. And then it'll compare those results.
And so, again, the whole idea here is that these calculations are at your fingertips. They're done in real time. You can change parameters. You can see the effect they have immediately. And you can even use different tools like DATCOM to gain validation for these coefficients.
I can see this particular thing as a real good tool for teams taking part in simple error modeling competitions or building model airplanes in general. Where you can quickly sort of manipulate values here and come up with a design. But also, figure out the performance characteristics of the plane, which is I think is great.
So here are the DATCOM predictions. And so, you can see that they're going to capture it pretty accurately. And what's really important here is the Stability slope, the slope of this graph on the bottom. And when that slope zeros out, you know that your CG is at your neutral point. And that's especially important for these teams building model aircraft very, very quickly, and trying different things, and making changes. Because you'll know, just running a quick simulation, whether your aircraft will be longitudinally stable.
And I'll show you the last tab over here real quick. It's Aerodynamics. And this is just going to give you a rough drag prediction by using a build-up method on each of the components and predicting this lift distribution here to get your induced drag coefficient.
So apart from a bunch of options at the top here on different settings you can play with, you can add different components to the aircraft. You can make it a little more realistic, especially when you're doing conceptual design, and you want a lot of control over the different parameters. And you want to make an aircraft that looks like the concept you're going after.
And lastly, once you're done with refining it to a certain point, and you're happy with the design you have, you can actually run it in a FlightGear simulator. And with a MATLAB interface, you can just quickly carry it over using Simulink input parameters and manipulate the model real time to see the effects it has.
OK, cool. Another thing that I should go ahead and mention is that the good part about using MATLAB apps is that you can also add documentation to it and also, package them. And a part of the advantage of packaging these apps is you can share it with other MATLAB users.
And all that they need to run the app is MATLAB Runtime, which is real easy to get, and it's on our website.
So overall, I wanted to share this tool because it ended up being a really useful design tool for the DBF competition and also, just for a general intuitive understanding of aircraft design. We found that being able to make quick geometric variations on doing so in an intuitive interface, like this MATLAB code provides, we can quickly understand how different geometric inputs affect the stability and handling characteristics of the aircraft.
And so, it's served as a useful tool for myself going through and looking at various designs. And we found, throughout the team-- the DBF team at my school-- several students were able to use it as a learning tool and quickly understand how they could achieve desired performance from an aircraft just by manipulating different geometric parameters.
Well, perfect. Thank you so much, Zachary, for helping us. For showing us this tool that you've built. One note to all our viewers is, Zachary has been kind enough to offer to share this tool on a needs basis. So if you guys are interested in downloading the tool and figuring out how it works, please write in to us at the Robotics Arena at mathworks.com. And I'll facilitate connecting you with Zach and helping you get the software.
The other places that you could contact us are the Robotics Arena Facebook group. So if you go on to the link on the screen, we do share a lot of new information on new products, and updates, and how you can use MATLAB and Simulink to perform better at your competitions. And finally, do visit our web page. A link to that page is on the screen. It's mathworks.com/RoboticsArena.
Do not forget about the software offer. We do offer free MATLAB and Simulink to student teams taking part in competitions. You can find out more about our software offer at the link on the screen. And also, take a look at the Racing Lounge blog. I know it sounds a little automotive, but it does include robots as well.