Jump to content

lesthegrngo

Members
  • Posts

    1245
  • Joined

  • Last visited

Everything posted by lesthegrngo

  1. HI all, there are a bunch of us who build our own cockpits and export the data to physical instruments that we make. The problem that we have is that when we use the HUD view, it disables a number of instrument data inputs that work fine when in the Cockpit view. Is there a way to hide the cockpit? Or at least set the cockpit view position so that it is in front of the cockpit? Cheers Les
      • 1
      • Like
  2. A quick update on this I increased the voltage to the IR LED after discussions with the old sketch not seeming to be sensitive enough - you can read all about it here https://forum.dcs.world/topic/318814-increasing-the-sensitivity-of-ir-digital-position-sensor/#comment-5152445 if you are feeling so inclined. My new setup uses a lot of that hardware, and it looks like I may have to go backwards a step on the sensitivity. The new sketch works well, right up until you put the gauge face and 'glass' on it, after which it will not zero. It looks like I have increased the IR LED output to the point where the IR light is bouncing back off the 'glass' with the result that there is no real zeroing signal. Additionally, the potentiometer that is supposed to adjust sensitivity is unable to compensate for it. So, it looks like I'll have to go back to the 390 ohm resistor, by no means a difficult task. Maybe a potentiometer would be an idea so that I can regulate it but I would have to redo the PCB for that Cheers Les
  3. My hubs are mostly good quality powered ones, as I think I had some issues with cheaper ones way back that made me go for the higher quality ones. Having said that I do have a couple of 'sub-hubs' in there that are primarily for the ESP32 devices used for the digital clock and Standby ADI. I didn't log which one of the devices was on the com port that was affected, but it hasn't repeated itself since. Cheers Les
  4. ok, that sounds like a workaround does anyone have the details of how to do that? Cheers Les
  5. ****EDITED***** Solution at the bottom of the thread I just realised that as the digital clock is not connected via RS485 it can't be anything to do with RS485! I swear I should have been a beta tester for Microsoft....... I have just discovered that using HUD view (in this case invoked with l-alt+f1) seems to interrupt the DCS Bios signal to some devices. In my case the ones I can definitely see are interrupted are the digital clock (ESP32 device) and the UHF radio (Nano) and there may be more of them that are not so obvious. I had the HUD assigned to a button on a Bodnar board too, and it does the same thing. Even more curiously, clicking l-alt+f1 again to get back into cockpit view starts them working again, and if you had rotated an encoder it would catch up. For info clicking the Bodnar assigned button does the same I will try and reassign the command, but as the Bodnar board works as a joystick input button I can't imagine it will change anything. All I can assume is that going to HUD mode simply stops DCS Bios from outputting the data Can someone else try it to see if it is just on my rig? Les
  6. Also trying to find out how to do this, or at least be able to edit the standard views to give me what I want. Setting a snap view is no good, I need it as the default view that appears when you start DCS. If I have to keep holding a couple of keys down in order to have the 'normal view' that defeats the object, so the purported 'solution' above is anything but In each aircraft mod there is a Views.lua and this appears to be where the default views are set for any particular aircraft. Is there a way of modifying this in order to set your default view as you want? I tried finding 'HUD View' in that lua file, but suspect that it is simply the standard cockpit view minus the actual cockpit hardware being rendered, it doesn't change the camera 'position'. If I wanted to move the camera view so it is just in front of the cockpit for example, what would I need to do? Les
  7. Thanks... I think! I am just imagining how many more posts that I will be writing trying to get this to work, and my wife in the background saying 'but I thought you said that you'd finished that....' Having said that, I have to say that it is working pretty well now despite all the prior issues, and I'll probably just stick with what I have on the basis that if it ain't broke, don't fix it (and don't piss off the wife...) The guys developing their stuff will appreciate all the input, so I know your help won't be wasted Les
  8. OK, I worked out a bit of a cheat method, it isn't perfect but it does work Do the l-alt+f1 thing, and you will get the HUD View. Now use the / and * keys on the keyboard NUM section and you can move the 'camera' view forwards and backwards, which also increases and decreases the size of the HUD projection. Once the size is better, use the 8 and 2 NUM keys to vertically align the HUD As I said, it isn't perfect, as the horizon vs the HUD will be off and you may have to play with the physical monitor height to improve it, but it will work. I will keep looking for a way to do it properly Les
  9. I found this thread https://forum.dcs.world/topic/316699-how-to-external-views/ that gives a nice cheat sheet that I can use to move around to get a view that would work, the problem is that i would have to do that every time I start or restart a mission. Is there a way to save a view if I settle on one that suits me? Cheers Les
  10. Not sure why, but today four of the six com ports have changed numbers. Obviously not devastating, as I just need to edit to correct it, however it would be good to be able to maintain the same com ports. I can see that there is a way of manually assigning the number but this appears to be only while the PC is powered and reverts when depowered - am I reading that right? Cheers Les
  11. And for the hard of thinking like me, what is it exactly we have to do to fix it, or has some software been changed? I have an A10 warning lights panel that I made using a Mega to drive individual LED's (one LED to one pin) that worked fantastically using USB, but was not working properly using RS458, as it would only light portions of the panel at any one time. If I could get that working properly under RS485 it would definitely be a plus Cheers Les
  12. your Arduino IDE is up to date? I know that screwed me for at least a year. Plus make sure you are using the Flightpanels DSC bios Fork Cheers Les
  13. Try the following, I think you should include the wire command /* 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 1 /* The Arduino pin that is connected to the /RE and DE pins on the RS-485 transceiver. */ #define TXENABLE_PIN 2 #include "DcsBios.h" #include <Wire.h> /* paste code snippets from the reference documentation here */ DcsBios::Switch2Pos pltHudDeclutter("PLT_HUD_DECLUTTER", 4); DcsBios::LED pltWarnLadder(0x12dc, 0x8000, 13); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } Les
  14. Hi there, let us see your sketch to see if there is something wrong with it as a starting point. Use the code brackets above (the symbol that looks like <> ) and put it in there. It will also let us se how you should be wiring up your circuit Cheers Les
  15. Hi all, generally I post in the Home Cockpits forum but this seems like a more generic type question I have built my sim rig cockpit, and so now only require the external view, and the HUD projection. However as I need to scale the HUD projection to fit my HUD frame, I will be trying to view it as a viewport, which can be scaled and moved to suit my setup. However to do this, I need to have an external view that does not have the HUD displayed, and if at all possible can be moved up and down or zoomed in or out to as closely match what I see to my physical rig. I would also like to be able to save a particular view once I have that set. The viewport should be easy enough (hopefully!) as I already have the RWR, CDU and MFCD's on their own viewports, but I cannot find an external view that suits Is this possible? Cheers Les
  16. Nice bit of sleuthing there! If that can be made to work it looks like it will be exactly what I need. The only caveat about that is to know that I can remove the HUD image from the HUD View, or if there is a separate exterior view that comes without the HUD image. Cheers Les
  17. Where did you find the code for that? Is there a list somewhere? Les
  18. Now I have the HUD view back, I'd like to know if it is possible to resize the actual HUD 'projected' image. The apparent size of the HUD is far smaller that the actual HUD size that it needs to be to correctly display with my cockpit Does anyone have any idea how this can be achieved? I don't believe that it can exported like the MFDC's and the RWR can Cheers Les
  19. I uninstalled the MFG control software, unplugged everything, restarted everything and went back through reinstalling. After doing that I can now get the axis tune to affect the pedals and it is so much better. The Crosswinds are so much smoother and positive than the Saitek ones and having a correct input curve has made everything better Cheers Les
  20. Those little details can bite..! I got the biggie, the Altimeter all sorted, complete with the Pneu / Baro settings encoder and switch, so started to sort some of the other minor issues that needed finishing. I needed to connect up the ADI pitch trim adjustment encoder, plus the two encoders for the HSI course and heading set. No problem, just add those to one of the existing nanos and away we go, right? Nope, I got put through the wringer by those. Boy are they picky about what pins the encoders are connected to. The ADI was less fussy that the other two, but the course and heading set could not be used with pins 7 through 13, and for the course set seemingly 14 through 17 on my Nanos. I tied various Nanos and it was repeatable, I checked the hardware to make sure it was not a duff encoder etc, and eventually got them to work with the following sketch //#define DCSBIOS_DEFAULT_SERIAL //#define DCSBIOS_IRQ_SERIAL #define DCSBIOS_RS485_SLAVE 101 #define TXENABLE_PIN 2 #include "DcsBios.h" #include <SPI.h> #include <Wire.h> DcsBios::RotaryEncoder adiPitchTrim("ADI_PITCH_TRIM", "-3200", "+3200", 8, 7); //was 8 7 DcsBios::RotaryEncoder hsiCrsKnob("HSI_CRS_KNOB", "-3200", "+3200", 6, 5); //was 9 10 DcsBios::RotaryEncoder hsiHdgKnob("HSI_HDG_KNOB", "-3200", "+3200", 18, 19); // was 5 6 DcsBios::LED markerBeacon(0x10da, 0x0002, 10); DcsBios::LED gunReady(0x1026, 0x8000, 11); DcsBios::LED canopyUnlocked(0x10da, 0x0004, 9); DcsBios::LED nosewheelSteering(0x10da, 0x0001, 12); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } I have no explanation as to why the wouldn't work - when you used any other pins, rotating the encoder would make the in game item tremble, but not move. I literally had to go through trying a pin pairing one at a time until I found ones that reliably worked. Anyway, done now, on to the next bit Les
  21. The AccelStepper version in that thread worked, once I made a patch PCB to enable me to delete the stepper driver. It is not perfect, despite playing around with the max steps in the stepper config, the position of the pointer doesn't properly match the 'real' position, but it will pass through the zero point with out a step forwards or backwards, so the rotation is smooth and doesn't detract. I also had no issues getting it functioning with RS485 either Puzzlingly the max steps value had to be changed when I went from the USB to the RS485 version, I don't know of any logical reason why that would be. Nonetheless, compared to the old version it is a massive improvement. In case anyone wants to use it here is the final sketch, which includes the fully functioning Baro set and Alt/Elec/Pneu rotary switch //#define DCSBIOS_IRQ_SERIAL #define DCSBIOS_RS485_SLAVE 100 #define TXENABLE_PIN 2 #include <AccelStepper.h> #include "DcsBios.h" struct StepperConfig { unsigned int maxSteps; unsigned int acceleration; unsigned int maxSpeed; }; class Vid60Stepper : public DcsBios::Int16Buffer { private: AccelStepper& stepper; StepperConfig& stepperConfig; inline bool zeroDetected() { return digitalRead(irDetectorPin) == 1; } unsigned int (*map_function)(unsigned int); unsigned char initState; long currentStepperPosition; long lastAccelStepperPosition; unsigned char irDetectorPin; long zeroOffset; bool movingForward; bool lastZeroDetectState; long normalizeStepperPosition(long pos) { if (pos < 0) return pos + stepperConfig.maxSteps; if (pos >= stepperConfig.maxSteps) return pos - stepperConfig.maxSteps; return pos; } void updateCurrentStepperPosition() { // adjust currentStepperPosition to include the distance our stepper motor // was moved since we last updated it long movementSinceLastUpdate = stepper.currentPosition() - lastAccelStepperPosition; currentStepperPosition = normalizeStepperPosition(currentStepperPosition + movementSinceLastUpdate); lastAccelStepperPosition = stepper.currentPosition(); } public: Vid60Stepper(unsigned int address, AccelStepper& stepper, StepperConfig& stepperConfig, unsigned char irDetectorPin, long zeroOffset, unsigned int (*map_function)(unsigned int)) : Int16Buffer(address), stepper(stepper), stepperConfig(stepperConfig), irDetectorPin(irDetectorPin), zeroOffset(zeroOffset), map_function(map_function), initState(0), currentStepperPosition(0), lastAccelStepperPosition(0) { } virtual void loop() { if (initState == 0) { // not initialized yet pinMode(irDetectorPin, INPUT); stepper.setMaxSpeed(stepperConfig.maxSpeed); stepper.setSpeed(200); initState = 1; } if (initState == 1) { // move off zero if already there so we always get movement on reset // (to verify that the stepper is working) if (zeroDetected()) { stepper.runSpeed(); } else { initState = 2; } } if (initState == 2) { // zeroing if (!zeroDetected()) { stepper.runSpeed(); } else { stepper.setAcceleration(stepperConfig.acceleration); stepper.runToNewPosition(stepper.currentPosition() + zeroOffset); // tell the AccelStepper library that we are at position zero stepper.setCurrentPosition(0); lastAccelStepperPosition = 0; // set stepper acceleration in steps per second per second // (default is zero) stepper.setAcceleration(stepperConfig.acceleration); lastZeroDetectState = true; initState = 3; } } if (initState == 3) { // running normally // recalibrate when passing through zero position bool currentZeroDetectState = zeroDetected(); if (!lastZeroDetectState && currentZeroDetectState && movingForward) { // we have moved from left to right into the 'zero detect window' // and are now at position 0 lastAccelStepperPosition = stepper.currentPosition(); currentStepperPosition = normalizeStepperPosition(zeroOffset); } else if (lastZeroDetectState && !currentZeroDetectState && !movingForward) { // we have moved from right to left out of the 'zero detect window' // and are now at position (maxSteps-1) lastAccelStepperPosition = stepper.currentPosition(); currentStepperPosition = normalizeStepperPosition(stepperConfig.maxSteps + zeroOffset); } lastZeroDetectState = currentZeroDetectState; if (hasUpdatedData()) { // convert data from DCS to a target position expressed as a number of steps long targetPosition = (long)map_function(getData()); updateCurrentStepperPosition(); long delta = targetPosition - currentStepperPosition; // if we would move more than 180 degree counterclockwise, move clockwise instead if (delta < -((long)(stepperConfig.maxSteps/2))) delta += stepperConfig.maxSteps; // if we would move more than 180 degree clockwise, move counterclockwise instead if (delta > (stepperConfig.maxSteps/2)) delta -= (long)stepperConfig.maxSteps; movingForward = (delta >= 0); // tell AccelStepper to move relative to the current position stepper.move(delta); } stepper.run(); } } }; /* modify below this line */ /* define stepper parameters multiple Vid60Stepper instances can share the same StepperConfig object */ struct StepperConfig stepperConfig = { 740, // maxSteps 8000, // acceleration 4000 // maxSpeed }; // define AccelStepper instance AccelStepper stepper1(AccelStepper::FULL4WIRE , 5, 4, 6, 7); // define Vid60Stepper class that uses the AccelStepper instance defined in the line above // v-- arbitrary name Vid60Stepper alt100ftPointer(0x107e, // DCS Bios address For stepper data stepper1, // name of AccelStepper instance stepperConfig, // StepperConfig struct instance 9, // IR Detector Pin (must be HIGH in zero position) 0, // zero offset [](unsigned int newValue) -> unsigned int { /* this function needs to map newValue to the correct number of steps */ return map(newValue, 0, 65535, 0, stepperConfig.maxSteps-1); }); void zero_stepper1(){ stepper1.setMaxSpeed(4000); // maximum speed in steps per second. Must be > 0. stepper1.setAcceleration(8000); // desired acceleration in steps per second per second. Must be > 0.0 stepper1.runToNewPosition(630); // go to the upper end stop delay(250); stepper1.setCurrentPosition(630); // set max steps stepper1.runToNewPosition(0); // go to the lower end stop delay(250); stepper1.setCurrentPosition(0); // set steps to zero } const byte altElectPneuPins[3] = {11, 10, 8}; DcsBios::SwitchMultiPos altElectPneu("ALT_ELECT_PNEU", altElectPneuPins, 3); DcsBios::RotaryEncoder altSetPressure("ALT_SET_PRESSURE", "-1600", "+1600", 12, 13); void setup() { DcsBios::setup(); zero_stepper1(); } void loop() { PORTB |= (1<<5); PORTB &= ~(1<<5); DcsBios::loop(); } cheers Les
  22. It seems to work for me, I have all six com ports and in the testing I did today I only had it 'fail' once, when I got a message that one of the com ports was denying access. All the other times it seems to run nicely. I edited it using Notepad++ in case anyone is interested Cheers Les
  23. Unfortunately definitely not the brakes. However later on today I will do the 'shows control indicator' thing to see if that helps me work out what is going on Cheers Les
  24. where do you find that? Cheers Les
  25. I have the extra springs (Bought direct) but springs don't act as dampers, unfortunately. Nonetheless, worth trying Cheers Les
×
×
  • Create New...