Jump to content

A-10 Digital Clock Experiments


No1sonuk

Recommended Posts

The fancy clock on the A-10C is a bit of a pig to reproduce due to its design.

 

As I've said elsewhere, I like to try to solve problems, so I decided to look at this one.

of course, the sweeping second marker is the real pig here, but I think I've found a way to do it.

 

 

I just need to sort out the numbers in the middle now.

Link to comment
Share on other sites

Great job - OLED? I ended up copping out and using LCD displays and just made it a digital readout.

 

The one that truly embarrasses me is the standby attitude indicator, which in my version is a printed copy sellotaped to the back of the gauge fascia!

 

Cheers

 

Les

Link to comment
Share on other sites

Great job - OLED? I ended up copping out and using LCD displays and just made it a digital readout.

No. If I'd found a 2" x 2" visible OLED or LCD, it would have been easy enough to do the whole display like the original in one go.

 

No. I "cheated" a bit.

Here's what it looks like under the paper. and with sound...

 

It's an illusion created by a servo and a 12 Neopixel ring with a slot above the centre of each LED.

Neopixels are WS2812 addressable RGB LEDs - yup - it can change colour too.

 

Here's how it works:

 

At 0 seconds, LED0 is turned on, and the servo is at the start position. for each of the next four seconds, the LED is turned off, the servo moves 6 degrees clockwise, and the LED is turned on again.

At 5 seconds, LED0 is turned off, the servo returns to the start position, and the next LED (LED1) is turned on.

This sequence repeats for the whole circle, producing the illusion of 360 degree movement.

The LED is turned off for a period at each move so you don't see the movement - particularly the return to servo zero position.

 

 

This approach has advantages over a single LED moved 360 degrees.

1) Because the servo only moves through 24 degrees, wires and supports for the centre digits can pass through slots in the ring. The video shows a solid slot ring, but that was just for proof of concept.

 

2) The method, and my code aren't "progressive". Rather than starting at 0 and just adding 6 degrees every time, it works out which of the 5 servo positions to use and which LEDs need to be on for the number of seconds

When you switch between clock and ET mode, it can change the seconds marker position much faster than a 360 degree motor because it only has to move a maximum of 24 degrees and change which LED is illuminated.

 

 

I suppose purists will complain because it "ticks", but with the engines running, are you really going to be able to hear it?

 

The code for this test:

/* A-10C Clock Seconds Sweep Test
This is a proof of concept

There is a free-running seconds counter for test purposes

*/

#include <Servo.h>
#include <FastLED.h>  //For neopixels

Servo myservo;  // create servo object to control a servo

int posStart = 90;    // variable to store the servo 0 position can be used for visual adjustment
int secondAngle = 6;    // degrees per second mark
int SecondsDigit = 0;    // counter for LEDS
unsigned long OldMillis;    // for timing on free-running test

// How many leds in your strip?
#define NUM_LEDS 12 

// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN.  For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806, define both DATA_PIN and CLOCK_PIN
#define DATA_PIN 7

#define NVG_PIN 11  // pin for white/green switch
#define EN_PIN 8  // pin for rotation on/off switch

// Define the array of leds
CRGB leds[NUM_LEDS];

void setup() {

 Serial.begin(9600); // for diagnostics

 pinMode(NVG_PIN, INPUT_PULLUP);
 pinMode(EN_PIN, INPUT_PULLUP);
 
 myservo.attach(9);  // attaches the servo on pin 9 to the servo object
 LEDS.addLeds<WS2812,DATA_PIN,RGB>(leds,NUM_LEDS);
 LEDS.setBrightness(84);
 myservo.write(posStart); 

 OldMillis = millis();  // get start time for free-running test
}

void loop() {  // This has a free-running seconds counter for test purposes

for(SecondsDigit = 0;SecondsDigit <60; SecondsDigit++){

Serial.println(SecondsDigit);
 
  
   if(digitalRead(EN_PIN)==LOW){  // Check for servo enable
 ledServo();
}
   
   while(millis()-OldMillis <1000) {} // Wait untill it's time for the next second change

   OldMillis = OldMillis + 1000;  // Add 1000 mS to the old value to maintain the time count
                                  // Adding 1000 to the "current" millis value would cause drift
                                  // There's no millis counter roll-over protection in this test
}

}

void ledServo ()
{
 int servoPosition = posStart-((SecondsDigit-((SecondsDigit/5)*5))*secondAngle); //Calculate required servo position

  FastLED.clear();  // clear all pixel data to turn off the LEDs
 FastLED.show();    // Send the data to turn off the LEDs
 
 myservo.write(servoPosition);  // Move the ring to the new position

 delay(80);  // Wait for the servo to get there

if(digitalRead(NVG_PIN)==LOW){  // Decide if the LED should be white or green
 ledRingGreen();
}
else{ ledRingWhite();}

}

void ledRingWhite()
{
 int five = SecondsDigit / 5;  // Calculate which LED is required
 leds[five] = CRGB::White;     // Set that LED's colour to white
 FastLED.show();               // Send the data to turn on the LED
}

void ledRingGreen()
// This does the same as ledRingWhite, but for green
{
 int five = SecondsDigit / 5;
 leds[five] = CRGB::Red;  // For some reason "red" results in green colour - to be investigated
 FastLED.show();
}

