Warhog Posted October 31, 2016 Posted October 31, 2016 Nice work Calum. It looks almost identical to mine. The only real difference is that I use an Easy Drive board to run the motor. The ED board only needs 2 pins, one for step and one for direction instead of 4 pins and it costs almost nothing ($1.80 I think). The code below is what I am using for mine and it works very well indeed. You may notice that the scale on the gauge face is not exactly linear. We needed to adjust the mapping of the export values to account of the differences in the scale. I would like to give credit to Ian for this work. He was mostly the author of this sketch which, for the most part, is still somewhat over my head. But I am learning more every day. Thank you Ian!:thumbup: As to the code below, you are more than welcome to give it a try Calum. I hope it will save you some time. #define DCSBIOS_DEFAULT_SERIAL //#define DCSBIOS_RS485_SLAVE 13 //#define TXENABLE_PIN A2 #include <AccelStepper.h> #include "DcsBios.h" AccelStepper vviMotor(AccelStepper::DRIVER, 11, 10); 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 emiStepperConfig = { 1360, // maxSteps 1200, // maxSpeed 10000 // acceleration }; Vid29Stepper vvi(0x106e, vviMotor, emiStepperConfig, [](unsigned int newValue) -> unsigned int { unsigned int absValue; if (newValue >= 32768) { absValue = newValue - 32768; } else { absValue = 32768 - newValue; } /* * 315 deg / 1360 steps * 0.29 9502 1000 fpm 50 deg 201 steps 0.50 16384 2000 fpm 84 deg 338 steps 1.00 32768 6000 fpm 169 deg 680 steps */ unsigned int newSetpoint = 0; if (absValue < 9502) { newSetpoint = map(absValue, 0, 9502, 0, 201); } else if (absValue < 16384) { newSetpoint = map(absValue, 9502, 16384, 201, 338); } else { newSetpoint = map(absValue, 16384, 32768, 338, 680); } newSetpoint = constrain(newSetpoint, 0, 680); if (newValue < 32768) { // negative fpm return newSetpoint + 680; } else { // positive fpm return 680 - newSetpoint; } }); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } Regards John W aka WarHog. My Cockpit Build Pictures... My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram, AIO Water Cooler, M.2 512GB NVMe, 500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals
Boltz Posted November 23, 2016 Author Posted November 23, 2016 Wiring for OSRAM displays on CMSP is done For locking toggle switches other than 12TWs I plan to use the NKK switches and turn new caps to create the Cutler switch. They'll thread nicely onto the shaft of these switches I'm also designing conversion of real 2 inch tubes for engine instruments. This will work for converting old cheap 2 inch instruments to stepper driven with correct faceplates. I'll include backlighting to see what it looks like but in the end these will likely be front lit. I managed to buy a 100W laser engraver and also a CNC6040 from eBay very cheaply so I'm waiting for them to arrive now. I don't expect anything amazing since they are cheap chinese made but I have money left to upgrade and get them running. After hearing horror stories of the "blue box" the CNC comes with I'll probably end up using a Gecko G540 drive. Then I can start cutting the instrument parts and some other parts. I've purchased materials as well to try making some panels but I know it will take a while just to get the machines set up and running to a good standard. Looking forward to it though. The machines should be here by the weekend so I'd like to get some test parts designed A-10C Cockpit Build Thread My YouTube Channel
Gadroc Posted November 23, 2016 Posted November 23, 2016 Looking great! Congrats on the new CNC machines... boy is that a dangerous part of this hobby. I've gotten lost in playing with them and making them better.
agrasyuk Posted November 23, 2016 Posted November 23, 2016 Good to hear from you again , and awesome you dabbled into the CNC madness :) so much more possibilities now. Do however prepare as far as ventilation for the Laser Anton. My pit build thread . Simple and cheap UFC project
MacFevre Posted November 23, 2016 Posted November 23, 2016 Again, gotta say Calum, you're really doing a fantastic job! Please keep up the updates, (unlike myself ;),) because they really do help everyone a lot. Thanks for that! Buttons aren't toys! :smilewink: My new Version 2 Pit: MacFevre A-10C SimPit V2 My first pit thread: A-10C Simulator Pit "The TARDIS." Dzus Fastener tutorial, on the inexpensive side: DIY Dzus Fastener
Cali Posted November 23, 2016 Posted November 23, 2016 Great job on the pit! i7-4820k @ 3.7, Windows 7 64-bit, 16GB 1866mhz EVGA GTX 970 2GB, 256GB SSD, 500GB WD, TM Warthog, TM Cougar MFD's, Saitek Combat Pedals, TrackIR 5, G15 keyboard, 55" 4K LED
Boltz Posted November 23, 2016 Author Posted November 23, 2016 Thanks guys. Looking forward to trying out CNC work. Got 4 of the 3 position locking switches in for EW panel and a Grayhill rotary to be modified to add the correct pull action A few more hours work and I got the EW displays done. At least the first version is working. I'd like to tidy it up in the future. In last picture the flash cancelled out the lights but it does show the displays nicely Still need to balance the brightness and wire up the pot to control it. 1 A-10C Cockpit Build Thread My YouTube Channel
Warhog Posted November 26, 2016 Posted November 26, 2016 That looks sooooo nice Calum. Well done.:thumbup: Regards John W aka WarHog. My Cockpit Build Pictures... My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram, AIO Water Cooler, M.2 512GB NVMe, 500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals
Hansolo Posted November 26, 2016 Posted November 26, 2016 Couldn't agree more. Top work Calum :thumbup: Do you have a link to the two types of Osram's? I have some Osram's but they are all same size. Looking forward for more picture my good Sir Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album
Boltz Posted November 26, 2016 Author Posted November 26, 2016 Thanks John. STill need to connect up the switches Hans I'm on my phone at the moment but top row displays are SLG2016 and lower row HDSP2003LP. If I was doing it again I would just use 8 units of 2016. They are nearer to drive and look better at the moment. I need to get the code for the 2003 devices running faster. Also then the dimming function will work better if they are all the same. Which displays do you have? A-10C Cockpit Build Thread My YouTube Channel
Deadman Posted November 26, 2016 Posted November 26, 2016 Now that looks fantastic!! great Job. https://forum.dcs.world/topic/133818-deadmans-cockpit-base-plans/#comment-133824 CNCs and Laser engravers are great but they can't do squat with out a precise set of plans.
Hansolo Posted November 26, 2016 Posted November 26, 2016 Hi Calum, Thanks for the numbers. I have gotten hold of some PDSP1881. The character height is the same as yours but the spacing on mine are a little bigger and it 8 digits displays. There is a datasheet for mine here; http://www.mouser.com/ds/2/311/00036139_0-280291.pdf And the SLG2016 datasheet is here; http://www.mouser.com/ds/2/311/XY%20Stackable%200.180%20%20%20%20%204-Digit%205x7%20Dot%20Matrix_%20Alp-335281.pdf Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album
Boltz Posted December 8, 2016 Author Posted December 8, 2016 After much back and forth regarding eBay purchases, turns out they were not going to show up so eBay gave me a refund. All is not lost though, I've gone back to previous plans and received a very satisfying delivery today. I know at least one person here will identify it immediately :) Thanks so much for convincing me nearly two years ago about this. Only wish I had bought it sooner A-10C Cockpit Build Thread My YouTube Channel
Hansolo Posted December 8, 2016 Posted December 8, 2016 Did you get a Taig milling machine? Warhog will definitly appreciated this. Congratulations on your purchase Calum :thumbup: Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album
Boltz Posted December 8, 2016 Author Posted December 8, 2016 Yes I did build quality is absolutely outstanding on it. Just waiting for the rest of the parts now:thumbup: A-10C Cockpit Build Thread My YouTube Channel
Warhog Posted December 9, 2016 Posted December 9, 2016 Congratulations Calum. Your potential for creating excellence has just been presented to you. There isn't much that machine can't do as you've seen from my work. Spend some time on Nick Carter tools web site. Lots of users on there with some great ideas. Once you learn to master this machine you will be amazed at what you can do with it. And not to worry, I'll be here if you need help. John Regards John W aka WarHog. My Cockpit Build Pictures... My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram, AIO Water Cooler, M.2 512GB NVMe, 500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals
Lobinjaevel Posted December 9, 2016 Posted December 9, 2016 Boltz, what green plastic did you use on the EW panel, for the Osram displays? Having a hard time finding it here in Sweden. Cheers!
MacFevre Posted December 10, 2016 Posted December 10, 2016 Nice new toy, Calum! Buttons aren't toys! :smilewink: My new Version 2 Pit: MacFevre A-10C SimPit V2 My first pit thread: A-10C Simulator Pit "The TARDIS." Dzus Fastener tutorial, on the inexpensive side: DIY Dzus Fastener
Boltz Posted December 12, 2016 Author Posted December 12, 2016 Thanks guys. I'm still waiting on more parts at the moment. @Lobinjaevel User agrasyuk designed and made the brilliant panel. hopefully he can help with what material to use A-10C Cockpit Build Thread My YouTube Channel
agrasyuk Posted December 12, 2016 Posted December 12, 2016 Ah, missed that question, sorry. Lobi, It's ordinary green transparent acrylic sheet material. Similar: http://r.ebay.com/W1fsMj Calum, looking very good. Sorry about the delay, still need to get the buttons redone. Next year looks more likely ) Anton. My pit build thread . Simple and cheap UFC project
Boltz Posted January 27, 2017 Author Posted January 27, 2017 Last parts I needed for the mill finally arrived today and got it up and running. Bit of tweaking and changing numbers and this is first engraving. Small font is 10 point font (~3.5mm) I'm very happy with this machine and working on a first panel to test engraving. Then I need to change to 6mm acrylic and get a proper lightplate made. A-10C Cockpit Build Thread My YouTube Channel
Warhog Posted January 27, 2017 Posted January 27, 2017 Looks great Calum. Just what I would have expected. With a finer tip you can get 6pt. lettering. I use Arial as my basic font. It engraves better than most others fonts as single line fonts are hard to fine. Don't forget that when you are using engraving plastic you will need to flip it over and pocket beneath where the engraving is located so you get the light penetration you need for backlighting. My depth of cut for engraving is .004" deep into 0.06" thick plastic. Then I flip it and pocket the backside to a depth of .035" wherever engraving exists. It provides for a very nice backlighting. I believe Anton uses the same technique. If I might make a recommendation, find a 4" wide ground plate (flat with even thickness) the length of your bed. Mount it to your existing bed. This will be your new work surface. Why? It gives you more width. The extra inch you get by doing this makes it much easier to handle larger panels. You can actually go a little further than that but be careful when you see how far you can go. You don't want to push the bed into the column.:doh: (new bearings required if you do :music_whistling: ) @forum... This is one guy to keep an eye on. He's now equipped to do some rather amazing things. Looking forward to your progress.:thumbup: Regards John W aka WarHog. My Cockpit Build Pictures... My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram, AIO Water Cooler, M.2 512GB NVMe, 500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals
agrasyuk Posted January 27, 2017 Posted January 27, 2017 Callum, you are indeed all set up now to make some quality parts. Big thumbs up. John, your idea of pocketing behind the text is solid, but actually never occured to me! Hmm, that will surely bring out that backlight. Anton. My pit build thread . Simple and cheap UFC project
Hansolo Posted January 28, 2017 Posted January 28, 2017 Nice Calum. Looking forward to seeing panels being spit out of you investment :thumbup: Can't wait to see you pit get into full gear. Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album
Recommended Posts