Jump to content

DCS-BIOS Discussion Thread


FSFIan

Recommended Posts

it looks like a 2 digit 7-segment, but it displays 100.

 

Having looked in the reference docs at the memory addresses involved, I can't see how setting stringbuffer to 3 can work correctly.

 

These are the addresses in that area:

oilpresl 0x7490 (2)

oilpresr 0x7492 (2)

RPML 0x7494 (2)

rpmr 0x7496 (2)

templ 0x7498 (3)

 

The numbers like " (2)" indicate the number of bytes allocated by stringbuffer, and that matches the differences in the numbers.

If you set stringbuffer to 3, you're reading the 2 digits you set, plus the first digit of the next number.

e.g. setting it to 3 then reading RPML gives you 2 digits of RPML and the left (tens) digit of RPMR.

 

I'm guessing in the game, there's some means of detecting the change from 99 to 00, and interpreting it as 100.

Link to comment
Share on other sites

I'm guessing in the game, there's some means of detecting the change from 99 to 00, and interpreting it as 100.

 

One correction to this, detecting the change from 99 to 10* and interpreting it as 100. I might try to mess around with the code and append a 0 when the value is 10... but that will be after I have several beers. This has been exhausting, ha.

Link to comment
Share on other sites

C101EB and rotary encoder

 

I am finding that the rotary encoder code doesn’t work on many of the C100EB controls. I tested on the F/A18 and they work fine. In some cases in the C101EB (Instrument Lights) They work ok also. Others like UHF VHF and VOR they don’t work at all. The heading bug turn clockwise only and is uncontrollable.

 

Is this a DCS Bios issue, a plane issue, or an operator ID-10T error? Any suggestions to overcome?

Thanks!

Link to comment
Share on other sites

@Johnsoir - ther are no codes in the cockpit.lua for it. so only via keybinding ingame sorry

 

@Mountaineer86 - BIOS-module issue. i programmed it but no deeptesting was made, because i dont had the module as i programmed it.

if you get me a list via PM with all errors i will have a look into it

Link to comment
Share on other sites

Is there a way to send data to DCS for a control there's only display output for?

e.g. P-51 rocket count. It has a clickable rotary to adjust the number, but DCS-BIOS only has the display output, and there's no apparent key binds.

Link to comment
Share on other sites

@BlackLibrary: I have a question about how to use the Marix2Pos and Matrix3Pos classes in the Flightpanel fork.

 

While there's an example sketch in the package that shows how to use the MatActionButtonSet class which I've used to build out a CDU I'm a bit stuck at controls that are 3 position based. I've yet to successfully send commands through the MatrixXPos classes after configuring the SwitchMatrix.h what I think is correct and configuring the sketch based on the commands found in control-reference.

 

Do you have any words of wisdom or perhaps examples of how to use the Matrix classes?

 

Thanks,

TheSmilingBandit

 

20200622 Update: So I got Matrix2Pos commands to start seeing inputs by replacing the setup and loop areas with:

void setup() {
 DcsBios::setup();
 SwitchMatrix swPanel = SwitchMatrix();
}

void loop() {
 swPanel.Scan();
 DcsBios::loop();
}

and now I'm getting inputs going to DCS-BIOS. Only issue now is that with every button press I see two "1" states upon pressing and a "1" then "0" state on release so inputs go three times. My learning of arduino programming will continue. :)

 

Matrix3Pos works just fine with no repeat characters.


Edited by SmilingBandit
Added 20200622 update 2
Link to comment
Share on other sites

Aaand another issue:

The P51 trim indicator outputs aren't giving usable numbers.

For example, the rudder onscreen needle has -10 to +10 degree deflection.

DCS BIOS has 2 bytes assigned (max 65535), but the mid point is 0 and as I increase, the number output stops at 65428 at the around the +5 degrees mark.

The other two are just as random.

 

For testing, I'm outputting the raw numbers to an LCD:

 

Test code for reference:

/*
 Tell DCS-BIOS to use a serial connection and use interrupt-driven
 communication. The main program will be interrupted to prioritize
 processing incoming data.
 
 This should work on any Arduino that has an ATMega328 controller
 (Uno, Pro Mini, many others).
*/
#define DCSBIOS_IRQ_SERIAL

#include "DcsBios.h"

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,20,4);  // set the LCD address to 0x27 for a 16 chars and 2 line display

/* paste code snippets from the reference documentation here */

void onAileronTrimChange(unsigned int newValue) {
   /* your code here */
   lcd.setCursor(9,1);
 lcd.print(newValue);
 lcd.print("     ");
}
DcsBios::IntegerBuffer aileronTrimBuffer(0x5024, 0xffff, 0, onAileronTrimChange);

void onElevatorTrimChange(unsigned int newValue) {
   /* your code here */
   lcd.setCursor(9,2);
 lcd.print(newValue);
 lcd.print("     ");
}
DcsBios::IntegerBuffer elevatorTrimBuffer(0x5026, 0xffff, 0, onElevatorTrimChange);

void onRudderTrimChange(unsigned int newValue) {
   /* your code here */
   lcd.setCursor(9,3);
 lcd.print(newValue);
 lcd.print("     ");
}
DcsBios::IntegerBuffer rudderTrimBuffer(0x5028, 0xffff, 0, onRudderTrimChange);

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

   lcd.init();                      // initialize the lcd 
   lcd.backlight();

     lcd.setCursor(0,0);
 lcd.print("Trim numbers");
 lcd.setCursor(1,1);
 lcd.print("Aileron");
  lcd.setCursor(0,2);
 lcd.print("Elevator");
  lcd.setCursor(2,3);
 lcd.print("Rudder");
}

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

