Author Topic: Trying to emulate three synchros using Arduino  (Read 62180 times)

0 Members and 1 Guest are viewing this topic.

Offline richfilesTopic starter

  • Regular Contributor
  • *
  • Posts: 156
  • Country: us
Trying to emulate three synchros using Arduino
« on: July 20, 2015, 07:56:40 pm »
I'm trying to emulate three synchros using Arduino. A synchro is a type of rotary transformer that takes an AC input and generates three amplitude adjusted outputs that represent the angle of the rotor. It looks a lot like a three phase motor winding. My application is to drive this: A 3 axis FDAI (Flight Director/Attitude Indicator).

•••• EDIT ••••

(Dec-2021)

I have found the following parts that will most likely be used:

• California Instruments 850T Precision Oscillator (salvaged from equipment from previous employer. This is my 400 Hz Sine source.)
• MCP4922 12-bit Dual DAC with Voltage Reference (5 on hand - Supports multiplying functionality)
• 74HC4066 Quad Bilateral Analog Switch (90 on hand - I might have enough)
• TA8251AH 4ch x 18W Audio Amplifier (I have a whole tube of these. Might use 'em, might not)
• LM675 Power Op-Amp (16 on hand... And I don't trust a single one of these. Possibly counterfeits. Dang it China... |O )

To reiterate, because it gets missed, a lot, the design I've chosen uses a hardware sine wave generator (California Instruments 850T Precision Oscillator) to generate the 400 Hz sine wave, uses a set of analog switch chips to select whether to use an inverted or a non-inverted sine wave, and feeds that into the voltage reference of a multiplying DAC. The microcontroller only needs to update the attenuation values of the DAC, and the sine wave is attenuated entirely by the hardware.

I will NOT in any way, shape, or form, be generating the sine waves from the microcontroller. There is no need. It doesn't need to be suggested. It keeps getting brought up. Enough that I'm going through old posts to strike-through older speculative info that's no longer relevant.

Finally, a 115vac 400Hz Power Amplifier has been developed! Special thanks to random internet denizen "Dr. Rockzo" for his crucial aid developing a viable power amplifier capable of taking the precision reference sine wave as an input, and driving the 115vac 400Hz output needed to supply the ADI with power while also retaining the precision required as a reference. I have created a new thread detailing the development of the Power Amplifier circuit, which can be found here:
https://www.eevblog.com/forum/projects/28vac-115vac-inverter-that-can-be-driven-by-400hz-analog-sine-wave/

•••• END EDIT ••••




My goal is to use the Kerbal Space Program SerialIO mod that outputs the game's vessel telemetry to an arduino over USB. I have a nice big pile of meters, switches, and other goodies, but the FDAI is my prize collection piece! Almost no one has done a physical "navball" in Kerbal Space Program. I know that these are very commonly installed in flight simulators. That's actually where mine came from, in fact. A lot of flight sims only use a 2 axis model. 3 axis models are more frequently used in fighter jets, stunt planes, and space craft.

These devices take a reference 115 volt ac, 400 Hz signal for both power and as the reference. Each of the three axes have three inputs that come from the synchros on the gyro gimbals. When the synchro transmitter transformer sends the 400 Hz ac sine wave over the three wires, it represents the angular magnetic alignment of the rotor. Inside the FDAI, three synchro receivers output the null error from their rotor, which feeds into a servo amplifier that drives a servo paired to each synchro receiver to zero out the error.

Anyway, I'm uncertain if the arduino has the beefiness to pull this off entirely in software emulation. Maybe it does, maybe it doesn't. I'm only just beginning... as in I'm still investigating and studying. I've not coded anything yet. Since I need to drive the reference output at 115 vac 400 Hz, and the synchro outputs at 28 vac 400 Hz, I figure it pays to rely on some support hardware to lighten the Arduino's load anyway.

I'm thinking I could buy a MAX038 off ebay to generate a nice clean 400 Hz sine wave, and go with digital potentiometers to set the 9 amplitude modulated outputs. The only question I have, is that digital pots seem to come mostly in 256 step (8 bit) varieties, and some 10 bit, 1024 step versions are out there. I need to be able to represent 360 degrees of rotation, and I'd like to avoid a jumpy ball, so I won't even consider the 256 step d-pots. I still wonder if the 1024 step d-pots are enough. The amplitudes I need to represent swing fully positive and negative, and the rate of the swing conforms to the curve of a sine wave, represented by the phase angle of the particular winding vs the rotor. Basically, I do not believe it's linear by a long shot. That more or less means I have to waste steps on the low end, and get lots of fine steps (of fudge it) at the top end. I don't think I'll get the full 1024 steps worth of resolution once the math calculates the amplitude of each sine wave output. mirrored against opposing actions on the other two signal lines, I can get half of 360 degrees (180 + or - degrees, with the + or - representing either a rise or a fall in the wave in relation to the angle of the other two). Between step 1023 and 1022, is 3.58157°, yet between steps 512 and 511 (the mid way point if you consider the center step being 0 volts), there is a change of only 0.11190589°.  Not sure how that poor resolution near the peak amplitudes will affect things. There will always be two other amplitudes that are not at peak, in the opposite polarity, when one output reaches that low resolution peak.

Does anyone know of any 12 bit digital pots? I imagine that would give me great resolution for my application, even at those pesky peak amplitudes.

Also, to clarify, there is NOT a phase shift happening between phases... The amplitude is modulated in phase with the reference, but the angular difference (0°, 120° and 240° windings) cause the sine wave to be attenuated by the sinusoidal angle of the "misalignment" of the rotor's magnetic field angle with the stator's angular orientation relative to the rotor. Clear as mud, right!  :palm:

I've seen a design that pairs two 8 bit digital pots together using three op-amps, but that takes me from 6 support chips (assuming at least dual d-pots) plus output drivers to 13 support chips plus output drivers. It more than doubles what I end up having to build! If I can just find 12 bit or higher digital pots, that'd be ideal. Even if I could only get single pots, it's still better than the other method, as it would only require 10 chips in single pot configuration (or still 6 if I can find dual d-pots). The BIG difference, is it simplifies the programming to not have to juggle values calculated and sent out to two chips to represent one number.

Can anyone recommend any higher resolution digital pots, or an alternative part. I need to be able to feed it a sine wave and attenuate it...

And dang it... I just added a few op amps, cause I need to attenuate high impedance "copies" of the sine wave... x9.

Finally, I was thinking of driving the output with the rails at +/-11.5 volts, and feed that through a 1:10 transformer to get my 115 volts ac. In the US, we use 120 vac, so if I find a non rectified 12 volt wall wart, that's a 1:10 ratio right there. I can probably find them surplus. If I find something close enough, I can always adjust my rails to meet the needed ratio. Does that seem like a reasonable method of getting my 115 volt, 400 Hz reverence/power sine wave?

 :-//

Yeah, I have my work cut out for me!
« Last Edit: December 12, 2021, 01:29:10 am by richfiles »
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4319
  • Country: us
  • KJ7YLK
Re: Trying to emulate three synchros using Arduino
« Reply #1 on: July 20, 2015, 08:14:19 pm »
I believe that Arduino is capable of the fundamental task of generating the three  axis-phase signals. It is not fundamentally different than a phase-angle dimmer circuit which is quite common.

I would start with a 115VDC signal, and use one output from the Arduino to generate the "reference phase" 400Hz signal.  I would use a simple power FET to chop up the 115VDC into 115 V, 400 Hz square-wave.  I would not think that your FDAI gadget will really care whether the signal is a nice sine-wave or simple chopped-DC.  If it really doesn't like the sharp square-wave edges, you can always smooth them out with a big torroid inductor (exactly the same technology as used in larger lamp dimmers to reduce RFI and "fliament buzz".)

The three axis inputs to your FDAI gadget are just phase-variations of the reference 115V, 400Hz signal, so it would be just a matter of using three additional Arduino output pins to send out three more copies of the reference signal, but phase-delayed to cause the display to show the desired information.  This is also a relatively common methodology for vehicle dashboard needle indicators like speedometer and tachometer.
 

Offline richfilesTopic starter

  • Regular Contributor
  • *
  • Posts: 156
  • Country: us
Re: Trying to emulate three synchros using Arduino
« Reply #2 on: July 20, 2015, 08:55:01 pm »
It should be noted, that these 400 Hz synchro devices can, and sometimes do hum to the harmonics... I'd like to keep a clean sine wave to reduce all the lovely harmonics found in a square wave. As for generating the sine, that's the easy part. A MAX038 can do it with a trimpot to fine tune it. While the part is discontinued, it's easy to find online.

Also to be considered... I have never done C in my life. I'm learning it fresh. If I can get the arduino to do a little math and then just send data packets to some digital pots, that works fine with me. I still need some room to program the output for the analog deflection gauge flight director crosshairs, and I need it to read an incoming data stream over serial from another arduino.

The difference between software emulation is needing to software generate a sine wave, then calculate the attenuation of 9 sine outputs, at the resolution of the sine wave, 400 times a second... That's 10 sine waves being calculated, x 400 x the resolution... Per second. Double if I wanna beat the Nyquist value. It has to then output that... Your method has it chopping DC... But remember, I have to go both above AND below 0 volts, so it'd be more like plus and minus 162 volts DC... Gotta remember RMS. (irrelevant due to coupling)

By going with the hardware sine generator, and digital pots, I only have to update it at the rate of change of the balls rotation... If the game is running 30 FPS, which seems a fair update rate, I only have to calculate the attenuation levels on the 9 outputs 30 times a second, or 270 trig functions per second, plus the assembly of the data packet, which involves some bit shifting and stuff, I think, to merge the commands, address, and data packets. I think it's 24 bits of data for a MAX5494 10 bit d-pot. That's 6480 bits of data... sent per second, to update all 9 pots at 30 updates per second... I think???  :-//
« Last Edit: November 07, 2019, 12:28:20 am by richfiles »
 

Offline richfilesTopic starter

  • Regular Contributor
  • *
  • Posts: 156
  • Country: us
Re: Trying to emulate three synchros using Arduino
« Reply #3 on: July 20, 2015, 09:18:31 pm »
Also... There is no phase delay involved in synchros. You'd be correct about phase shifting if we were talking resolvers.

It's kinda... not obvious till you get it on an oscilloscope, and I had it wrong for years, myself. I did the same, and confused it for resolvers. Of course, it HAS been a decade since I built my last synchro at my old job. It;s only been a couple years since I last worked with resolvers.

The input reference, and all three windings output sine waves that are in phase, either flipped or unflipped (positive/negative flipped around) in relation to the reference, but they are attenuated based on the phase angle of the winding to the rotor.

Mike's Electric Stuff covers this quite well. Only polarity and amplitude shift, not the phase.
https://youtu.be/fcoR8plMMK8?t=15m18s

there are three signals, per synchro, and a synchro per axis, so with 3 axes, there are 9 signals to the FDAI, plus the reference.
« Last Edit: July 20, 2015, 09:20:04 pm by richfiles »
 

Offline LaserSteve

  • Super Contributor
  • ***
  • Posts: 1313
  • Country: us
Re: Trying to emulate three synchros using Arduino
« Reply #4 on: July 20, 2015, 09:48:34 pm »
You would be perhaps better off using AD633 as the modulation means, driven by a multiple DAC chip controlled by the Arduino. You'll need a few trim pots for the unused multiplier inputs.   This eliminates much processing in the Arduino.

Or find a 12Bit Multiplying  DAC that is capable of AC reference inputs.

Steve
"What the devil kind of Engineer are thou, that canst not slay a hedgehog with your naked arse?"
 
The following users thanked this post: richfiles

Offline Skimask

  • Super Contributor
  • ***
  • Posts: 1433
  • Country: us
Re: Trying to emulate three synchros using Arduino
« Reply #5 on: July 20, 2015, 10:02:14 pm »
I've worked on and recognize that ADI, but I can't place what aircraft it's out of...

If I can throw a second idea out there that adds a 1/2 load of complexity...
Get your hands on 3 more synchro transmitters and drive those with stepper motors...maybe???possibly???

And you obviously won't need the full 120VAC to drive the synchros themselves.  Worked in a flightline backshop for a bit.  One of the checks was to run the AC voltage down to X volts and see if the ball still indicated correctly.  If I remember right, 30-40VAC was good enough as long as the bearings were halfway good.  Get one with really nice bearings in it and they would indicate fairly well down to 20VAC but stick once in awhile.
« Last Edit: July 20, 2015, 10:07:44 pm by Skimask »
I didn't take it apart.
I turned it on.

The only stupid question is, well, most of them...

Save a fuse...Blow an electrician.
 

Offline BennVenn

  • Regular Contributor
  • *
  • Posts: 160
  • Country: au
    • BennVenn's site
Re: Trying to emulate three synchros using Arduino
« Reply #6 on: July 20, 2015, 10:05:07 pm »
Or.... Find some smaler synchro's and tie them directly to your sychro's. All you'll need is the 400hz ref and a way to manipulate your master synchro's. Stepper motors?

We have sychro testers at work which are just sychro's with alligator leads.

We also have synchro to resolver converers which are just 3 phase transformers.

Another idea could be use 3 ferrite transformers with 400hz AC input and the output going to your sychro's. Use a DC bias to control the output voltage of the transformer. Some of the older gear at work uses variable differential transformers so that is another method.

Easiest would be the MAX038
 

Offline richfilesTopic starter

  • Regular Contributor
  • *
  • Posts: 156
  • Country: us
Re: Trying to emulate three synchros using Arduino
« Reply #7 on: July 21, 2015, 12:51:59 am »
I've worked on and recognize that ADI, but I can't place what aircraft it's out of...

If I can throw a second idea out there that adds a 1/2 load of complexity...
Get your hands on 3 more synchro transmitters and drive those with stepper motors...maybe???possibly???

And you obviously won't need the full 120VAC to drive the synchros themselves.  Worked in a flightline backshop for a bit.  One of the checks was to run the AC voltage down to X volts and see if the ball still indicated correctly.  If I remember right, 30-40VAC was good enough as long as the bearings were halfway good.  Get one with really nice bearings in it and they would indicate fairly well down to 20VAC but stick once in awhile.

This one, I'm told, came from an F-4 Phantom simulator. I've heard ADI many times before, but I'm so used to FDAI, due to references to Apollo that I come across, thanks to my being a Kerbal Space Program nerd!  ::)

That's interesting to hear, regarding the lower voltages... I might have to try that.
The ball sometimes spins a little just from inertia when I'm moving it around. Smooth as a baby's butt!  :-DD

I had considered driving it with steppers linked to synchros... If I could get three Tachtronic Instruments synchros that'd work with it, i'd LOVE that... Cause they'd have been built by people I knew... and  if they were from 2004-2005... possibly ME!  8)

Still, I somehow like the idea of doing a design that makes it all solid state... I dunno. I STILL have to come up with the 400 Hz inverter. Do you have any details you can share on these things. I have this, so far...

Quote
This is the Lear Siegler Inc. (Instrument Division, Grand Rapids, Michigan, USA) ARU-11/A Artificial Director Indicator (ADI). It is similar in appearance and electrical connections as the Lear Siegler Inc. ID-1144/AJB-7 ADI and both were used in the various Phantom types. It sits in the center of the main pilot's panel and receives signals from remote units. The heading, pitch and roll can be moved using synchros.

Pin connections are:

A=Ground
B=115 V- 400 Hz


F=Heading-x
G=Heading-y
H=Heading-z


J=Glide-slope-flag+
K=Glide-slope-flag-

P=rate-gyroscope-power-warning-flag+
R= rate-gyroscope-power-warning-flag-

S=glideslope-pointer+
T=glideslope-pointer-

U=vert-ptr-flag+
V=vert-ptr-flag-

W=horiz-ptr-
X=horiz-ptr+

Y=vert-ptr-
Z=vert-prt+

a=pitch-x
b=pitch-y
c=pitch-z


d=roll-x
e=roll-y
f=roll-z


g=lighting (5 V)
h=lighting (GND)

C,D,E,L,M,N and j not used.

That chip can has a 1974 date code!!! She's half a decade older than I am! O0
Can i ask, this "grease"... Is that from the gasket breaking down, or is this something i should be concerned about... The thing was just sticky around the seam.


Fortunately, The Kerbals GOT another gimbal for Kristmas... So they don't have to worry about gimbal lock!  :-DD
« Last Edit: July 21, 2015, 01:22:08 am by richfiles »
 

Offline daveatol

  • Regular Contributor
  • *
  • Posts: 136
  • Country: au
Re: Trying to emulate three synchros using Arduino
« Reply #8 on: July 21, 2015, 01:00:40 am »
The arduino shouldn't have an problems generating the required signals; there's only a a single sinewave to generate, and all signals are just a scaled version of that. Integer multiplication is fast on the arduino, so there shouldn't be any performance issues there.

You can get the nine analogue voltages using a single DAC, a MUX, and nine capacitors (see attached circuit - sorry I drew it thinking there were only 7 channels; add another MUX to get the additional channels). The DAC generates the voltage for all channels in sequence, while the MUX is used to direct the voltage to each of the caps. The MUX should be directed to an unused output between changing DAC samples to stop glitches occurring at the used outputs. The voltage on the caps is then buffered and fed to the AC-coupled transformers (or AC-coupled transformer drivers).
« Last Edit: July 21, 2015, 01:02:45 am by daveatol »
 
The following users thanked this post: salbayeng

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3893
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Trying to emulate three synchros using Arduino
« Reply #9 on: July 21, 2015, 01:16:10 am »
Arduino is maybe bendable to do something here, but in my opinion useless. I'd rather use some more sofisticated chip, at least with threephase complementary PWM peripheral (like tiny261 or AT90PWM3 if you like the AVRs so much - I don't) with brake input (OC protection) to generate the threephase power signal using a threephase bridge and LC reconstruction filters (if needed, I don't know the exact construction inside the device) with a dc bus link voltage of 163V (using third harmonic injection modulation type).

I am quite not sure about the other part, because I haven't understood clearly what the unit outputs and what should be processed. Is it some kind of a threephase resolver thingy? But it is indeed interesting one. Never seen anything like that. Only yrs ago, I have built a few 3ph supplies of 28V~ and 400Hz for gyroscpoes.
 

Offline richfilesTopic starter

  • Regular Contributor
  • *
  • Posts: 156
  • Country: us
Re: Trying to emulate three synchros using Arduino
« Reply #10 on: July 21, 2015, 01:18:07 am »
You would be perhaps better off using AD633 as the modulation means, driven by a multiple DAC chip controlled by the Arduino. You'll need a few trim pots for the unused multiplier inputs.   This eliminates much processing in the Arduino.

Or find a 12Bit Multiplying  DAC that is capable of AC reference inputs.

Steve

Certainly an interesting chip, but I'm not sure it gives me much in gains for processing. I'd still need to update a DAC at the same rate as the d-pots (30-ish updates per second, x 9 DAC channels, still needing to calculate the attenuation using trig functions). The real difference is I get to use a higher resolution DAC to feed this thing it's analog multiplier (in this case, attenuator) value. Trying to just do it all in software though.. I have utterly no idea what a little 16 MHz chip is or is not capable of, nor do I know what the limits of the Arduini C language are, but I still have no ideas if it's really genuinely possible on an arduino to calculate and render 10 sine waves, all at different amplitudes... Maybe it is. Probably possible if you know what you're doing, but I don't. Still just learning.  :-//

What I do tend to feel more comfortable with though, is hardware. I guess that's why this seems like a reasonable option to me.

One thing to consider is price. I'll need 9 attenuation channels, and these are easily 3-4x the price of the digital pots, even the 1024 step ones.

Hmm... If you have a linear pot... Is there any type of circuit that would attenuate an AC signal by the RMS value? I hope that makes sense... If I had a circuit that could do that, then I could spread out my resolution more uniformly along the sine wave, focusing more of the resolution where it shallows out at the peaks, and dropping resolution at the zero crossing.

Is that even a thing? Can it be made to work off a linear pot?
 

Offline richfilesTopic starter

  • Regular Contributor
  • *
  • Posts: 156
  • Country: us
Re: Trying to emulate three synchros using Arduino
« Reply #11 on: July 21, 2015, 01:35:19 am »
Arduino is maybe bendable to do something here, but in my opinion useless. I'd rather use some more sofisticated chip, at least with threephase complementary PWM peripheral (like tiny261 or AT90PWM3 if you like the AVRs so much - I don't) with brake input (OC protection) to generate the threephase power signal using a threephase bridge and LC reconstruction filters (if needed, I don't know the exact construction inside the device) with a dc bus link voltage of 163V (using third harmonic injection modulation type).

I am quite not sure about the other part, because I haven't understood clearly what the unit outputs and what should be processed. Is it some kind of a threephase resolver thingy? But it is indeed interesting one. Never seen anything like that. Only yrs ago, I have built a few 3ph supplies of 28V~ and 400Hz for gyroscpoes.

The biggest difference between a synchro and a resolver, is that resolvers use phase shift to read angle of the input shaft. Synchros use amplitude modulation of three IN phase signals (though they can flip over the zero crossing, so they appear 180° out of phase... It's a literal polarity flip, as opposed to phase shifting, in that case)

The arduino shouldn't have an problems generating the required signals; there's only a a single sinewave to generate, and all signals are just a scaled version of that. Integer multiplication is fast on the arduino, so there shouldn't be any performance issues there.

True there is a single sine wave, but the attenuation factor is not going to be an integer. It'll be a floating point (I assume floating point) trig function... Either the sine or cosine of the rotor angle or something like that. Not really so sure it'd be zipping by on integers. I have a 240p grainy video that explains the maths... but it's... It's also a real SLOG...   :=\

You can get the nine analogue voltages using a single DAC, a MUX, and nine capacitors (see attached circuit - sorry I drew it thinking there were only 7 channels; add another MUX to get the additional channels). The DAC generates the voltage for all channels in sequence, while the MUX is used to direct the voltage to each of the caps. The MUX should be directed to an unused output between changing DAC samples to stop glitches occurring at the used outputs. The voltage on the caps is then buffered and fed to the AC-coupled transformers (or AC-coupled transformer drivers).

Well this is certainly interesting!
 

Offline daveatol

  • Regular Contributor
  • *
  • Posts: 136
  • Country: au
Re: Trying to emulate three synchros using Arduino
« Reply #12 on: July 21, 2015, 01:55:28 am »
True there is a single sine wave, but the attenuation factor is not going to be an integer. It'll be a floating point (I assume floating point) trig function... Either the sine or cosine of the rotor angle or something like that. Not really so sure it'd be zipping by on integers. I have a 240p grainy video that explains the maths... but it's... It's also a real SLOG...  :=\
You will already have a lookup table being used for the sinewave that you're driving the DAC with. Therefore it takes a single lookup to calculate the sin or cos of an angle.

You said that a 12-bit DAC would be ideal; with such a small dynamic range, floating point is not even attractive. FYI fractional multiplications can be done efficiently using integer multiplications. e.g. if I want to multiply my 16-bit value by sin(25°) = 0.4226..., I can multiply by 27697 (which is 0.4226.. * 65536) and then divide by 65536. The division is done by ignoring the lower 16 bits of the multiplication result (because 65536 is 2^16), and consequently doesn't use any processing time whatsoever.

I didn't watch the linked hour-long video. Perhaps you could summarise/transcribe the pertinent formulae.
« Last Edit: July 21, 2015, 01:57:29 am by daveatol »
 

Offline richfilesTopic starter

  • Regular Contributor
  • *
  • Posts: 156
  • Country: us
Re: Trying to emulate three synchros using Arduino
« Reply #13 on: July 21, 2015, 02:13:37 am »
https://www.desmos.com/calculator/kt7yt0gz5m

This is a link to a graph. The table indicates the limitation in using a 10 bit digital Potentiometer. Put simply, the resolution is extremely compressed near the zero crossing, and extremely sparse at the peaks. at the peaks, I get over a degree of change with a single step. At the zero crossing, I only reach half a degree in 5 steps! Fortunately, the resolution quickly jumps to a degree per step by the thirds step from peak, and then by the 6th or 7th step, it's getting near to half a degree per d-pot step. The other two outputs will never be near peak when one output is there. They will be in a more median range. Will their finer resolution compensate then, for the lack of resolution at peak? I imagine even in the analog domain, this has to be a weak spot too.

maybe It'll be fine, and I'm just over thinking things.

I'll have to perform the trig function off the winding's angle in relation to the others (output x, y, and z is 0, 120°, and 240° respectively, from the null angle). Then I'll have to scale that to 0-1023 and round it to an integer of that, to derive my step position.
 

Offline richfilesTopic starter

  • Regular Contributor
  • *
  • Posts: 156
  • Country: us
Re: Trying to emulate three synchros using Arduino
« Reply #14 on: July 21, 2015, 02:35:14 am »
You will already have a lookup table being used for the sinewave that you're driving the DAC with. Therefore it takes a single lookup to calculate the sin or cos of an angle.

You said that a 12-bit DAC would be ideal; with such a small dynamic range, floating point is not even attractive. FYI fractional multiplications can be done efficiently using integer multiplications. e.g. if I want to multiply my 16-bit value by sin(25°) = 0.4226..., I can multiply by 27697 (which is 0.4226.. * 65536) and then divide by 65536. The division is done by ignoring the lower 16 bits of the multiplication result (because 65536 is 2^16), and consequently doesn't use any processing time whatsoever.

I didn't watch the linked hour-long video. Perhaps you could summarise/transcribe the pertinent formulae.

Actually, if using D-pots, or using a DAC with those multiplier chips... My 400 Hz sine wave never enters the arduino. It'll come from a MAX038. The D-Pot or the multipliers (used as attenuators) simply get set to a level that then attenuates the sine wave that is sent into the device. If the navball is static, then I'd be driving DC from the DAC, or keeping the D-pots fixed at a particular set of steps. I'd still need the trig library (assuming this installs the lookup table as well)

I DID consider another option that would double my D-pot resolution... If I reference one side of the D-pot to ground, and then have 9 digital outputs from the arduino attached to a half H-bridge type circuit, I can reference either the positive or the negative supply rail, and it will only ever switch when the d-pot wiper is stepped to ground... aka, at the zero crossing.

Using 9 digital lines from the arduino and a 1024 step pot would net me a 2048 step pot (with minor support hardware). That reduces my dead zone to 90° - 87.46765° = 2.53235°, and the second step is already 1.04922°, and the third step is already sub 1° at 0.8053°! Combined with the fact that even with the low resolution at peak, the other two outputs will have nominal sub degree values... I think it might work!

not to mention, basic op amps and the d-pots are dirt cheap too. Going with surplus wall wart transformers ought to get me a good, low cost transformer to step up, and going on Skimask's suggestions, i likely don't even need to drive this all the way to 115 volts.

***EDIT***

Maybe... I was originally going to pass the sine wave through the pot, with one side if the pot tied to ground, and the other tied to the reference. The wiper would be the output.  It's 10 PM here, and I can't think... I'm mixing DAC generated sine with d-pot passthrough... ugh!  :palm:

I suppose, I could try something else... If I created a voltage divider between the actual sine wave and ground, and tied the "ground" side of the digital pot to this point, it ought to give a range between 0 attenuation, and I'm not really sure... This is... I think it would alter the range, for sure... Plugged it into a sim.. It's weird... I imagine it would take some crazy tricks to make work... It does give me two ranges, but not like the other idea... The other idea toggled my supply rails at the zero crossing. This gives you a 0-full range and a half to full range, but does not switch at zero... I don't like that at all. It won't be simple to implement, and the rise times of the sine waves will be off due to the different ranges. DEFINITELY a NO GO. I'll leave the pic for LOLs.  :-DD

A BETTER idea, might be to rectify the sine wave, and then have a digital I/O tied to the amplifier to amplify it either positive or negative. That gets the zero crossings back, and solves something I TOTALLY missed... The pots can attenuate, but not flip the polarity. I need to be able to flip the polarity.  :palm:

Fortunately, relying on the arduino to select whether to amplify each signal positive or negative both solves this, and provides 1024 steps for a 0 to 90° zero to peak range, rather than splitting 1024 steps between -90 to 90°. I need to have an input that detects zero crossing if I do this though... Dang it.. the pots were so cheap too!  |O

If I use DACs and tie that to an op-amp... I could have a better range (since 12 bit DACs are common enough, I believe) and I get my polarity reversals by inverting the op amp with the bias signal. I'd get the attenuation AND the polarity flip when the DAC flips... Right?

Okay...

I think what I need is a DAC to output the attenuation level/polarity, and that needs to feed into an op amp circuit that actually performs the attenuation (and can invert the input when the bias inverts). If I do a 12 bit DAC, I get reasonably good resolution, in both the positive and negative (quadruple the number of steps as the d-pot).

Since I need to pass the output through an amp anyway, this also saves me the effort and lets the attenuation happen right in the amp.

Okay... Now I need a good amp circuit that will attenuate a signal with a DC bias input, and invert it when that bias goes negative.

I need to go to bed though...  :=\
« Last Edit: July 21, 2015, 03:59:20 am by richfiles »
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6228
  • Country: us
Re: Trying to emulate three synchros using Arduino
« Reply #15 on: July 21, 2015, 02:52:25 am »
You can buy off the shelf digital to synchro converters.  For example http://www.ddc-web.com/Products/83/Default.aspx  There are others.

Also, a synchro resolver can also be used as a transmitter so if you connect a step motor to a synchro it can act as a D/R.
 

Offline daveatol

  • Regular Contributor
  • *
  • Posts: 136
  • Country: au
Re: Trying to emulate three synchros using Arduino
« Reply #16 on: July 21, 2015, 03:24:18 am »
The MUXes aren't usable for attenuating the signal. If you use the circuit I showed with a 14-bit DAC (e.g. AD5641 is 14-bit >100kSps for $1.72), surely you can get the resolution you're after. The arduino just has to feed a constant stream of values to the DAC, and update the MUX. Assuming an DAC update rate of 50kSps, that's 13.9 samples per cycle of the 400Hz waveform.

I like your idea about inverting the signal as a way to get an extra bit.

Of course you can use the digital pot approach, I just have the feeling that readily available DACs generally have higher resolution (I haven't looked in a while though, please correct me if this has changed).
« Last Edit: July 21, 2015, 03:27:55 am by daveatol »
 

Offline daveatol

  • Regular Contributor
  • *
  • Posts: 136
  • Country: au
Re: Trying to emulate three synchros using Arduino
« Reply #17 on: July 21, 2015, 03:30:18 am »
Also, what happens if you try to drive a synchro with DC current? Does it become magnetised or something? If there's no magnetisable material in the synchro, then I'd expect that DC could work fine.
 

Offline Skimask

  • Super Contributor
  • ***
  • Posts: 1433
  • Country: us
Re: Trying to emulate three synchros using Arduino
« Reply #18 on: July 21, 2015, 03:34:03 am »
This one, I'm told, came from an F-4 Phantom simulator.
That's it...the F4G.  Didn't really work them so much as got a bunch of training on them.  FADI, ADI, same, same overall.  I think about the only difference, in my view, is the FADI has azimuth markings on the ball.  ADI, no azimuth.

Quote
That's interesting to hear, regarding the lower voltages... I might have to try that.
The ball sometimes spins a little just from inertia when I'm moving it around. Smooth as a baby's butt!  :-DD
That'll be misleading at best if I remember right.  Bearings good, windings/contacts old, needs more vitamin VAC.  Windings/contacts good, bearings old, still needs more vitamin VAC.  Like anything else, try it until it fails and back up one step.

Quote
I had considered driving it with steppers linked to synchros... If I could get three Tachtronic Instruments synchros that'd work with it, i'd LOVE that... Cause they'd have been built by people I knew... and  if they were from 2004-2005... possibly ME!  8)
Got a 3-D printer?  Build your own synchro TX. :)  I know..I know..sounds easy in theory.  Getting it to work right, another story entirely...

Quote
Still, I somehow like the idea of doing a design that makes it all solid state... I dunno. I STILL have to come up with the 400 Hz inverter.
Not only that, but you have to come up with a 3 phase 400Hz inverter, at a reasonable cost.

Quote
Do you have any details you can share on these things. I have this, so far...
Nothing more than you have already.  Synchro signals 120VAC, 3ph, 400HZ.  All of the flags, pointers, etc. should be <1V DC to pull them in or out as needed.  Like anything else, throw a volt at it thru a current limit resistor, see what the flag does.  Increase or decrease as necessary.

I just had another look at the pictures.  That recessed cannon plug placement is just like the old ones they used to use on the ADI's on the tankers (C-135's) and B-52 bombers (and probably a hundred other aircraft types).  Even with a cannon plug pliers, made it a bitch to get the thing on or off.  Half the time, I ended up using a straight edge screwdriver and making gouges in the cannon plug outer shell to get it to lock or unlock.
I didn't take it apart.
I turned it on.

The only stupid question is, well, most of them...

Save a fuse...Blow an electrician.
 

Online Someone

  • Super Contributor
  • ***
  • Posts: 4684
  • Country: au
    • send complaints here
Re: Trying to emulate three synchros using Arduino
« Reply #19 on: July 21, 2015, 03:37:05 am »
AVRs at 16MHz will have no problem generating the signals you need, even software PWM of the output ports will suffice when the final result is a set of synchronous 400Hz sine waves. The trick will be narrow bandpass filters that will have the desired settling time, then you can dither the PWM to get enough resolution in the final waveforms.
 

Offline richfilesTopic starter

  • Regular Contributor
  • *
  • Posts: 156
  • Country: us
Re: Trying to emulate three synchros using Arduino
« Reply #20 on: July 21, 2015, 04:21:55 am »
So digital pots are pretty much out... cause I had a case of the dumb and forgot I needed the ability to INVERT the signals.  :palm:

I GUESS if I used an Arduino(s) with at least 10 total PWM outputs, I suppose it might me possible to render the sine waves via software... People seem to be saying it's possible. **NO! Just, no!** I've considered splitting each of the three axes across three Pro Minis (they only have 6 PWM pins). One of them would need to generate the reference, AND they'd have to all stay synchronized... Maybe one could do two axes, and the other could do 1 axis, and the reference, plus the two remaining PWMs could operate the horizontal and the vertical parts of the crosshairs.

Or I could use a Mega... I currently have a pair of Mega 2560s and 4 of the Pro Minis.

I have ZERO C experience... So the idea of doing this all in software is... a pretty big jump for me.

Would a pile of small DACs be best, or a pile of code???  :-//
« Last Edit: December 12, 2021, 02:15:11 am by richfiles »
 

Offline richfilesTopic starter

  • Regular Contributor
  • *
  • Posts: 156
  • Country: us
Re: Trying to emulate three synchros using Arduino
« Reply #21 on: July 21, 2015, 05:09:04 am »
You can buy off the shelf digital to synchro converters.  For example http://www.ddc-web.com/Products/83/Default.aspx  There are others.

What's the old saying... If you have to ask how much... You can't afford it... :o

Darn "Request a quote" buttons... That's exactly what those mean!

Sadly, I'm on a tight budget. I've spread the collecting of these parts out over about half a year (the FDAI and Arduinos were just my latest purchases). My job sucks... but it's incredibly stable, and may have LONGterm options to move up... As in it may take a long time to move up... But it may happen in time. :-\
At least I got a good raise last week!  ;D

Part of why I want to do this, is not just for myself, but for the small circle of people who want to give this a try, but generally would get wiped out just buying the FDAI itself. In that sense... It DOES make sense to try to do as much in software as possible. It's just REALLY intimidating to go into learning a programing language ENTIRELY from scratch, haver having not touched programming since Commodore 64 BASIC, and TI-89's TI-BASIC. Not to mention the fact that the task I'm wanting to do is very computationally intensive, considering the tiny devices that are meant to run it. Part of me doesn't know what the capabilities of these microcontrollers really are, and for me to be learning a programing language I've never used before, AND have such a big project... I guess my natural instinct is to add moar chips! I'm used to watching sine waves plot in real time on those old graphing calculators, and then expect to do that 400 times a second, times 10!

I have zero experience with microcontrollers, and as a result, I've not built up confidence in knowing what I can and can't do with them.

I've spent more time thinking about how I might do it, and haven't tried a thing.

So, both the Pro Mini and the Mega 2560 have a 16 MHz chip. The big difference is in the I/O and memory. The mega has 8K of SRAM, vs the Mini having only 1K. Should I just start on the Mega? Is there even a possibility of fitting lookup tables and all the needed code to do this on the Pro Mini? Does a trig lookup table get stored in the flash or eeprom, or does it load into SRAM for use?

Lots of noob questions and noob thoughts here!  ???
 

Offline daveatol

  • Regular Contributor
  • *
  • Posts: 136
  • Country: au
Re: Trying to emulate three synchros using Arduino
« Reply #22 on: July 21, 2015, 08:28:05 am »
So digital pots are pretty much out... cause I had a case of the dumb and forgot I needed the ability to INVERT the signals.  :palm:
They're not out; you just have to shift the signal (using AC-coupling) to the appropriate level. So, if you sinewave is ±2.5V, you reference it to 2.5V for a 0-5V range. After the pot, you can couple it to 0V for a 0V-centred signal, or leave t as is if you're using some inverter... but if you're using an external sinewave source you wouldn't be using an inverter for the extra bit of resolution.

I GUESS if I used an Arduino(s) with at least 10 total PWM outputs, I suppose it might me possible to render the sine waves via software... People seem to be saying it's possible. I've considered splitting each of the three axes across three Pro Minis (they only have 6 PWM pins). One of them would need to generate the reference, AND they'd have to all stay synchronized... Maybe one could do two axes, and the other could do 1 axis, and the reference, plus the two remaining PWMs could operate the horizontal and the vertical parts of the crosshairs.
The lookup table would take up 180 bytes for 16-bit samples or 90 bytes for 8-bit samples, assuming degree resolution (only 0-pi/2 is required due to symmetry). This project doesn't sound computationally intensive at all; the microcontroller shouldn't break a sweat.

I'm not so confident about using PWM; you'd need heavy filtering to get a sinewave. It may or may not be a good option.
 

Offline richfilesTopic starter

  • Regular Contributor
  • *
  • Posts: 156
  • Country: us
Re: Trying to emulate three synchros using Arduino
« Reply #23 on: July 21, 2015, 01:30:44 pm »
They're not out; you just have to shift the signal (using AC-coupling) to the appropriate level. So, if you sinewave is ±2.5V, you reference it to 2.5V for a 0-5V range. After the pot, you can couple it to 0V for a 0V-centred signal, or leave t as is if you're using some inverter... but if you're using an external sinewave source you wouldn't be using an inverter for the extra bit of resolution.

Level shifting is no problem. I was going to be using dual supplies initially. The issue is actually flipping the polarity... Sine wave peaks become troughs, and vice versa.

The lookup table would take up 180 bytes for 16-bit samples or 90 bytes for 8-bit samples, assuming degree resolution (only 0-pi/2 is required due to symmetry). This project doesn't sound computationally intensive at all; the microcontroller shouldn't break a sweat.

I'm not so confident about using PWM; you'd need heavy filtering to get a sinewave. It may or may not be a good option.

So... If I can make all 10 sine waves inside... How do I get them out? I've read about filtered PWM, and it seems... not perfect. Other than that... ??? I read about ports. Being able to lay several bits down at a time to update all the pins of a port at once, but it seems like there are risks if you screw up stuff. DigitalWrite seems to be to slow to be of much use with regular pins.

So basically, it's not "but we couldn't fit it all in", but is instead "how do we get this through the door"? I think that was my initial reasons to consider hardware. I can easy output serial commands. Still... Is there a way to do this...

regarding PWM, one o my concerns is that it seems the PWM frequency is already quite low, according to some sources I've read. Is this adjustable. Likewise... Since this circuit will ALWAYS be dealing with 400 Hz, and never any frequency faster or slower... How tightly can we tune a filter for the output?
« Last Edit: November 07, 2019, 03:36:23 am by richfiles »
 

Offline BennVenn

  • Regular Contributor
  • *
  • Posts: 160
  • Country: au
    • BennVenn's site
Re: Trying to emulate three synchros using Arduino
« Reply #24 on: July 21, 2015, 09:57:41 pm »
Wow this is getting complicated! It doesn't need to be!

Offload as much as possible to analog circuits. 400hz sine generator? Couple of op-amps. Easy. SPI digital pots? Cheap and simple to drive. Small look up table in the AVR. You wont need much current to drive the synchro, a nice low impedance driver coupled to an off the shelf mains transformer will do.

If you are using an Arduino, it becomes even easier as there are Sine/Co-sine math libraries available.

No need to generate multiple 400hz signals (in phase) from the AVR.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf