Jump to content

Modular A-10C gauge controller for DCS Bios


lesthegrngo

Recommended Posts

I'm making these Modular interconnecting RS485 based connection gauge controllers to work with DCS Bios. Each module has a Nano board, an EasyDriver board, a RX487 chip on an adaptor board, and each plugs directly into each other, with barebones PCB's taking the place of wires.

 

The idea is that they plug together, meaning no interconnect wires.

 

I have some pirahna type LED's on some at the moment to test, but I am feeding them from 12V with a 220K Ohm resistor, but I suspect that will change - the resistors get awfully hot. The ultimate intention is that each module sits directly behind the stepper motor, and by using a front panel with the correct spacing, they simply plug in the back and they then interconnect, with the only wires needed are the 12v supply and ground, plus the wiring to Arduino Mega. As the LED's are on the rear PCB, there is no need for a separate set of wiring, although I may end up pulling the voltage down to 3.3V and supplying them on a separate bus - I think each Nano or Easydriver can supply enough power for four LED's

 

Any thoughts or suggestions gratefully received, especially regarding the LED's

 

Cheers

 

Les


Edited by lesthegrngo
Link to comment
Share on other sites

What are the specs for the LED's? Without knowing your LED specs I'd risk saying the resistor is too small.

 

You need to look at the LED spec to determine the forward voltage and current. The total supply voltage minus the LED forward voltage is the voltage drop that need to be over the resistor and the specified LED current.

 

https://www.kitronik.co.uk/blog/led-resistor-value-calculator/

 

I used tried with a standard green 5mm and the resistor should be almost 500Ohm. If your resistor is too small you end up damaging the LED in the long run.

 

Cheers

Hans

Link to comment
Share on other sites

Thanks Hans. I am going to drop the voltage down to 3.3V on a separate bus, it just needs a small isolator cut and the connection holes are already in the boards so isn't a big job. Just a couple of extra supply wires, but they should link too to simplify.

 

More of a worry is that I am not sure that using the same power supply for the Nano VIN as for the stepper motor is good - I've asked that in a separate post (the generic DCS BIOS thread), as a couple of stepper boards went dead after about an hour of testing

 

Cheers

 

Les

Link to comment
Share on other sites

Fair point, will do

Here is the question re the power supply and schematic for the RS485 network

 

Gents, I am pretty sure I have made some errors in my wiring, probably as a result of misinterpreting the diagrams with regards to setting up gauges with stepper motors.

 

While I can make individual stepper motors work running off USB connected Nanos, when i come to set up for the RS485 setup, I am burning out EasyDriver boards. Essentially, as the MAX487 chip needs to be connected to the Nano, and the Nano is not connected via USB, I see the 12V supply (that I am using for the EasyDriver) is used to power the VIN input for the Nano as well. I am also using a common ground for the VIN. The stepper is then connected using the GND on the other side of the Nano, then pins 11 and 10 for Step and DIR respectively.

 

I am wondering whether the 12v supply to the Nano is the cause of the EasyDrivers burning out?

 

If someone has a complete schematic for the Mega, Nanos, Max487 chips, EasyDrivers and steppers I can look at I would be grateful

 

Cheers

Les


Edited by lesthegrngo
Link to comment
Share on other sites

Ok, so here are the schematics I was working on.

 

First up is the wired up testing, USB powered Nano, with the 12v supply to the motor not being connected to the Nano and no common ground bus (filename non RS485 schematic USB). This worked fine, seemed reliable.

 

Second up is the 1st step to the modular construction, with no MAX487 chips connected. It is hard wired using PCB's (filename non RS485 schematic 12V power USB) where the nano is connected to the PC via USB, but the nano is also receiving 12V DC from the motor power supply on a common bus, a shared ground between the VIN to the Nano and the Easydriver, but a separate hardwired link between the STP / DIR / GND pins between the Nano and stepper. This is the configuration at the moment, and I have burned out three EasyDrivers. Also, with the remaining two that do work, I find after half an hour or so, the gauges gradually lose movement until such point that they eventually stop. If I depower everything, and restart, they will come back but they will eventually stop responding again. Note that I am using boards without LEDs for troubleshooting, and when I return to using them they will be on a separate circuit.

 