The FastLED library is used for the Neopixels in this. Research indicates it's better than Adafruit's library, and I have used FastLED in Neopixel backlight tests with DCS-BIOS.

 

The test videos are using a Tower Pro SG51R micro servo. This is turning a balsa wood slot ring with an Adafruit 12-Neopixel ring screwed to it.

 

Neopixels are used to reduce the wiring that needs to move. All 12 LEDs are run from just 3 wires - two power + one data.

 

Next steps:

 

The design of the slot ring would need to be changed to accommodate the centre display, which will have to be a custom job. I don't think there's enough room for a commercial display.

A better servo might improve the effect. Faster movement means the LED off delay can be reduced.

Link to comment
Share on other sites

Ever thought of TFT?

I did.

TFT is an LCD technology.

 

I couldn't find one with 2"x 2" visible display that would fit in the clock's housing.

 

I suppose more out-of-the-box cheating could be done by using one display with windows for the whole panel.

The standby attitude indicator, UHF radio frequency repeater and angle of attack indicator are in that square cluster with the clock.

Link to comment
Share on other sites

I have a 3.5" TFT that was my original CDU screen, before I made the (mistaken, now I realise) jump to a 5" unit. I always wondered whether it could be used for the clock, but it's the standby attitude indicator that I always thought would be nice for that. As you say, the size is not quite right, but compared to my crappy printed version........

 

Like you I also wondered about getting another LCD monitor for that entire panel. Trouble is, it would be a major redesign of what I have, and goodness knows how many times I've gone back on a design and lost a lot of time doing so. Also, it would mean a sixth monitor and I'm not sure whether my rig PC would be able to handle it . It already has a 1070 GTX and GTX660 in it, and the noise of the fans when in game is pretty obtrusive already.

 

Anyway, enough dreaming, I have to finish what I've started already.

 

By the way, new record for slow delivery - ordered 20th January, arrived 29th May, but I suppose I should be glad it got here at all in the current situation

 

Cheers

 

Les

Link to comment
Share on other sites

Nice find.

The info says "Active Area: 53.38(Diameter)", which is big enough without being too big.

The problem I see is that I don't know anything about the MIPI interface, and there may be a 500 MOQ.

 

Very cool!

 

I have this screen in mind for the clock

https://www.alibaba.com/product-detail/2-1-inch-480-480-round_62303878009.html?spm=a2700.galleryofferlist.0.0.37e6b532hDiHu1

 

Theres a low res drawing in the description. It should fit without the touchscreen part

This looks similar to the second one Deadman posted, but includes the driver.

 

 

I've not ordered from there before. Shipping time would probably horrendous right now though.


Edited by No1sonuk
Link to comment
Share on other sites

It all depends on where he wants the screen to set built in to the clock bezel or to sit behind the clock and MIP( Main Instrument Panel) I could not find a data sheet on that screen a that unit may just fit in to the bezel but the face screw holes would be blocked by the screen.

https://www.shapeways.com/shops/a-10c-warthog-supplies

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.

Link to comment
Share on other sites

... but the face screw holes would be blocked by the screen.

Probably so, I was thinking the same. I faced the same problem with the larger square displays I found for 3.25" gauges. One can always cut the heads of the screws, glue them on and clamp the gauge from behind the panel.

Link to comment
Share on other sites

Probably so, I was thinking the same. I faced the same problem with the larger square displays I found for 3.25" gauges. One can always cut the heads of the screws, glue them on and clamp the gauge from behind the panel.

 

As Deadman says, the screw holes (and the control buttons) would be a problem with that screen.

 

If the 3.1" is the diagonal, that works out to just under 2.2" on each side.

Link to comment
Share on other sites

  • 1 year later...

WOW!
21 months!

Here's the latest.  I went with a round TFT.  This one is what I could get when I decided to revisit this project, so it's only 1.28".
That's too small, even for just the segment ring, but it's a start.
 

The ring segments are made of 2 filled triangles, with the coordinates calculated from the seconds angle on-the-fly.
The digit segments are rounded rectangles.
The "ETC" is a text string.
On a Nano, all this adds up to 56% of program storage space and 28% of dynamic memory for global variables.

It's free-running there, using a delay between ticks for testing.
Buttons and DCS-BIOS integration next.
I have an idea for a real time clock as well.  One that would switch over to DCS-BIOS when it receives data.

As for the size: I'm revisiting some of the earlier suggestions.

Link to comment
Share on other sites

Have a look at the older postings for a connected digital clock 

If you like, I also could share the adapted version for the round 1.28 display.

Regards, Vinc

 

 


Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

1 hour ago, Vinc_Vega said:

Have a look at the older postings for a connected digital clock 

If you like, I also could share the adapted version for the round 1.28 display.

Regards, Vinc

Thanks.
I wrote the code so it can easily be adapted for DCS-BIOS integration - I just haven't gotten around to it yet.

One option I'm also considering is a larger, non-square TFT that will fit in the case.
Either landscape with switches for the buttons, or portrait with a touch screen for the buttons.
OR, as I'm not planning on building a full size cockpit, I might just leave it small. 😀

Link to comment
Share on other sites

  • Recently Browsing   0 members

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