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.json
anddesignParameters.json
files are present indata/uav|uam/<vehicle_name>/
. -
To store results from
n
iterations of the drag model with specified study parameters, runathens-dragstudy --vehicle <vehicle_name> --rand-length --rand-prop --rand-wing --runs n
- The
rand-length
flag will randomly alter theLENGTH
of each cylinder/tube in the vehicle, therand-prop
flag will alter theDIAMETER
of each propeller in the vehicle, and therand-wing
flag will alter theCHORD_1
,CHORD_2
, andSPAN
values of each wing in the vehicle.
- The
-
Results are written to
data/uav|uam/<vehicle_name>/results/*.csv
where 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
uam
oruav
directory and copy thedesignData.json
anddesignParameters.json
files (this will be a command line option, eventually). Noteuam
anduav
are 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_zips
folder. Then, from the command line, use the--from-zip
argument along with the--vehicle vehicle_name
argument wherevehicle_name
is 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