The 12v supply is an old Dell laptop power pack rated at 3.3 amp, 40W

 

The last schematic (filename RS485 schematic) is what I believe that the eventual configuration should be, using the MAX487 chips and the Mega as the controller. The TR / TX connection pins to the Mega are ones I would like to solidly lock down as well.

 

Of course, I am not even going to try this last one until I can find out why the EasyDriver boards are burning out

 

Hope someone can help with this, I am getting close to throwing in the towel as while the EasyDrivers and Nanos are cheap, they take weeks to get here and I can't just think of them as consumables!

 

 

Cheers

 

Les

non RS485 schematic USB.pdf

non RS485 schematic 12V power USB.pdf

RS485 schematic.pdf


Edited by lesthegrngo
Link to comment
Share on other sites

Have you tried to run the stepper setup ‘non RS485 schematic 12V power USB’ outside your modular gauge controller? I mean on a breakboard setup or similar?

 

I just ran same setup for 40 minutes and no issues so far. The EasyDriver chip was warm but not smoking hot. I ran at minimum current settings and it was enough to drive my Nema11 stepper.

 

Cheers

Hans

DSC_3890.thumb.JPG.6ec29eaca33e45c2a34d93748b7aa91c.JPG

Link to comment
Share on other sites

Thanks Hans, I will give it a go. Reading between the lines, you are saying that there is nothing wrong with the schematic, so at least I have got that right.

 

I am wondering whether I have just got a crappy quality set of boards, they were purchased together.

 

Cheers

 

Les

Link to comment
Share on other sites

Managed to put a new board together this evening.

 

What you see is two setups using Arduino Nano and EasyStepper. The one on the right is getting values from DCS via DCS-BIOS over USB.

 

The one on the right is communicating with DCS via DCS-BIOS over RS-485. As far as I can see your schematics correspond with the way I set up system.

 

 

Test was only about 12minutes.

 

Cheers

Hans

Link to comment
Share on other sites

Thanks for testing that Hans, glad to see I got that bit right. I have some more easydriver boards on the way, I will do the breadboard test as you suggested to see.

 

In the meantime I have checked and rechecked my PCB's and I cannot find anything at all wrong with the circuitry or the physical condition of the boards themselves, no short circuits, crossed connections, nothing. I'm wondering if there were intermittent connections in the connectors, but as they were static that seems unlikely.

 

While I was playing around with all that, the back light LED and resistor solution hit me on the head. I tried it and I can't see why I didn't think of it before. I simply connected the four LED's in series, as they are rated for around 3V once connected over the 12V they all run at the correct brightness with no need for any resistors.

 

A final note, once I get bits of this working properly I will post the schematics used, pictures and specifications of the parts and also the sketch used with it so that anyone who wants can copy

 

Cheers for all the assistance

 

Les

Link to comment
Share on other sites

I am still waiting for the replacement set of easydriver boards, so on Monday I thought I had nothing to lose by re-testing the modules with the two boards I have left. They previously seemed to stop working after a while, but I triple checked the PCB's I made, and reassembled everything carefully to make sure there were no polarity issues.

 

This time they seemed to work consistently over the course of a couple of hours. I was testing LCD 1602A modules and knocking up different sketches for the various panels and testing them, so I was pausing the game frequently, having to stop and restart the communication widow, trying in different flight phases. It all worked consistently, so I can only conclude I messed something up the last time.

 

I read on the EasyDriver page that disconnecting the stepper while the power was connected was bad for the board; I know I didn't do that , but wonder if there were slack connections that were momentarily disturbed. Whatever, three of the five boards died, so when I get the replacements I will be making sure that I make solid contacts for the stepper wiring.

 

