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

Some KA-50 gauges showing too small values #791

Closed
usagiyon opened this issue Jan 16, 2024 · 4 comments
Closed

Some KA-50 gauges showing too small values #791

usagiyon opened this issue Jan 16, 2024 · 4 comments
Assignees
Labels
bug Something isn't working Delivered Code for this issue is in a generally available Helios Release fixed Code is complete, waiting for release

Comments

@usagiyon
Copy link

usagiyon commented Jan 16, 2024

  • Helios 1.6.6050.001
  • DCS Open Beta 2.9.2.49940

Some gauges provided for KA-50 by Helios (Profile Editor's Toolbox / KA-50 Gauges) displays too small values.
I haven't checked all gauges. The most distinct are Rotor RPM gauge, QFE and Rotor Blade Angle gauge. There might be more.

The rotor rpm gauge is off about 4-5% at high rpm's (around 100% rpm). The error will go smaller as rpm value goes down.
I figured out that if I use factor 1.05 for TriggerValue in Helios Editor, then gauge will display quite accurate values:

Screenshot 2024-01-16 193245

In screenshot above I used Custom gauge along with 'baked in' gauge as I cross checked their behavior. Both had same issue.

What I have checked is that routines itself in KA-50 plugin seems to work properly (did small test program to get values).
When https://github.com/HeliosVirtualCockpit/Helios/blob/master/Aircraft%20Ka-50%20Plugin/Gauges/RotorRPM/RotorRPM.cs receives a value, it will calculate proper value for needle.

I also tried to fiddle with json interface and changed it's values from:

{
  "heliosType": "DCS.Common.ScaledNetworkValue",
  "device": "Rotor",
  "name": "RPM",
  "description": "Rotor RPM",
  "exports": [
    {
      "format": "%.4f",
      "id": "52"
    }
  ],
  "baseValue": 0.0,
  "scale": 110.0,
  "valueDescription": "(0-110)",
  "unit": "RPMPercent"
},

to

{
  "heliosType": "DCS.Common.ScaledNetworkValue",
  "device": "Rotor",
  "name": "RPM",
  "description": "Rotor RPM",
  "exports": [
    {
      "format": "%.4f",
      "id": "52"
    }
  ],
  "baseValue": 0.0,
  "scale": 116.0,
  "valueDescription": "(0-116)",
  "unit": "RPMPercent"
},

Which also works as it's essentially same as 110 * 1.05

My guess is that something happens for value received from DCS before it is passed to KA-50 plugin.

The engine RPM-% gauge which is similar to rotor rpm works fine and has almost 1:1 code in plugin.

@usagiyon usagiyon added the New Issue Label given to issues which have not yet been triaged label Jan 16, 2024
@usagiyon
Copy link
Author

I did some more digging and fixed this with small code change.
Is the fix proper way, I am not sure as I am not that familiar with architecture of Helios.

There's nonlinearity in gauge.
Although values seems like they should just map by using factor 110 for values 0 ... 1, in reality DCS does not behave that way.
For example, for rotor rpm value 93% DCS will output value (roughtly) 0.82 which will be 90% when scaled with factor 110 which is used in interfaces and which will work for extremes (0 and 1).

Here's lookout table I made:

Arg     Calc    DCS     
0       0       0%      
0.1     11%     11%     
0.2     22%     23%    
0.3     33%     35%     
0.4     44%     46%     
0.5     55%     58%     
0.6     66%     69%     
0.7     77%     80%     
0.8     88%     91%     
0.9     99%     101%    
1.0     110%    110%    

With this, fix is:
In file: https://github.com/HeliosVirtualCockpit/Helios/blob/master/Aircraft%20Ka-50%20Plugin/Gauges/RotorRPM/RotorRPM.cs
Line 34:
_needleCalibration = new CalibrationPointCollectionDouble(0d, 0d, 110d, 346.5d);
should be replaced with:

            _needleCalibration = new CalibrationPointCollectionDouble(0d, 0d, 110d, 346.5d);
            _needleCalibration.Add( new CalibrationPointDouble( 33d, 110d ) );  // in gauge: 35%
            _needleCalibration.Add( new CalibrationPointDouble( 55d, 182d ) );  // in gauge: 58%
            _needleCalibration.Add( new CalibrationPointDouble( 88d, 287d ) );  // in gauge: 91%
            _needleCalibration.Add( new CalibrationPointDouble( 99d, 312d ) );  // in gauge: 101%

If this is the proper way for fix, I can put changes to git.

@BlueFinBima BlueFinBima self-assigned this Jan 18, 2024
@BlueFinBima
Copy link

@usagiyon Thanks for "rolling up your sleeves" and getting stuck in. It is great to seek folk helping the project and themselves. What you've shown in calibration filter changes above is the (or at least one) way of correcting this. Typically you would make the changes in your fork on GitHub, and then create a Pull Request to get your changes considered for inclusion in Helios.
You mentioned in your first post that there were several gauges which were inaccurate, so I suggest that you make adjustments to all the affected gauges before submitting the PR. Many thanks for the contribution.

@usagiyon
Copy link
Author

Pull Request: #794

@BlueFinBima BlueFinBima added bug Something isn't working fixed Code is complete, waiting for release Awaiting Delivery Fixed and awaiting shipment in a new release and removed New Issue Label given to issues which have not yet been triaged labels Jan 21, 2024
@BlueFinBima BlueFinBima added Delivered Code for this issue is in a generally available Helios Release and removed Awaiting Delivery Fixed and awaiting shipment in a new release labels Jan 29, 2024
@BlueFinBima
Copy link

Shipped in 1.6.606. Many thanks for the contribution to Helios

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Delivered Code for this issue is in a generally available Helios Release fixed Code is complete, waiting for release
Projects
None yet
Development

No branches or pull requests

2 participants