Categories
Uri_ba's pit

First baby pit steps

Now that the pit has arrived it’s time to start putting things in.

with the pit I’ve ordered 3 8″ LCD screens, two for MFD and one for the central console. I have my 27″ monitor and my PC to think about.

placing everything wasn’t easy, I need to think about where the power outlets are in the room, what goes to which outlet (I’m not fond of connecting the massive gaming rig to the same outlet with a treadmill or my soldering iron), where the window is (TIR hell!) and where the door is (I hate sitting with my back to the door – It makes me feel uncomfortable).

while I was trying to figure out where I would place the pit in my workroom, the Better half has suggested we trade room as here work room is more simple and there a lot of stuff in what was my room that are just bulky. So we swapped rooms, now I don’t have to deal with the treadmill, and I only have a closet full of shoes I need to allow access to.. Not the perfect man-cave, but hey, you take what you can get.

Eventually we will have this:

Pit being powered up after initial assembly. Aug. 18th, 2014
Pit being powered up after initial assembly.
Aug. 18th, 2014

But let’s break down what we have.

Categories
Uri_ba's pit

From Desk to Pit (welcome to the nuthouse)

As a person grows into flight sims, his list of toys is getting longer (usually). Personally I’ve started collecting them things back in when I was 6 (circa 1989). My first proper stick I got at the age of 13, a CH FlightStick pro with the CH throttle – I still have them laying around. by 2011 my gaming station looked like this.

Uri's PC - Nov 2010
Uri’s Desk – Nov 2010

this covered the “basics” (or at least for a low budget enthusiest):
X-52 Pro
TIR4
TM MFD’s on Samsung U70 (USB 7″ screens).
with 20″ main monitor.

upgraded with time, I ended up with this:

Uri's Pit - Nov 2013
Uri’s Desk – Nov 2013

TM Warthog
Saitek Combat pedals
TIR4 (same unit)
TM MFD’s (same units)
27″ Main Monitor
18.5″ LCD for displays

But after, after all the tinkering with the DED and Arduino,
I suddenly had to have some more. Armed with a itchy trigger finger and a surprisingly supportive better half (I still have no idea what went through her head) I went ahead with the “must have a pit” plan.

Categories
Uri_ba's pit

DED Adventures – Part 5 – And we’re expanding!

We’ll after we got the DED and FuelFlow sorted out it’s time to think on how to get everything packed for the real pit installation, in addition, when we have things running we get a better clue on available memory and CPU cycle limit. When I’ve changed the way the DED worked, I suddenly realized I’ve cleared the exact amout of memory to drive a second DED, or to be more precise, to drive the PFL. The PFL is identicle to the DED in size and resolution, the the adaptation was very easy, on the PC side of things, PFL uses exact same structure in the SharedMem. so it’s a matter of reusing the DED code.

    //PFL Lines
    char PFLLines[5][26];  //25 usable chars
    char PFLInvert[5][26]; //25 usable chars
DED, PFL and FuelFlow driven by Arduino Micro
DED, PFL and FuelFlow driven by Arduino Micro

Once we have that done, we can get some more thought into final solution. I’ve decided to start with the small scale, the Indexers.

Categories
Uri_ba's pit

DED Adventures – Part 4 – And there be light

OK, So we got the DED and FuelFlow sorted out. we got a way to get the data over and drive the screen. Before we go on, let’s talk a bit about Arduino boards.

Arduino Boards are ATMEGA based development board, putting the I/O pins available for quick connections. Basic Arduinos traditionally have 13 available digital I/O pins and 6 ADC 10bit “analog” Inputs.

the “classic” arduino board is the Arduino Uno.
Based on the ATMEGA328P, a 16MHZ, 2K RAM chip that uses an on-board RS232 chip to handle serial communication via 2 of the 13 IO pins. I’ve done my initial prototyping work on this board and it works with comms of up to 96000 baud reliably. you might start catching some errors but YMMV.

on the other side of the scale there is the Arduino Due.
the Duo is ARM based 84MHz chip with 96k RAM, it has 54 IO pins, 12 ADC pins and so on. it’s bigger then the Uno.

in the middle this is the Leonardo, it’s about the same size as the Uno, but uses a different Chip, the ATMEGA32u4. However, it’s his little brother the Arduino Micro, is the one I’ll focus about. the 32u4  is pretty much identical to the 328P with a few exceptions, it has 2.5K of RAM, a bit more I/O pins, but the most important feature on the chip is that it has native USB capability, which means it can do serial communication much faster then the Uno. the added bonus is it’s size, the Micro is TINY, it’s slightly less the 5cm long, and has male headers in two rows, which makes it breadboard compatible, and allows an easier mounting . So I chose it and everything I wrote was Micro Optimized. However I do indend to try and make the code in an Uno version (but with diminished capability) and in  Due version (as Acef already has on – so why not).

And back to the design..

Categories
Uri_ba's pit

DED Adventures – Part 3

now that we covered the basics, and we know how to run our FuelFlow, we can continue our dive into the project. DED screen was chosen as it is the closest I could get to the real thing from the selection of avaiable hardware. I chose the BuyDIsplay 2.8″ OLED Yellow-On-Black another option would be the New Haven 2.8″ OLED Yellow-On-Black they both use the same u8glib constructor and are interchangeable (different wiring is required of course).

