The simFlight Network Forums

# More Slope Calculation Problems

## Recommended Posts

Peter,

I appreciate all your time an effort fixing the slope problems I found before... unfortunately I think I found a few more related things in version 4.718.

1. When going to the negative side of an axis, the slope initially outputs a slight positive rise before beginning to output negative values.

That is when the axis input goes below 0, the slope output rises to the positive side before it drops below 0.

1.png shows everything centered and at 0

2.png shows negative input, but positive output from slope

3.png shows negative input, and the first negative output form slope (crossover)

2. When the center of an axis is not 0 but negative, the slope will only begin to output non-zero negative values after the input is below the negative center and above 0, but not in between.

That is, if my center is -512, the slope will output only a 0 value between -512..0, but will then begin to output negative values below -512, and positive values above 0.

4.png shows center at -512, input at -456, but output still 0

5.png show input above 0 with output correct

6.png shows input below center, and output as non zero

3. On my aileron axis, the minimum step of 16 that I set in the INI seems to be ignored and defaults to 512

However, this seems to be fine on the elevator axis, so I'm not sure if it has something to do with the center, since with a center 0 it loads correctly.

7.png shows the 512 step but below is the part of the INI where it's set to 16

```Aileron=-16192,512,16,15808
Elevator=-16192,-512,16,16192
Rudder=-12288,0,16,12288
```

Regards,

John

##### Share on other sites

1. When going to the negative side of an axis, the slope initially outputs a slight positive rise before beginning to output negative values.

That is when the axis input goes below 0, the slope output rises to the positive side before it drops below 0.

I can't reproduce that nor see how it can happen. And I'm sorry, but your "png"s are way too small for me to see. Rather than taking pictures why not just state the numbers?

2. When the center of an axis is not 0 but negative, the slope will only begin to output non-zero negative values after the input is below the negative center and above 0, but not in between.

That is, if my center is -512, the slope will output only a 0 value between -512..0, but will then begin to output negative values below -512, and positive values above 0.

The "centre" is a range between two values, not "at -512". If the range is set at -512 to 0 then what you say happens is exactly right, as designed.

3. On my aileron axis, the minimum step of 16 that I set in the INI seems to be ignored and defaults to 512

Most hardware axes cannot give very small increments. For example my PFC throttle quadrant axes only have an output value from - to 127. This is scaled up by the driver to get the -16k to +16k standard range, so the minimum increment is 256. some axes are 'better' some worse. And they can vary on the same device. For instance on the Microsoft Sidewinder's the throttle wheel has much less resolution than the aileron/elevator axes.

If you want to see the raw hardware inputs you have to set RAW mode. This stops the Windows scaling. However, all axes on a single joystick have to be RAW or scaled. Windows doesn't allow different axes on the same joystick to be read in different modes.

However, this seems to be fine on the elevator axis, so I'm not sure if it has something to do with the center, since with a center 0 it loads correctly.

You showed the calibrations from the INI but I would need the slope settings and the Assignments (Axes settings) too.

[LATER]

LogExtras=9

into the [General] section of the INI file before loading FS, then it will log the pre-calibration and post-calibration values. You'll get big logs but perhaps you can cut to the parts showing what problem(s) you seem to identify.

I'm afraid there's no similar facility in FSUIPC3.

Regards

Pete

##### Share on other sites

I can't reproduce that nor see how it can happen. And I'm sorry, but your "png"s are way too small for me to see. Rather than taking pictures why not just state the numbers?

If you click/download on the PNGs they should be full size, but I'll enable logs with the new version and post those...

The "centre" is a range between two values, not "at -512". If the range is set at -512 to 0 then what you say happens is exactly right, as designed.

So in the INI excerpt I posted, what defines the "range" on the center? Is it always the second number to 0? On the elevator 512 seems to be the center (not range) but on the aileron -512..0 seems to be the "center".

Most hardware axes cannot give very small increments. For example my PFC throttle quadrant axes only have an output value from - to 127. This is scaled up by the driver to get the -16k to +16k standard range, so the minimum increment is 256. some axes are 'better' some worse. And they can vary on the same device. For instance on the Microsoft Sidewinder's the throttle wheel has much less resolution than the aileron/elevator axes.

Just moving my controller, the smallest incremental change that appears is about 10 (I'm using one of Bodnar's controllers, 12-bit, that exhibits a raw range of about 400-3600) so I was forcing it to 16 in the INI. I'll post the full section when I post the logs. But the issue still is that upon loading it picks 512 on the aileron axis despite it being set at 16. This is likely the result of the centering setting though.

