View Full Version : Starting Questions
Marc1980
07-08-2015, 04:02 AM
Good morning,
Ive spent some time thinking about what kind of cockpit to build and have decided to go with a GA cockpit. I have a background in aeronautical engineering so am fairly quick to pick up anything technical.
My thinking is to use something like fsxpand on a networked pc, using input cards such as BU0836x for switches, button etc, which will be run through FSUIPC. That part of it i can pretty much get my head around. However, I would like to include in this build some led's such as landing gear lights, outer, middle, inner marker lights etc. As I have been looking around there seems to be a number of ways in which to accomplish this, some use arduino, others use opencockpit cards. I don't mind having a go at getting my head around some programming but the simpler the better.
Does anyone have any suggestions as to which direction I should take to accomplish this.
Many thanks
Marc
HansJansen
07-08-2015, 07:48 AM
Marc,
I.M.O. OpenCockpits is the way to go! Programming in SIOC isn't that difficult; the cards are not too expensive, and also have been around for about 20 years already. If you want more information, take a look at Nico Kaan's website (www.lekseecon.nl (http://www.lekseecon.nl)), where he describes the system extensively.
Good flying,
Marc1980
07-08-2015, 08:31 AM
Thanks Hans for taking the time to reply. I appreciate it. Ill take a look.
Would you recommend a card to use. I had a look on their website for the USB output card which I have seen mentioned on here a fair bit but cant seem to find it anywhere.
Kind regards
Marc
Marc1980
07-08-2015, 08:47 AM
Think I have found what I was looking for.
http://www.opencockpits.com/catalog/usboutputs-p-122.html?cPath=21_44
Will this work? Or is there anything cheaper that will do the job?
Thanks again
HansJansen
07-13-2015, 07:43 AM
Yes Marc, this would work all right. But, be aware that this is an OUTPUT ONLY card; you can control lights etc. with it, but you cannot connect any switches to it.
If you really want to build a usable setup, I would recommend one or more OC Master cards, of which you can connect up to four via their USB expander to a single USB port.
For any 7-segment displays you would need one or more Display cards, which are daisy-chained from the Master card.
No, it will not get any cheaper than this! But in the end, you will have something worthwile... Moreover, building a cockpit is a long-term project; reckon with several years!
Good luck,
Marc1980
07-13-2015, 09:53 AM
Thanks again for your response. That is very helpful. I think you are right time and money will indeed mean it being a long term project. Ill take a look at those cards.
thanks again
Marc
xplanematt
07-16-2015, 01:32 AM
I might get flamed for this, but here goes.
You might want to try a couple different options before settling on OpenCockpits. I did quite a bit of work with OC stuff in the course of interfacing the altimeters on a real 737 cockpit. My experience up til that point had mostly been in Python and C++, using Arduinos and Phidgets. I found SIOC to be a joke. It's structured very strangely, and has some really bizarre limitations (for instance, you can do floating point math, but you can't store floats as variables...this forces you to either scale up the values you're working with and accept potentially less precision, or just use a bunch of hard-coded floats, which leads to repetitive code, and is generally bad programming protocol). It's "sort of" event-based, as opposed to a scheduled loop, but has timers and looping of sorts, which I found very inconvenient for controlling and monitoring what was going on. I ran into some weird bugs that might have been the SIOC "IDE" (if you can call it that), others may have been bugs within SIOC itself. There were a few times where I had to export the SIOC code, hand-edit the resulting ASCII file, and re-import the code into SIOC, because the "IDE" simply would not let me input what I needed to. Capability for iterable objects is virtually nil, you'd best not be needing anything "fancy" like multi-dimensional arrays. And you can forget about multi-threading.
I started out working with someone else's SIOC script, they had attempted (and supposedly succeeded) to write the entire algorithm for the altimeters in SIOC. I could see how the SIOC "philosophy" had led to messy code, random hacks, and LOTS of duplication. Ultimately, I ended up doing all my logic inside a standalone Python script. SIOC was used only to communicate with the OC cards. It worked OK, and the altimeters have been humming along for about two years now (and the Python script is several orders of magnitude smaller than the original SIOC script).
As to the cards themselves, I found the documentation was severely lacking. At times, I would come across official documentation or examples that were not available in English. The DC motor controller was particularly egregious: there was one sample script for an auto-throttle (which had almost no comments, by the way), and ZERO documentation. That board took a lot of trial and error to run the altimeters. I was quite shocked after getting used to the Arduino ecosystem (and Phidgets also), where there is full documentation on both hardware and firmware, along with examples, hundreds of user-produced guides and tutorials for any given board, and even (in the case of Arduino) schematics and Gerber files for the boards themselves.
I realize there is widespread enthusiasm for OC/SIOC, and that's great. I think SIOC's big advantages are that it's coupled with a flightsim-specific family of I/O hardware, and that it's probably more user-friendly for folks who have no interest in trying to learn a full-blown programming language (and there is nothing wrong with that either). I have never tried to "convert" any OC/SIOC users, other than to suggest experimenting with other technologies in addition to OC stuff.
But, since you are starting out, and since you said you are up for some programming, I think you owe it to yourself to try something like Arduino ( https://www.arduino.cc/ ), Teensy ( https://www.pjrc.com/teensy/ ), Phidgets ( http://www.phidgets.com/ ), or (for input) Hagstrom ( https://www.hagstromelectronics.com/ ), to name just a few.
Matt
Avro748
07-18-2015, 12:08 PM
You said you found a way to use Python with OC Cards? Could you show me how that can be done? I ask because I already know Python, and would love to apply it here.
xplanematt
07-27-2015, 03:26 AM
Like I said, I still used SIOC for actually talking to the OC cards, but that's *all* I used it for. I broke the raw OC data out to unused offsets, then read/wrote those offsets from within the Python FSUIPC interface (look it up, it comes with your FSUIPC build). So where an OC card might present an analog value of 0 to 255, I simply map that to an offset, and read that same offset with Python. Similarly, I might have an integer value in Python that I send to an unused offset, then SIOC simply sends that integer value to an OC motor controller's PWM output.
This allowed me to deal with the existing OC cards, but do all my heavy lifting in a full-featured programming language, with all the power and versatility that comes with it.
Matt