AC-voltage measurement

Hi,

I want to measure a +/- 10V voltage with my Arduino Due. The problem is, that the input-range of the ADC is 0-3,3V.
The AC-voltage comes from a resolver. The resolver is a rotorposition-sensor of an e-motor. It gives me 2 sinusoidal signals with an +/- 10V voltage. With the phase shift of these 2 signals, I can calculate the rotorposition.

How can I realise that?

Thank you!

Are the +-10 Volt from a different battery/power supply then the supply of the Arduino ?
(voltage divider to +-1,5V, adding 1.5V from other source -> 0-3V)

Yes, the voltage comes from the resolver. Thats a different power supply.

Hi arduino13,

maybe its possible to use use a Voltagedivider e.g. with 6KOhm and 1KOhm to GND.
So you would have +-1,42V measured at the 1kOhm to GND.

If you have a second Voltage Divider at the other (2.)power supply which gives you around 1,5Volts you could connect the gnd of the first power supply with the 1,5V so you should be able to measure around 0,08-2,84 on the first Voltage divider refering to the GND of the second power supply.

Maybe try this first only with two batteries and the voltage dividers, to see if it works.

I hope my explanations are helpful.

Kind Regards
Enam

Maybe there is also an easier solution for this problem.
Do you have a datasheet of the resolver, or better a picture of how the signal looks and what you exactly need to know of the signal.

I think I did not understand what of the signal you need exactly or if its enough to know when the 0V crossing happens.

The project lxascope on Sourceforge includes a schematic for a preamplifier which translates an input range of -4 to +6V to a 3V range of an Arduino, with 1Megohm input impedance. Included is a tutorial on how the resistors were calculated to achieve the range translation. It should be easy to adapt the range to +/-10V. If you need help, use the Sourceforge mail system for contacting the author.

As you only want the phase shift and you do not want to measure the voltage I would but the signal into a transistor, with a seriese resistor and reverse bias diode for protection. Then collector to input emitter to ground and enable the internal pull ups.

Use a digital I put it is much faster then measure the phase angle.

Alternatively put the two signals into an exclusive OR gate then smooth the output, the voltage is then proportional to the phase.

I understand you need to measure the phase shift between 2 sinusoidal signals, maybe you can use or make a 0 cross detector which send a pulse when the ac voltage is 0.

You might be interested in this thread: Replacing synchros with Hall-effect absolute position sensors - Sensors - Arduino Forum. He is using an Arduino to generate the AC signal to drive a resolver, and also to measure the outputs. I have pointed him towards some code I wrote for an induction balance metal detector, which measures the phase shift of the received signal vs. the transmitted signal.

Do you know the output resistance of the resolver signal? Useful to know
before designing a voltage divider circuit.

Assuming its fairly low I'd suggest the following divider:

resolver input to 22k to ADC pin,
+3.3V to 6k8 to ADC pin,
GND to 9k1 to ADC pin.

Then 10V input gives 3.11V, 0V gives 1.60V and -10V gives 0.10V

Sorry if in some of the links above already mentioned:

For recognizing the zero crossing,
clipping diodes and a resistor for keeping the current low enough (Imax of diode @ Umax) should do the job.

edit:
Well, of course it has to look like here in the first post with an additional resisor at Vin.
Also Schottky Diodes should be used...
http://www.mikrocontroller.net/topic/78414

Sorry for not finding the right picture in the first.

Enam:
Sorry if in some of the links above already mentioned:

For recognizing the zero crossing,
clipping diodes and a resistor for keeping the current low enough (Imax of diode @ Umax) should do the job.
Clipper (electronics) - Wikipedia

edit:
Well, of course it has to look like here in the first post with an additional resisor at Vin.
Also Schottky Diodes should be used...
Klemmdiodenfunktionsweise - Mikrocontroller.net

Sorry for not finding the right picture in the first.

That's not necessarily going to work well into a digital pin, the Due requires
very fast logic edges on its inputs, a sloping waveform is going to cause all
sorts of havoc(*).

It could work for an analog pin, but its asymmetrical, the zero-point isn't nicely on
the sloping part so you'll see distorted crossing times from a pure sinewave in.

You really need a fast comparator like an LM339 with a little hysteresis feedback
and a pull-up on the output. Use a resistor divider to scale and shift the input voltage
appropriately into the range of the comparator and use an identical network to map
your AC zero volt level to the other comparator input. Result is symmetrical crossing
detection with fast edges.

(*) oscillations / multiple transitions (perhaps hundreds of them, depends on how noisy
the original signal is), high current flow through the input circuitry when the level is
mid-rail (the CMOS equivalent of shoot-through in H-bridges).

Logic signals need to be either LOW or HIGH or transitioning rapidly between those
states (for the Due which is a high speed chip, that probably means < 100ns). Arduinos
like the Uno have some hysteresis built-in to the pins input circuitry to help prevent
these issues, the Due has this only on a subset of the pins (the datasheet says which).