whartsell Posted June 11, 2013 Posted June 11, 2013 (edited) EOS and Helios Tutorial Update I have only tested Arduino UNO AND Duemilanove boards with EOSV1. MEGAS will NOT work. Leonardos most likely will not work. Others...your on your own. I believe that after testing an Arduino Duemilanove that all the 168/328 based boards should work fine as all the internals are the same. Yesterday I noticed that Gadroc released the latest EOS libs and Helios to support them. I played around with it yesterday and noticed that the learning curve can be a bit steep for the uninitiated so I figured I would right a quick tutorial on how to get an Arduino Uno up and running with EOS and configured in Helios as the Electrical Control Panel for the A-10. This tutorial will walk through all the steps required to get it up and controlling your A-10. Requirements Latest version of Helios Latest EOSV1 Libraries Arduino Uno and Arduino IDE. MEGAs will not work due to UARTS and EOS using low level serial control) ALL other boards are UNTESTED and expected to have issues Minimum 1 toggle switch wired to pin2 and ground on your arduino. Recomended 7 toggle switches each wired between pin [2,3,4,5,6,7,8] and ground on your arduino Initial Setup This Tutorial assumes you already have your arduino software setup and know how to download sketches to it. Basic Helios knowledge is assumed as there are better sources than me for the intricacies of setting it up. The attached sketch is verbosely documented which should allow you to understand whats going on. This example assumes you have a clean export.lua in DCS with no extras installed there. PLEASE do not deviate from this tutorial until after you have completed it and verified everything works. Ensure you have the latest Helios Installed Install the EOS libraries according to the included read me Download my attached sketch for the Arduino Installing the Arduino Sketch Clearing the EEPROM Since EOS uses EEPROM to store config data its a good idea to make sure all the EEPROM space is in a known state. Open The arduino IDE go to File>Examples>EEPROM>eeprom_clear Upload and run this sketch on your arduino Install the EOS_Digital_Input_Example sketch Open the Example sketch in your IDE Upload the sketch into your Arduino You can close the Arduino IDE now as we are finished with it HELIOS SETUP There are 3 main steps here Configure DCS Interface Configure EOS Interface Bind our board inputs to the A-10 Add DCS Interface Open Helios Profile Editor Go to Profile > Add Interface Select DCS A10C and click Add You can leave the defaults Under A-10 Setup Ensure it says "Your DCS A-10C configuration is up to date. If not click "Setup DCS A-10C" button Add EOS Interface Repeat the steps above, only this time select EOS Bus Under Properties ensure Bus Type is set to Serial Bus Master Select the Com Port for your Arduino The TX/RX lights should start flashing on your arduino. After a few seconds you should see "T01Board" listed under EOS Devices Configure the Board Click the Board listed under EOS Devices Set the Address to 2 (It appears 1 causes problems) Change the Name to ELEC PWR. NOTE the name is limited to 8 characters tab or click out of the Name box Notice that the address and name have been updated under the EOS Devices. This has been saved to the EEPROM on the Arduino and it will remember these settings on next boot To the Right of the Properties Tab click the Digital Inputs Tab You should see 7 digital inputs named Digital Input 0-7 Toggle each switch to ensure that the "button" turns from dark red to light red when on Rename the Inputs according to the attached pic Now is a good time to save your Profile. Setup the bindings in Helios Here we will map our switches to actual DCS bindings Under Bindings select Output Tab Expand the ELEC PWR carrot and notice that all the switch actions have our names Expand the Interfaces Tab under Actions Expand DCS A10C and expand the Electrical group We will start from the top and start adding the binds Under Actions drag "set APU Generator" over the Binding "APU GEN PWR ON" Under Properties Value you will notice red text that says "Action Value Warning - Value canno be empty ensure value source is set to static value Action value contains the valid values we can use. Since this is the on position set it to 1 by typing 1 in the box Repeat the steps for APU GEN PWR OFF except this time set the action value to 2 for Off/Reset Repeat the steps above for all switches. NOTE the Inverter has 3 action values. Save your profile once you have all the bindings configured Running and Testing your profile on my dev rig I run dcs windowed on a second monitor as its easier for troubleshooting. BE SURE YOU CLOSE PROFILE EDITOR BEFORE YOU START. otherwise when you attempt to launch the profile the com port will be locked by it and the profile will crash Launch Helios Control Center and select your Profile then click start. you should see your TX/RX lights flashing on your arduino Launch DCS and load an A-10 mission toggle your switches and you should see them working in the sim Gotchas..Issues backlight intensity will crash hellios...WORKAROUND dont use your mouse to slide the bar use keyboard only no way to remove a board from the interfaces. if you change your board address or name outside of helios (e.g on another profile) you will have to hack the hpf file to get it to work again if you change the name of an analog input your profile will become corrupted. Even hacking the hpf file will not fix it EOS_Digital_Input_Example.zip Edited December 6, 2013 by whartsell Verified Duemilanove works 4 Arduino,EOS and Helios Tutorial Static ATC menu mod
Gadroc Posted June 11, 2013 Posted June 11, 2013 I use backlight intensity, it should not crash Helios. I think it's an intermittent problem where Helios tries to send a command to the bus when the bus is busy. I've hit it periodically and need to put the right defensive action there. Good catch on the ability to remove a device from the bus in Helios. I'll add that asap. Also any recommendation on how to detect updated addresses? Since there is not one manufacturer there is not really the concept of a serial number. Can prompt on matching name / input counts with different addresses after a scan.
whartsell Posted June 11, 2013 Author Posted June 11, 2013 I use back light intensity, it should not crash Helios. I think it's an intermittent problem where Helios tries to send a command to the bus when the bus is busy. I've hit it periodically and need to put the right defensive action there. Good catch on the ability to remove a device from the bus in Helios. I'll add that asap. Also any recommendation on how to detect updated addresses? Since there is not one manufacturer there is not really the concept of a serial number. Can prompt on matching name / input counts with different addresses after a scan. In my (short) experience every time i touch the back light brightness bar it will crash. Ill have to think about it in terms of the boards. I like the matching idea as then you don't loose all your bindings. As it stands right now profiles are not easily shared as you have no idea what their board name or address will be. May also want to match on firmware as its the only immutable parameter in the Info command. Arduino,EOS and Helios Tutorial Static ATC menu mod
Avilator Posted June 11, 2013 Posted June 11, 2013 I was just going to post asking about this! THANK YOU! :worthy::thumbup: EDIT: I vote to make this a sticky. I only respond to that little mechanical voice that says "Terrain! Terrain! Pull Up! Pull Up!" Who can say what is impossible, for the dream of yesterday is the hope of today and the reality of tomorrow. -Robert Goddard "A hybrid. A car for enthusiasts of armpit hair and brown rice." -Jeremy Clarkson "I swear by my pretty floral bonet, I will end you." -Mal from Firefly
whartsell Posted June 11, 2013 Author Posted June 11, 2013 I have also gotten an example SAS panel sketch created if anybody is interested. I figured it was a nice next step as it includes analog inputs,digital inputs and a LED output so it tests all the basics. I wont do a full tutorial but the sketch is well documented. If anybody is interested lemme know Arduino,EOS and Helios Tutorial Static ATC menu mod
whartsell Posted June 12, 2013 Author Posted June 12, 2013 I use backlight intensity, it should not crash Helios. I think it's an intermittent problem where Helios tries to send a command to the bus when the bus is busy. I've hit it periodically and need to put the right defensive action there. Good catch on the ability to remove a device from the bus in Helios. I'll add that asap. Also any recommendation on how to detect updated addresses? Since there is not one manufacturer there is not really the concept of a serial number. Can prompt on matching name / input counts with different addresses after a scan. I did some checking on this and it will only crash if you attempt to click and drag the slider. If you just click on a position on the bar or use the keyboard to scroll it will work just fine Arduino,EOS and Helios Tutorial Static ATC menu mod
wolfster Posted June 12, 2013 Posted June 12, 2013 I have also gotten an example SAS panel sketch created if anybody is interested. I figured it was a nice next step as it includes analog inputs,digital inputs and a LED output so it tests all the basics. I wont do a full tutorial but the sketch is well documented. If anybody is interested lemme know Thanks for the excellent tutorial Whartsell, please could I have a copy of your SAS panel sketch?
whartsell Posted June 12, 2013 Author Posted June 12, 2013 Ill attach it when I get home from work Arduino,EOS and Helios Tutorial Static ATC menu mod
agrasyuk Posted June 12, 2013 Posted June 12, 2013 (edited) I wont do a full tutorial but the sketch is well documented. If anybody is interested lemme know Will be very interesting to see. Did you take on releasing the magnetic switches or are you using plain ones? And yes, many many thanks for the tutorial. To bad I'm not in position to try these things yet Edited June 12, 2013 by agrasyuk Anton. My pit build thread . Simple and cheap UFC project
whartsell Posted June 12, 2013 Author Posted June 12, 2013 Will be very interesting to see. Did you take on releasing the magnetic switches or are you using plain ones? And yes, many many thanks for the tutorial. To bad I'm not in position to try these things yet No magnetic switches as I dont have any laying around. Arduino,EOS and Helios Tutorial Static ATC menu mod
whartsell Posted June 12, 2013 Author Posted June 12, 2013 EOS SAS Script Please be sure you walk through my tutorial before you try to run this sketch. It will save allot of time for everybody as there are fundamental concepts in the tutorial that i assume you know if you are trying this sketch Here is the sas sketch. Pinouts: A0 analog (yaw trim) A1 - A5 Digital inputs 2-3 - Digital inputs 4 Take Off Trim Anunciator 5 PWM output for backlight 12 RS-485 TX (if you are using a bus controller) WARNING: due to a bug in helios. DO NOT change the name of the analog input in Helios. It will corrupt your profile. NOTE: binding the analog to the yaw trim see the attached screenshot for config If the trim works backwards you have two options. 1. swap the pots ground/power wires 2. change the lua from return (TriggerValue-512)/512 to return (TriggerValue-512)/-512EOS_SASExample.zip Arduino,EOS and Helios Tutorial Static ATC menu mod
MacFevre Posted June 12, 2013 Posted June 12, 2013 I've been wanting to try this since I got an Arduino startup Kit. Thank you. (And you too, Gadroc.) Buttons aren't toys! :smilewink: My new Version 2 Pit: MacFevre A-10C SimPit V2 My first pit thread: A-10C Simulator Pit "The TARDIS." Dzus Fastener tutorial, on the inexpensive side: DIY Dzus Fastener
whartsell Posted June 13, 2013 Author Posted June 13, 2013 128 digital input sketch for EOS I have created and am testing a sketch that supports a 128 input matrix on an arduino. It does require two 74hc164 chips (about 2 bucks each locally or .50 online). This sketch is intended for people (like) me who dont want to have to add hardware for each "dumb" panel that doesn warrant it (e.g elec power panel). I am using a Pokeys in my pit now that uses a matrix so in my case it was a drop in replacement for the pokeys. After i finished testing it I will create a new thread and post the sketch,lib, and schematic for it along with instructions. if you dont know what an input (switch) matrix is...you can find some info here Arduino,EOS and Helios Tutorial Static ATC menu mod
Gadroc Posted June 13, 2013 Posted June 13, 2013 Actually the EOS Panel Board is pretty cheap per panel... I think the PCBs will end up being $3 each and you don't have to fully populate all the chips. I'll double check but total BOM for the full Panel Board was <$30 at low volume. You almost get up to that price when you add up cost for cables and connectors to home run that many switches.
whartsell Posted June 13, 2013 Author Posted June 13, 2013 Actually the EOS Panel Board is pretty cheap per panel... I think the PCBs will end up being $3 each and you don't have to fully populate all the chips. I'll double check but total BOM for the full Panel Board was <$30 at low volume. You almost get up to that price when you add up cost for cables and connectors to home run that many switches. When i started I was using pokeys which were way too pricey to use in each panel. Now that EOS is out ill most likely start using pcbs in each panel. One question...how did you plan on handling the intercom panel? has like 8 or nine analog inputs and the arduino only has 6. Are you going to multiplex using something like a 4051? If so I have started on that sketch here but haven't finished it. Arduino,EOS and Helios Tutorial Static ATC menu mod
whartsell Posted June 13, 2013 Author Posted June 13, 2013 The wiring for my panels cost about $5 each. Since its a ribbon you just crimp in a new connector where you need it. It does become a pain to troubleshoot if something goes wrong. You also need to be really organized so you don't accidentally put multiple switches on the same node in the matrix. Arduino,EOS and Helios Tutorial Static ATC menu mod
whartsell Posted June 13, 2013 Author Posted June 13, 2013 Oh boy my Leonardo just showed up. Let the fun begin. Arduino,EOS and Helios Tutorial Static ATC menu mod
darthun Posted June 19, 2013 Posted June 19, 2013 I'm really confused about this post. it says that The Arduino Uno and leonardo won't work with EOS and helios, then it says it will work. I want to buy an arduino for dcs:a10c but i don't know which one to get since this post seems to say none of them actually work ?
whartsell Posted June 19, 2013 Author Posted June 19, 2013 I'm really confused about this post. it says that The Arduino Uno and leonardo won't work with EOS and helios, then it says it will work. I want to buy an arduino for dcs:a10c but i don't know which one to get since this post seems to say none of them actually work ? It says the UNO will work. Nowhere does it say the Leonardo will work. If you buy an UNO you are safe. Arduino,EOS and Helios Tutorial Static ATC menu mod
whartsell Posted June 19, 2013 Author Posted June 19, 2013 Whoops. I see what your saying now. There is a period missing in the requirements. I'll fix it shortly. Nice catch. Arduino,EOS and Helios Tutorial Static ATC menu mod
Phoenix Posted August 5, 2013 Posted August 5, 2013 How do you use multiple Arduino boards without using a lot of USB ports? Looks like there is some way to chain them together?
whartsell Posted August 8, 2013 Author Posted August 8, 2013 How to use multiple EOS boards with a Single USB interface How do you use multiple Arduino boards without using a lot of USB ports? Looks like there is some way to chain them together? You can link them together using the EOS interface board sketch on a Arduino Leonardo board with some supporting hardware. The interface board has a RS-485 transceiver that allows it to talk to multiple EOS boards. It communicates to Helios via serial over USB. The interface sketch will only work on a Leonardo board due to the Leonardo having two UARTS Schematic below is a simple schematic of how to hook up a RS-485 transceiver to the Leonardo Your transceiver may have different names for the pins but the pinout should be the same Obviously all your EOS boards will need this hardware if you want to use RS-485. In The EOS Sketches you will see something like EosBus.begin(2, 250000); This means that digital pin 2 is your TX Enable pin for RS-485. It is also called Device Enable. Notice that it matches the diagram above. If you define a different pin here you just need to make sure that you wire that up to 2/3 on the RS-485 chip Helios when you start Helios and add your EOS interface it defaults to Bus Controller. Change this to Bus Interface After you define your port the controller will start looking for boards connected. You should only connect One board at a time as it will have a default address. If you don't have any EOS boards hooked up to the controller you will not see anything. Once a board has been detected change the address add your next board,rinse repeat till all your boards are hooked up and assigned. From here on out the Helios UI is just like the tutorial. Arduino,EOS and Helios Tutorial Static ATC menu mod
grainny Posted August 9, 2013 Posted August 9, 2013 dear whartsell, this is a very good thing you are doing for us here. however you need to understand most of us do not electronics engineer be! therefore, could you add basic photos and/or diagrams in step by step (as in the idiots guide to...) that is the only way we will even begin to understand your work let alone use it. most people (just a general statement) have not done this before and are thus experimenting. do not give us too much credibility, we are not as clever as you and we need a lot of help! furthermore, we will not have the same/exact configuration as you do (for example: i dont use helios and i build a harrier pit but i follow your advice anyway). bye for now grainny
Phoenix Posted August 9, 2013 Posted August 9, 2013 Awesome info thank you. So what do you do at the next board in line does it also have to be a Leonardo?
Recommended Posts