##### Share on other sites

So in the INI excerpt I posted, what defines the "range" on the center? Is it always the second number to 0? On the elevator 512 seems to be the center (not range) but on the aileron -512..0 seems to be the "center".

The four numbers in the INI are the same four numbers you "SET" in the calibration, left to right:

minimum, low centre, high centre, maximum

The centre range in the part between the two centre values. That's why there ARE two centre values you set on screen. Isn't that clear from the documentation? What did you think there were two centre values in the calibration section on screen for? The step by step instructions do tell you to set them both.

Just moving my controller, the smallest incremental change that appears is about 10 (I'm using one of Bodnar's controllers, 12-bit, that exhibits a raw range of about 400-3600) so I was forcing it to 16 in the INI. I'll post the full section when I post the logs. But the issue still is that upon loading it picks 512 on the aileron axis despite it being set at 16. This is likely the result of the centering setting though.

Without the relevant parts of your INI file to look at I can't really comment on this part.

Checking the code, the default is 512, and there's no minimum Delta imposed on axes X Y Z R U V S and T, which are the usual 8 analogue ones. However, but 0 is set for P Q M and N with are POVs ("Points of view"), which either switch in 45 or 90 degree angles or (possibly) every individual degree (though I've never seen any of the latter, it can be done by software).

Regards

Pete

##### Share on other sites

Got it about the "center". My confusion... this also answers my step question.

Here's the output for the calibrated values going positive first, when input goes negative:

```
218900 Axis calibration: Control=65763, Original=34, Calibrated=36
218931 Axis calibration: Control=65763, Original=43, Calibrated=56
218978 Axis calibration: Control=65763, Original=53, Calibrated=76
219009 Axis calibration: Control=65763, Original=43, Calibrated=56
219056 Axis calibration: Control=65763, Original=24, Calibrated=16
219103 Axis calibration: Control=65763, Original=43, Calibrated=56
219259 Axis calibration: Control=65763, Original=34, Calibrated=36
219462 Axis calibration: Control=65763, Original=24, Calibrated=16
219493 Axis calibration: Control=65763, Original=14, Calibrated=0
219540 Axis calibration: Control=65763, Original=24, Calibrated=16
219587 Axis calibration: Control=65763, Original=4, Calibrated=0
221989 Axis calibration: Control=65763, Original=-5, Calibrated=500
222020 Axis calibration: Control=65763, Original=0, Calibrated=0
222067 Axis calibration: Control=65763, Original=-15, Calibrated=480
222098 Axis calibration: Control=65763, Original=-45, Calibrated=420
222145 Axis calibration: Control=65763, Original=-35, Calibrated=440
222176 Axis calibration: Control=65763, Original=-45, Calibrated=420
222348 Axis calibration: Control=65763, Original=-55, Calibrated=400
222426 Axis calibration: Control=65763, Original=-74, Calibrated=362
222457 Axis calibration: Control=65763, Original=-64, Calibrated=382
222504 Axis calibration: Control=65763, Original=-93, Calibrated=322
222535 Axis calibration: Control=65763, Original=-64, Calibrated=382
222582 Axis calibration: Control=65763, Original=-74, Calibrated=362
222660 Axis calibration: Control=65763, Original=-64, Calibrated=382
222707 Axis calibration: Control=65763, Original=-84, Calibrated=342
222816 Axis calibration: Control=65763, Original=-103, Calibrated=302
222894 Axis calibration: Control=65763, Original=-113, Calibrated=282
222987 Axis calibration: Control=65763, Original=-132, Calibrated=244
223019 Axis calibration: Control=65763, Original=-142, Calibrated=224
223097 Axis calibration: Control=65763, Original=-132, Calibrated=244
223190 Axis calibration: Control=65763, Original=-142, Calibrated=224
223221 Axis calibration: Control=65763, Original=-132, Calibrated=244
223299 Axis calibration: Control=65763, Original=-123, Calibrated=262
223346 Axis calibration: Control=65763, Original=-152, Calibrated=204
223377 Axis calibration: Control=65763, Original=-132, Calibrated=244
223424 Axis calibration: Control=65763, Original=-152, Calibrated=204
223455 Axis calibration: Control=65763, Original=-142, Calibrated=224
223502 Axis calibration: Control=65763, Original=-152, Calibrated=204
223533 Axis calibration: Control=65763, Original=-132, Calibrated=244
223580 Axis calibration: Control=65763, Original=-142, Calibrated=224
223627 Axis calibration: Control=65763, Original=-162, Calibrated=184
223658 Axis calibration: Control=65763, Original=-152, Calibrated=204
223705 Axis calibration: Control=65763, Original=-172, Calibrated=162
223736 Axis calibration: Control=65763, Original=-162, Calibrated=184
223783 Axis calibration: Control=65763, Original=-172, Calibrated=162
223814 Axis calibration: Control=65763, Original=-162, Calibrated=184
223861 Axis calibration: Control=65763, Original=-172, Calibrated=162
223908 Axis calibration: Control=65763, Original=-181, Calibrated=144
223939 Axis calibration: Control=65763, Original=-172, Calibrated=162
223986 Axis calibration: Control=65763, Original=-201, Calibrated=104
224017 Axis calibration: Control=65763, Original=-172, Calibrated=162
224064 Axis calibration: Control=65763, Original=-201, Calibrated=104
224095 Axis calibration: Control=65763, Original=-220, Calibrated=66
224142 Axis calibration: Control=65763, Original=-210, Calibrated=86
224189 Axis calibration: Control=65763, Original=-201, Calibrated=104
224220 Axis calibration: Control=65763, Original=-240, Calibrated=26
224267 Axis calibration: Control=65763, Original=-250, Calibrated=6
224345 Axis calibration: Control=65763, Original=-240, Calibrated=26
224376 Axis calibration: Control=65763, Original=-259, Calibrated=-7
224423 Axis calibration: Control=65763, Original=-250, Calibrated=6
224469 Axis calibration: Control=65763, Original=-259, Calibrated=-7
224547 Axis calibration: Control=65763, Original=-279, Calibrated=-27
224579 Axis calibration: Control=65763, Original=-259, Calibrated=-7
224625 Axis calibration: Control=65763, Original=-279, Calibrated=-27
224906 Axis calibration: Control=65763, Original=-289, Calibrated=-37
224984 Axis calibration: Control=65763, Original=-279, Calibrated=-27
225093 Axis calibration: Control=65763, Original=-289, Calibrated=-37
225187 Axis calibration: Control=65763, Original=-279, Calibrated=-27
225218 Axis calibration: Control=65763, Original=-289, Calibrated=-37
225296 Axis calibration: Control=65763, Original=-279, Calibrated=-27
225343 Axis calibration: Control=65763, Original=-289, Calibrated=-37
225546 Axis calibration: Control=65763, Original=-298, Calibrated=-46
225655 Axis calibration: Control=65763, Original=-308, Calibrated=-56
225733 Axis calibration: Control=65763, Original=-318, Calibrated=-66
225780 Axis calibration: Control=65763, Original=-327, Calibrated=-75
225905 Axis calibration: Control=65763, Original=-318, Calibrated=-66
225936 Axis calibration: Control=65763, Original=-337, Calibrated=-85
225983 Axis calibration: Control=65763, Original=-347, Calibrated=-96
226014 Axis calibration: Control=65763, Original=-357, Calibrated=-106
226061 Axis calibration: Control=65763, Original=-337, Calibrated=-85
226092 Axis calibration: Control=65763, Original=-347, Calibrated=-96
226217 Axis calibration: Control=65763, Original=-367, Calibrated=-116
226263 Axis calibration: Control=65763, Original=-357, Calibrated=-106
226295 Axis calibration: Control=65763, Original=-347, Calibrated=-96
226341 Axis calibration: Control=65763, Original=-357, Calibrated=-106
226373 Axis calibration: Control=65763, Original=-367, Calibrated=-116
226419 Axis calibration: Control=65763, Original=-377, Calibrated=-126
226451 Axis calibration: Control=65763, Original=-386, Calibrated=-135
226497 Axis calibration: Control=65763, Original=-377, Calibrated=-126
226622 Axis calibration: Control=65763, Original=-367, Calibrated=-116
226653 Axis calibration: Control=65763, Original=-377, Calibrated=-126
226700 Axis calibration: Control=65763, Original=-406, Calibrated=-155
226731 Axis calibration: Control=65763, Original=-425, Calibrated=-175
226778 Axis calibration: Control=65763, Original=-445, Calibrated=-195
226825 Axis calibration: Control=65763, Original=-454, Calibrated=-204
226856 Axis calibration: Control=65763, Original=-474, Calibrated=-224
226903 Axis calibration: Control=65763, Original=-484, Calibrated=-234
226934 Axis calibration: Control=65763, Original=-474, Calibrated=-224
227012 Axis calibration: Control=65763, Original=-484, Calibrated=-234
227137 Axis calibration: Control=65763, Original=-503, Calibrated=-253
227184 Axis calibration: Control=65763, Original=-513, Calibrated=-272
227215 Axis calibration: Control=65763, Original=-503, Calibrated=-253
227262 Axis calibration: Control=65763, Original=-513, Calibrated=-272
```

Here's the calibration section from the INI (assignments are through FSX):

```
ExcludeThrottleSet=Yes
ExcludeMixtureSet=Yes
ExcludePropPitchSet=Yes
SepRevsJetsOnly=No
ApplyHeloTrim=No
UseAxisControlsForNRZ=No
FlapsSetControl=0
FlapDetents=No
MaxThrottleForReverser=256
SteeringTillerControl=0
MaxSteerSpeed=60
Aileron=-16192,0,16,15808
Elevator=-16192,0,16,16192
Rudder=-12288,0,16,12288
LeftBrake=-16192,20480
RightBrake=-16192,20480
Throttle1=-16192,0,0,16192/40
Throttle2=-16192,0,0,16192/40
Mixture1=-16192,0,0,16192/40
Mixture2=-16192,0,0,16192/40
PropPitch1=-16192,0,0,16192/40
PropPitch2=-16192,0,0,16192/40
SlopeRudder=3
SlopeRightBrake=4
SlopeLeftBrake=4
SlopeAileron=-2
SlopeElevator=-1
```

##### Share on other sites

Here's the calibration section from the INI (assignments are through FSX)

Er, I don't understand. If the assignments are through FSX, not FSUIPC4, where does the step (delta) question come into it?

I'll look at your negative problem later this week, as I'm a bit tied up with other things. I cannot see anything likely in the code, and I have no easy way of testing anything like this as the best resolution input device I have only gives steps of 256, and I suspect it is to do with the granularity of the slopes. There are only 256 points pre-computed on each slope's curve, each interval representing 256 input points, and linear interpolation is used between them. Looking at your log it is probably no coincidence that the crossover point appears to be 256, or at least between 250 and 259:

224376 Axis calibration: Control=65763, Original=-259, Calibrated=-7

224423 Axis calibration: Control=65763, Original=-250, Calibrated=6

I'm going to have to write a software joystick input "device" to fiddle the input figures. If I don't get to it this week, please remind me in the first week of September. (I am on holiday all next week).

Regards

Pete

##### Share on other sites

Er, I don't understand. If the assignments are through FSX, not FSUIPC4, where does the step (delta) question come into it?

Disregard the center/delta question. It was my misunderstanding.

I'll look at your negative problem later this week, as I'm a bit tied up with other things. I cannot see anything likely in the code, and I have no easy way of testing anything like this as the best resolution input device I have only gives steps of 256, and I suspect it is to do with the granularity of the slopes. There are only 256 points pre-computed on each slope's curve, each interval representing 256 input points, and linear interpolation is used between them. Looking at your log it is probably no coincidence that the crossover point appears to be 256, or at least between 250 and 259:

224376 Axis calibration: Control=65763, Original=-259, Calibrated=-7

224423 Axis calibration: Control=65763, Original=-250, Calibrated=6

I'm going to have to write a software joystick input "device" to fiddle the input figures. If I don't get to it this week, please remind me in the first week of September. (I am on holiday all next week).

Regards

Pete

It's interesting that as soon as the input goes negative, the output jumps to 500+ (could it be 512 at -1?) If it's linearly interpolated, the interpolation should be to the negative side, 0..-512. I'm sure it's some minor logic issue... Thanks!

##### Share on other sites

On a quick unrelated topic, I'd like to ask you a weather related question since FSUIPC handles some of that...

Would you know what the units are for Min/MaxGustTime, Min/MaxVarTime etc. in FSX.cfg (seconds, 1/10 sec, 1/100)? I find that the gusty winds are not gusty enough, at least not like they are here in real-life, and would want to start tweaking.

I just thought I'd ask an authority. :)

##### Share on other sites

Would you know what the units are for Min/MaxGustTime, Min/MaxVarTime etc. in FSX.cfg (seconds, 1/10 sec, 1/100)? I find that the gusty winds are not gusty enough, at least not like they are here in real-life, and would want to start tweaking.

Sorry, I've never twiddled with those. If I needed to I'd try to find out by trying changes and seeing what happened.

Regards

Pete

##### Share on other sites

Wind gusts are handled through your weather program and should be adjusted through there!

##### Share on other sites

I'm going to have to write a software joystick input "device" to fiddle the input figures.

Okay. I managed to reproduce it with a software "joystick" with a resolution of 10 units over the 32k range. It looks like my correction to your previously reported problem was not correct, and in fact was responsible for introducing this new problem. Basically the crossover point, pos to neg or vice versa, was one "slope table" division out (512 units) because of a sign error in a remainder. The remainder needs to take the sign of the dividend and it wasn't because I stupidly used "&" instead of "%"!

Please try FSUIPC 4.725 and re-check that i haven't reintroduced the original error please.

Regards

Pete

##### Share on other sites

Please try FSUIPC 4.725 and re-check that i haven't reintroduced the original error please.

The new version fixed this problem, but I think reintroduced the original one... on the negative side of input, the outputs flip-flop (decrease then increase then decrease etc.)

Notice the decrease in "original" at -14358 but an increase in "calibrated", and the same thing at -15100. This seems less pronounced than originally though, but it's still visible in-cockpit.

```
286527 Axis calibration: Control=65763, Original=-14173, Calibrated=-15168
286559 Axis calibration: Control=65763, Original=-14193, Calibrated=-15188
286590 Axis calibration: Control=65763, Original=-14212, Calibrated=-15207
286621 Axis calibration: Control=65763, Original=-14222, Calibrated=-15217
286652 Axis calibration: Control=65763, Original=-14251, Calibrated=-15245
286683 Axis calibration: Control=65763, Original=-14281, Calibrated=-15275
286715 Axis calibration: Control=65763, Original=-14319, Calibrated=-15312
286761 Axis calibration: Control=65763, Original=-14358, Calibrated=-15350
286793 Axis calibration: Control=65763, Original=-14407, Calibrated=-15104
287011 Axis calibration: Control=65763, Original=-14632, Calibrated=-15363
287042 Axis calibration: Control=65763, Original=-14680, Calibrated=-15411
287073 Axis calibration: Control=65763, Original=-14710, Calibrated=-15440
287105 Axis calibration: Control=65763, Original=-14739, Calibrated=-15469
287136 Axis calibration: Control=65763, Original=-14768, Calibrated=-15497
287167 Axis calibration: Control=65763, Original=-14846, Calibrated=-15574
287198 Axis calibration: Control=65763, Original=-14885, Calibrated=-15612
287229 Axis calibration: Control=65763, Original=-14963, Calibrated=-15689
287261 Axis calibration: Control=65763, Original=-15051, Calibrated=-15775
287307 Axis calibration: Control=65763, Original=-15100, Calibrated=-15823
287339 Axis calibration: Control=65763, Original=-15159, Calibrated=-15616
287760 Axis calibration: Control=65763, Original=-15412, Calibrated=-15874
287791 Axis calibration: Control=65763, Original=-15461, Calibrated=-15922
```

##### Share on other sites

The new version fixed this problem, but I think reintroduced the original one.

Weird.

It is very difficult to debug without any suitable input devices. I have to try to devise ways of simulating things by program. All my analogue devices are PFC via serial port and handled directly via my PFC drivers.

I might not have time to look at this in sufficient detail for a couple of weeks. I'll have a quick look now for anything obvious, but the code is so simple for the slope application I really can't see how it goes wrong. i have to actually feed the numbers through it at just the right point for it to throw its wobbly. not easy to do.

Looking now .. but if you haven't heard back by mid-September, remind me,

Pete

##### Share on other sites

Looking now ..

Please try FSUIPC 4.726. This has to be my last attempt before September I'm afraid. I've tested as best I can and "dry run" it with assorted near-boundary conditions.

Regards

Pete

##### Share on other sites

Please try FSUIPC 4.726. This has to be my last attempt before September I'm afraid. I've tested as best I can and "dry run" it with assorted near-boundary conditions.

I think this fixed both problems... Thanks, and have a good vacation!

##### Share on other sites

I think this fixed both problems

Ah, at last! ;-)

Thanks,

Pete

## Create an account

Register a new account