DCS BIOS TACAN Left Channel - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 03-10-2018, 06:15 AM   #1
Pavespawn
Junior Member
 
Pavespawn's Avatar
 
Join Date: Nov 2014
Location: Florida Panhandle
Posts: 76
Default DCS BIOS TACAN Left Channel

I was wondering if you can code the TACAN channel selectors as a rotary switch. It will take up more pins but I have a real TACAN and I have modded the rotary to allow for a single contact every rotation.
Pavespawn is offline   Reply With Quote
Old 03-10-2018, 05:06 PM   #2
Pavespawn
Junior Member
 
Pavespawn's Avatar
 
Join Date: Nov 2014
Location: Florida Panhandle
Posts: 76
Default

Pavespawn is offline   Reply With Quote
Old 03-11-2018, 04:01 AM   #3
frogger
Member
 
frogger's Avatar
 
Join Date: Oct 2010
Posts: 137
Default

depending on aircraft you can. it also allows for volume knob and some more.
frogger is offline   Reply With Quote
Old 03-13-2018, 12:22 AM   #4
Pavespawn
Junior Member
 
Pavespawn's Avatar
 
Join Date: Nov 2014
Location: Florida Panhandle
Posts: 76
Default

Well I’m the absence of guidance, I went with the next best thing: I made things up. I prototyped a rotary encoder (fancy way of saying “I rigged this crap up”) to the output shaft of the left channel selector. It works but you have to make sure you are set to 0 at game start. Is there a way to get DCS to recognize where the encoder is positioned?





Pavespawn is offline   Reply With Quote
Old 03-13-2018, 02:47 AM   #5
frogger
Member
 
frogger's Avatar
 
Join Date: Oct 2010
Posts: 137
Default

this is the a10c tacan panel coding from the control reference.

right channel selector
DcsBios::RotaryEncoder tacan1("TACAN_1", "DEC", "INC", PIN_A, PIN_B);

left channel selector
DcsBios::RotaryEncoder tacan10("TACAN_10", "DEC", "INC", PIN_A, PIN_B);

the encoder should have middle pin to gnd on arduino and the 2 out side pins on encoder are pin a and b. im not sure how encoders go with arduino just hooked up i know other devices u need to wire in diodes to make them work abit better. im fairly new to dcs bios myself but so far ive been able to get most things to work in the M2000
frogger is offline   Reply With Quote
Old 03-13-2018, 03:18 AM   #6
Pavespawn
Junior Member
 
Pavespawn's Avatar
 
Join Date: Nov 2014
Location: Florida Panhandle
Posts: 76
Default

Quote:
Originally Posted by frogger View Post
this is the a10c tacan panel coding from the control reference.

right channel selector
DcsBios::RotaryEncoder tacan1("TACAN_1", "DEC", "INC", PIN_A, PIN_B);

left channel selector
DcsBios::RotaryEncoder tacan10("TACAN_10", "DEC", "INC", PIN_A, PIN_B);

the encoder should have middle pin to gnd on arduino and the 2 out side pins on encoder are pin a and b. im not sure how encoders go with arduino just hooked up i know other devices u need to wire in diodes to make them work abit better. im fairly new to dcs bios myself but so far ive been able to get most things to work in the M2000
Yup. All that is coded and works. What I mean is that because the dial is a physical one, if DCS starts and the physical dial is set to anything other than 0, it doesn't sync. DCS BIOS just knows to DEC or INC. It doesn't know where my physical dial is set at start.
Pavespawn is offline   Reply With Quote
Old 03-13-2018, 02:26 PM   #7
yoreh
Junior Member
 
Join Date: Dec 2013
Posts: 42
Default

While i was searching for a solution how to sync my UHF divce with dcs, Hansolo referred me to his Tacan project and tjis helped me alot. Maybe this can help you too...

https://forums.eagle.ru/showpost.php...&postcount=180
Cheers,
Yoreh.
yoreh is offline   Reply With Quote
Old 03-13-2018, 02:36 PM   #8
Pavespawn
Junior Member
 
Pavespawn's Avatar
 
Join Date: Nov 2014
Location: Florida Panhandle
Posts: 76
Default

Quote:
Originally Posted by yoreh View Post
While i was searching for a solution how to sync my UHF divce with dcs, Hansolo referred me to his Tacan project and tjis helped me alot. Maybe this can help you too...

https://forums.eagle.ru/showpost.php...&postcount=180
Cheers,
Yoreh.
Thanks. I was using some of his code from that project!
Pavespawn is offline   Reply With Quote
Old 03-13-2018, 04:45 PM   #9
Hansolo
Senior Member
 
Hansolo's Avatar
 
Join Date: Aug 2012
Location: Denmark
Posts: 1,497
Default

Rotary incremental encoders like the one you are using will only give a sequence of pulses when it moves. This sequence will differ depending on the rotation you give it, but only send signals while you rotate;
https://en.wikipedia.org/wiki/File:Q...re_Diagram.svg

This type is a very easy type to implement and I would recommend it when using LED or other type of displays for showing the channels. Then you remove the sync issue as the displays will always show what DCS is seeing anad you just tell the channels to go up or down.
But the rotary incremental encoder will never tell you the current position.


You can get rotary absolute encoders from which you can determine the actual position, as it has a specific set of outputs for a specific position.
https://en.wikipedia.org/wiki/File:E...it_binary).svg

These comes in many different variants depending of use. If you are using the original switch on your TACAN then this is an absolute encoder.

You sent me two PM’s, oneyesterday and one today. One states that you made the original left switch into a switch with one input per positions and tried to trick DCS-BIOS into seeing the left selector as a switch.

The second PM was about using rotary encoder and you also tried to incorporate the right switch with my code but can’t get it to ready the port registers.

I am currently travelling with work and have limited time. If you need assistance then you need to do the following;

1. Decide which of the two switches you want to implement first
2. Make a small wiring diagram on a piece of paper so that we can see how you connect it.
3. Make a matrix which shows correlation between switch positions and which pins will be grounded in this case.
4. Imbed the code you have used to solve the switch you decided from point 1 into the post you make

With my limited knowledge to Arduino coding I have found that solving multiple problems at the same time ends up in a bowl hay where you will not be able to conduct sequential trying and testing to prove what works and what does not. Focus on one item at a time, code it, load it, try it. If it works then save the code with a name that you can go back to. If it doesn’t work go back to the step that worked before and rethink your strategy.
For my TACAN code I ended up with 10 different saved versions, most which worked partly.

An original TACAN is IMHO a very difficult panel to implement as DCS isn’t prepared for it. The ILS is a much easier panel to implement.

Cheers
Solo
__________________
Hansolo is offline   Reply With Quote
Old 03-13-2018, 07:39 PM   #10
Pavespawn
Junior Member
 
Pavespawn's Avatar
 
Join Date: Nov 2014
Location: Florida Panhandle
Posts: 76
Default

Hans,

Thanks for providing so much assistance and feedback. I did start with modding the switch so there is only a single contact for each rotation. I originally hoped that I could define the channel selector as a rotary switch and then it would work all the way to 12 ( remember you saying that you had an issue with that) but that did not work. I really needed some kind of a win so I rigged up the encoder just to prove I could make the dial move. I don’t see this as the permanent fix.

I am now wondering if I can stick with the individual contact idea for each switch but also use the port registers. I am going to try to code it like so (I am typing this at work so this is a guess):
Code:
  

if (PINA == B10000000) {
    valueTacan_left = 0;
  }
  if (PINA == B01000000) {
    valueTacan_left = 1;
  }
 if (PINA == B00100000) {
    valueTacan_left = 2;
  }
 
Etc, etc
So that each individual contact works as a high reading. Since I have 13 contacts I will have to use multiple ports but it seems like it should work. What do you think?

I started a diagram to map this out so I’ll finish that and post my product based on my modified switch. I’ll then move onto the right switch.

Can you tell me what timer library you are using? I have one but it didn’t like some of your commands.
Pavespawn is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 12:35 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.