Posts

Showing posts from 2024

A-10C Standby Compass - Sun Shade

Image
 One of the final items to add to this instrument build (besides the text covers for the lower LEDs) was the sun shade for the AR LED box.  I made this out of thin aluminum sheets , cutting it from a template using some metal sheers .    My template was created by tracing some of the actual artwork from the DCS sim, and then scaling it to the proper size. It turned out ok, not perfect but pretty good.  Primed and painted it and then installed it using 2 of the 4 holes that were already on the LED box 3D print.  I used some heat inserts in those holes to give the screws something to bite, but the holes are really too big for my inserts so had to use some glue to help out.  

A10-C Standby Compass: Final Setup

Image
Got everything soldered together (after likely damaging one EasyDriver and moving to a backup) and squeezed it into the case.  At first I thought the compass wheel was much too high but then I realized the front bezel was installed upside down. Used an Exacto knife to cut a piece of acrylic for the front glass and put a small vertical sticker on it to act as the reference line.  Not super pretty but works ok until I can cut with a laser instead (maybe an xTool). Getting everything to fit was trickier than I expected, but it all worked out without too much rework required.  I used some 5.5mm x 2.1mm plugs for the 12v power plugs (tip/center was positive).   For the aerial refueling LEDs I used some more LEDs that have resistors built-in.  They are made for 12v so will likely bit a little dim since I am powering them off the digital out 5v pins from the Nano.  Don't have a way to make the lens for those yet so will wait to see if that is the case.  So far so good though! Since I had

A-10C Standby Compass - Hardware Wiring

 Components: Arduino Nano , no headers attached EasyDriver board to run stepper motor 2x 12V power circuits (for LEDs and motor power) - used computer power supply with ATX breakout board IR sensor X27 168 Stepper Motor 3 green LEDs with built-in resistor 3 LEDs for the Ready/Latch/Disconnect box (and resistors if not built in) 3D printed parts from The Warthog Project Wiring 3 green LEDs , in parallel -> power and ground to one 12V circuit Arduino Nano (10 connections, plus USB) D11 to IR Sensor "OUT" D3 to EasyDriver DIR D2 to EasyDriver STEP GND to IR sensor GND GND to EasyDriver control GND (by STEP) 5V PWR to IR Sensor VCC D6 , D7 , D8 and ICSP GND (from the 6-pin cluster) routed out of box to later power the 3 LEDs below this compass unit ("ready", "latch", "disconnect") IR Sensor (3 connections) VCC to Nano 5V GND to Nano GND OUT to Nano D9 Stepper Motor (open it to remove tiny plastic stop tab, for 360 motion - 4 connections) Coil 1/A

A-10C Standby Compass: Basic Functions Working

Image
After getting the stepper motor to move yesterday I worked on the LEDs and getting the IR sensor into the mix today.  My LEDs are green ones that have the resistor built-in, and therefore are expected to be wired to my 12v power supply in parallel.  That generally went ok even with my sub-par soldering skills but there was very little room for things.  If I had made my own 3D print for the LED holder (or had the original 3D design files) I might have improved that a bit, but I made it work. Here's the code I used for this today . Things I learned while copying this awesome work : Be careful with how wires need to route before putting heat-shrink on them, that stuff doesn't bend well.  Also consider the type of wire in use: I switched to easy bending wire for the things I had to route around tight spots. If the motor spins the wrong way, swap the pins on ONE of the coils, A or B - or use the AccelStepper's setPinsInverted() function in the Arduino code to invert the DIR pin

Standby Compass: StepperTest

Image
Yesterday I finally received the EasyDriver stepper driver and the X27-168 steppers(no more AliExpress orders if I can help it - took weeks to arrive).   I opened up the motor and removed the tiny plastic tab that was keeping it from spinning 360.  I soldered headers on one of the EasyDrivers for prototyping and soldered some solid core wire to the little leads on the motor.   After wiring it all up on the breadboard I used this code to see it run. For the connections: you need to put one coil's wire pair on the A pins for the EasyDriver and the other coil's on the B pins.  There is no polarity so the A coil wires can go on plus or minus.  I put the 12v power on the M+ and GND pin pair.  Then these as well: // EasyDriver -> Nano stp -> 2 dir -> 3 MS1 -> 4 MS2 -> 5 EN   -> 6 GND (by step pin) -> GND Do not connect/disconnect the motor when power is applied . Power is constantly flowing to keep motor still and changing connection when powered will kill

More Standby Compass work