Lastly, I am still waiting for my Mega to arrive (three weeks and waiting, everything takes an age to get delivered to here!) so hopefully soon I can try the RS485 solution

 

Cheers and many thanks again for the help

 

Les

Link to comment
Share on other sites

Well, the mega arrived, and rather than improving things, I seem to have taken a massive step backwards.

 

I put together a test for the RS485 using the LCD and the CSMC sketch that was working well, and dovetailed in the RS485 sections of the sketches. I soldered a couple of MAX487 chips on to break out boards and wired everything up. I uploaded the master sketch to the mega, and connected that to the USB port, then ported the 5V supply and GND to the Nano, with a breakout for the LCD module. It worked first time, and I was encouraged enough to see if I could make one of the gauges work.

 

That's where the story essentially ends. I couldn't get the gauge working alongside the CSMC, and in fact the CSMC stopped working too. I removed the gauge hardware, and the CSMC still failed to function. I stripped out the MAX487 hardware and went back to the original USB connected nano running the CSMC and got that working again.

 

I then got another two MAX487 chips and reconnected the first RS485 setup that worked. Nope, nothing.

 

the problem is compounded by the fact that nothing is repeatable. The nano(s) seems to behave differently every time. Sometimes the TX light would flicker on the nano (I believe it should on the Mega, but believe that the RX light should flicker on the Nano not the TX?).

 

Other times there would be no lights other than the red 'on' light. Then on another, the RX light comes on hard, no flickering. On another, if you touch the nano board the RX light comes on, but if you let go, it goes off again. Yet another does the same but only when you touch the D2 pin! I forgot to mention that this happens with different nano boards too - I tried four different ones in case

 

After that, I redo the CSMC on USB with the Nano just to make sure I have the wiring correct and haven't disturbed the LCD wiring.... and now the CMC on the LCD using the nano doesn't work any more. Putting the same wiring on the same pins of an UNO board, and it works again.

 

I connected up the Uno board with the Max487 chips, and the CSMC RS485 sketch . Nothing, the Mega TX light is flickering but the Uno board just sits there, nothing flashing

 

*sigh*

 

So essentially I have no repeatability, so it means I can't troubleshoot anything. I literally have no idea what is working properly and what is not. I know that you guys can't help me with that, so all I can ask is to review the RS485 sketch to verify that is OK

 

 

Here is the sketch that I used for the Nano

 

 

/*

The following #define tells DCS-BIOS that this is a RS-485 slave device.

It also sets the address of this slave device. The slave address should be

between 1 and 126 and must be unique among all devices on the same bus.

*/

#define DCSBIOS_RS485_SLAVE 100

 

/*

The Arduino pin that is connected to the

/RE and DE pins on the RS-485 transceiver.

*/

#define TXENABLE_PIN 2

 

#include <LiquidCrystal.h>

#include "DcsBios.h"

#include "Wire.h"

 

const int rs = 12, en = 10, d4 = 6, d5 = 5, d6 = 4, d7 = 3;

LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

 

void onCmscTxtJmrChange(char* newValue) {

lcd.setCursor(0, 0);

lcd.print(newValue);

}

DcsBios::StringBuffer<8> cmscTxtJmrBuffer(0x1096, onCmscTxtJmrChange);

 

void onCmscTxtChaffFlareChange(char* newValue) {

lcd.setCursor(8, 0);

lcd.print(newValue);

}

DcsBios::StringBuffer<8> cmscTxtChaffFlareBuffer(0x108e, onCmscTxtChaffFlareChange);

 

void onCmscTxtMwsChange(char* newValue) {

lcd.setCursor(0, 1);

lcd.print(newValue);

}

DcsBios::StringBuffer<8> cmscTxtMwsBuffer(0x12b0, onCmscTxtMwsChange);

 

