Interface

159 views
Skip to first unread message

David

unread,
Aug 31, 2021, 3:17:18 AM8/31/21
to MachUp Forum
I currently use xflr5 but have been looking at other options which I can use to "evolve" small UAVs within some simple bounds around flight envelope/ weight/ size/ payload (eg changes in onboard fuel/battery capacity) and an initial airfoil and motor/prop setup.

I have a fairly large shopping list, but had thought machupX might be reasonably extended to do all this as my shopping list seemed to fit the purpose of the project anyway. However after spending over 45mins just getting it installed and seeing the interface/outputs (which actually I have no idea what it's even showing) I have (almost certainly) decided that xflr5 analysis is significantly more advanced and a far better bet as a base for modifications, but I'm just checking before I write machup off completely.

I have until now been using xflr5 (https://sourceforge.net/projects/xflr5/  sourcecode at https://sourceforge.net/p/xflr5/code/HEAD/tree/) since it's extremely intuitive to generate a design and the ouputs are obvious - the first time I found the program from download to a fully analysed plane took me around 10mins and I can develop a new design from scratch and run an analysis with solid 3d viewing of the aircraft and results and output to 3d modelling/printing software. 
However it doesn't consider propwash, multiwing or fuselage effects, nor does it allow scripting for automated/bounded evolution of the model, and outputs to 3d printing and simulation software are fairly limited.

On the output I'd also like an automatic "3d printable" export - ie the software automatically generates ribs with appropriate holes for carbon spars aligned along the entire wingspan and slices parts into printer sized outputs with an adjustible skin thickness and appropriate connectors at the ajoining surfaces. Although I can do this with 3d CAD software it would be better to do this in the initial model as it also influences weight and importing a simple "skin only" airfoil mesh then requires significant post processing (I actually generally find it easier to redo from scratch).

If possible it would be nice to have it importable into a simulator like flightgear for further visualisation and torture testing (eg testing stability with variable sheer/turbulance and shifting strain/g-forces/weight distribution), but this isn't particularly important and I thought that pylot would probably fit my needs for this.

I ditched Python some years ago after I found compiling and running anything was exceedingly slow, dependencies were complex to manage and compiled applications overly bloated and not portable so my main coding toolchain is C++-based, and my current experience with machupX makes me think it isn't worth the python pain.

Sorry this is a bit involved, but I thought it was worth asking actual users before I just go back to xflr5 code, or search for other options.

Thanks
David

Cory

unread,
Sep 1, 2021, 6:29:04 PM9/1/21
to MachUp Forum
Hi David

Sounds like a cool project you're working on! I won't make any comments as to the user experience of MachUpX; I'll leave that for the rest of the forum.

I'm surprised to hear installation was such a hassle for you. Normally it's pretty straightforward. Could you explain a bit more what exactly your installation troubles were? I'm sure it would be helpful for future users if I were to clarify things in the documentation.

As far as clarity of interface/outputs goes, could you give more detail on what exactly is confusing you? Hopefully I can clarify things a bit. We've produced an introductory video which walks you through the scripting interface. You can find it at  https://youtu.be/KLZWTqD8GhM .

I'm not too familiar with XLFR5. MachUpX does account for interactions between multiple wings. However, it does not have capability for modeling fuselage effects or propwash. The biggest advantage to MachUpX is scriptability, which it does very well. Rendering the wing geometry is currently very limited. That's something we'd like to improve in the near future.

For exporting the model for 3D printing, we've put together a guide (https://machupx.readthedocs.io/en/latest/dxf.html) for doing this using dxf files. This works much better than trying to import an STL model. However, what you describe (automatically creating a finite-thickness skin with connectors, supports, and holes for spars and then exporting that as a CAD model) would be extremely difficult to implement. CAD file formats are very complex and require a great deal of know-how to work with directly.

I've rarely attempted compiling my Python code. As you say, the result is very bloated and unusable. Simply running Python directly in the interpreter has always been sufficient for me. If you're looking for increased speed, it's easy to run multiple instances of MachUpX at once on multiple processes.

Cory

David

unread,
Sep 2, 2021, 3:02:10 AM9/2/21
to MachUp Forum
Thank you Cory,
I will review the video over the weekend.
Here is a breakdown of the "time cost" and the issues I encountered for installation (including tracebacks and depreciation errors - although most can be ignored and are just to "share the experience" - and why although it's probably smooth once you have it running, it's a fairly steep cliff for someone just starting. At this point I still remain hopeful that pylot would be able to help me pid tune models, but I think I would be better off editing the xflr5 code to enable me to "evolve" airfoils (although I suspect machupX would be a good choice if I couldn't do that). 
The last trial / traceback (at the bottom) I never managed to get past and get pylot running:


1: 15mins: I found pylot initially as I was actually looking for software I could use to simulate a model for pid tuning - since xflr5 provides an excellent analysis of a static wing I had no need or desire for this. My 5min initial review suggested pylot might be suitable and obviously much faster to run than something like flightgear so I spent a bit more time reviewing other information - although I was left feeling normal process with new software is just to "try it and see" - and from experience this would normally be very efficient. [so I'm not sure if you can count this in the 45mins]. I didn't look at any videos at this point as I have historically found I can learn more about software by just installing and trying (this was probably my first mistake).

2: 5-10mins: installing anaconda (there were an extra 10 mins on top of that which I'm not counting on top of that as my previous installation was old and said Spyder needed an upgrade but this then failed and I had to uninstall and reinstall from scratch) - I would accept many researchers would have it installed however if you wanted it to be used widely this isn't necessarily the case. 

3: 20mins: I tried to install Pylot first this flagged depreciation issues (I think about ABC module installation), I then went back to the repo to see if it was a live project (as if not being regularly update would have automatically meant I would have had to fix this and would probably have eliminated it from my contention). I then spent a few minutes figuring out the directory structure and where the actual example files were. Having tried and failed to get these to run I went back to the documentation and realised Machup was a dependency and went through the same loop then realised that aerofoil was a dependency (I now know that's written at the top of the installation page, but I had skipped to the "installation" section) - it would have probably only been 2 mins to install all 3 had I realised the correct order, but ended up costing me in total about 10mins to just get all the dependencies installed to be able to run Pylot (which was my goal).
Much of the time cost was related to not being familar with the required command line inputs, and having to go through the extended python traceback to identify the issue (eg 10 lines just to say I'm in the wrong directory)
So my wasted time / frustration came from some of this     (and yes in retrospect the documentation does say to load the "input" file, but I was assuming I need to run a .py file as it was after all Python

eg this was one attempt:
>> python -m machupX ./examples/Swarm/swarm_example.py
failed
>> python -m machupX "./examples/Swarm/swarm_example.py"
failed
>> cd .\examples\Swarm\
>> python -m machupX ".\swarm_example.py"
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\ProgramData\Anaconda3\lib\site-packages\machupX\__main__.py", line 96, in <module>
    raise IOError("Please specify a .json input file (got {0}).".format(input_filename))
OSError: Please specify a .json input file (got .\swarm_example.py).

>> python -m machupX "swarming_drone.json"
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\ProgramData\Anaconda3\lib\site-packages\machupX\__main__.py", line 99, in <module>
    _run_prescribed_analyses(input_filename)
  File "C:\ProgramData\Anaconda3\lib\site-packages\machupX\__main__.py", line 36, in _run_prescribed_analyses
    for key, params in input_dict["run"].items():
KeyError: 'run'

>> python -m machupX ".\swarm_input.json"
Finally got there, but all I see is 4 low poly planes, so spend some time looking in the interface to figure out how to display the analytic outpus (at which point I would admit I realised I was going to have to learn the json file structure before I could even start so gave up and went back to pylot)...


>> cd C:\Users\dgm55\source\repos\Pylot\examples\LiftingLineModel
>> python -m pylot joystick_trimmed_input.json

>> python -m pylot .\joystick_state_input.json
This then slowly goes through various loading screens before freezing at "Loading aircraft"
After watching it for a minute or two so I eventually look at the powershell and find the following traceback
Unable to load numpy_formathandler accelerator from OpenGL_accelerate
C:\ProgramData\Anaconda3\lib\site-packages\pylot\graphics.py:55: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
  return np.array([[1.,0.,0.,0.],
pygame 2.0.1 (SDL 2.0.14, Python 3.8.8)
Hello from the pygame community. https://www.pygame.org/contribute.html
Process Process-2:
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\multiprocessing\process.py", line 315, in _bootstrap
    self.run()
  File "C:\ProgramData\Anaconda3\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pylot\physics.py", line 33, in run_physics
    aircraft = load_aircraft(input_dict, units, quit_flag, view_flag, pause_flag, data_flag, enable_interface)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pylot\physics.py", line 138, in load_aircraft
    with open(aircraft_file, 'r') as aircraft_file_handle:
FileNotFoundError: [Errno 2] No such file or directory: 'examples/LiftingLineModel/flying_wing.json'

This apparently crashes powershell so I can't close the pygame window or even ctrl-c and close the terminal to abort it ...
So I try again... With fundamentally the same output but it stops responding at "Loading terrain" (and this time I can at least ctrl-c)

Then I try:
python -m pylot .\examples\LiftingLineModel\joystick_state_input.json
again it freezes but this time I know not to wait and find:
...
  File "C:\Users\dgm55\source\repos\Pylot\pylot\controllers.py", line 230, in __init__
    raise RuntimeError("Couldn't find any joysticks!")
RuntimeError: Couldn't find any joysticks!

After tracking down a PS2 joystick and crawling around under my desk I find that all 9 USB ports are occupied so I remove the least critical and rerun
This time I actually get a helpful "Crashed!" message
Unable to load numpy_formathandler accelerator from OpenGL_accelerate
C:\Users\dgm55\source\repos\Pylot\pylot\graphics.py:55: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
  return np.array([[1.,0.,0.,0.],
pygame 2.0.1 (SDL 2.0.14, Python 3.8.8)
Hello from the pygame community. https://www.pygame.org/contribute.html

Generating 3D model from MachUpX...

FreeCAD modules not found. Reverting to Cessna model...
pygame 2.0.1 (SDL 2.0.14, Python 3.8.8)
Hello from the pygame community. https://www.pygame.org/contribute.html
C:\ProgramData\Anaconda3\lib\site-packages\scipy\interpolate\interpolate.py:623: RuntimeWarning: invalid value encountered in true_divide
  slope = (y_hi - y_lo) / (x_hi - x_lo)[:, None]


So I totally gave up and wrote my original post

Cory

unread,
Sep 2, 2021, 4:49:13 PM9/2/21
to MachUp Forum
Hi David

Pylot should work just fine for tuning PID controllers. If you read the docs, it explains how to implement a custom controller; no need to edit the source code. What do you mean by "evolving" airfoils though?

I'm glad you were able to find the answers to your dependency issues in the documentation. The interface is explained in the documentation (https://machupx.readthedocs.io/en/latest/user_interface.html). All inputs and outputs are done using files if you're using "python -m machupX" or within a python script if you're importing MachUpX as a python module. MachUpX currently has no GUI. As I said, we're hoping to improve that soon. The JSON structures are all explained in the docs. I think you'll find them rather intuitive.

That last error is a troubling one. Did you get that just by running "python -m pylot .\examples\LiftingLineModel\joystick_state_input.json"?

I will be the first to admit these codes are a little unpolished, particularly Pylot. We've developed them in house for our research projects, so user experience has definitely not been a focus. I really appreciate feedback like yours to be able to improve things.

Thanks

Cory

David

unread,
Sep 2, 2021, 5:53:32 PM9/2/21
to MachUp Forum
This might be getting a bit off topic and happy to move it to the github but
Re the error below are a couple of tries - this time it displayed the actual world simulation (which hadn't appeared last time), but still as soon as I touch the xbox (sorry not PS2 as above) controller left joystick it produces some sort of error although it's not identical.
Looking at the screens (see attached), the climb or roll rate seems to go ridiculous, so I suspect its a joystick sensitivity/incompatability issue - (assuming you haven't developed some secret tech for allowing a cessna to climb at 2.9e17 ft/min or roll at 5.5e20 deg/sec)
All motion then freezes although it doesn't seem to crash the program as the Graphics Time Step keeps flickering, and it closes
Pressing the right joystick, the directional pad, or any other button has no appreciable effect.
It seems to work OK with the  python -m pylot .\examples\LinearizedModel\keyboard_trimmed_input.json, (although it is more sensitive to keyboard inputs than I would expect).
I also get the weird horizon effect as per 2nd screenshot fairly regularly.
If it matters I'm running Win10




(base) PS C:\Users\dgm55\source\repos\Pylot> python -m pylot .\examples\LiftingLineModel\joystick_state_input.json

pygame 2.0.1 (SDL 2.0.14, Python 3.8.8)
Hello from the pygame community. https://www.pygame.org/contribute.html

-----------------------------------------------------
|                                                   |
|                    Pylot 1.3.4                    |
|                                                   |
|               (c) USU AeroLab 2020                |
|                                                   |
|             This software comes with              |
|    ABSOLUTELY NO WARRANTY EXPRESSED OR IMPLIED    |
|                                                   |
|           Submit bug reports on Github.           |
|                                                   |
-----------------------------------------------------

Unable to load numpy_formathandler accelerator from OpenGL_accelerate
C:\Users\dgm55\source\repos\Pylot\pylot\graphics.py:55: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
  return np.array([[1.,0.,0.,0.],
pygame 2.0.1 (SDL 2.0.14, Python 3.8.8)
Hello from the pygame community. https://www.pygame.org/contribute.html

Generating 3D model from MachUpX...

FreeCAD modules not found. Reverting to Cessna model...
pygame 2.0.1 (SDL 2.0.14, Python 3.8.8)
Hello from the pygame community. https://www.pygame.org/contribute.html
C:\Users\dgm55\source\repos\Pylot\pylot\helpers.py:39: RuntimeWarning: overflow encountered in double_scalars
  m = sqrt(q0*q0+q1*q1+q2*q2+q3*q3)
C:\ProgramData\Anaconda3\lib\site-packages\machupX\airplane.py:156: RuntimeWarning: invalid value encountered in true_divide
  self.q = self.q/np.linalg.norm(self.q)
C:\Users\dgm55\source\repos\Pylot\pylot\airplanes.py:1097: RuntimeWarning: overflow encountered in double_scalars
  V = m.sqrt(u*u+v*v+w*w)
C:\Users\dgm55\source\repos\Pylot\pylot\airplanes.py:225: RuntimeWarning: overflow encountered in double_scalars
  dy[0] = 2*self._g*(qx*qz-qy*q0) + self._m_inv*FM[0] + r*v-q*w
C:\Users\dgm55\source\repos\Pylot\pylot\airplanes.py:226: RuntimeWarning: overflow encountered in double_scalars
  dy[1] = 2*self._g*(qy*qz+qx*q0) + self._m_inv*FM[1] + p*w-r*u
C:\Users\dgm55\source\repos\Pylot\pylot\airplanes.py:227: RuntimeWarning: overflow encountered in double_scalars
  dy[2] = self._g*(qz*qz+q0*q0-qx*qx-qy*qy) + self._m_inv*FM[2] + q*u-p*v
C:\Users\dgm55\source\repos\Pylot\pylot\airplanes.py:230: RuntimeWarning: overflow encountered in double_scalars
  pq = p*q
C:\Users\dgm55\source\repos\Pylot\pylot\airplanes.py:231: RuntimeWarning: overflow encountered in double_scalars
  qr = q*r
C:\Users\dgm55\source\repos\Pylot\pylot\airplanes.py:232: RuntimeWarning: overflow encountered in double_scalars
  pr = p*r
C:\Users\dgm55\source\repos\Pylot\pylot\airplanes.py:233: RuntimeWarning: overflow encountered in double_scalars
  p2 = p*p
C:\Users\dgm55\source\repos\Pylot\pylot\airplanes.py:234: RuntimeWarning: overflow encountered in double_scalars
  q2 = q*q
C:\Users\dgm55\source\repos\Pylot\pylot\airplanes.py:235: RuntimeWarning: overflow encountered in double_scalars
  r2 = r*r
C:\Users\dgm55\source\repos\Pylot\pylot\airplanes.py:237: RuntimeWarning: invalid value encountered in double_scalars
  M[0] = -self._hz*q + self._hy*r + FM[3] + self._I_diff_yz*qr + self._I_yz*(q2-r2)+self._I_xz*pq-self._I_xy*pr
C:\Users\dgm55\source\repos\Pylot\pylot\airplanes.py:238: RuntimeWarning: invalid value encountered in double_scalars
  M[1] =  self._hz*p - self._hx*r + FM[4] + self._I_diff_zx*pr + self._I_xz*(r2-p2)+self._I_xy*qr-self._I_yz*pq
C:\Users\dgm55\source\repos\Pylot\pylot\airplanes.py:239: RuntimeWarning: invalid value encountered in double_scalars
  M[2] = -self._hy*p + self._hx*q + FM[5] + self._I_diff_xy*pq + self._I_xy*(p2-q2)+self._I_yz*pr-self._I_xz*qr
C:\Users\dgm55\source\repos\Pylot\pylot\simulator.py:389: RuntimeWarning: invalid value encountered in double_scalars
  N_quads_x = (x_pos-self._quad_size//2)//self._quad_size+1
C:\Users\dgm55\source\repos\Pylot\pylot\simulator.py:393: RuntimeWarning: invalid value encountered in double_scalars
  N_quads_y = (y_pos-self._quad_size//2)//self._quad_size+1
C:\Users\dgm55\source\repos\Pylot\pylot\simulator.py:421: RuntimeWarning: invalid value encountered in double_scalars
  if (N_quads_x%2 != 0):
C:\Users\dgm55\source\repos\Pylot\pylot\simulator.py:424: RuntimeWarning: invalid value encountered in double_scalars
  if (N_quads_y%2 != 0):


This was another try:
(base) PS C:\Users\dgm55\source\repos\Pylot> python -m pylot .\examples\LiftingLineModel\joystick_state_input.json

pygame 2.0.1 (SDL 2.0.14, Python 3.8.8)
Hello from the pygame community. https://www.pygame.org/contribute.html

-----------------------------------------------------
|                                                   |
|                    Pylot 1.3.4                    |
|                                                   |
|               (c) USU AeroLab 2020                |
|                                                   |
|             This software comes with              |
|    ABSOLUTELY NO WARRANTY EXPRESSED OR IMPLIED    |
|                                                   |
|           Submit bug reports on Github.           |
|                                                   |
-----------------------------------------------------

Unable to load numpy_formathandler accelerator from OpenGL_accelerate
C:\Users\dgm55\source\repos\Pylot\pylot\graphics.py:55: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
  return np.array([[1.,0.,0.,0.],
pygame 2.0.1 (SDL 2.0.14, Python 3.8.8)
Hello from the pygame community. https://www.pygame.org/contribute.html

Generating 3D model from MachUpX...

FreeCAD modules not found. Reverting to Cessna model...
pygame 2.0.1 (SDL 2.0.14, Python 3.8.8)
Hello from the pygame community. https://www.pygame.org/contribute.html
C:\Users\dgm55\source\repos\Pylot\pylot\airplanes.py:1097: RuntimeWarning: overflow encountered in double_scalars
  V = m.sqrt(u*u+v*v+w*w)
C:\ProgramData\Anaconda3\lib\site-packages\machupX\scene.py:582: RuntimeWarning: invalid value encountered in true_divide
  self._u_inf = self._v_inf/self._V_inf[:,np.newaxis]
C:\ProgramData\Anaconda3\lib\site-packages\machupX\scene.py:584: RuntimeWarning: invalid value encountered in true_divide
  self._u_inf_and_rot = self._v_inf_and_rot/self._V_inf_and_rot[:,np.newaxis]
C:\ProgramData\Anaconda3\lib\site-packages\machupX\scene.py:587: RuntimeWarning: invalid value encountered in true_divide
  self._u_trailing_0 = self._P0_joint_v_inf/np.linalg.norm(self._P0_joint_v_inf, axis=-1, keepdims=True)
C:\ProgramData\Anaconda3\lib\site-packages\machupX\scene.py:588: RuntimeWarning: invalid value encountered in true_divide
  self._u_trailing_1 = self._P1_joint_v_inf/np.linalg.norm(self._P1_joint_v_inf, axis=-1, keepdims=True)

Process Process-2:
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\multiprocessing\process.py", line 315, in _bootstrap
    self.run()
  File "C:\ProgramData\Anaconda3\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\dgm55\source\repos\Pylot\pylot\physics.py", line 84, in run_physics
    integrator.step(t, dt, store=True)
  File "C:\Users\dgm55\source\repos\Pylot\pylot\integrators.py", line 53, in step
    k3 = self._aircraft.dy_dt(t+dt)
  File "C:\Users\dgm55\source\repos\Pylot\pylot\airplanes.py", line 207, in dy_dt
    FM = self.get_FM(t)
  File "C:\Users\dgm55\source\repos\Pylot\pylot\airplanes.py", line 1108, in get_FM
    coefs = self._mx_scene.solve_forces(dimensional=False, body_frame=True, wind_frame=True)[self.name]["total"]
  File "C:\ProgramData\Anaconda3\lib\site-packages\machupX\scene.py", line 1457, in solve_forces
    self._handle_error(e)
  File "C:\ProgramData\Anaconda3\lib\site-packages\machupX\scene.py", line 3770, in _handle_error
    raise error
  File "C:\ProgramData\Anaconda3\lib\site-packages\machupX\scene.py", line 1442, in solve_forces
    linear_time = self._solve_linear(**kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\machupX\scene.py", line 818, in _solve_linear
    self._gamma = np.linalg.solve(A, b)
  File "<__array_function__ internals>", line 5, in solve
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\linalg\linalg.py", line 393, in solve
    r = gufunc(a, b, signature=signature, extobj=extobj)
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\linalg\linalg.py", line 88, in _raise_linalgerror_singular
    raise LinAlgError("Singular matrix")
numpy.linalg.LinAlgError: Singular matrix

and another
...
  File "C:\Users\dgm55\source\repos\Pylot\pylot\airplanes.py", line 502, in _component_effects
    FM += gear.get_landing_FM(self.y, self.controls, rho, u_inf, V)
  File "C:\Users\dgm55\source\repos\Pylot\pylot\components.py", line 214, in get_landing_FM
    psi = Quat2Euler(q)[2]
  File "C:\Users\dgm55\source\repos\Pylot\pylot\helpers.py", line 61, in Quat2Euler
    return [atan2(2*(q0*q1+q2*q3), q02+qz2-qx2-qy2), asin(2*x), atan2(2*(q0*q3+q1*q2), q02+qx2-qy2-qz2)]
ValueError: math domain error
unnamed.png
image.png

David

unread,
Sep 2, 2021, 6:16:51 PM9/2/21
to MachUp Forum
Also re "evolving" airfoils - in xflr5 I can batch run an xfoil evaluation over a large range of airfoils and/or wings. I want to develop a process whereby these can be randomised, tested and then feed into a next generation based on fitness and looped.
I was really wondering if there were other "discoveries" like the NASA "safe" wing using leading edge droop to improve stability or the Horton flying wing modifications to decrease adverse yaw, and especially as flying wings and drone/wing hybrids are becoming increasingly common there must be loads of interesting discoveries to be identified in this fusion...

Cory

unread,
Sep 8, 2021, 2:41:59 PM9/8/21
to MachUp Forum
Not sure if my other reply made it through. It does look like that's simply an issue with your controller if the keyboard works fine for input.

I don't know what could be causing the graphics issue. The physics shouldn't be affected though.

I see what you mean by evolving. Well that's the advantage to MachUpX being scriptable. You can wrap an optimizer around it rather easily. AirfoilDatabase is also scriptable and provides an interface to Xfoil, so you can tie that in as well. I agree there are lots of interesting discoveries to be made. Automated optimization is only speeding that up.

David

unread,
Sep 9, 2021, 2:46:38 PM9/9/21
to MachUp Forum
Thanks.
Am I correct in thinking the place to modify the joystick weightings would be here in controllers.py, and that I'll have to reinstall the module each time I try a new value (I'm not familar with creating installed modules in python so asking in case there's a better way)

def joystick_listener
...
                # Analog inputs
                if event.ev_type == 'Absolute':

                    # Roll axis
                    if event.code == 'ABS_X':
                        axes_def[0] = event.state/511.5-1.0

                    # Pitch axis
                    elif event.code == 'ABS_Y':
                        axes_def[1] = event.state/511.5-1.0

                    # Yaw axis
                    elif event.code == 'ABS_RZ':
                        axes_def[2] = event.state/127.5-1.0

                    # Throttle axis
                    elif event.code == 'ABS_THROTTLE':
                        if not throttle_perturbed_flag.value:
                            throttle_perturbed_flag.value = 1
                        axes_def[3] = event.state/127.5-1.0


Cory

unread,
Sep 10, 2021, 10:42:01 AM9/10/21
to MachUp Forum
Yep that's the way to do it.
Reply all
Reply to author
Forward
0 new messages