Link to comment
Share on other sites

its false programmed from my side. Fixing in progress

 

edit: Uploaded in booth BIOS versions.

 

@Flightpanels: download Master Branch

 

@HUB: just do a normal update. NOTE: there are a lot more changes maybe some switches have to reprogrammed


Edited by BlackLibrary
Link to comment
Share on other sites

@BlackLibrary:

 

First of all many thanks for your work improving and maintaining DCS BIOS and off course to FSIan for developing DCS BIOS in the first place! Great piece of software!!

Currently started work on building an F-14 cockpit (just the Pilot station for now) and started exploring DCS BIOS for that purpose.

Incorporsating Artifcial control feel for the flight controls is something that I think would really improve immersion in the sim.

I have the following question;

Is it possible to add the export of the stick or trimmer position from the ControlsIndicator_page.lua of the F-14 model to a ServoOutput in DCS BIOS.

The ControlsIndicator_page.lua is located in the

DCS World\Mods\aircraft\F14\Cockpit\Scripts\ControlsIndicator folder.

To explain why I'm asking;

I have setup a miniature testrig using the servoOutput of the pilot Accelerometer needle as a makeshift artificial control feel in the pitch axis. Basically the more G's are pulled, both negative and positive, the servo wants to return the stick back to the "neutral" force position with a force equal to the amount of G's. So If you pull back hard (high g's) and release the stick, the stick will be pulled back to "neutral" position and as stick deflection decreases also the amount of force by the servo is decreased. I've set up a testrig (not full size) using a HSS high torque servo connected to a"flight stick" by way of a cable & pulley system connected to some springs. It actually works pretty ok. Stick doesn't bounce when released at full deflection. Some military fighter aircraft with hydraulically boosted mechanical flight controls feature a Bobweight connected to the pitch belcrank which increases counter force when G's are "pulled".) T-38/F-5 also have this feature.

 

Now I'm looking into incorporating the stick trim functionality in the testrig. Initially i wanted to use the ServoOutput of the stabilator indicator needles, however since the horizontal stabilators on the F-14 function as Elevons and have 2 needles, this would work ok in the pitch axis, until you start making roll inputs, then the needles split. So that is not an option.

If it where possible to export the actual position of the flight stick instead of the "stabilisator" indicator needles, it would make it possible to also intermix the movement of the stick while trimming the aircraft.

Hope above makes sense to you.

Eager to hear what's possible!

Thanks in advance!

Link to comment
Share on other sites

Correct

 

 

Verzonden vanaf mijn iPad met Tapatalk

 

 

Sorry hit send button to fast. I actually mean the trim(mer) position. Stick position would probably give the same problems when one would move the stick in the pitch axis as the servo would respond to that manual input as well.

Since it mentions trimmer in the cockpit indicator.lua file. Maybe we would be able to export that data to a servo.

 

 

Verzonden vanaf mijn iPad met Tapatalk

Link to comment
Share on other sites

Sorry hit send button to fast. I actually mean the trim(mer) position. Stick position would probably give the same problems when one would move the stick in the pitch axis as the servo would respond to that manual input as well.

Since it mentions trimmer in the cockpit indicator.lua file. Maybe we would be able to export that data to a servo.

 

 

Verzonden vanaf mijn iPad met Tapatalk

 

 

I assume you mean essentially the angles of the trim tabs on the control surfaces.

Seems like that's kind of related to my earlier question about the P51 trim values.

The difference is that the P51 values appear to be there, but they don't work properly.

Link to comment
Share on other sites

Not quite the same as the F-14 has hydraulically boosted mechanical flight controls and the trim basically move the entire horizontal stabilator independent of dynamic air pressure on the airfoil.

The trim tabs on the P-51, at least in real life, “push” the horizontal stabilator to a certain position until dynamic pressure on the airfoil is balanced again. Just to indicate, when the P-51 speed is 0 there are no aerodynamic forces acting on the control surfaces and therefore there are no forces acting on the flight stick other than friction. At low speed the flightcontrols are “sloppy” where as at high speed you would have to excert more force to move the stick. When you start up DCS P-51D in cold start condition and and do not touch the joystick, the flight stick of the model is not centered. When you move the joystick, the flight stick centers, because it then senses the potentiometer or Hal effect sensor. So the question with regards to your “problem” is, how airflow and dynamic pressure is modeled in the “digital” P-51D. Is it modeled to resemble real life physics? Maybe a question we should ask the P-51D development team.

But then again the same question can be asked about the “digital” aerodynamic modeling of any airplane module in DCS..

 

 

Verzonden vanaf mijn iPad met Tapatalk

Link to comment
Share on other sites

I look over this lua and must say: not possible to get an offset for the stick since I have to use arguments.

 

What I can do is a readout for the trim colliehat. And every time he is pressed in an direction you move the stick a step

Link to comment
Share on other sites

Hey guys... Has anyone encountered any issues with the Hornet parking break with DCS bios? I cannot release the brake. Once it is released I can turn it, push it in/out but I cannot release it. Looks like a few people across the forums have asked this question with no resolution.

 

DcsBios::Switch2Pos emergencyParkingBrakePull("EMERGENCY_PARKING_BRAKE_PULL", 8);

 

const byte emergencyParkingBrakeRotatePins[3] = {9, 10};

DcsBios::SwitchMultiPos emergencyParkingBrakeRotate("EMERGENCY_PARKING_BRAKE_ROTATE", emergencyParkingBrakeRotatePins, 3);

Link to comment
Share on other sites

  • Recently Browsing   0 members

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