void setup() {

lcd.begin(16, 2);

lcd.clear();

DcsBios::setup();

 

}

 

void loop() {

DcsBios::loop();

}

 

 

Beyond that, if you can review the pictures of the MAX487 chips and verify that they are the correct type and that I have the orientation right - the little circle on the chip goes towards the arrow on the PCB. By the way, I did check for shorts on the board, there is no solder overflow and all the contacts are isolated properly, plus I checked continuity between the chip pins and the PCB pins

 

I'm very frustrated and disheartened. It seems that you guys have no issues putting all the electronics together, but despite trying to make good proper cables with proper connections on 0.1" headers, using PCB's to cut down on loose wiring and double checking connections etc, I'm going backwards rather than forwards.

 

One thing I am good at and am able to progress with is the panel hardware, so in the event I do get this all resolved at least I have somewhere to put it all. I just need to understand why I am getting all this screwed up so badly.

 

Cheers

 

 

****EDIT***

 

Forgot to mention, using 12v to power the Mega and the Nano's caused the Mega to get very hot. I asked the question on the Arduino forum, and they advised that the 12V should only be used for powering particular devices, like the stepper motor drivers, and that a 5v supply from a phone charger should be used to supply the 5v pins of the mega, nanos and for anything else that needs 5v.

 

That's what I using for the above

20190615_135504.thumb.jpg.066a924db49156b7082a5d5976b5628c.jpg

20190615_135547.thumb.jpg.7de1b73c1993ae2508b788baa02d0e6c.jpg

RS485 schematic.pdf


Edited by lesthegrngo
Link to comment
Share on other sites

Hi Les, it might be worth using MAX487 chips that can be mounted into an 8 Pin IC socket which sits on your PCB. Soldering the MAX487 chip directly could damage it. Also if the chip becomes damaged in some other way you can easily replace them.

 

Sent from my SM-G955F using Tapatalk

Link to comment
Share on other sites

Hi Les, I'd order new parts but keep playing with the ones you've got whilst you're waiting, to learn as much as possible. When I did my network I also tried to break parts of it to understand it more fully. I'd stick with the MAX487 chip rather than the other ones you mentioned.

 

Sent from my SM-G955F using Tapatalk


Edited by CraigS
Link to comment
Share on other sites

I have the above mentioned 485 modules. They do the Job they are for. I recommend to use them until your Network ist good and than try yuor owen PCBs.

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Craig, Vinc, thanks for the replies

 

They are cheap so I might get a couple of them for test purposes, I also still have 40 of the Max487 chip from the original lot left so they can be test pieces. For me, I keep coming back to hardware issues; the wiring schematic is really quite simple. While I accept it is not impossible to get it wrong, for the limited testing I have been doing, it really is not that many connections to make so it's not like a plate of spaghetti.

 

I found a couple of threads where there were some instances of bad MAX487 chips (Hansolo and WarHog) so maybe those are my issues? Could that explain the weird behaviour?

 

Whatever, this has been painful, I have literally wasted three days to get back to where I was a week ago

 

My wife is of the opinion that I'm certifiable, she sees me surrounded by bits and pieces, wires and always muttering to myself...... maybe she has a point?

 

Cheers

 

Les


Edited by lesthegrngo
Link to comment
Share on other sites

I feel your pain

 

Hi Lesthegrngo,

 

I have had very similar problems. I have rewired, resoldered and rebuilt several versions of my network, following Hansolo's and CraigS' schematics. Swapped out Max487 chips, burned out one Nano, and still I get nothing. If I revert to a non-slave sketch in serial, it all works....

 

An exercise in frustration and futility, but I am determined to get it working. I will order more Max487s

 

 

Mole

Craig, Vinc, thanks for the replies

 

They are cheap so I might get a couple of them for test purposes, I also still have 40 of the Max487 chip from the original lot left so they can be test pieces. For me, I keep coming back to hardware issues; the wiring schematic is really quite simple. While I accept it is not impossible to get it wrong, for the limited testing I have been doing, it really is not that many connections to make so it's not like a plate of spaghetti.

 

I found a couple of threads where there were some instances of bad MAX487 chips (Hansolo and WarHog) so maybe those are my issues? Could that explain the weird behaviour?

 

Whatever, this has been painful, I have literally wasted three days to get back to where I was a week ago

 

My wife is of the opinion that I'm certifiable, she sees me surrounded by bits and pieces, wires and always muttering to myself...... maybe she has a point?

 

Cheers

 

Les

SCAN Intel Core i9 10850K "Comet Lake", 32GB DDR4, 10GB NVIDIA RTX 3080, HP Reverb G2

Custom Mi-24 pit with magnetic braked cyclic and collective. See it here: Molevitch Mi-24 Pit.

 

[sIGPIC][/sIGPIC] www.blacksharkden.com

bsd sig 2021.jpg

Link to comment
Share on other sites

I built my RS485 network for the EMI panel and it seems to drive gauges without issue. I've also tested it with indicator lights, toggles and push buttons and they work fine also. However, I encountered problems with 7 Segment displays on a master / slave setup and haven't tried oleds with it yet. The 7 Segment displays would output the data needed but keep having little glitches.

Over time I plan to look more closely at this and hopefully overcome, however, currently from a time perspective I plan to use the RS485 network for all the gauges (steppers and servos), and also the TISL and circuit breaker panels. However everything else through dcs bios would be on a standard setup straight to Arduino Megas.

I'd be interested to know if anyone else has had challenges with 7 Segment displays on a master / slave setup? Or do all components work for you? And if so, do you have a different approach to the wiring

 

Sent from my SM-G955F using Tapatalk

Link to comment
Share on other sites

I soldered up some new MAX487 chips, I used my finger to hold them down while soldering so that I could feel if they got hot, which they didn't. I checked continuity and for shorts. I rechecked the wiring, making sure the cables were colour coded, and twisting the A and B , RX and TX wires as pairs. I used 0.1" headers to make sure the cables were aligned with the right pins on each part of the setup. I used the USB serial sketch with the Uno, and the 1602A module, made sure that was working OK

 

This is the USB sketch that works fine

 

#include <LiquidCrystal.h>

 

 

 

#define DCSBIOS_IRQ_SERIAL

 

#include "DcsBios.h"

#include "Wire.h"

 

const int rs = 12, en = 10, d4 = 6, d5 = 5, d6 = 4, d7 = 3;

LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

 

void onCmscTxtJmrChange(char* newValue) {

lcd.setCursor(0, 0);

lcd.print(newValue);

}

DcsBios::StringBuffer<8> cmscTxtJmrBuffer(0x1096, onCmscTxtJmrChange);

 

void onCmscTxtChaffFlareChange(char* newValue) {

lcd.setCursor(8, 0);

lcd.print(newValue);

}

DcsBios::StringBuffer<8> cmscTxtChaffFlareBuffer(0x108e, onCmscTxtChaffFlareChange);

 

void onCmscTxtMwsChange(char* newValue) {

lcd.setCursor(0, 1);

lcd.print(newValue);

}

DcsBios::StringBuffer<8> cmscTxtMwsBuffer(0x12b0, onCmscTxtMwsChange);

 

void setup() {

lcd.begin(16, 2);

lcd.clear();

DcsBios::setup();

 

}

 

void loop() {

DcsBios::loop();

}

 

 

 

I then added the RS485 wiring (RX, TX and D2 pinouts), got a 5V supply to the Mega, Uno and 1602A boards. I loaded this slave sketch

 

 

 

/*

The following #define tells DCS-BIOS that this is a RS-485 slave device.

It also sets the address of this slave device. The slave address should be

between 1 and 126 and must be unique among all devices on the same bus.

*/

#define DCSBIOS_RS485_SLAVE 1

 

