Another Nasal issue

Everything in connection with developing aircraft for FlightGear
User avatar
IAHM-COL
Posts: 5616
Joined: Sat Sep 12, 2015 3:43 pm
Location: Homey, NV (KXTA) - U.S.A
Contact:

Re: Another Nasal issue

Postby IAHM-COL » Thu Oct 05, 2017 6:45 pm

oh that's good.
Im still clueless
R.M.S.
If we gave everybody in the World free software today, but we failed to teach them about the four freedoms, five years from now, would they still have it? Probably not, because if they don’t recognise their freedoms, they’ll let their freedoms fall

User avatar
it0uchpods
Posts: 2092
Joined: Sun Oct 18, 2015 2:47 am
Location: A far corner of my room.
Contact:

Re: Another Nasal issue

Postby it0uchpods » Thu Oct 05, 2017 11:59 pm

Hi
Is there still an issue? If so, maybe I can help solve it.

Can you post your latest revision of the code, and the exact error?

Kind Regards,
Josh
it0uchpods/WTF411

FlightGear Aircraft Developer
Lead Programmer at the it0uchpods Design Group
Download High Quality Aircraft from it0uchpods Hangar

User avatar
LesterBoffo
Posts: 751
Joined: Tue Sep 15, 2015 3:58 am
Location: Beautiful sunny, KOTH

Re: Another Nasal issue

Postby LesterBoffo » Fri Oct 06, 2017 4:26 pm

it0uchpods wrote:Hi
Is there still an issue? If so, maybe I can help solve it.

Can you post your latest revision of the code, and the exact error?

Kind Regards,
Josh


Hi Josh,

So far this is what I have. I have to add that the improvement in the toggling is still present, but it doesn't adjust the mixture with altitude yet. I've been remming out lines so it's a bit of a hash. I'm still getting a console complaint about the last line of code being a parse error, it always calls the last line. I'm not sure I should be using the " return 0;' on the altitude/mixture table functions.

Code: Select all

#### Set Diesel idle level/cutoff with throttle position and mixture with altitude.

var pos_throttle   = props.globals.getNode("controls/engines/engine[0]/throttle");
var pos_mixture   = props.globals.getNode("controls/engines/engine[0]/mixture");
var pos_gear   = props.globals.getNode("gears/gears[1]/wow");
var pos_alt         = props.globals.getNode("instrumentation/altimeter/pressure-alt-ft");


 setlistener("/controls/engines/engine[0]/throttle", func {
   var throttle = pos_throttle.getValue();
   if (throttle >= 0.05)   { pos_mixture.setValue(1.0); return 0; }
   if (throttle > 0)   { pos_mixture.setValue(0.068); return 0; }
   pos_mixture.setValue(0);
 });

