[simpits-tech] How 1 hour becomes 3+ (Progress update)

Wiebe, Alex simpits-tech@simpits.org
Tue, 26 Feb 2002 10:08:34 -0600


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C1BEDF.D79671F0
Content-Type: text/plain

What a night! A while back a managed to assemble my HSI gauge, but hadn't
found time to get the software working. Over the weekend I grabbed WideFS
(thanks Gene for the pointer) and last night I started tackling more then
one problem at once (never a good sign). I've been staying up far too late
over the last few nights, and had decided to give my pit a good 1 hour, and
then go to bed. I even set my watch alarm to 9:50PM to remind myself to be
responsible and get some sleep...

I rewrote my servo driver to be an executable so I can use WideFS instead of
the bulkier FS98 installation. I then tried to get it to work with the newly
build HSI - nothing.

So I wrote a test program, and spent a long time wondering why the pitch /
bank information wasn't changing. (beep-beep-beep - its 9:50, I'm so close I
can taste it! Just a couple more minutes.)

Turns out the math routines were performing rounding too soon. After
changing the 

'* 360 / (65356 * 65356)'

to the following;

'* 360.0 / (65356.0 * 65356.0)'

the data started working! Wheee! (At this point it is 10:30PM)

Well, now I have the program working, and the HSI is sitting there looking
at me. Ok, port the code to the driver and see if it works. Then I'll go to
bed. Well, it turns, but the pitch is inverted! Easy fix, recompile and go.
Pitch is fixed. Bank is off. I knew it would be - the servo was mounted with
a best guess as to centre (for that matter so was the pitch - guess I got
lucky there).

Add a fudge factor, recompile, test, repeat.

It's close, but, the bank range is limited to +/- 45 degrees! (It's now
11:30PM, time for bed, I'll fix it another day)

I thought I had the controller driving the servo +/- 90 degrees! Nope,
forgot that jumper. Adding the jumper only takes 2 minutes! Dang, now I need
to recalibrate it... lather,rinse,repeat

12:00AM Hooray! It's working! I wonder what it looks like mounted in the
dash (I just painted it "Knight's Armour" on the weekend)?

12:30AM After a couple touch-n-goes, the instrument looks pretty sweet. I
stumble into bed mumbling something about hoping the coffee's extra strong
at work tomorrow...

http://www.geocities.com/ehud42/pics/HSI_Construction/gallery.htm

------_=_NextPart_001_01C1BEDF.D79671F0
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>How 1 hour becomes 3+ (Progress update)</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>What a night! A while back a managed to assemble my =
HSI gauge, but hadn't found time to get the software working. Over the =
weekend I grabbed WideFS (thanks Gene for the pointer) and last night I =
started tackling more then one problem at once (never a good sign). =
I've been staying up far too late over the last few nights, and had =
decided to give my pit a good 1 hour, and then go to bed. I even set my =
watch alarm to 9:50PM to remind myself to be responsible and get some =
sleep...</FONT></P>

<P><FONT SIZE=3D2>I rewrote my servo driver to be an executable so I =
can use WideFS instead of the bulkier FS98 installation. I then tried =
to get it to work with the newly build HSI - nothing.</FONT></P>

<P><FONT SIZE=3D2>So I wrote a test program, and spent a long time =
wondering why the pitch / bank information wasn't changing. =
(beep-beep-beep - its 9:50, I'm so close I can taste it! Just a couple =
more minutes.)</FONT></P>

<P><FONT SIZE=3D2>Turns out the math routines were performing rounding =
too soon. After changing the </FONT>
</P>

<P><FONT SIZE=3D2>'* 360 / (65356 * 65356)'</FONT>
</P>

<P><FONT SIZE=3D2>to the following;</FONT>
</P>

<P><FONT SIZE=3D2>'* 360.0 / (65356.0 * 65356.0)'</FONT>
</P>

<P><FONT SIZE=3D2>the data started working! Wheee! (At this point it is =
10:30PM)</FONT>
</P>

<P><FONT SIZE=3D2>Well, now I have the program working, and the HSI is =
sitting there looking at me. Ok, port the code to the driver and see if =
it works. Then I'll go to bed. Well, it turns, but the pitch is =
inverted! Easy fix, recompile and go. Pitch is fixed. Bank is off. I =
knew it would be - the servo was mounted with a best guess as to centre =
(for that matter so was the pitch - guess I got lucky =
there).</FONT></P>

<P><FONT SIZE=3D2>Add a fudge factor, recompile, test, repeat.</FONT>
</P>

<P><FONT SIZE=3D2>It's close, but, the bank range is limited to +/- 45 =
degrees! (It's now 11:30PM, time for bed, I'll fix it another =
day)</FONT>
</P>

<P><FONT SIZE=3D2>I thought I had the controller driving the servo +/- =
90 degrees! Nope, forgot that jumper. Adding the jumper only takes 2 =
minutes! Dang, now I need to recalibrate it... =
lather,rinse,repeat</FONT></P>

<P><FONT SIZE=3D2>12:00AM Hooray! It's working! I wonder what it looks =
like mounted in the dash (I just painted it &quot;Knight's Armour&quot; =
on the weekend)?</FONT></P>

<P><FONT SIZE=3D2>12:30AM After a couple touch-n-goes, the instrument =
looks pretty sweet. I stumble into bed mumbling something about hoping =
the coffee's extra strong at work tomorrow...</FONT></P>

<P><FONT SIZE=3D2><A =
HREF=3D"http://www.geocities.com/ehud42/pics/HSI_Construction/gallery.ht=
m" =
TARGET=3D"_blank">http://www.geocities.com/ehud42/pics/HSI_Construction/=
gallery.htm</A></FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C1BEDF.D79671F0--