Page 2 of 3

Re: Another Nasal issue

Posted: Thu Oct 05, 2017 6:45 pm
by IAHM-COL
oh that's good.
Im still clueless

Re: Another Nasal issue

Posted: Thu Oct 05, 2017 11:59 pm
by Octal450
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

Re: Another Nasal issue

Posted: Fri Oct 06, 2017 4:26 pm
by LesterBoffo
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
#  }

Re: Another Nasal issue

Posted: Fri Oct 06, 2017 4:47 pm
by Octal450
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

Re: Another Nasal issue

Posted: Mon Oct 09, 2017 4:31 pm
by LesterBoffo
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.

Re: Another Nasal issue

Posted: Mon Oct 09, 2017 6:36 pm
by Octal450
No problem.
Any further problems, feel free to ask.

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

Kind Regards,
Josh

Re: Another Nasal issue

Posted: Mon Oct 09, 2017 6:38 pm
by Octal450
No problem.
Any further problems, feel free to ask.

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

Kind Regards,
Josh

Re: Another Nasal issue

Posted: Mon Oct 09, 2017 7:42 pm
by IAHM-COL
Repeated... Repeated :D

Re: Another Nasal issue

Posted: Mon Oct 09, 2017 10:53 pm
by Octal450
lol WTF

Kind Regards,
Josh

Re: Another Nasal issue

Posted: Sat Oct 21, 2017 1:28 pm
by LesterBoffo
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.