Closed DheerendraTomar closed 4 years ago
But your throttle value in your GUI screenshot is 0 and sure enough the thrust being generated by the engines is also pretty much 0 in your GUI screenshot.
That is an old screenshot (I mentioned that screenshot is for illustration purpose only). I will upload the new screenshots and data file csv.
Without actual data output, e.g. graphing the control positions versus time plus a bunch of useful states like alpha, theta, thrust etc. versus time it's very difficult to help debug.
But a couple of random things I noticed.
Any reason for not using the default dt
- as opposed to fdm['simulation/dt'] = 0.017
(58.8Hz)?
Also this looks incorrect: fdm['fcs/throttle-cmd-norm'[-1]] = throttle_cmd
, it should be fdm['fcs/throttle-cmd-norm[-1]'] = throttle_cmd
Your version is the equivalent of: fdm[m] = throttle_cmd
. You have the same error as part of setting your initial conditions, so I'm guessing you're ending up with no thrust/idle thrust.
No need for setting the mixture for a turbofan fdm['fcs/throttle-cmd-norm'[-1]] = throttle_cmd
Thanks you. I will share the graphs tomorrow.
The frequency part is a rounding error. It was supposed to be 60Hz. I have fixed it.
You have guessed it correct. I am ending up with no thrust/idle thrust. I am using fdm['fcs/throttle-cmd-norm'[-1]] = throttle_cmd
because it doesn't work like fdm['fcs/throttle-cmd-norm[-1]'] = throttle_cmd
. I get an error(uploaded the screenshot with this comment). Any idea why the thrust command doesn't work your way.
Removed the mixture command.
Any reason not to go with the default frequency of 120Hz which you get if you don't explicitly set dt
?
Rather paste console output as text as opposed to as a bitmap, e.g. like the following. Makes it indexable for searching etc.
>>> fdm['fcs/throttle-cmd-norm[-1]'] = 0.8
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "jsbsim.pyx", line 998, in jsbsim.FGFDMExec.__setitem__
File "jsbsim.pyx", line 1148, in jsbsim.FGFDMExec.set_property_value
RuntimeError: unterminated index (looking for ']')
I thought the python wrapper would end up passing in -1 for the engine number to SetThtottleCmd()
, but it must be trying to parse the indexed property name and getting confused.
Remember the -1 idea is simply a shortcut to apply the throttle value to all engines, particularly useful if the script code doesn't care about the number of engines etc.
But in your case for now since you know you're dealing with a 2 engine aircraft simply pass the throttle command to both engines, i.e.
fdm['fcs/throttle-cmd-norm[0]'] = joystick_throttle
fdm['fcs/throttle-cmd-norm[1]'] = joystick_throttle
The thrust part is solved. I used your method to set throttle command to each engine. The frequency is set to 60 Hz to keep the file size small and I believe it will affect the learning of reinforcement agent(which will interact with the simulator at less frequency the simulator frequency) in a good way. I will paste the command line output as mentioned by you.
I will keep the thread open for now as I will post the graphs tomorrow to seek your advice. Many thanks
@seanmcleod These are the graphs before I made the correction suggested by you. Pleas note that I was trying to stall the aircraft that's why 0 thrust is there. But, idle thrust is 32%, which was not working because of the wrong command for throttle (which is fixed now.) Everything is working as expected now.
The image below is stick input to control the pitch.
Which airbus a320 model do you suggest to simulate aircraft stall more accurately than this? Presently I am using the A320 model provided by JSBSim.
If you want to accurately simulate the aircraft near, at and possibly just past the stall then you need to find a model which has accurate data for that region, i.e. accurate data for things like the coefficient of lift for those alpha angles, and coefficient of drag around those angles, Cm-alpha
around those alpha angles etc.
A lot of models won't have accurate data around that region. I'm not familiar with the data for the A320 model that comes with JSBSim.
Okay. Thank you so much.
Hi all,
I am not able to understand why the aircraft is falling down from sky. I am taking control inputs from joystick (which is working fine). I am visualising the simulation in FlightGear. I am attaching my python code below. Also, I am not able to figure out which is the variable to monitor vertical velocity of the aircraft.
`import jsbsim import time
`
The aircraft is initialsed using below configuration:
`<?xml version="1.0"?>
`
I have attached the snapshot of the a basic GUI(for illustration purpose only) of for monitoring the variables as well. I am attaching the picture below.
I am attaching a snapshot of the command line to which prints basic configuration of the aircraft. I don't know what is wrong which my code or settings. Why the aircraft is falling down?