Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjusting mixture keyboard sensitivity #623

Closed
gilbertohasnofb opened this issue Dec 12, 2015 · 53 comments

Comments

Projects
None yet
4 participants
@gilbertohasnofb
Copy link
Member

commented Dec 12, 2015

Reporter by kjd.nc in the forum:

C172p Mixture control is erratic

Hover the mouse over the mixture knob

  • Key 'm' repeatedly (don't hold it down) and watch the mixture % increase

Expected Result: for each keystroke, I expected the mixture to increase by 1% (controls.adjMixture(1)).
Actual Result: somewhere between 12 and 25%, it jumps suddenly to, usually 38%. There are several non-incremental jumps.

Same thing happens with 'M' to decrease the mixture.
Same kind of thing happens with my custom keyboard binding in effect to controls.adjMixture(5) and -5 instead of 1 and -1.
Same thing happens on FG3.6 and on FG3.7, DMG dated 5 December.
Same thing happens whether I'm using the laptop keyboard or an external bt keyboard.
MacOS 10.11.2, MacBook Pro.

I haven't found any other aircraft whose mixture control advertised the current setting. If someone would like me to try one in particular, I'll be happy to download that model.

In reality it isn't erratic, but the behaviour isn't the best either. Pressing m increases the mixture by 0.00825 and then FG rounds it when hoovering (the opposite is true for M). This means that some numbers may be skipped, while others may appear twice. It's nitpicking, but it costs nothing to make the value 0.01.

@gilbertohasnofb gilbertohasnofb added this to the FlightGear 3.8 feature freeze milestone Dec 12, 2015

@gilbertohasnofb

This comment has been minimized.

Copy link
Member Author

commented Dec 12, 2015

@onox what do you think?

@onox

This comment has been minimized.

Copy link
Member

commented Dec 12, 2015

Where do you see that number 0.00825?

@gilbertohasnofb

This comment has been minimized.

Copy link
Member Author

commented Dec 12, 2015

Sorry, I was not very clear. It's the property controls/engines/current-engine/mixture, which ranges between 0.0 and 1.0. Set it to 0.0 then press m once, and it will increase by that value. But actually you must hit the key very quickly, anything longer will output something larger than 0.00825. So indeed it's very erratic as the user reported.

@onox

This comment has been minimized.

Copy link
Member

commented Dec 12, 2015

Can you ask that user what controls.adjMixture(1) does for other aircraft?

@gilbertohasnofb

This comment has been minimized.

Copy link
Member Author

commented Dec 12, 2015

Lines 222-227 from our engine.nas:

controls.adjMixture = func {
    var delta = arg[0] * controls.THROTTLE_RATE * getprop("/sim/time/delta-realtime-sec");
    var old_value = getprop("/controls/engines/current-engine/mixture");
    var new_value = std.max(0.0, std.min(old_value + delta, 1.0));
    setprop("/controls/engines/current-engine/mixture", new_value);
};
@onox

This comment has been minimized.

Copy link
Member

commented Dec 12, 2015

I'm interested in knowing whether he always gets the same increment if repeats the experiment multiple times.

Also, in the c172p you get increments of 1 or 2 %, not 12 to 25 % when you press the m key.

@onox

This comment has been minimized.

Copy link
Member

commented Dec 12, 2015

@gilbertohasnofb Here's the truth: Nasal/controls.nas in FGDATA uses THROTTLE_RATE and /sim/time/delta-realtime-sec for adjMixture. That file also defines adjThrottle, but in keyboard.xml it actually uses incThrottle, which does not use that /sim/time/delta-realtime-sec property, but instead always increments/decrements by 0.01.

@onox

This comment has been minimized.

Copy link
Member

commented Dec 12, 2015

So if that user says that m key is erratic, it should be erratic for all airplanes.

@gilbertohasnofb

This comment has been minimized.

Copy link
Member Author

commented Dec 12, 2015

I see. So is there a way to make at least our plane non-erratic from our side or would that require a modification to FGDATA?

@onox

This comment has been minimized.

Copy link
Member

commented Dec 12, 2015

Well, first I want to know from that user if the m key is "erratic" for all this airplanes, because it should if the code uses controls.adjMixture.

@gilbertohasnofb

This comment has been minimized.

Copy link
Member Author

commented Dec 12, 2015

I see, I will ask him.

@onox

This comment has been minimized.

Copy link
Member

commented Dec 12, 2015

Second, we have to ask ourselves what kind of behavior we want. Do we want a consistent time between 0 % and 100 %, or do we want consistent increments, which means that the duration from 0 to 100 % will depend on the frame rate.

@onox

This comment has been minimized.

Copy link
Member

commented Dec 12, 2015

If you're tuning the mixture/throttle while in flight you probably want consistent increments, but if you quickly need full throttle (when going around for example) then I would see we need consistent time.

@onox

This comment has been minimized.

Copy link
Member

commented Dec 12, 2015

@gilbertohasnofb His propeller pitch (n/N) should be "erratic" as well.

@gilbertohasnofb

This comment has been minimized.

Copy link
Member Author

commented Dec 12, 2015

Ok, I will inform him of these things and ask for tests.

@gilbertohasnofb

This comment has been minimized.

Copy link
Member Author

commented Dec 12, 2015

Second, we have to ask ourselves what kind of behavior we want. Do we want a consistent time between 0 % and 100 %, or do we want consistent increments, which means that the duration from 0 to 100 % will depend on the frame rate.

The problem of that is if the changes aren't consistent, fine tuning becomes impossible. But that said, who needs to adjust mixture to 1% of precision anyway?

@gilbertohasnofb

This comment has been minimized.

Copy link
Member Author

commented Dec 12, 2015

By the way, I forgot to add the link to the forum in case anyone is interested: http://forum.flightgear.org/viewtopic.php?f=68&t=28257

@gilbertohasnofb

This comment has been minimized.

Copy link
Member Author

commented Dec 12, 2015

The user informed us that he isn't aware of large skips in mixture with other planes as most do not have tooltips, and he is going to watch that property I mentioned before and test other planes.

@kjd-nc

This comment has been minimized.

Copy link

commented Dec 12, 2015

Thanks for your help, Gilberto. I found the logging setting to capture the /controls/engines/engine/mixture value in the .csv log file, so I can check out some other aircraft that way. I just tried it again, using the C172 in FG36 with the default mixture resolution (adjMixture(+/-1)) and this time, the biggest jump I saw was from 42% to 48% in a single keystroke. I was probably tapping my key more slowly this evening than I was this morning.

I don't know what the frame rate on my mac is -- I've seen some mention of displaying it, but I haven't been able to find it this evening. If you'll advise how I can watch that, I'll enable it.

Kevin

@onox

This comment has been minimized.

Copy link
Member

commented Dec 12, 2015

I don't know what the frame rate on my mac is -- I've seen some mention of displaying it, but I haven't been able to find it this evening.

Go to "Debug" and then click on "Cycle On-Screen Statistics". Press F10 to hide the menu bar. The frame rate is shown in the top left corner.

@kjd-nc

This comment has been minimized.

Copy link

commented Dec 12, 2015

On that flight, while sitting on the tarmac, which was where I was when I was testing the mixture behavior, I was getting between 20 and 30 FPS. Once I began flying, I normally was between 50 and 65, although sometimes it would get down into the 10's or 20's, at which point the sim did indeed get choppy.

If the answer to this issue is that it's an artifact of the real-time behavior of the control, I'm OK with that. I don't expect to be adjusting many controls by hair's breadths, especially not in a situation where I'd need high real-time performance.

@gilbertohasnofb

This comment has been minimized.

Copy link
Member Author

commented Dec 12, 2015

@kjd-nc but can you tell if those large skips happen when the sim get choppy? If yes, then that may explain the problem.

@gilbertohasnofb

This comment has been minimized.

Copy link
Member Author

commented Dec 14, 2015

@kjd-nc I am closing this issue given what we wrote in the forum:

  • no one could reproduce it
  • you also believed it might have been caused by the alterations you made to the code while testing it

If you do happen to see it again, let us know and this will be reopened.

@onox

This comment has been minimized.

Copy link
Member

commented Dec 14, 2015

I thought I had written here that I get different time durations (from 0 to 100 %) depending on FPS, which isn't what I expected. Can anyone reproduce this?

@onox onox removed this from the FlightGear 3.8 feature freeze milestone Dec 14, 2015

@onox onox modified the milestones: FlightGear 2016.3 release, FlightGear 2016.2 release May 17, 2016

@onox onox modified the milestones: FlightGear 2016.3 release, FlightGear 2016.4 release Aug 8, 2016

@onox onox removed their assignment Nov 8, 2016

@onox onox modified the milestones: 2016.4 release, 2017.1 release Nov 9, 2016

@onox onox modified the milestones: 2017.1 release, 2017.2 release Feb 15, 2017

@onox onox modified the milestones: 2017.2 release, 2017.3 release Aug 9, 2017

@onox onox modified the milestones: 2018.1 release, Future release Feb 10, 2018

@gilbertohasnofb

This comment has been minimized.

Copy link
Member Author

commented Mar 10, 2018

@onox reading through this I think this is a won't fix, do you agree we can close it?

@onox

This comment has been minimized.

Copy link
Member

commented Mar 10, 2018

Do we want to keep the current behavior as described in #623 (comment) ?

@gilbertohasnofb

This comment has been minimized.

Copy link
Member Author

commented Mar 10, 2018

Yes, I think that the current behaviour is fine. In RL we don't have such finesse with the levers, particularly in such old aircrafts, so there is no such thing as consistency of adjusting the mixture at values around 1%.

@onox

This comment has been minimized.

Copy link
Member

commented Mar 10, 2018

Okay, let's close it then.

@onox onox closed this Mar 10, 2018

@onox onox added the wontfix label Mar 10, 2018

@onox onox removed this from the Future release milestone Mar 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.