PDA

View Full Version : Math question for some ubersmartypants



BaldieJr
12-16-2004, 01:18 AM
Consider these results:
<pre class="ip-ubbcode-code-pre">
-1828.8 meters = 1
0.0 meters = 127
1828.5 meters = 255
</pre>

What mathmatical equation would result in this being true?

This is on topic. I'll explain later.

SerpentBlade
12-16-2004, 01:26 AM
Its almost linear...

so you can say y=14.4X-1843

c-ber3
12-16-2004, 02:03 AM
Taking the meters value as the variable you are controlling I get:

y = 0.07x + 127

BBB_Hyperion
12-16-2004, 03:15 AM
There are 2 solutions i can think of at the moment .

1st Lagrange Interpolating Polynomial
http://mathworld.wolfram.com/LagrangeInterpolatingPolynomial.html

2nd Newton Interpolation Polynomial
http://math.fullerton.edu/mathews/numerical/np.htm

-1828.8 meters = 0
0.0 meters = 127
1828.5 meters = 255

After Lagrange i would say

y(x) = 127.0 + 0.07 * x + 0.153 *10^-6 * x^2

x(y) = -1.828.8 *10^-3 + 14.457 * x - 0.45*10^-3 * x^2

They may not be 100 % accurate cause only 3 point far from each other http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif

Tully__
12-16-2004, 03:20 AM
The right hand side is the decimal conversion of the binary 1's complement or 2's complement (don't recall which) notation for a scaled binary representation of the range -1828.8 to 1828.5 using 8 bits of data.

BaldieJr
12-16-2004, 07:45 AM
y = 0.07x + 127 does it and seems work at any point along the scale.

I'm assuming it was arrived at by using the equations BBB_Hyperion posted. Unfortunatly, its all voodoo to my weakened mind, so I'll probably be asking more questions like this in the future http://forums.ubi.com/images/smilies/16x16_smiley-very-happy.gif

Consider this:

I have this VSI printed:
http://www.simpits.org/database/graphics/Gauges/biggauges/G_ww2_vert.jpg

(sorry for the size)

I have a servo that turns 180 degrees. I'm going to extend the range by gearing the output 2:1 (giving 360 degrees).

The VSI is calibrated at x1000 fps.

Devicelink reports variometer settings at mps.

So, full deflection (+/-6000 ft) equals 1828.8 (+/-).

The servo interface requires input values 1-255. Sending 0 shuts the interface down, 1 sends it to max counter-clockwise, 255 sends the servo to max clockwise, and 127 sends it to hard-home (center).

Now, I know at least one of you is going to say "that VSI is not 360 degrees!". I know. I need to measure the angle of the unused portion of the guage and compensate. I'll buy a protractor tomorrow, I swear!

I've been having a lot of fun with this servo controller and devicelink, but some of the math involved is waaaay outside my envelope of reasoning

http://forums.ubi.com/images/smilies/35.gif

buz13
12-16-2004, 08:32 AM
Oh,,,veeeeeeeery interesting...and I thought it was just another explanation as to why the patch is delayed.... http://forums.ubi.com/images/smilies/53.gif

BBB_Hyperion
12-16-2004, 08:51 AM
http://www.pilotfriend.com/flight_training/aircraft%20instruments/Vertical%20Speed%20Indicator%20(VSI).htm

When you gear it 2 to 1 you must also change the equitation cause now every 2nd position isnt viewable .) The unused area not substracted.

12000 / 360 = 33 ft per degree 255 / 360 = 0,7 position per degree

0.7 = 33 ft cause only every 2nd can be displayed 1.4 = 66 ft is detailed enough i guess .)

BaldieJr
12-16-2004, 09:02 AM
http://forums.ubi.com/images/smilies/blink.gif I somehow understood what you just wrote http://forums.ubi.com/images/smilies/blink.gif

Here's the fun part: the guage doesn't work. It sits at 0 and only moves off under extreme dive/climb angles.

So I check the variables as reported by the game. The VSI in the cockpit says -6. Devicelink is saying -43.73

The docs say its meters/second, but thats obviously not what I'm getting, or I don't understand the VSI at all (quite possible).

BaldieJr
12-16-2004, 01:46 PM
A brief demonstration:

http://www.hi-techredneck.org/Movie.wmv

My deepest thanks!

There are 3 servos running. Left to right they are:
Roll (reversed)
Pitch
VSI (limited to 180 degrees until I can get the gears I need)

The AI is flying the plane. I need an o-scope to veryfy what appears to be a glitch in the game (or in my electronics).

GoatseLives
12-16-2004, 04:21 PM
A collection of dimes and quarters has a total value of $2.75. If there are 3 times as many dimes as quarters, how many of each coin is in the collection?

BaldieJr
12-16-2004, 07:11 PM
42

Wolf-Strike
12-16-2004, 07:23 PM
5 quarters and 15 dimes???

