Menu

#595 Support for electric motors in YASim (patch provided)

Done
nobody
2020-04-25
2012-01-12
Anonymous
No

Originally created by: i...@beware.dropbear.id.au

I have created a model of an ultra micro electric powered model plane in YASim. I started by using a gasoline engine model but it is not a good fit.

Both the turbine engine model and the piston engine model consume fuel which changes the mass and balance of the aircraft. While a battery powered plane's "fuel" does run out, it doesn't weigh anything. Also the piston engine and turbine engines are poor models for an electric engine in other respects such as altitude effects, torque/speed characteristic and response time.

I have created a simple electric engine model which uses no fuel and has a torque/speed characteristic of a DC electric motor. The parameters are easily found: Kv, Rm and V.

It would be nice to have an electric current fuel type and a "tank" which holds amp-hours, but the fuel consumption model in YASim seems to presume that fuel is measured and consumed by mass, so I didn't go that far. Also, I have only done one kind of electric motor, and the characteristics can be greatly affected by the electronic speed control. Still, I think it is a better model than a piston engine or a turbine engine!

Patch attached.

1 Attachments

Related

Tickets: #595

Discussion

  • Anonymous

    Anonymous - 2012-11-24

    Originally posted by: bcoco...@gmail.com

    (No comment was entered for this change.)

    Labels: YASIM

     
  • xDraconian

    xDraconian - 2018-10-01
    • Labels: YASIM --> YASIM, Expired
    • Status: New --> Done
     
  • Jakub Kákona

    Jakub Kákona - 2019-12-27

    Hi, is there some chance the patch will be merged in upstream code or is there something that needs to be done for that?

     
    • xDraconian

      xDraconian - 2019-12-29

      The ticket is 8 years old, so no, we cannot merge the patch without some
      due diligence first.  I don't know the history of why it was not merged
      eight years ago, but I'll assume it wasn't officially rejected.

      If someone takes the time to test the patch against the current code,
      and potentially make edits to ensure it works properly with the current
      code base, then it can be resubmitted as a new merge request.

      Scott

      On 12/27/19 12:58 PM, "Jakub Kákona" wrote:

      Hi, is there some chance the patch will be merged in upstream code or
      is there something that needs to be done for that?


      [codetickets:#595]
      https://sourceforge.net/p/flightgear/codetickets/595/ Support for
      electric motors in YASim (patch provided)

      Status: Done
      Milestone:
      Labels: YASIM Expired
      Created: Thu Jan 12, 2012 03:30 AM UTC by Anonymous
      Last Updated: Fri Dec 27, 2019 06:48 PM UTC
      Owner: nobody
      Attachments:

      /Originally created by:/ i...@beware.dropbear.id.au
      http://code.google.com/u/114297321497058531580/

      I have created a model of an ultra micro electric powered model plane
      in YASim. I started by using a gasoline engine model but it is not a
      good fit.

      Both the turbine engine model and the piston engine model consume fuel
      which changes the mass and balance of the aircraft. While a battery
      powered plane's "fuel" does run out, it doesn't weigh anything. Also
      the piston engine and turbine engines are poor models for an electric
      engine in other respects such as altitude effects, torque/speed
      characteristic and response time.

      I have created a simple electric engine model which uses no fuel and
      has a torque/speed characteristic of a DC electric motor. The
      parameters are easily found: Kv, Rm and V.

      It would be nice to have an electric current fuel type and a "tank"
      which holds amp-hours, but the fuel consumption model in YASim seems
      to presume that fuel is measured and consumed by mass, so I didn't go
      that far. Also, I have only done one kind of electric motor, and the
      characteristics can be greatly affected by the electronic speed
      control. Still, I think it is a better model than a piston engine or a
      turbine engine!

      Patch attached.


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/flightgear/codetickets/595/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Tickets: #595

  • Slawek Mikula

    Slawek Mikula - 2019-12-28

    Hi, I've forwarded it to te developer's mailing list - for check and give explanation for the quality of the patch itself. Jakub, do you use this patch for your work and can you give more information is it correctly implemented and what issues/missing functions it may have yet ?

     
  • Henning

    Henning - 2020-01-06

    I will have a look...

     
  • Henning

    Henning - 2020-01-06

    There are some issues with formating and "coding style" (latter are my personal view of cource and may be due to the age of the patch). What I am missing is some more documentation (e.g. verbose variable names or comments that explain things). Kv, Rm, omega0 are not self-explaining.
    As I did not work with the engine code in detail yet, I cannot even tell, if this patch will create a working engine, this would need more time.

     
  • Slawek Mikula

    Slawek Mikula - 2020-01-06

    Maybe Jakub can extend it and elaborate needs expressed by Henning (work needed on the patch) ? Jakub please, if you want to move it forward, work on the new version of the patch. If not, the ticket (I suppose) will be left as closed.

     
  • Jakub Kákona

    Jakub Kákona - 2020-01-06

    Ok, I will try to make a new merge request, containing the patch and possible improvements mentioned by Henning.

     
  • Henning

    Henning - 2020-01-06

    Hi again,
    please find attached modified patch file for illustration. I added some iniitializers in the .hpp
    getTorque0 is defined but does not seem to be used anywhere so my best guess is we can calcuclate a _torque0 once in the constructor and use that in calc.
    As already said, verbose parameters / variables would make the code much easier to read and understand.

     
    • Jakub Kákona

      Jakub Kákona - 2020-01-06

      Ok, did you make modifications in patch file itself or in patched files? Because I have troubles with the new patch usage with git apply.

      error: corrupt patch at line 59
      
       
  • Henning

    Henning - 2020-01-07

    ups :/ I hacked in the patch file. maybe that was not a good idea - I was not working on my development box.
    no need to use my patch, but it may illustrate some ideas maybe.

     

Log in to post a comment.

MongoDB Logo MongoDB