Jump to content

DCS.Bios and cuircut breakers


Hogtie

Recommended Posts

Hi all

 

Im sorry if this subject have been discussed before, but I have not been able to find much about it, when searching the forum.

 

I am currently looking into the the circuit breakers. When i look at the code for the circuit breakers DCS-BIOS, they are made as 2pos switch.

 

Something is missing, when the circuit breaker activates, it jumps out. my question is, how do you make a circuit breaker jomp out on a psychical panel, when all you have from DCS-BIOS is an input PIN ?

 

As i see it, there should be a input signal, so DCS-BIOS know then the psychical circuit breaker is the normal position (pushed in).

also there should be an output signal, that activates the circuit breaker, and make it jump out, this output should be kept activated, as long as it is not possible to reengage the circuit breaker in the game, so if you try to push the circuit breaker into its place on the psychical panel, it will just bounce right out, when you move you finger.

 

Also I notice in the reference documentation, that some circuit breakers on the Huey helicopter, are noted with no function, does this mean, that they are not implanted in the DCS-BIOS code, so they do not function, or are they not yet implemented in the game ?

 

Hope someone can help with my questions or guide to a place where i can find the answers.

Link to comment
Share on other sites

I guess! one way would be to implement a cockpit curcuit breaker with a momentary switch with integrated LED (or separete) using the toggle function on the switch and the LED output function for indication. Note that I haven't experimented with these

 

 

i.e. Normal state is curcuit braker in the pit is not activated, if activated/released the LED will lit (red?), you push it (and toggle it the switch in the SIM) if SIM says it holds, it will blank the LED (or 'pop' it again). Cheaper HW and implementation.

 

Code extract below from the 10C DCS:BIOS advanced ref

 

 

AILERON DISC L Circuit BreakerA-10C/CBP_AILERON_DISC_L

Input Interface: fixed_step Message: CBP_AILERON_DISC_L <DEC|INC> Description: switch to previous or next state

DcsBios::RotaryEncoder cbpAileronDiscL("CBP_AILERON_DISC_L", "DEC", "INC", PIN_A, PIN_B);

Input Interface: set_state Message: CBP_AILERON_DISC_L <new_value> Value Range: 0 ... 1 Description: set position

const byte cbpAileronDiscLPins[2] = {PIN_0, PIN_1};

DcsBios::SwitchMultiPos cbpAileronDiscL("CBP_AILERON_DISC_L", cbpAileronDiscLPins, 2);

DcsBios::Switch2Pos cbpAileronDiscL("CBP_AILERON_DISC_L", PIN);

Input Interface: action Message: CBP_AILERON_DISC_L TOGGLE Description: Toggle switch state

DcsBios::ActionButton cbpAileronDiscLToggle("CBP_AILERON_DISC_L", "TOGGLE", PIN);

Output Type: integer Address: 0x1138 Mask: 0x0400 Shift By: 10 Max. Value: 1 Description: selector position

void onCbpAileronDiscLChange(unsigned int newValue) {

/* your code here */

}

DcsBios::IntegerBuffer cbpAileronDiscLBuffer(0x1138, 0x0400, 10, onCbpAileronDiscLChange);

DcsBios::LED cbpAileronDiscL(0x1138, 0x0400, PIN);

 

 

Gus

- - - -

Link to comment
Share on other sites

Hi Hogtie,

 

Very interesting question you have there. As for implementing circuit breakers into DCS-BIOS I agree with the description by Duckling. It should be possible to do it similar to the way you can implement magnetic held toggle switches e.g. https://forums.eagle.ru/showpost.php?p=3121287&postcount=148

 

According to DCS-BIOS advanced mode you have similar commands available which with good results made the mag switches work;

 

const byte cbpAileronDiscLPins[2] = {PIN_0, PIN_1};
DcsBios::SwitchMultiPos cbpAileronDiscL("CBP_AILERON_DISC_L", cbpAileronDiscLPins, 2);
DcsBios::LED cbpAileronDiscL(0x1138, 0x0400, PIN);

 

The LED is the status of the position in the 3D cockpit i.e. in game, and could be used to energize a coil which releases the circuit breaker. Based upon the experience with the mag switches you need two inputs one for each of the circuit breakers positions, one for in and one for out position.

 

This is a very expensive solution, http://www.simkits.com/product/circuit-breaker-for-flight-simulation/ but I imagine with 3D printer you can build something similar for less money

 

I am not near pit at the moment but can try and see if I can replicate the intentions using a mag switch when I come home. Pretty sure I have one circuit board almost ready setup with MOSFET.

 

Cheers

Hans

Link to comment
Share on other sites

Alright sorry for the delay but manage to make a quick proof of concept this evening.

 

Running DCS-BIOS over RS-485. When the circuit breaker is in the IN position then DCS-BIOS energizes the output and thereby 12VDC is applied to the magnetic held toggle switch over MOSFET.

 

/*
 The following #define tells DCS-BIOS that this is a RS-485 slave device.
 It also sets the address of this slave device. The slave address should be
 between 1 and 126 and must be unique among all devices on the same bus.
*/
#define DCSBIOS_RS485_SLAVE 100

/*
 The Arduino pin that is connected to the
 /RE and DE pins on the RS-485 transceiver.
*/
#define TXENABLE_PIN 2

#include "DcsBios.h"

/* paste code snippets from the reference documentation here */
DcsBios::LED masterCaution(0x1012, 0x0800, 13);
//AILERON DISC L Circuit Breaker
DcsBios::LED cbpAileronDiscL(0x1138, 0x0400, 12);
const byte cbpAileronDiscLPins[2] = {11, 10};
DcsBios::SwitchMultiPos cbp_ileronDiscL("CBP_AILERON_DISC_L", cbpAileronDiscLPins, 2);


void setup() {
 DcsBios::setup();
}

void loop() {
 DcsBios::loop();
}

 

LED on pin 13 is just connected to the master caution just to confirm the Arduino is connected.

 

 

Obviously the mag switch won't work as circuit breaker substitute, but servers the purpose the verify if it is possible to implement into the pit. Based on this test I would say yes it is possible.

 

p.s. sorry for the poor recording

 

Cheers

Hans

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...