BaldieJr
12-16-2004, 07:28 PM
Ya know, my coworkers think i'm a nut-job, but when I showed them the movie they were completely blown away.

You people suck.

http://forums.ubi.com/images/smilies/53.gif

F19_Orheim
12-16-2004, 07:33 PM
<BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by BaldieJr:
42 <HR></BLOCKQUOTE>
http://forums.ubi.com/images/smilies/25.gif http://forums.ubi.com/images/smilies/11.gif

BaldieJr
12-16-2004, 08:03 PM
No no no.

LOOK AT THIS (http://www.hi-techredneck.org/Movie.wmv)

C'mon. I'm proud of it. Say something.

Loki-PF
12-16-2004, 08:46 PM
dood I salute you!

I also must recognize the fact that you have entirely too much leisure time on your hands! Of which I am extremely envious. I don't even have enough free time to fly as much as I want, let alone tinker!

Good on ya mate

BaldieJr
12-16-2004, 09:55 PM
THANK YOU FOR NOTICING!!!!1

http://forums.ubi.com/images/smilies/16x16_smiley-very-happy.gif http://forums.ubi.com/images/smilies/16x16_smiley-very-happy.gif http://forums.ubi.com/images/smilies/16x16_smiley-very-happy.gif http://forums.ubi.com/images/smilies/16x16_smiley-very-happy.gif http://forums.ubi.com/images/smilies/16x16_smiley-very-happy.gif http://forums.ubi.com/images/smilies/16x16_smiley-very-happy.gif

While it is still rough around the edges, I think it does a great job of proving this sim as "cutting edge" as any sim out there.

BBB_Hyperion
12-17-2004, 03:19 AM
Btw BaldieJr what was command to activate devicelink on server for clients ?

WWSensei
12-17-2004, 04:05 AM
Tully has it right. It's that range of numbers because that's the range you can represent using 1 and 2's complement in an a 8 bit variable.

Dog.Corban
12-17-2004, 08:12 AM
Congratulations! You have won the ubersmarty pants award DEC 2004 for the most technical & confusing post & extreme nerdness anyone attempting to better this will have to be on the ball BE SURE!

http://www.gamespec.co.uk/1ubersmartypants.jpg

AFJ_Locust
12-17-2004, 08:43 AM
Baldie how come I cant watch your movie ??

It looks all green & orange & well just messed up....

I wana see it dang it

BlitzPig_DDT
12-17-2004, 09:34 AM
Really cool stuff but...........what about the screen?

Let's say you complete the pit and have all the instruments up and working, you then see them doubled on the screen.

If you turn the onscreen pit off, you now have vis you really shouldn't, plus are limited in your online options.

Not to mention how each pit is different and it would be odd flying a 109 in a Corsair pit (for example).

Not knocking it at all. I just wish there was a better on screen view alternative to wonder woman view.

BaldieJr
12-18-2004, 12:27 AM
Here's my thoughts on that...

By the time this thing is done, no one will be flying this series http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif

So, I'll just play offline. If I can somehow afford to continue development and keep up with modern gaming hardware, I'll use the gear with other games. If not, I can just live with DCG http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif

Locust:
Are you using Windows Media Video 9 or better?

Dog.Corban
12-18-2004, 08:52 AM
Reference my post above just joking there was some great stuff done by amateur developers for cfs 1,2,3 which a lot of people got great enjoyment out of,interesting project

http://www.gamespec.co.uk/1reel%20em%20in.jpg

BaldieJr
12-19-2004, 01:26 PM
<BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by BBB_Hyperion:
Btw BaldieJr what was command to activate devicelink on server for clients ? <HR></BLOCKQUOTE>

If its even possible, I believe the server would have to enable devicelink in conf.ini but list only the port being used, or list nothing at all.

I never tested it. I'm just making a giant guess http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif

TX-EcoDragon
12-19-2004, 01:54 PM
Just a side note. . . you also need to convert the output to feet per minute (not feet per second) if you want that VSI face to work. As it is now the needle wont move very much at all using the graduations that you have on the face. That face is sourced from an aircraft that uses fpm.

BaldieJr
12-19-2004, 03:08 PM
This little detail was pointed out to me in ORR.

I made some software adjustments and the guage is now accurate within its range of motion. As soon as I recieve the gears I've ordered, I should be able to extend the range to +/- 6000 fpm http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif

I've also ordered a new servo motor that, if workable, should cut the build costs considerably.

Charlie_52ndVFW
12-19-2004, 04:24 PM
Have you looked at Phidgets yet? They have a complete SDK for C, VB, and Java. Very easy to use for this like this if you have the data out already down pat.

Interested to see how you are using DL.

BaldieJr
12-19-2004, 04:39 PM
Phidgets are to pricey. I build on a shoe-string budget of about $40/ month.

These guages are the tip of the iceberg really. I don't have the cash to do what I really want, so I'm busying myself with the things I can afford to do.