Jump to content

Middlefart’s A-10 build


Middlefart

Recommended Posts

Ok, I will get one and try it, I will need another anyway for the fuel quantity indication so it won't be wasted

 

Cheers

 

Les

 

Well, got the new OLED display, and the sketch works perfectly straight out of the box. Clearly the one I had needs a completely different set of sketches.

 

Thanks again fro providing this, I now have a very cool looking altimeter reading!

Cheers

 

Les

Link to comment
Share on other sites

Just a quick question - if I want to remove the two last zeros, what bit of the code addresses them? I may have painted myself into a corner with the positioning of the stepper motor, so may have to move the OLD display to the left a bit

 

Cheers

 

Les

Link to comment
Share on other sites

Middlefart’s A-10 build

 

At the top, change “24, 5” to “24, 3”, right after ”OLED_RESET),”

I think that’s all you need to do.

24 is the size and 5 is the number of digits.

I’m not 100% sure that it will work, there might be some other changes that’s needs to be done.

 

#ifdef ALTIMETER

disp oled = {Adafruit_SSD1306(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET), 24, 5, {{0,0},{0,0},{0,0},{0,0},{0,0}}};

#else

disp oled = {Adafruit_SSD1306(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET), 16, 4, {{0,0},{0,0},{0,0},{0,0},{0,0}}};

#endif


Edited by Middlefart
Link to comment
Share on other sites

Perfect, that did it! To explain, the stepper motor spindle passes through the last zero on my gauge face, with the last two zeros laser engraved on the front. I thought initially that I could just

hide some of the OLED behind the gauge face, but I miscalculated. Knocking off the two zeros lets me position the OLED correctly.

 

I'm super impressed with Middlefart's code, it looks fantastic and adds that extra bit to the whole thing.

 

Thanks a million to everyone on this

 

Cheers

 

Les

Link to comment
Share on other sites

All the 40w lasers on Ebay or AliExpress are more or less the same.

There are basically two versions of them.

An analog one where you regulate the current with a potentiometer like this one:

https://www.ebay.com/itm/40W-USB-DIY-Laser-Engraver-Cutter-Engraving-Cutting-Machine-Laser-Printer-CO2/233296256862?hash=item36518a5f5e:g:reUAAOSwPdNdOZ4H

 

and an "upgraded" digital one where you regulate the current with buttons.

Don't bother with this one. I thought it would be better, but in reality it is worse.

I converted mine back to analog and it is much better.

This site explains it https://lasergods.com/k40-control-panels-analog-vs-digital/

 

What you want to make sure is that the Controller board is compatible with K40 Whisperer https://www.scorchworks.com/K40whisperer/k40whisperer.html.

Most 40w lasers are but make sure that it is. The manufacturer is LIHUIYU for theese boards, ask the seller if the one you are looking at has a board from them.

 

The included software is crap. Don't use it. Use K40 Whisperer instead. This is free and uses Inkscape (also free) to cut.

You create the sketches in Inkscape and then open the file in K40 whisperer to cut it. Really easy.

 

The upgrades that you must do:

Better exhaust. The included one sucks (in a bad way, not the way we want it to :))

Add air assist. This blows air at the cutting point making sure that the fumes are blown away and doesn't clog up the lens.

 

I've also added a flow sensor so that the laser cannot light up if the water isn't flowing. https://k40laser.se/k40-parts/k40-spare-upgrade-parts/cooling/water-flow-sensor/

and some laser pointers so that i know exactly where its going to cut. https://k40laser.se/k40-parts/k40-spare-upgrade-parts/electronics/red-dot-laser/

 

I've also replaced the original bed to get a bigger cutting surface.

 

These sites has some good tips.

https://lasergods.com/beginners-guide-to-the-k40-laser-engraver/

https://k40laser.se/faq-how-to/

 

I can take some photos and make a video about my laser if you want me to.

 

Can you do links to everything that you have done to the laser including the laser. Ie a step by step tutorial on how you got to were you are now so someone can duplicate it. No need for the stuff that doesn’t work just needs kit of items to build an indentical laser so I can produce the panels like you.

BlackeyCole 20years usaf

XP-11. Dcs 2.5OB

Acer predator laptop/ i7 7720, 2.4ghz, 32 gb ddr4 ram, 500gb ssd,1tb hdd,nvidia 1080 8gb vram

 

 

