Jump to content

Recommended Posts

Posted

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...



John Wall

 

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

  • 4 weeks later...
Posted

Wiring for OSRAM displays on CMSP is done

IMG_1136_zpsodvg9z21.jpg

 

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

IMG_1137_zpsx5o3a1si.jpg

 

I'm also designing conversion of real 2 inch tubes for engine instruments.

IMG_1139_zps08cwvq2g.jpg

gauge%20kit_zpskbyjbuno.png

Screenshot_4_zpsxvkbhqce.png

IMG_1141_zpsb1aoglri.jpg

 

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.

 

Screenshot_3_zpsn91ukm5f.png

Screenshot_2_zpsqrhbo8rb.png

 

The machines should be here by the weekend so I'd like to get some test parts designed

Posted

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.

Posted

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

 

Posted

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

 

IMG_1145_zps5x6pgply.jpg

IMG_1143_zpsi3hoqqbq.jpg

IMG_1144_zpsy6g6j43k.jpg

 

Still need to balance the brightness and wire up the pot to control it.

  • Like 1
Posted

That looks sooooo nice Calum. Well done.:thumbup:

Regards

John W

aka WarHog.

 

My Cockpit Build Pictures...



John Wall

 

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

Posted

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?

Posted

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

  • 2 weeks later...
Posted

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

 

IMG_1176_zpsqsnrzogg.jpg

Posted

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...



John Wall

 

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

  • 1 month later...
Posted

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)

 

IMG_1455_zpswgd9b9fo.jpg

 

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.

Posted

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...



John Wall

 

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

  • Recently Browsing   0 members

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