This repository contains a cli for generating drag data for UAV and UAM vehicles from the SwRI Athens Corpus.
At a high level, this repo runs the new drag model with altered parameters for the specified vehicle. It is currently possible to randomly adjust cylinder/tube length, propeller diameter, and wing shape (chord1, chord2, span) and store the resulting drag values. Note that the drag model requires the existence of the designData.json and designParameters.json which are generated in buildcad.py and are transformations of the 8 json files produced by the autograph.py. Thus, we assume that the vehicle has been built in Creo at least once. This is because the drag model needs the transforms (i.e. orientation, rotation, and translation) for each component in the vehicle in order to create representative meshes.
The benefit of this tool is that, instead of updating parameters and rebuilding the vehicle using Creo (slow), we can regenerate the mesh with modified parameter values and record the resulting drag data. Then, for parameters that produce "optimal" drag, we can run the vehicle fewer times through the slower Creo pipeline. Additionally, by operating directly on the dictionaries representing the designData.json and designParameters.json files, we save a little file I/O by reading from these files once and then writing to the dictionaries on each iteration of the drag model. Currently, to update parameters of interest and run the drag model using this tool takes ~1s / iteration.
-
To install this package, run
pip install -e .from the root of this repository (assumes Python >= 3.8 or so) -
To store the baseline info for a vehicle including x, y, z plots, the stl mesh, and default drags and centers, run
athens-dragstudy --vehicle <vehicle_name> --baseline. This will exit if the data already exists for the vehicle's default parameters and assumes thatdesignData.jsonanddesignParameters.jsonfiles are present indata/uav|uam/<vehicle_name>/. -
To store results from
niterations of the drag model with specified study parameters, runathens-dragstudy --vehicle <vehicle_name> --rand-length --rand-prop --rand-wing --runs n- The
rand-lengthflag will randomly alter theLENGTHof each cylinder/tube in the vehicle, therand-propflag will alter theDIAMETERof each propeller in the vehicle, and therand-wingflag will alter theCHORD_1,CHORD_2, andSPANvalues of each wing in the vehicle.
- The
-
Results are written to
data/uav|uam/<vehicle_name>/results/*.csvwhere each row represents a single iteration through the drag model and contains the resulting 6 output values from the drag model iteration and the value of each parameter in that iteration. -
To add a new vehicle, create a directory named after the vehicle in the appropriate
uamoruavdirectory and copy thedesignData.jsonanddesignParameters.jsonfiles (this will be a command line option, eventually). Noteuamanduavare still separated because of CAD part and parameter naming differences -
It is also possible to run a drag study on a zip file which is output from Jenkins. To do this, move the zip file of interest to the
design_zipsfolder. Then, from the command line, use the--from-zipargument along with the--vehicle vehicle_nameargument wherevehicle_nameis the name of the zip folder of interest, without the ".zip" extension.
See the drag_model notes file for FAQs about the code itself
Generate data for a single component as the drag subject (called a "primitive"). Results are stored under data/primitive/<drag_subject>/results/*.csv
- Capsule (UAV fuselage):
athens-dragstudy -subject capsule --runs 1000 - refactoring/ cleanup needed for other commands at this time, WIP
- Add curve fitting
- Resolve positional changes in motors when changing lengths
- Create data format for running experiments using files from Jenkins data.zip
- Clean up data format for studying multiple params (e.g. length vs length + prop)
- Specify vehicle, study parameters, number of runs
- Create command option to generate baseline results (original vehicle) with plots and mesh