Giter VIP home page Giter VIP logo

alsetlab / modelica-drone-3d-fmi Goto Github PK

View Code? Open in Web Editor NEW
40.0 7.0 22.0 107.29 MB

DroneLibrary: Multi-Domain Drone Modeling in Modelica with 3D visualization and FMU export configuration

Home Page: http://alsetlab.com

License: BSD 3-Clause "New" or "Revised" License

Modelica 97.02% Batchfile 0.02% Motoko 1.57% Python 1.39%
drone-models dymola fmi modelica modelica-library modelica-models modeling simulation

modelica-drone-3d-fmi's People

Contributors

adrpo avatar dietmarw avatar lvanfretti avatar marcelofcastro avatar mpodlaski avatar tyanni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

modelica-drone-3d-fmi's Issues

Update Readme to reflect contents

@mpodlaski we should modify the Readme to reflect the contents.
The current description can be used as a "User Guide" which you can put in a different markdown file.
Then, the landing page can be simplified and updated to reflect the different models and resources that we are putting here.

Improve style

One thing to still improve (and is a low hanging fruit) would be to fix the issues found when running a style check on the library. I just did those using Dymola 2023x Refresh1 on v1.0.0:
DroneLibrary_StyleCheckLog.html.zip

Now that report is very strict but what should at least be fixed (also when thinking of the library reward) is:

Must

  • "Class description string missing"
  • "Component description string beginning with lower case character for"
  • "Class description string starting with whitespace"

Optional

  • "Documentation missing" (this is quite a big job)
  • "(Possibly) insufficient documentation" (points to an empty html part, so same as above)
  • "Mixing of components and equations" (should be investigated)

