Pages: [1]   Go Down
Author Topic: Replacing synchros with Hall-effect absolute position sensors  (Read 1837 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I folks, I have been digging around the forums and the 'net, and I THINK I found what I need, but I'm not sure. What I'm trying to do is read the absolute angular position of indicators on aircraft gauges. Specifically, I am trying to convert synchro/resolver-based instruments (which require 400hz AC and have no straightforward PC interface) to simple DC motors and circuits. Some of these gauges are infinite-turn instruments (like a compass card).

I am needing some guidance: first, I see devices like this (found on the forum): http://www.megatron.de/en/products/hall-effect-multiturn-rotary-encoder/hall-effect-multiturn-absolute-encoder-series-mab40apm.html which look REALLY promising...even the enclosure style is the same as all the instrument synchros I've been working with. Question: when a device like the MAB40APM series say they can be programmed up to 200 turns, does that mean the device would make 200 turns before the return voltage on the analog output drops from maximum to minimum? Or does it follow a sine wave, where the voltage ramps up to maximum at the halfway point of travel (100 turns, for example) then tapers back down to 0.25v or so (which would not quite be absolute, of course, as you'd have to keep track of which phase you are in)? In my case, I would probably want the start/stop points to be set to just one turn, as I have other ways to count number of turns on most instruments (in the case of a compass card, for instance, I would not even need to count turns) and this would provide the most precision. Or am I misunderstanding something here?

Second question: what is a good source for reasonably cheap sensors in various sizes? Ideally they would feature a design similar to the one I linked to, so I could remove the old resolvers entirely and use the Hall sensors as drop-in replacements (at worst, I can gut the old resolvers and mount the new Hall devices inside them). Everything I'm finding so far that is close to what I need seems to be special order/pricey.

Third question: Has anyone played with using air core motors to sense position? I am using them to position simple single-needle indicators with light loads (such as airspeed indicators) and they are AWESOME for that. I am wondering if it's possible to run a current through the coils and read the return voltage to sense their position. At the moment I don't have any motors to experiment with (they are driving gauges in my old flight simulator).

Thanks!

Matt
Logged

Oregon, USA
Offline Offline
Edison Member
*
Karma: 65
Posts: 2125
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You might be able to use the Austria Microsystems magnetic shaft encoder chips (10 or 12 bits absolute position)  to make your own shaft encoders. The following outfit sells breakout boards and the corresponding diametrically magnetized disk magnets. http://www.madscientisthut.com/Shopping/agora.cgi?cart_id=1151712.7598&product=CNC%20/%20Robotic%20Sensors&user4=Rotary%20Encoder&xm=on

Data sheets are here http://www.ams.com/eng/Products/Position-Sensors/Rotary-Magnetic-Position-Sensors/AS5040
Logged

"It seems to run on some form of electricity"

United Kingdom
Offline Offline
Tesla Member
***
Karma: 223
Posts: 6593
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think you may find the megatron unit you linked to very expensive. The magnetic shaft encoder chip suggested by jremington looks a better bet to me.

Personally, I would try to use the synchros. You could use the Arduino to generate the 400Hz signal for the primary, connect the secondary windings to analog inputs (with a suitable DC bias), and write a phase sensitive detector in software to measure the secondary amplitudes and compute the angle. I've done something very similar for an induction balance metal detector running at 7.8kHz (see https://github.com/dc42/arduino/tree/master/MetalDetector), and it would be much easier at 400Hz. If you want to read several instruments, you could implement this on an attiny for each one.
« Last Edit: November 19, 2013, 05:28:52 am by dc42 » Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow, thanks for the helpful replies! I am ordering one of those AS5040 sensors and some magnets for experimenting...it looks quite a bit more sophisticated than a few Hall sensors strung together with magnets rotating around them, but it may prove even more useful for my purposes. They also seem to be quite tiny....if I can mount the PCB behind an old synchro can and attach the magnet onto the shaft, I should have my position-sensing situation covered. All I have to do is either drive the old synchro motors or figure a way to replace them with DC motors.

dc42, your post GREATLY intrigues me! It had never occurred to me to try running synchro devices with the Arduino. I suppose I could run my low Arduino voltage into the rotor as you suggest, and just read the resulting voltages from the 3 output phases, as long as I push them up to 0 - 5v with a DC offset. Tapping into the stock synchros would be awesome...I could drive/read/run just about any big-aircraft gauge without hacking it up.

I actually had to google "DC offset". smiley My electronics knowledge is limited, but growing all the time...this flight simulator stuff has been very educational. Anyways, I am looking up DC offset circuits now, hopefully I will be able to come up with something that will give me good clean DC voltages for the Arduino.

Question: I have picked out a spare instrument for testing that appears to be the perfect candidate. It has a synchro "control transformer" to move a dial, and a "resolver" to detect the dial's position. The dial says its rotor is 0.221v! And the two-phase stator is .09v! Is there any way the 5v logic signal from my Arduino would damage these little guys?

The control transformer synchro says its rotor is 23.5v, and the three-phase stator is 11.8v. I can use a transistor to switch these voltages to the synchro, I assume. I do have a question: will a synchro run the same with the square wave I am going to be sending to it via the Arduino's PWM, as it would with the original sinusoidal voltages?

Matt
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 223
Posts: 6593
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Question: I have picked out a spare instrument for testing that appears to be the perfect candidate. It has a synchro "control transformer" to move a dial, and a "resolver" to detect the dial's position. The dial says its rotor is 0.221v! And the two-phase stator is .09v! Is there any way the 5v logic signal from my Arduino would damage these little guys?

Yes, if the rotor really wants only 0.221V @ 400Hz then you need to scale down the voltage supplied by the Arduino. A series resistor and capacitor will probably be sufficient, unless the rotor has very low impedance. What is the resistance of the rotor? Ideally, you should measure the inductance of the rotor too (this can be done with an Arduino).

You will need to amplify the voltage from the stators with op amps. Preferably, use rail-rail output op amps such as MCP6282, however even the LM358 would probably be adequate. Use low-pass filters to get rid of the higher harmonics, then you should be OK driving the rotor with a square wave. You can eliminate sensitivity to the 3rd harmonic by sampling eight times per 400Hz cycle, as I did in my induction balance metal detector.

There are a couple of different ways of detecting the position:

1. Wire each rotor to its own amplifier, then measure the sign and amplitude of each output relative to the original, using a software synchronous detector.

2. Connect the rotors in series, use a single amplifier, and measure the amplitude and phase using two synchronous detectors in quadrature (like I did in my IB metal detector).

Driving the synchro will be a little more challenging, due to the need to generate a 3-phase signal. It may work OK with square waves, which would simplify things.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, I have made quite a bit of progress! First, a couple of videos for reference:





First, I did try the DC offset idea to get a readable signal to the Arduino. I had to look up DC offset circuits, as I am very much an electronics newbie. For some reason I could not get a simple two-resistor arrangement (as found on the net) to work, I never got any DC voltage. Is there a different approach you recommend?

I did go another route and got a DC signal....I almost forgot that I had pulled a bridge rectifier from some of the old avionics I have around here. I had tried months ago to use this to get a DC signal, but I made a silly beginner mistake: I didn't consider that I was still getting the top half of the AC sine wave, so I saw the (seemingly random) wildly varying analog levels from the Arduino and figured it wasn't going to work. So, last week, I hooked up the rectifier again and was a little smarter with my code: I am recording analog inputs at regular intervals, and using the highest input level as my level for that time interval. This worked perfectly, I am able to reliably read A/C levels with this approach. I would still like to figure out the DC offset circuit, more for academic purposes now (plus I may, at some point down the road, need to read the entire waveform).

Initially, my supply voltage was coming from a surplus 400hz aircraft inverter. I put together my first resistor voltage-divider circuit (yep, I'm a newbie) to get the 26v from the inverter down to 0-5v for the Arduino. But this particular inverter is a bit unreliable, plus the squeal is annoying.....so I decided to try energizing the synchro with the Arduino. Good news: the synchros respond well to square waves, at least as far as position-detection is concerned. Initially I was putting a signal to the stator of a control transformer synchro, and reading voltage at the rotor.

I am getting the square wave by hooking both leads of the rotor (or stator, in the case of the control transformer synchro) to two digital outputs on the Arduino. One output is high, the other low. Every 2.5ms (approximately), I switch the high output to low/low output to high. The high lead gets 5v, and the low lead finds ground through the (now low) other output. This yields (in theory) a rough 400hz square wave. It would be nice to use the Arduino's PWM outputs here, but there is no way that I'm aware of to sync two separate PWM channels so that they go high/low at opposite times. Frankly I was a little surprised this worked. smiley

Second attempt (after ordering some more rectifiers) was to supply AC voltage from the Arduino to the rotor of a resolver, and read the voltages coming off the two stators. I am happy to report that the resolver, despite its specific voltage and frequency labeling, responds just fine to much higher voltages (like the native 5v levels of the Arduino), as well as greatly varying frequencies. The Arduino's square wave yields a less precise signal, but still good enough that once I convert position readings to degrees, I see "jitter" of only 1 degree.

My new challenges (on the reading part): since I'm only reading the amplitude of the A/C levels, I have no way of knowing which quadrant the resolver is in. I can read 0*-90*, I just don't know where that region falls. I'm assuming that if I was analyzing the waveforms, each signal would phase-shift every 180*. The problem is, even if I get this far, I don't know where I'm at within the wave.

Other challenge: I need to do something about the dead area at the 90* points. I think I understand why this happens: if I look at the peaks of a sine wave, the closer you get to the peak, the less the amplitude changes....I guess I just need my input reading to be more precise. I wonder if using a 12bit ADC would help here? You can see this problem in the video, there's a point close to 90* where the readings barely change, as the instrument position changes by more than 30*. Even with the clean signal from the 400hz inverter, I don't see how I'm going to get really precise information near the 90* points.

I am hoping that since the resolvers are handling my square waves so well, driving synchros will be not so difficult. The tricky part is that I need to actually change voltage levels going to the synchro. I see there are some digital-to-analog solutions for the Arduino, so I don't think this would be too terribly difficult. I could pulse two analog outputs to create my A/C signal, and just adjust the output level to position the synchro, no?

Matt
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 223
Posts: 6593
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm glad you made progress!

You may be overloading the Arduino and/or resolver rotor by driving it directly fro the Arduino output pins. The fix would be to put a resistor in series with the rotor. What is the resistance of the rotor? You should make sure that the rotoe resistance plus any series resistance you add is at leasrt 100 ohms and preferably at least 200 ohms. Of course, reducing the rotor drive in this way will also reduce the amplitude of the signal from the stator windings.

To get the DC offset, connect two 10K resistors in series, with one end of the pair connected to +5V and the other end connected to ground. The junction will be at +2.5V. Connect one end of the stator winidng to this junction, and the other end to the analog input pin.

I think you could adapt my metal decetor code at  https://github.com/dc42/arduino/tree/master/MetalDetector to get better accuracy and read phase in all four quadrants, like this:

1. Connect the two stators in series, one end to the 2.5V junction I already described, the other end to the analog input. Check that the total stator voltage you get never exceeds 5V peak-to-peak (if it does, add more resistance in series with the rotor to reduce the drive).

2. Change the metal detector code to use timer 2 where it used timer 1, and timer 1 where it used timer 0. This change is needed to allow us to get antiphase PWM outputs. You will have to adjust the wiring accordingly (i.e. output of timer 2 goes toi nput of timer 1).

3. In the code, change the CS bits in TCCR2B (which control the prescaler) and (if necessary) the value TIMER2_TOP to run timer 1 at about 3200Hz instead of 62.5kHz.

4. Also change the code to put timer 1 in phase-correct PWM mode and use ICR1 to define the TOP value of 3. Set OCR1A to 1 and OCR1B to 2. Set the COM1A and COM2A bits to generate PWM on OC1B and inverted PWM on OC1A. This will give you antiphase signals on OC1A and OC1B to drive the rotor.

5. Optionally, change the code to read all 10 bits from the ADC instead of just 8.

Then use the phaseAverage variable as the reading.
« Last Edit: December 08, 2013, 03:51:49 am by dc42 » Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi again! I have not been in the shop much between Christmas/New Years and the crazy cold weather here (my "shop" is in my garage...for now). I just wanted to thank you for posting your project, I will definitely be digging into it now. Tonight I wired up a more organized breadboard for my synchro experiments and explored this control transformer synchro and the resolver a bit more (using my old rectifier approach for now). I now realize I *must* do wave form analysis to get correct absolute angular position info. I am also trying to figure out how the control transformer uses a 3-phase signal on its stator to get position info from its 1-phase rotor. I may have better luck applying an AC voltage to the rotor and reading the disparate voltages from each stage of the stator (like a traditional torque transmitter synchro)...except then I have to boost the supply voltage to overcome the higher impedance of the rotor. Interesting stuff.........

On a not-quite-related note, I did get sidetracked just a bit finishing up another Arduino project: I finally got serious and figured out how to drive the 35-dot character LED displays I pulled from an old aviation Loran, woohoo!  They use an onboard 28bit shift register and column strobing, which was new to me. I even wrote a program that allows me to "design" fonts, and then spit out the code to send to the shift register to display that character. Now I need to make time to re-implement (in Python) the software of the Trimble GPS that I pulled from my Sabreliner (uses the same LED matrices, so I can gut the GPS and drive it with an Arduino). Fun stuff!
Logged

Pages: [1]   Go Up
Jump to: