Jump to content
The simFlight Network Forums
TRodick

Setting Spoilers/Speedbrakes via Offset 0BD0

Recommended Posts

Hi all,

 

I'm working with Jason Fayre on the Talking Flight Monitor project, the accessibility add-on for FSX and Prepar3d. One of our users asked for the ability to set spoilers/speedbrakes to an arbitrary percentage; in the sim, the keyboard command (slash key by default) either sets them to full or off, with no way to fine-tune their extension. The notes for the offset (0BD0) say that a value of 4800 is armed, but that 5620 is the minimum you can set that actually causes extension. 5620 is 7% extended, and 16383 is 100%. I'm fairly good at math, but I'm confused by the snippet that says: "The percentage extension is the proportion of the distance in the range 4800 to 16383..." I can't figure out, for the life of me, a good formula that can be used to convert an arbitrary percentage value into the value to write to the offset. I consider myself a decent coder, but the way FSUIPC and SimConnect represent things can sure make for some difficult calculations. :) Any help would be greatly appreciated.

 

Thanks,

Tyler

Share this post


Link to post
Share on other sites
3 hours ago, TRodick said:

I can't figure out, for the life of me, a good formula that can be used to convert an arbitrary percentage value into the value to write to the offset.

As it says, 5620 is 7% and 16383 is 100% (well, on the ground -- bear in mind that in flight the maximum the spoiler really goes to is about 70 or 80% (don't remember which). In the latter case it is known as "speedbrake" rather than "spoiler").

So, if you want x% then if x < 7, don't bother.

Otherwise, consider 93% is spread over (16383 - 5620) points in this scale.  So 1% = 10763 / 93 = 115.73, near enough.

So for x% where x >7, you'd use 5620 + ((x - 7) * 115.73), rounded down to an integer.

3 hours ago, TRodick said:

I consider myself a decent coder, but the way FSUIPC and SimConnect represent things can sure make for some difficult calculations. 🙂

It's really neither FSUIPC nor SimConnect, just the way that axis works internally.

Note that this is not the same in MSFS.

Pete

 

Share this post


Link to post
Share on other sites

You said round down to an integer. Are you saying follow the standard math rounding rules, or a simple truncation?

Share this post


Link to post
Share on other sites
9 hours ago, TRodick said:

You said round down to an integer. Are you saying follow the standard math rounding rules, or a simple truncation?

Sorry it wasn't clear. "Rounding down" is the same as truncation if you mean just discarding the fractional part.

Pete

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.