Mike Powell Posted July 19, 2015 Posted July 19, 2015 Several years ago I built a synchro interface that took an RS485 serial control input and generated synchro stator signals as outputs. The goal of this project was to allow real aircraft, synchro-based instruments to be used in sims. You can read about the project toward the bottom of this page: http://mikesflightdeck.com/oldnews/oldnews_2006.html Over the past few years technology has changed and there seems to be an increased interest in synchro interfaces so I decided to take another look at my old project and perhaps update it. I saw that the price of a key component of my original design had ballooned. This seemed particularly important to me because there is never a need for just one synchro interface. If you're committed to using real A/C instruments, you'll have a lot of synchro inputs to drive, so low cost is worth pursuing. I also saw that Arduinos had become a common bit of interface glue in even modest simpits. Given their ubiquity, low cost, and capability, utilizing them seemed a no brainer. A key functionality of any synchro interface is the generation of a pair of AC voltages which can be set to various desired amplitudes. For A/C instruments these voltages are nominal 400Hz signals and they are both electrically in phase with the 400Hz power supplied to the synchro instrument. The more accurately the amplitude can be controlled, the smoother the motion of the instrument indicator. For something like a 2 inch engine gauge 7 or 8 bits of amplitude control gives good results. For something like a 5 inch ADI, you'd really prefer something north of 10 bits. A common approach to designing a synchro interface is to use a multiplying DAC, a digital potentiometer, or a voltage controlled amplifier to scale a sample of the 400Hz power. This produces the variable amplitude, and guarantees that the outputs are in phase with system power. Works quite well, but I was looking for a less expensive approach. I decided to generate a pair of amplitude controlled, non sine waves under control of a cheap micro controller, a PIC16F648A (~$2) using a dual voltage digital to analog converter (~$3). Synchros will operate from a wide range of nasty, noisy electrical signals, but I thought if it didn't cost too much I'd add a filter to suppress all but the 400Hz fundamental of the synchro signals the circuit generates. Two individual, four pole filters can be built with a single quad opamp (~$0.40) and a smattering of discrete components (~$0), so adding the filter seemed worth it. Depending on the instrument being driven, several watts of synchro signal might be required so a bit of power amplification is needed. A pair of LM1875 20/30 watt amps (~$3 each) handle that. The PIC micro controller receives its command across a serial com connection. This can be an RS485 physical link if long cables are used, or a TTL input if the commands come from an Arduino a few inches away. The PIC can synchronize with the 400Hz power, or it can send a 400Hz inverter drive signal to another amplifier board capable of generating power for the A/C instrument being interfaced. Here's a block diagram: You'll note that one of the synchro signals is grounded. This is almost guaranteed to generate some angst ridden comments, so here's the explanation: Synchro signals are defined as the difference between pairs of inputs. In an electrically noisy environment with long cable runs and poorly managed electrical grounds, keeping the synchro signals isolated from ground reduces the chances you'll introduce noise into your system. In a sim you're unlikely to face problems quite this bad. In fact, the most likely issue is the possibility that the instrument itself has an internal ground. In that case you'd need to assure the ground in the instrument was connected to the ground on the interface. And in the worst case, you could simply add a pair of isolation transformers to the outputs of the interface. The circuit board will look something like this: (Though not exactly...There's a mistake which I caught just before sending the files out.) Currently parts are dribbling in, and the prototype boards should arrive toward the end of the week. The next big task, aside from soldering a pile of SMD parts on the board, is dusting off some archaic PIC assembly code and adapting it to its new home. Mike Powell www.mikesflightdeck.com www.mikesflightdeckbooks.com
Deadman Posted July 19, 2015 Posted July 19, 2015 Mike that sounds great. this will solve the problem of driving quite a few things I have on the shelves thanks DM 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.
Hansolo Posted July 19, 2015 Posted July 19, 2015 Whoa that sound really interesting Mike :thumbup: I just happen to have a few of those 2" engine gauges laying in wait for something to drive them. Will follow this with great interest :smilewink: Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album
JCook Posted July 19, 2015 Posted July 19, 2015 Thanks Mike That will help a lot of the builders using real instruments.
FSFIan Posted July 19, 2015 Posted July 19, 2015 Great project, I will be following this. I had started to read up on synchro motors because WarHog plans to use a real ADI and HSI, but analog stuff still confuses me. Glad to see this handled by someone who knows what he is doing! The PIC micro controller receives its command across a serial com connection. This can be an RS485 physical link if long cables are used, or a TTL input if the commands come from an Arduino a few inches away. For the use case of driving it from an Arduino board, a version of the firmware with a SPI or I2C interface would come in handy so the Arduino can use its UART to talk to the PC. That would make integration into an existing RS-485 setup that uses Helios or DCS-BIOS easier. DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua
Mike Powell Posted July 19, 2015 Author Posted July 19, 2015 I envision the synchro interface card as a dumb peripherial for an Arduino. It might make sense to dedicate an Arduino to managing fairly large clusters of instruments depending upon just where you want to place the processing load of ancillary tasks. For example, the flight sim engine on the main PC may not be able to supply instrument updates fast enough to produce smooth movement of the instruments. (I know this has been a problem with a Falcon derivative.) Jerky motion of a ADI or HSI is seriously distracting. Arduino code may be able to resolve this. Mike Powell www.mikesflightdeck.com www.mikesflightdeckbooks.com
Warhog Posted July 19, 2015 Posted July 19, 2015 (edited) Mike, I was reading this on your web site and I was just about to ask you for some details. As Ian mentioned, he and I are looking at integrating a real A10 HSI into my cockpit. I also have an real ADI but due to some wiring issues it will need to be driven with stepper motors. I look forward to seeing this develop. :) And thank you for your initiative Mike. This will be a big help to many of us. Edited July 20, 2015 by Warhog Regards John W aka WarHog. My Cockpit Build Pictures... 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
bnepethomas Posted July 20, 2015 Posted July 20, 2015 Hi Mike I'm sure this is a dumb question, but I have to ask :), if you've got the arduino ticking away, whats the reason for keeping a PIC in the mix? Cheers Peter
Mike Powell Posted July 20, 2015 Author Posted July 20, 2015 Hi Mike I'm sure this is a dumb question, but I have to ask :), if you've got the arduino ticking away, whats the reason for keeping a PIC in the mix? Cheers Peter Hi Peter I use the PIC to tightly control the timing of the output waveform. The PIC will be busy in a loop loading data into the DACs at precise intervals to generate a 400Hz signal with suppressed lower order harmonics. I could probably get reasonable performance from an Arduino if only one or two of the DACs were used, but too many would result in waveform jitter that would eventually turn into random movements of the instrument indicator. If there were a lot of instruments this might mean using a lot of Arduinos which in turn means more USB connections to the PC. With the PIC handling the low level busy work servicing the DACs, a single Arduino can interface the bulk, if not all, of the instruments. Is this the best tradeoff? In truth, I don't know. There are too many variables for me to wrap my head around. (Might be a good experiment for someone.) It is certainly a conservative tradeoff, and at ~$2 not a terrible one if I got it wrong. NOT a dumb question. Thanks for your interest. Mike Powell www.mikesflightdeck.com www.mikesflightdeckbooks.com
Boltz Posted July 20, 2015 Posted July 20, 2015 Hi Mike Looks great. Can't wait to see a prototype A-10C Cockpit Build Thread My YouTube Channel
FSFIan Posted July 20, 2015 Posted July 20, 2015 With the PIC handling the low level busy work servicing the DACs, a single Arduino can interface the bulk, if not all, of the instruments. Is this the best tradeoff? In truth, I don't know. There are too many variables for me to wrap my head around. (Might be a good experiment for someone.) It is certainly a conservative tradeoff, and at ~$2 not a terrible one if I got it wrong. I agree that you want a dedicated microcontroller to handle the waveform generation. Any other significant time-sensitive processing you make that controller do (like, say, listening and responding to the RS-485 bus) will increase the worst-case interrupt latency for the waveform code, which reduces the signal quality you are able to guarantee. Did you choose the PIC for any specific hardware features or is that just the microcontroller architecture that you are most familiar with? If we can port the firmware to an ATMega328 later, it would make it possible for someone to replicate the project without having to build a PIC programmer. The Arduino IDE comes with an ArduinoISP sketch that can turn any Arduino board into an in-circuit programmer for ATMega chips. DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua
Mike Powell Posted July 20, 2015 Author Posted July 20, 2015 The choice of the PIC was largely driven by familiarity and the fact that I have a number of them on hand. I've been using them for 12 years or so, but there is certainly no reason for someone not to use another type. The availability of a zero (?) cost programmer for ATMega certainly is attractive. A PIC programmer can be had for about US$50 (the PICKit3), but free does have its appeal. (I've built several programmers, but the low cost PICKit with its support for new devices as they were released won me over pretty quickly.) Mike Powell www.mikesflightdeck.com www.mikesflightdeckbooks.com
Mike Powell Posted July 24, 2015 Author Posted July 24, 2015 The prototype DTS2 circuit boards are here. Most of the parts are here as well. What I'm most interested in doing first is simply generating two, 400 Hz output to show that the key concept of this approach is viable. I'll initially leave the power amplifiers off the board so I can debug without fastening the board to a heat sink. It's been awhile since I developed PIC code, and of course the IDE has changed so an early step for me will be reading the Microchip MPLAB X IDE getting started guide. Mike Powell www.mikesflightdeck.com www.mikesflightdeckbooks.com
Dropship Pilot Posted July 25, 2015 Posted July 25, 2015 Hi Mike, your stuff looks great! I'm looking forward to see more of it. It's probably old news to you, but there's a synchro interface project on the viperpits forum as well: http://www.viperpits.org/smf/index.php/topic,9661.0.html Cheers, DSP
Mike Powell Posted July 26, 2015 Author Posted July 26, 2015 Hi Mike, your stuff looks great! I'm looking forward to see more of it. It's probably old news to you, but there's a synchro interface project on the viperpits forum as well: http://www.viperpits.org/smf/index.php/topic,9661.0.html Cheers, DSP Yes, I've seen it. We're taking different approaches. Mike Powell www.mikesflightdeck.com www.mikesflightdeckbooks.com
bnepethomas Posted July 27, 2015 Posted July 27, 2015 The choice of the PIC was largely driven by familiarity and the fact that I have a number of them on hand. I've been using them for 12 years or so, but there is certainly no reason for someone not to use another type. The availability of a zero (?) cost programmer for ATMega certainly is attractive. A PIC programmer can be had for about US$50 (the PICKit3), but free does have its appeal. (I've built several programmers, but the low cost PICKit with its support for new devices as they were released won me over pretty quickly.) Hi Mike Part of the reason for my ask about PIC is I haven't had the greatest run with PIC programmers. Perhaps I'm jinxed or holding my tongue the wrong way, after trying some cheap ones went for the PICKit3 and still managed to kazump myself. Hopefully the ATMegas are easier to work with. Really looking forward to seeing your project in action, I'm have some synchro instruments gathering dust :) cheers Peter
Mike Powell Posted July 27, 2015 Author Posted July 27, 2015 Hi Mike Part of the reason for my ask about PIC is I haven't had the greatest run with PIC programmers. Perhaps I'm jinxed or holding my tongue the wrong way, after trying some cheap ones went for the PICKit3 and still managed to kazump myself. Hopefully the ATMegas are easier to work with. Really looking forward to seeing your project in action, I'm have some synchro instruments gathering dust :) cheers Peter My early results with self built and cheap programmers were definitely mixed, but the PICkit2 always worked. I've recently bought a PICkit3, though I haven't used it yet. I should have some experience with it in the next few days. Mike Powell www.mikesflightdeck.com www.mikesflightdeckbooks.com
Mike Powell Posted July 30, 2015 Author Posted July 30, 2015 The test board is now assembled far enough for debugging. I left the power amplifiers off so a heat sink is not needed. I also left the RS-485 receiver off as I'll simply be stuffing a TTL level signal directly into the micro controller. While this is largely an SMD project, I have used a few through hole components. In some cases I had a surplus of through hole versions on hand. A few other components were only available in through hole packages. And in one case, even though I have the SMD version on hand AND the board is designed for the SMD part, I used a though hole part because when I started assembling the board I remembered what a pain in the butt soldering that particular SMD package was last time I used one. Next step is completing the firmware. Mike Powell www.mikesflightdeck.com www.mikesflightdeckbooks.com
Duckling Posted July 30, 2015 Posted July 30, 2015 Looks very impressive Mike. Follows it with great interest and sure result will be great. Got a load of syncros standing by ;-) Best /gus - - - -
Mike Powell Posted August 10, 2015 Author Posted August 10, 2015 Project update The test board is together, and so far not smoking. I've got a chunk of software running on the PIC and have successfully exercised the core functionality of the board: producing 400 Hz sine waves with varying amplitudes. The DACs are actually producing a "modified sine wave" which is marketing double speak for power inverters that produce really crappy waveforms. The reason for making modified sine waves is that it's far easier than making pure sine waves. Turns out that filtering can make a very nice sine wave from it. The top trace is the modified sine wave. The bottom trace is the cleaned up waveform that will make its way to the synchro. I have a few more functions to add to the software then I'll solder the power amplifiers to the board and see what a synchro thinks of the board. Mike Powell www.mikesflightdeck.com www.mikesflightdeckbooks.com
FSFIan Posted August 10, 2015 Posted August 10, 2015 Wow, it's impressive what a little analog circuitry can do! How many stages does your filter have? Also, I think I need to get an analog scope (even though I just bought a Rigol DS1054Z). That screen looks beautiful! DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua
agrasyuk Posted August 10, 2015 Posted August 10, 2015 That is indeed some cool electronic wizardry. Sure wish i hadn't slept through that many analog electronics classes. Ian, why do you believe you need an analog ? Back in highschool we used Tektronix devices circa late 80ies- early 90ies, reading about that rigol instrument I can't think of much things it won't do. Anton. My pit build thread . Simple and cheap UFC project
FSFIan Posted August 10, 2015 Posted August 10, 2015 Ian, why do you believe you need an analog ? Back in highschool we used Tektronix devices circa late 80ies- early 90ies, reading about that rigol instrument I can't think of much things it won't do. Aesthetics, mostly. I like the idea of a scope that reacts immediately to any change in settings, no menus to get through, dedicated mechanical switches for everything. I also want to have a second scope to use when I am at home over the weekend, even if it is not as full-featured as the one in my dorm room. I agree that there is nothing a sub-100€ used analog scope will do better than my DS1054Z, except maybe (the beginning of the video shows an analog scope, at 4:40 we see it displayed on a DS1074Z). DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua
Gadroc Posted August 10, 2015 Posted August 10, 2015 Mike - Excellent progress!! Depending on cost I may think about actually getting my HSI working. I just put it on the shelf after realizing it's 6-8 synchros to drive. Ian - The DS1054Z is an awesome scope for the money. I assume you've unlocked it to full capability. It's been essential for me debugging DCSBios / Arduino Library. Being able to trigger on a serial decode byte is awesome. Don't bother getting an old analog if you have it (have one sitting in the closet now).
Warhog Posted August 10, 2015 Posted August 10, 2015 Mike, this is indeed an excellent step forward. Way to go!:thumbup: I expect there are quite a few others, including myself, that are in the same boat as Gadroc. I too have an HSI just sitting on a shelf waiting... I'm hoping to drive it with synchros as the alternative is going to be me ripping it apart and trying to drive it with stepper motors.:( I would rather not tear it down as it is a beautiful instrument and it would be extremely satisfying to see it function on its own volition without any extreme modification. Regards John W aka WarHog. My Cockpit Build Pictures... 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
Recommended Posts