#### Set mixture to alt level
  setlistener("/gears/gears[1]/wow", func {
    var gear = pos_gear.getValue();
     if (gear = false)  { pos_gear.setValue(1.0); return 0;
      if (gear = true)  { pos_mixture.setValue(1.0); return 0;
   var alt = pos_alt.getValue();
   var mixture = "controls/engines/engine[0]/mixture";
   if (alt >= 15000) { pos_mixture.setValue(0.59); return 0;
   ##   }
  ##    if (getprop(alt) < 15000) {
   ##   setprop (mixture, 0.59);
   ##   }
   if (alt >= 10000) { pos_mixture.setValue(0.71); return 0;
   ##   }
  ## if (getprop(alt) < 10000) {
   ##   setprop (mixture, 0.82);
   ##   }
   if (alt >= 5000) { pos_mixture.setValue(0.84); return 0;
   ##   }
  ##   if (getprop(alt) < 5000) {
   ##   setprop (mixture, 0.94);
   ##   }
      if (alt > 3000) { pos_mixture.setValue(0.91); return 0;
   ##    }

var MixtureInit = func {
var AltInit = func {

  settimer(env_effects, 2);
  settimer(mixture_loop, 3);   
  settimer(alt_loop, 3);
   
  # Delay startup a bit to allow things to initialize
#  }

User avatar
it0uchpods
Posts: 2092
Joined: Sun Oct 18, 2015 2:47 am
Location: A far corner of my room.
Contact:

Re: Another Nasal issue

Postby it0uchpods » Fri Oct 06, 2017 4:47 pm

Hi
Of the last line is giving a parse error, it usually means you forgot a " somewhere.

Code: Select all

var mixture = "controls/engines/engine[0]/mixture";

That wont work
try

Code: Select all

var mixture = getprop("controls/engines/engine[0]/mixture");


Kind Regards,
Josh
it0uchpods/WTF411

FlightGear Aircraft Developer
Lead Programmer at the it0uchpods Design Group
Download High Quality Aircraft from it0uchpods Hangar

User avatar
LesterBoffo
Posts: 751
Joined: Tue Sep 15, 2015 3:58 am
Location: Beautiful sunny, KOTH

Re: Another Nasal issue

Postby LesterBoffo » Mon Oct 09, 2017 4:31 pm

I think I've got it solved thanks to Josh's hints. Thanks again 8-)

I just need to fine tune the optimum base mixture for altitude with this weird engine. Normally, most Diesels don't have a throttle plate or air restriction across their intake and they run purely on the metered amount of Diesel oil fuel injected into the cylinder. I think you can throttle an IC recip engine in either YAsim or JSB-sim by leaving the throttle wide open and cutting back on the mixture, and it won't overheat or go into pre-detonation like in real life gasoline engines would.

User avatar
it0uchpods
Posts: 2092
Joined: Sun Oct 18, 2015 2:47 am
Location: A far corner of my room.
Contact:

Re: Another Nasal issue

Postby it0uchpods » Mon Oct 09, 2017 6:36 pm

No problem.
Any further problems, feel free to ask.

In my JSB props, I use a FCS overwrite to control mixture.

Kind Regards,
Josh
it0uchpods/WTF411

FlightGear Aircraft Developer
Lead Programmer at the it0uchpods Design Group
Download High Quality Aircraft from it0uchpods Hangar

User avatar
it0uchpods
Posts: 2092
Joined: Sun Oct 18, 2015 2:47 am
Location: A far corner of my room.
Contact:

Re: Another Nasal issue

Postby it0uchpods » Mon Oct 09, 2017 6:38 pm

No problem.
Any further problems, feel free to ask.

In my JSB props, I use a FCS overwrite to control mixture.

Kind Regards,
Josh
it0uchpods/WTF411

FlightGear Aircraft Developer
Lead Programmer at the it0uchpods Design Group
Download High Quality Aircraft from it0uchpods Hangar

User avatar
IAHM-COL
Posts: 5616
Joined: Sat Sep 12, 2015 3:43 pm
Location: Homey, NV (KXTA) - U.S.A
Contact:

Re: Another Nasal issue

Postby IAHM-COL » Mon Oct 09, 2017 7:42 pm

Repeated... Repeated :D
R.M.S.
If we gave everybody in the World free software today, but we failed to teach them about the four freedoms, five years from now, would they still have it? Probably not, because if they don’t recognise their freedoms, they’ll let their freedoms fall

User avatar
it0uchpods
Posts: 2092
Joined: Sun Oct 18, 2015 2:47 am
Location: A far corner of my room.
Contact:

Re: Another Nasal issue

Postby it0uchpods » Mon Oct 09, 2017 10:53 pm

lol WTF

Kind Regards,
Josh
it0uchpods/WTF411

FlightGear Aircraft Developer
Lead Programmer at the it0uchpods Design Group
Download High Quality Aircraft from it0uchpods Hangar

User avatar
LesterBoffo
Posts: 751
Joined: Tue Sep 15, 2015 3:58 am
Location: Beautiful sunny, KOTH

Re: Another Nasal issue

Postby LesterBoffo » Sat Oct 21, 2017 1:28 pm

So after a week or so of tinkering with the Nasal file I've decided that the Nasal solution is kaput. I can reasonably make this idea work with some changing around of the YASim FDM parameters and keep this change entirely within the FDM's .xml file.

This is a great thing, I've also been able to do the same for a nasty helicopter FDM nasal, the less nasal calls within FG in my old Win XP OS the better.

And it all works great, there none of the Nasal's at-cross-purposes interference with each setting, and the engine runs like a true Diesel with pretty good power and fuel economy at altitude.


Return to “Aircraft Development”

Who is online

Users browsing this forum: No registered users and 1 guest