/*

The Arduino pin that is connected to the

/RE and DE pins on the RS-485 transceiver.

*/

#define TXENABLE_PIN 2

 

#include "DcsBios.h"

#include "Wire.h"

 

#include <LiquidCrystal.h>

 

const int rs = 12, en = 10, d4 = 6, d5 = 5, d6 = 4, d7 = 3;

LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

 

void onCmscTxtJmrChange(char* newValue) {

lcd.setCursor(0, 0);

lcd.print(newValue);

}

DcsBios::StringBuffer<8> cmscTxtJmrBuffer(0x1096, onCmscTxtJmrChange);

 

void onCmscTxtChaffFlareChange(char* newValue) {

lcd.setCursor(8, 0);

lcd.print(newValue);

}

DcsBios::StringBuffer<8> cmscTxtChaffFlareBuffer(0x108e, onCmscTxtChaffFlareChange);

 

void onCmscTxtMwsChange(char* newValue) {

lcd.setCursor(0, 1);

lcd.print(newValue);

}

DcsBios::StringBuffer<8> cmscTxtMwsBuffer(0x12b0, onCmscTxtMwsChange);

 

void setup() {

lcd.begin(16, 2);

lcd.clear();

DcsBios::setup();

 

 

 

I also double checked the master sketch, this is what I loaded up to the Mega

 

/*

Tell DCS-BIOS this is a RS-485 Master.

You will need to flash this to a Mega 2560.

*/

#define DCSBIOS_RS485_MASTER

 

/*

Define where the TX_ENABLE signals are connected.

You can connect up to three half-duplex RS-485 transceivers.

 

Arduino Pin RS-485 Transceiver Pin

TXn ------------------- DI (driver input)

RXn ------------------- RO (Receiver Output)

UARTn_TXENABLE_PIN ---- /RE, DE (active low receiver enable, driver enable)

 

If you have less than three transceivers connected, comment out the corresponding

#define UARTn_TEXENABLE_PIN lines for receivers that are not present.

*/

#define UART1_TXENABLE_PIN 2

/*#define UART2_TXENABLE_PIN 3

#define UART3_TXENABLE_PIN 4

*/

#include "DcsBios.h"

 

void setup() {

DcsBios::setup();

}

 

void loop() {

DcsBios::loop();

}

 

 

So I ran this, and again, it didn't work. On the LCD screen the top left hand character set showed a flashing cursor, but beyond that nothing happens. The Mega TX light flashes, I can see the data stream on the MS Dos window, but the Uno RX and TX lights are off. I depowered, unplugged, and tried another MAX487 chip, and this time, I didn't even get the blinking cursor on the LCD screen. I went back to the original MAX487 chip and now the blinking cursor had disappeared there too. Yet another inconsistent result.

 

I am absolutely certain my wiring is good, at least in line with the schematic attached on the previous post . I have nothing left to try beyond getting a different set of MAX487 chips, a new mega and new Nano. If anyone can point me to a source of chips that they know worked, I'd be grateful. I have some more Nano's on the way, so I know they will be new and from a different source. I don't know how to test the Mega to check that is OK, but I'm at the point where I have no faith in it.

 

Cheers

 

Les


Edited by lesthegrngo
Link to comment
Share on other sites

Hi Guys,

 

Is there a specific max487 chip to order? There seem to be quite a few variations, eg CSA, CPA, EPA etc.

 

Last time I ordered, I got a CPA designation, which I think is what was recommended, but does it make any difference?

 

Mole

SCAN Intel Core i9 10850K "Comet Lake", 32GB DDR4, 10GB NVIDIA RTX 3080, HP Reverb G2

Custom Mi-24 pit with magnetic braked cyclic and collective. See it here: Molevitch Mi-24 Pit.

 

[sIGPIC][/sIGPIC] www.blacksharkden.com

bsd sig 2021.jpg

Link to comment
Share on other sites

  • Recently Browsing   0 members

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