Let’s look back at the DED in the “flightData.h” file.

 //DED Lines
    char DEDLines[5][26]; //25 usable chars
    char Invert[5][26]; //25 usable chars

in C a string is a char array ending with null character (ASCII 0)
so we actually have 5 lines of 25 chars ending with a 0 (from now it will be referred as “\0”)
DED is actually 5*24, so I don’t know why the extra \0, so we can safely only transmit the 24 bytes.

in Part 1 you saw a video with an early code, in that code I’ve sent the two arrays and drew them with the arduino, that required multiple passes on both arrays, costing many CPU cycles. I’ve decided to do the manipulation on the computer side, sending only one ANSI array. However that required a special font to be loaded onto the Arduino/Display. The font was drawn as TTF, re-positioned to correct ANSI position, and converted to the Format u8glib can use.
I’ve created the font using fontstruct and it’s available here

I ofcourse had to write the code to normlize the entire thing

        private string NormalizeLine(string Disp, string Inv)
        {
            char[] NormLine = new char[25];
            for (short j = 0; j < Disp.Length; j++)
            {
                if (Inv[j] == 2)
                {
                    if (char.IsLetter(Disp[j]))
                    {
                        NormLine[j] = char.ToLower((Disp[j]));
                    }
                    else if (Disp[j] == 1)
                    {
                        NormLine[j] = (char)192;
                    }
                    else if (Disp[j] == 2)
                    {
                        NormLine[j] = (char)170;
                    }
                    else if (Disp[j] == 3)
                    {
                        NormLine[j] = (char)223;
                    }
                    else if (Disp[j] == '~')
                    {
                        NormLine[j] = (char)252;
                    }
                    else
                    {
                        NormLine[j] = (char)(Disp[j] + 128);
                    }
                }
                else
                {
                    if (Disp[j] == 1)
                    {
                        NormLine[j] = '@';
                    }
                    else if (Disp[j] == 2)
                    {
                        NormLine[j] = '*';
                    }
                    else if (Disp[j] == 3)
                    {
                        NormLine[j] = '_';
                    }
                    else if (Disp[j] == '~')
                    {
                        NormLine[j] = '|';
                    }
                    else
                    {
                        NormLine[j] = Disp[j];
                    }
                }

            }
            return new string(NormLine);
        }

The arduino side is very simple, so I will not elaborate much

char DED[5][26] = {{ 0 }};

void  readDED() {
  for (short i = 0; i < 5; i++) {
    Serial.print("D");
    Serial.print(i);
    Serial.flush();
    Serial.readBytes(DED[i], 25);
  }
}

void drawDED() {
  /// Begin Picture loop ///
  dedDisp.firstPage();
  do {
    for (unsigned short i = 0; i < 5; i++ ) {
      dedDisp.drawStr(DED_H_CONST, i * DED_CHAR_H + DED_V_CONST, DED[i]);
    }
  } while ( dedDisp.nextPage() );
  /// End Picture loop ///
}

Combining this, with the code we saw in the previous part, gives us a DED and an animated FuelFlow. in the video you can also see the indexers modeled by 6 leds, but that code uses a different logic, and will be covered in a later post.

BTW – The code shown here is pretty old, so there is a bug in the FuelFlow code used here, the snippet in Post 2 is already corrected (one of the benefits of starting a blog late)

Enjoy! 🙂

Categories
Uri_ba's pit

DED Adventures – Part 2 – Tech post

Let’s talk about a bit about the technical stuff. I think that going over the technical aspects will make some sense, and naturally help others in their quest.

I’ll have posts like that from time to time, covering technical aspects of the project. Which means that code examples, circuit schematics and random technical mambo jumbo are all legit in this type of posts.

So lets begin….

Categories
Uri_ba's pit

DED Adventures – Part 1

Well, Acef has asked me for advice about his pit. I’ve been playing around with BMS sharedmem and Arduino just to get the hang of it. I’ve starded by getting an Arduino to show fuelflow on a simple 2X16 LCD and drive a servo to show Airbreak – all of that was done around May 2013 and I haven’t touched it since. until June 2014.

I’ve started toying around again with the Arduino After speaking with Acef about the progress of his pit. Using some LCD screens I had lying around I’ve started working on the code. it took me  a few days but I finally got it to do some reasonable work. still had issues with highlights.

 

Categories
Uri_ba's pit

And the saga begins

Well I’ll start off by saying that the Blog is a late start.

I’ve known from day one that I’ll need to blog this project, for others, as well as for myself. however this blog is starting in somewhat of a delay, as i’ve done some work already and got ahead. I’ve tried to document what I’ve done so far for this blog. but post affect posting, is a bit different.

With that said, I’m not posting any progress reports yet, as I have some issues to solve first.

What I’m actually trying to say, without much success is:

Welcome to my Pit blog.

I’m building an F-16 pit, for falcon BMS, As I mostly fly IAF F-16C Block 30 “Barak I” in ITO (which we at the 108th are developing), the Pit will be ITO block 30 inspired, I’ll try to walk the line between the real IAF block 30 and the BMS version of it.

The pit is based on the “ViperWIng” pit. Electronis are currently planned for Arduino,  but more on that as we progress!

Cheers!

Uri