Image
 Did the filling, sanding and painting of the box today.   Got the computer power supply breakout board working and tested it by powering 50 green LEDs with 12v.  These LEDs have a resistor built-in so I ran them all in parallel.  They pulled about 13 mA at steady state, which is well under the typical 20 mA limit.  They were super bright. Played with an Arduino sim here - using wrong driver board - to try to think though the wiring.

Servo responding the fuel gauge changes in DCS

Got a servo SG90 working, just powered off arduino since only running one - just needs one digital pin.  Seems to do just fine! //============ #include <Servo.h> #define DCSBIOS_DEFAULT_SERIAL #include "DcsBios.h" DcsBios::ServoOutput fuelQtyL(0x10ca, 8, 544, 2400); void setup() {   DcsBios::setup(); } void loop() {   DcsBios::loop(); }

Standby Compass - first steps

Started on a standby compass today.  Printed out the parts from TWP (Warthog Proj) and ordered electronics he mentioned in the video.  Did the same finishing of the 3d prints as he did - started the sanding.   Mounted the electric dewalt sander in the big vice upside down to act as a bench sander.  Sanded and rinsed them in water to remove the dust.  Will use spray filler and then paint to get them looking better. Used some of the black M3 screws to mount some of the parts.   Learned a bit about backlighting, TWP has some good info on that.   Ordered computer PSU breakout boards to get to power coming off that.  Also ordered 2 PWM LED dimmers to connect to that breakout.   3d prints: I like the organic/tree supports, but make sure you orient the part such that the top of the tree is minimal cross section.  If the tree ends up "spreading out" at the top it is near impossible to break loose - you want a minimal connection at the top where it supports the print.  Flexing them w

LCD, Potentiometer, LED, Rotary Encoder all working with DCS-BIOS

Image
 Learned a lot today trying to get a pot going:  DO NOT have Serial.begin() in the hardware code as that seems to disrupt the DCS BIOS comms DO NOT have a delay in the loop func - DCS BIOS can't do its thing When you run multiple-com-ports.cmd watch for errors - if you have the IDE connected to the device the script will fail to connect since it is tied up - it will errors with a message about the device (but the com number will be 1 lowered that what you put in the script itself, must be zero-indexed) Wire switches from GROUND to a digital pin, not from +5v YOU CAN stop the bios cmd, deploy new code via IDE, and then restart BIOS while the game is running, so that is helpful The BORT tool is called ...setup.exe - that is the binary itself, not a setup program BORT does not appear to update all its values shown on-demand, seems to not be 2-way comms with BIOS - though SOME vals do work 2-way The rotary encoder I was using would occasionally skip input or put out a double input. 

Heated Inserts for 3D print screws

Image
 Worked on inserting magnets and heat inserts for screws today (into 3D prints, for better strength). I paused the print for the magnet insert and let them have 2 layers printed on top after. The Prusa XL needed help clearing the nozzle upon resume, it did not do that itself. I sized the hole purely based on the magnet size and that was fine.  The magnets were fairly weak with the 2 layers on top so plan accordingly in the future. For the brass heat inserts: they worked with the dimensions I measured off the inserts - however, I needed to countersink the insert holes (made a surround that was 1 mm more in DIAMETER, 1 mm deep - should have used 2mm for both those offsets).  However the extra plastic that came out the top was easy to sand away.  Some sort of drill press setup for the soldering iron would have helped them go in perfectly straight. I used my older soldering iron ( basic Weller ) with new tips that are sized for different heat insert sizes.   Bought a very nice Hakko sold

First time trying DCS-BIOS to talk to DCS sim

Used the warthog proj video to learn how to use DCS-BIOS to control the switches.  Worked on the first try! Found the Arduino com port in Device Manager under "Ports..."  Updated the "C:\Users\vecto\Saved Games\dcs-bios-master\Programs" file multiple-com-ports (to update the com ports for my Arduinos) and then let it run - the first time it unzipped socat for me, and then I re-ran the cmd to make sure it worked.  The cmd window did not have clear messages but it was working Used Bort as well, from the same org in github (not the other fork) Don't download the code, find the latest exe in there to grab It needs to know where the json dir is within DCSBios - I had that in Saved Games so pointed it there https://www.youtube.com/watch?v=LsAnP6H9BMU used the dcs-bios and arduino lib from that same shunkworks org - did not use FlightPanels thing Based on warthog's notes, I plan to use joystick style coding for all dumb switches so they can work in other apps and