Ignore

  • "Bad class name Name of model shall start with capital letter. Name shall not contain '_'." (not ideal but we can probably live with those for now

Update FMU's

Hi @mpodlaski
Now that we have it, we should use the source code generation license to generate new FMUs.
I suggest you use Dymola 2020x, and maybe you can generate FMUs for the different cases, not only the "ideal power system" but also the other ones that require libraries.

Rename package to DroneLibrary

The name "DroneSimulation" is not quite optimal. I think calling it "DroneLibrary" or maybe just "DroneLib" might be much more suitable.
What do you think?

Detailed Instructions to Generate FMU

Add detailed instructions on how the FMU was generated.

From @t-sommer via email.

On Mar 20, 2019, 5:42 AM -0400, SOMMER Torsten [email protected], wrote:
Hi Luigi,
when I try to export the model with Dymola 2019FD01 as an FMU I get an error:
The model can only be exported assuming a fixed set of states.
The model will run as ...
Can you add instructions on how you exported the FMU?
Cheers,
Torsten

Tests package contains broken models

in DroneSimulation.Tests there are several models that contain broken links. Probably easy to fix if one knows which component should be linked to (and which was probably moved around).

Clean up library dependencies

Currently, the DroneLibrary states the following dependencies:

  • Visualization(version="1.5.1")
    • OK
  • IdealizedContact(version="0.2.0")
    • Only used in some test models, plus the latest version is still based on MSL 3.x.x and would need conversion and updating and cutting a release upstream
    • it looks like the original developer has become inactive a long time ago.
    • solution: either integrate the components needed from IdealizedContacts in a sublibrary of DroneLibrary (I would probably store those components under DroneLibrary.IdealizedContacts keeping the same internal hierarchy or remove the example models if they are found as not that important
  • ModelicaServices(version="4.0.0")
    • This library should normally not be used directly by the user (hence it is also not visible by default in Dymola). Currently, the DroneLibrary uses:
      • ModelicaServices.ExternalReferences.loadResource
        but why not use the proper (user-facing) function:
      • Modelica.Utilities.Files.loadResource instead?
  • Modelica(version="4.0.0")
    • OK
  • VeSyMA(version="2023.1")
    • I can't find any usage of VeSyMA classes in DroneLibrary itself, other than that this is mentioned in the uses annotation and the README
    • should be removed
  • Claytex(version="2023.1")
    • same as for VeSyMA
    • should be removed
  • Battery(version="2.5.0")
    • same as for VeSyMA
    • should be removed
  • Modelon(version="4.1")
    • There are several mentions of Modelon but many packages, though present on the file system do not get loaded by Dymola since they are not listed in the package.order file. This needs to get fixed.

Mind it could well be that the Visualisation library depends on VeSyMa or Claytex (not sure since I don't have access to that one) but this does not really matter for DroneLibrary since they will then state there dependencies to the tool.

Continuous Integration

I think it is a good idea to set up some continuous integration for this repository. At least some syntax checking.

Unit problems with bp

Running a check on DroneLibrary will report quite a lot of unit errors. Most of them stem from

parameter Modelica.Units.SI.Impulse bp = 2e-2 "Propeller friction force";

which has the unit N.s but since used in the equation :

Jp*der(w)= tout-bp*(w^2);

needs to have the unit of an inertia, i.e., kg.m2.

So how true is it that bp is a friction force rather than another type of inertia?

Missing plot scripts

The library contains several commands that are pointing to plot scripts that are missing.

Can't run example

Upon attempting to run the model as per readme, with the exception that I don't have the VeSyMA or Modelon libraries. Perhaps I really need those libraries.


Building "DroneSimulation.Examples.DroneWithIdealPower.Drone_IdealMachine" as experiment "Drone_IdealMachine 1" started at 17:34:34 
Error: DroneSimulation.Mechanical.Chassis.Templates.droneChassis [14:3-14:3] Class not found. When looking up Modelica.Units.SI.Mass in scope DroneSimulation.Mechanical.Chassis.Templates.droneChassis, Units was not found in Modelica.
Error: DroneSimulation.Mechanical.Chassis.Templates.droneChassis [13:3-13:3] Class not found. When looking up Modelica.Units.SI.Length in scope DroneSimulation.Mechanical.Chassis.Templates.droneChassis, Units was not found in Modelica.
Error: DroneSimulation.Electrical.controlModule_Continuous [2:3-2:3] Class not found. When looking up Modelica.Units.SI.Time in scope DroneSimulation.Electrical.controlModule_Continuous, Units was not found in Modelica.
Error: DroneSimulation.Electrical.Machines.SimpleDCmotor [13:3-13:3] Class not found. When looking up Modelica.Units.SI.Power in scope DroneSimulation.Electrical.Machines.SimpleDCmotor, Units was not found in Modelica.
Error: DroneSimulation.Electrical.Machines.SimpleDCmotor [12:3-12:3] Class not found. When looking up Modelica.Units.SI.Voltage in scope DroneSimulation.Electrical.Machines.SimpleDCmotor, Units was not found in Modelica.
Error: DroneSimulation.Electrical.Machines.SimpleDCmotor [11:3-11:3] Class not found. When looking up Modelica.Units.SI.AngularVelocity in scope DroneSimulation.Electrical.Machines.SimpleDCmotor, Units was not found in Modelica.
Error: DroneSimulation.Electrical.Machines.SimpleDCmotor [10:3-10:3] Class not found. When looking up Modelica.Units.SI.Force in scope DroneSimulation.Electrical.Machines.SimpleDCmotor, Units was not found in Modelica.
Error: DroneSimulation.Electrical.Machines.SimpleDCmotor [9:3-9:3] Class not found. When looking up Modelica.Units.SI.Torque in scope DroneSimulation.Electrical.Machines.SimpleDCmotor, Units was not found in Modelica.
Error: DroneSimulation.Electrical.Machines.SimpleDCmotor [5:3-5:3] Class not found. When looking up Modelica.Units.SI.Inertia in scope DroneSimulation.Electrical.Machines.SimpleDCmotor, Units was not found in Modelica.
Error: DroneSimulation.Blocks.Control.continuousPID [5:3-5:3] Class not found. When looking up Modelica.Units.SI.Time in scope DroneSimulation.Blocks.Control.continuousPID, Units was not found in Modelica.
Build finished at 17:34:36 (took 00:01).

TorqueSensor model is broken

DroneSimulation.Sensors.TorqueSensor is broken also would be hard to measure torque with just one flange. This model is not used anywhere and should probably be removed. If one needs a torque sensor then Modelica.Mechanics.Rotational.Sensors.TorqueSensor can be used instead.

Which version of BrushlessDCDrives should it be if at all?

Currently, the DroneLibrary depends on the commercial BrushlessDCDrives library which will be shipped as version 1.3.0 (non-backwards compatible with conversion script) in Dymola 2023x Reresh1. Now the current master (at point ae6acf7 at the time of writing) still uses version 1.2.1 (as shipped with Dymola 2023x.

This means every time somebody with the most recent version of Dymola will, when opening the DroneLibrary experience a warning message that the just opened library needs to get updated. Which really is non-optimal.

Having looked a bit closer, the only reason for the dependency on the BrushlessDCDrives library is this one model DroneSimulation.Mechanical.Motor.DCMotor_Averaged_Machine which is used in two examples. The question now is, how important/useful are those two examples to justify the dependency of a whole commercial library that just provides a very simple model pretty much similar to DroneSimulation.Electrical.Machines.SimpleMotor_EMF (because that's all it is internally).

Simulation error

I am running Wolfram System Modeler since I haven't bought Dymola as of now. The software does load the package and the model is globally balanced but during simuation i get the following error
Error: Equation ramp.y = ramp.offset + (if time < ramp.startTime then 0.0 else if time < ramp.startTime + ramp.duration then (time - ramp.startTime) * ramp.height / ramp.duration else ramp.height) has no unknown variables to solve for.
. If you have any idea what might be causing this error then please inform me. The complete statement is that the error equation has no unknown variable to solve for.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.