legoboyvdlp / A320-family

A high-quality Airbus A320 simulation for the open source simulator, FlightGear
GNU General Public License v2.0
149 stars 44 forks source link

Feature Request - Stall simulation #162

Closed DheerendraTomar closed 4 years ago

DheerendraTomar commented 4 years ago

Does this Airbus family support almost accurate stall simulation?

legoboyvdlp commented 4 years ago

Are you talking about the flight dynamics or the warnings / fly by wire? :)

DheerendraTomar commented 4 years ago

I am more interested in dynamics (like it should simulate accurate stall). If there are stall warnings then It is a plus point.

Octal450 commented 4 years ago

Hi, I'm working on this in the new aero model. It will take some time to be correct, but it will be done. The current one did not take any stall into account.

I will add protections to the FBW as well once the aero is sorted out.

Lego will have the warnings and such done I assume.

Kind Regards, Josh

legoboyvdlp commented 4 years ago

At the moment, there is a stall warning based off angle of attack -- it is accurate to the real aircraft; there also is alpha floor -- I have not verified this yet, according to maintenance manual, but it should also be accurate. I will verify this sometime soon.

So, on my end, the warnings are all per the real aircraft.

What is missing at present is the FBW protections as stated above.

DheerendraTomar commented 4 years ago

Hi,

That is so good to hear that you are working on it. Do you have any timeline for this feature?

And How do I use this model with JSBSim?

DheerendraTomar commented 4 years ago

At the moment, there is a stall warning based off angle of attack -- it is accurate to the real aircraft; there also is alpha floor -- I have not verified this yet, according to maintenance manual, but it should also be accurate. I will verify this sometime soon.

So, on my end, the warnings are all per the real aircraft.

What is missing at present is the FBW protections as stated above.

Hi,

Stall warning based on angle of attack sounds good as well. I am new to this Aerospace but I am learning and would be giving back to the open source community very soon. Thanks

merspieler commented 4 years ago

Note that it's very hard to even get into a stall... A.FLOOR kicks in to prevent an actual stall. To really test the stall behavior, you've got to get rid of the protections.

Like with every thing we do... it comes, when it comes...

You just run flightgear as usual... JSBSim run silently in the background for you

DheerendraTomar commented 4 years ago

Hi,

I am using JSBSim with python and using FlightGear just for visualisation. The aircraft is controlled using algorithms. I am pretty sure there will be a way to disable protection systems, right?

DheerendraTomar commented 4 years ago

Hi,

If anyone can direct me to the files which contain the 'stall warning based on angle of attack' section for the aircraft. It will be a great help. Thanks

merspieler commented 4 years ago

Well... I've never run JSBSim on it's own... but it shouldn't be different to any other aircraft.

You can disable the protections by going to "A320-family" -> "Aircraft Config" -> "FBW Settings" and check "Define Custom FBW Mode", Then you can change between the different Laws as you like.

DheerendraTomar commented 4 years ago

Alright, I will check it out. I can see that there are different control laws. Thanks for this.

Octal450 commented 4 years ago

You should not do that, you should run it as normal. I cannot guarantee that anything related to FDM and FBW will work correctly of you do that. The model was designed to be used in Flightgear and needs modification to work properly elsewhere.

Josh

DheerendraTomar commented 4 years ago

FlightGear also uses JSBSim at the backend. I think it will not cause a problem to use this model with JSBSim. I will check it out and will update on this thread.

Octal450 commented 4 years ago

Yes, I am aware obviously, My point is that the FLYbywire relies on things that will only work if FG is used, especially the pitch axis, so I can't verify that it will work properly or realistically.

Kind Regards, Josh

DheerendraTomar commented 4 years ago

Hi Josh, I didn't know that FLYbywire works like that. However, I will try it out and post the results here. Keeping my finger crossed. One question though, Aircraft is defined in XML and JSBSim needs that only (XML definitions) what might go wrong? Thanks and regards, Dheerendra

Octal450 commented 4 years ago