New FlightSim Blog at https://blackeysblog.wordpress.com. Go visit it and leave me feedback and or comments so I can make it better. A new post every Friday.

Link to comment
Share on other sites

You don’t need to modify the laser to make good panels. None of my mods changes how the laser or travel work.

I suggest that you start with a standard K40 and add the mods that you need.

 

Just make sure to buy a K40 with the analog controller and not the upgraded “digital” crappy one and also make sure that it is compatible with K40 Whisperer

Link to comment
Share on other sites

  • 2 months later...

Hey.

While trying to help lesthegrngo with his glitchy altimeter displays, I came across your code in post #58

https://forums.eagle.ru/showpost.php?p=4194969&postcount=58

 

While it mostly works well, I noticed the altimeter 10000ft digit only displays the \\\ for 0 and 1.

The service ceiling quoted in Chuck's guide for the A-10 is 45000 feet.

I managed to get one up to 20000ft, and while the onscreen numbers went to 20000, the OLED displayed a blank character and 0000.

 

I've modified your code like this.

Remove this:

 void onAlt10000FtChange(unsigned int newValue)
 {
   if (newValue == 6553)
   {
     oled.digits[0].digit = 1;
     oled.digits[0].y = 0;
   }
   else if (newValue == 0)
   {
     oled.digits[0].digit = -1;
     oled.digits[0].y = 0;
   }
   else
   {
     oled.digits[0].digit = -1;
     oled.digits[0].y = map(newValue, 0, 6553, 0, YPos());
   }
 }

And replace it with this:

  void onAlt10000FtChange(unsigned int newValue)  // Modified to allow more numbers than \\\ and 1
 {
    if (newValue == 0)
   {
     oled.digits[0].digit = -1;
     oled.digits[0].y = 0;
   }
   else
   {
   unsigned int mappedValue = newValue / 6553;
   unsigned int y = map(newValue, mappedValue * 6553, mappedValue * 6553 + 6553, 0, YPos());
 
   oled.digits[0].digit = mappedValue;
   oled.digits[0].y = y;
   }
 }

This now works like the on-screen gauge.

 

I've not solved the glitching yet, but I found this on the way.

 

BTW, it seems the A-10 DOES NOT like flying that high. ;)

Link to comment
Share on other sites

I am aware of the problem and corrected it last weekend but forgot to post it here :-)

 

My new version of the code looks like this:

 

void onAlt10000FtChange(unsigned int newValue)
 {
   unsigned int mappedValue = newValue / 6553;
   unsigned int y = map(newValue, mappedValue * 6553, mappedValue * 6553 + 6553, 0, YPos());

   if (mappedValue == 0)
   {
     mappedValue = -1;
   }
   oled.digits[0].digit = mappedValue;
   oled.digits[0].y = y;
 }

Link to comment
Share on other sites

Thanks Middlefart

 

Both No1SonUK and I are trying to resolve the funny glitching that happens with OLEDs using sketches that we and yourself have devised. We have to ask, do you notice it, and if you do, do you have any explanation or even better, fix, for it?

 

We've been wracking our brains for a cure for our OLED's sketches, but so far are not making any significant progress - as you can see from the four page thread on it.

 

If you are able to help, in any way, we would be grateful for your input!

 

Cheers

 

Les

Link to comment
Share on other sites

  • 1 month later...
Thanks!

Here are some more pictures.

The motor is driven by a AX1201728SG driver chip which can run 4 steppers.

It only uses 2 GPIO pins per motor and has microstepping with 12 steps per degree.

I use the SwitecX12 library and rewrote the code for dcs bios to work with this library instead of accelstepper which seems to be what everyone else use.

The reason i went this way is because I already had the chip

 

https://guy.carpenter.id.au/gaugette/2017/04/29/switecx25-quad-driver-tests/

 

Currently its all connected to a Mega but that will be changed to a Nano later on.

The photos of the back was taken before i added the back lighting diodes.

The grey-purple-black-white wire goes from the driver chip to the motor and the yellow-brown-red is a reset pin and the two pins to run the motor.

 

 

Middlefart, do you have the sketch you used with the AX1201728SG driver chip? I am trying to get one of these to work, and using the info on Guy Carpenter's site hasn't got me any further, I seem unable to get the chip to function with the X27-168 stepper. I would like to see if it makes any difference to the quality of movement of the gauges

 

Cheers

 

Les

Link to comment
Share on other sites

  • Recently Browsing   0 members

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