

lesthegrngo
Members-
Posts
1245 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by lesthegrngo
-
Stepper motor drivers for use with Arduino and DCS Bios
lesthegrngo replied to lesthegrngo's topic in Home Cockpits
you will have to adjust this part struct StepperConfig stepperConfig = { 3900, // maxSteps 1000, // maxSpeed 1000 // acceleration }; The maxSteps will be the most important one Les -
Stepper motor drivers for use with Arduino and DCS Bios
lesthegrngo replied to lesthegrngo's topic in Home Cockpits
This sketch uses pin 11 for step and pin 10 for direction, it is more complicated as it has an extra part that makes the stepper reset its position when initialised. Credit must go to Craig for the original sketch that this is based on. Use the section stepperconfig to set step values and acceleration rates to suit #define DCSBIOS_IRQ_SERIAL #include <AccelStepper.h> #include "DcsBios.h" struct StepperConfig { unsigned int maxSteps; unsigned int acceleration; unsigned int maxSpeed; }; class Vid29Stepper : public DcsBios::Int16Buffer { private: AccelStepper& stepper; StepperConfig& stepperConfig; unsigned int (*map_function)(unsigned int); unsigned char initState; public: Vid29Stepper(unsigned int address, AccelStepper& stepper, StepperConfig& stepperConfig, unsigned int (*map_function)(unsigned int)) : Int16Buffer(address), stepper(stepper), stepperConfig(stepperConfig), map_function(map_function), initState(0) { } virtual void loop() { if (initState == 0) { // not initialized yet stepper.setMaxSpeed(stepperConfig.maxSpeed); stepper.setAcceleration(stepperConfig.acceleration); stepper.moveTo(-((long)stepperConfig.maxSteps)); initState = 1; } if (initState == 1) { // zeroing stepper.run(); if (stepper.currentPosition() <= -((long)stepperConfig.maxSteps)) { stepper.setCurrentPosition(0); initState = 2; stepper.moveTo(stepperConfig.maxSteps/2); } } if (initState == 2) { // running normally if (hasUpdatedData()) { unsigned int newPosition = map_function(getData()); newPosition = constrain(newPosition, 0, stepperConfig.maxSteps); stepper.moveTo(newPosition); } stepper.run(); } } }; struct StepperConfig stepperConfig = { 500, // maxSteps 1000, // maxSpeed 1000 // acceleration }; AccelStepper stepper(AccelStepper::DRIVER, 11, 10); Vid29Stepper AirspeedNeedleBuffer(0x5030, stepper, stepperConfig, [](unsigned int newValue) -> unsigned int { return map(newValue, 0, 65535, 0, stepperConfig.maxSteps); }); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } Cheers Les -
Stepper motor drivers for use with Arduino and DCS Bios
lesthegrngo replied to lesthegrngo's topic in Home Cockpits
Ok, good news for you then, as that Arduino sketch is for that stepper motor Cheers Les -
Stepper motor drivers for use with Arduino and DCS Bios
lesthegrngo replied to lesthegrngo's topic in Home Cockpits
Hi, what hardware are you using? you can try using this code, although the part that says 8, 544, 2400 you may hav to change to adjust the range #include <Servo.h> #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" void onAirspeedNeedleChange(unsigned int newValue) { /* your code here */ } DcsBios::IntegerBuffer AirspeedNeedleBuffer(0x5030, 0xffff, 0, onAirspeedNeedleChange); DcsBios::ServoOutput AirspeedNeedle(0x5030, 8, 544, 2400); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } Cheers Les -
Thanks guys The intention would actually be to offload some of the GPU work, so only data for the second PC to use to make the displays would be sent, a bit like sending telemetry to a remote PC rather than processing it on the same PC I know in the olden days PC's could be linked for certain tasks, when processing power was limited - I seem to remember the company I worked for having effectively a network of PC's in order to run their CAD program, where the calculations were shared out amongst the individual satellite units. That still used to be so slow that you would start the porcessing on Friday evening and hope it had finished by the time you came in Monday morning, so I think you can guess how long ago that was! Les
-
Guys, I'm finally being able to put my rig back together after our recent move. However it is currently using a total of five monitors, one for the main display and four for the MFCD's and other instruments. I am also looking at replacing the CDU TFT with a 5 inch LCD screen to get rid of the character mismatch, which would bring the total to six displays. apart from the main display most are (relatively) low resolution. I have two GPU's in the PC, so the number of displays is on the limit but achievable with one PC, but I am worried that the need to drive all the displays from one PC will negatively affect it; either slowing the PC or causing lag. I know that before I managed to resolve the issue with RS485 having lots of USB connections caused lag So I have an older i5 desktop PC in pieces doing nothing, so I started wondering whether it is possible to link it to the main PC and use it to drive some of the monitors, and maybe DCS BIOS so that the main PC can max out the framerate and performance. Is this erroneous thinking? Cheers Les
-
OLED Display and Arduino Sketch Help Please
lesthegrngo replied to Kenpilot's topic in Home Cockpits
Ken, away from home at the moment, but following that fleabay link it says that there is an example sketch for arduino, can you post it so we can check how it is configured? Different OLEDs use different protocols, so that may help us crack it Les -
While this will work (and remember there are companies that sell different faceplate for the G2 so it is pretty low risk) what about the concept of using a pass through from the cameras on the G2 used for tracking? If it is able to show your surroundings overlaid on the VR environment, you would be able to use the combination of visual cues (assuming that the overlaid image would be monochrome or low res) plus muscle memory Just a thought Les
-
You are just like me - no plan, just do whatever takes my fancy next. Still, my wife worked out long ago that most of the pleaure for me is the building not the playing so she realises it keeps me happy! Les
-
Very cool, nice work! Eco friendly too! Les
-
I can see the .stl files in Cura, and they do look good, but in order to use them for my purposes I need to be able to modify them to be able to then make the accompanying hardware. Thanks for the feedback about SW connected, I was looking into that but didn't realise it didn't have the backwards compatibility. A question, the thread at the base, what was that designed to couple to? Cheers Les
-
Hi there, is there any chance that you can save the .sldprt files in SW2012 format? The current format gives an error which I believe is due to my old version of SW Thanks in advance! Les
-
Or you could use four ON-ON-ON switches wired in series with the resistors? Les
-
Certainly on civilian aircraft, deploying the undercarriage (or flaps for that matter) above a certain speed is very dangerous, so I can imagine there is an interlocking mechanism for that too - having to pull the lever out would perform that function I suppose, so it is entirely possible that it has to be pulled for both up and down Les
-
All, looking at this diagram below, it's clear that this would equally apply to a series of linear buttons too if connected in series with the 1K resistors between them So, if my thinking is right, switch heavy panels like the A10C CDU, UFC, MFCD's could have the number of necessary pinouts reduced by a factor of 11 by wiring up the switches in 'ladders' of 12 separated by 1K resistors, correct? Obviously you have to have the right Bodnar board (I do) but I could seriously reduce to wiring in that way. Or am I understanding it wrong? ******EDIT********* Ignore me, I was understanding it wrong, I forgot to factor in the dynamic nature of the switch. I would have to use 11 different resistors and if two were pressed at onece it would completely mess it up Les
-
The other thing is you can use a thin sheet of white polystyrene, maybe .01mm thick behind it to diffuse the light better, modeling plasticard is cheap and can be cut to shape with scissors. Using 'transparent' filament with a diffuser behind it will have the effect you want Les
-
Circuit breaker panel question - curiosity only!
lesthegrngo replied to lesthegrngo's topic in Home Cockpits
Thanks guys - and yes, the LED switch solution is quite an elegant one. I will definitely make a dummy breaker panel to start with for ease and speed, but at least if the fancy takes me this gives me lots of ideas. Sometimes I make things for the rig not because I need them, but because I like the challenge and down the line this may be one of those Thanks as always to all who help! Les -
Circuit breaker panel question - curiosity only!
lesthegrngo replied to lesthegrngo's topic in Home Cockpits
Very true, although maybe a bit too OCD...?! Out of curiosity (again) does DCS BIOS support the tripping function? That's great, thanks - easy enough to make an .stl file for 3D priniting. If anyone is interested in the files, let me know Les -
Circuit breaker panel question - curiosity only!
lesthegrngo replied to lesthegrngo's topic in Home Cockpits
Thanks for the feedback Cheers Les -
Circuit breaker panel question - curiosity only!
lesthegrngo replied to lesthegrngo's topic in Home Cockpits
Fair enough, is the normal acuation just a push action? Ouch, by the time you did the whole panel you could buy a new PC! Les -
I don't intend to make anything more than a dummy circuit breaker panel, having never used any in game ( I know DCS BIOS lists them). A cosmetically pleasing panel will be enough for me. However, other than real circuit breaker units, I can't imagine what else you would use. You wouldn't be able to make them pop out, so they would just be glorified switcheds, but I just know someone has made a working panel. What did you you use?! Cheers Les
-
Thanks - very similar to my initial 3D models I designed yesterday! Les
-
Ah, ok, no worries. I'll start work on a better lever assembly. I should be able to find some translucent resin for the resin printer I have to replicate the knob. The pull out part should be relaitively simple too, I have some square aluminium tube I can use for the base for the lever to slide out of Cheers Les
-
Definitely helps, thanks! One thing is I never noticed the three lock lights flashing red while the gear was being retracted (or extended) in game. DOn't know if this is not representetd in game or just that I havent't been paying attention! Cheers to all Les
-
All, my cockpit has a simple undercarriage lever that works fine in terms of a simplistic up and down lever with an overcenter action. However it obviously is not very representative of the real thing, but curiously no-one will let me play with a real one to find out how it should act! I am under the impression that the lever has to be pulled towards you first, then moved to the selected position and then it pulls back into the dash under spring pressure. I am also going to assume that the pull feature is an interlock or inadvertent movement prevention device. Is there also an interlock button? The top of the lever knob seems to have what looks like a button, is it? Lastly, from my commercial aircraft experience often the lever knob will flash when the undercarriage is in transit, with the lock lights being the confirmation of the fully down position Is that all correct or am I way off the mark? Cheers Les