Hi. Its because in order to make the FlyByWire act like the actual aircraft, some things did not go well in JSBsim. In addition, there is a lot of legacy code that is still needing to be rewritten in NASAL that control the FlyByWire in JSBsim, causing that missing will cause either JSBsim to throw errors, or FlyByWire (or FCS) to not work properly. An example of this is the pitch G load controller. When I attempted this in JSBsim, I ran into problems with the way the integrator respects the output clamps, the solution was to use FG's property rule for the integrator instead.

Can you give me a more better explanation as why to do it this way instead of using JSBsim "built-in" to FG? Perhaps then I can better help you achieve the goal!

Kind Regards, Josh

DheerendraTomar commented 4 years ago

Hi, Thanks for the explanation.

I am writing a reinforcement learning environment. I just need to pass in the side stick controls and receive the state from the environment. I used X-Plane before. But, the problem with X-Plane was when an episode ends, the reloading made the aircraft upset (there was a sinusoidal movement). I tried many things to make it work like turning back the autopilot on so that the aircraft is stable and cruising at some altitude but it was so heavy on processing and made the learning very slow. So, I dropped X-Plane. Then, I came to know about JSBSim and moved ahead with it. I am using python language through out this project and it is proving to be good. It's just the Airbus A320 model which is provided with JSBSim is not accurate for my task.

Thanks and regards, Dheerendra

Octal450 commented 4 years ago

Hi, Thanks for the info. The JSBsim model here needs a lot of work, and it will take time before I am able to finish the correct model. That is likely why you are seeing this, as the model currently available in sim does not have correct stall behavior at all. This will be correct in time with the new calculations for aerodynamics in all 6 axis.

Kind Regards, Josh

DheerendraTomar commented 4 years ago

Hi,

So, you mean this FlightGear model once worked upon will also work in standalone JSBSim, right?

Thanks and regards, Dheerendra

Octal450 commented 4 years ago

Negative, I'm just reworking the aerodynamics not the FBW for now - maybe I'll look at it again later, last time was 2 years ago about.

Kind Regards, Josh

DheerendraTomar commented 4 years ago

Alright. Thanks

DheerendraTomar commented 4 years ago

Hi Josh,

I have one question. If I want to go ahead to create a flight model which works with JSBSim and also simulates stall behaviour, how should I proceed? I have found a tool DATCOM which says that it generates model files for FG, JSBSim and others, if you insert dimensions of an aircraft. Is this the right direction to go in order to design a A320 model for JSBSim which simulates stall?

Thanks and regards, Dheerendra

legoboyvdlp commented 4 years ago

To be clear, the current model does stall, its just not verified to be an accurate stall.

DheerendraTomar commented 4 years ago

But it doesn't work with JSBSim. I have tried this model in FG and it works quite good but is not so accurate.

Octal450 commented 4 years ago

The aero will always work in JSBsim, the FBW ans FCS does not and that won't change unless you make your own which doesn't do what mine does.

I would recommend VSPaero over DATCOM personally.

We already know the stall is wrong now, it will be addressed. Remember that we are hobbyists, not professional programmers or engineers.

Kind Regards, Josh

DheerendraTomar commented 4 years ago

Hi Josh,

Yes! I tried to run this model in JSBSim by disabling some part of the code like FBW, didn't succeed. However, I would like to know how should I proceed to write my own FCS (I don't really need FBW) in python for this model. I will check out VSPaero.

I really appreciate the work you guys are doing. I didn't mean to offend you guys in my last comment.

Thanks and regards, Dheerendra

Octal450 commented 4 years ago

Hi, You can use the existing FCS, just remove the FBW from it and set your own properties there for control. (a320-fcs.xml) You will also need a320-spoilers.xml for the spoilers, or else aero will not start. Let me know if that makes sense.

No worries!

Kind Regards, Josh

DheerendraTomar commented 4 years ago

Hi,

Thanks for this information. I will try it out and get back to you.

:) Thanks and Regards, Dheerendra

Octal450 commented 4 years ago

You're most welcome!

Josh