Go Down

### Topic: AC-voltage measurement (Read 10044 times)previous topic - next topic

#### arduino13

##### Oct 25, 2013, 10:42 amLast Edit: Oct 25, 2013, 11:00 am by arduino13 Reason: 1
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!

#### Enam

#1
##### Oct 25, 2013, 12:02 pmLast Edit: Oct 25, 2013, 12:04 pm by Enam Reason: 1
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)

#### arduino13

#2
##### Oct 25, 2013, 12:12 pmLast Edit: Oct 25, 2013, 12:16 pm by arduino13 Reason: 1
Yes, the voltage comes from the resolver. Thats a different power supply.

#### Enam

#3
##### Oct 25, 2013, 04:03 pmLast Edit: Oct 25, 2013, 11:35 pm by Enam Reason: 1
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.

#### privatier

#4
##### Nov 21, 2013, 05:14 am
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.

#### Grumpy_Mike

#5
##### Nov 21, 2013, 06:37 am
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.

#### jetraid

#6
##### Dec 09, 2013, 07:00 pm
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.

#### dc42

#7
##### Dec 10, 2013, 12:32 am
You might be interested in this thread: http://forum.arduino.cc/index.php?topic=199839. 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.
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.

#### MarkT

#8
##### Dec 29, 2013, 11:20 pm
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
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

#### Enam

#9
##### Jan 05, 2014, 06:31 amLast Edit: Jan 06, 2014, 05:47 pm by Enam Reason: 1
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.
http://en.wikipedia.org/wiki/Clipper_(electronics)

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.

#### MarkT

#10
##### Jan 23, 2014, 12:56 am

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.
http://en.wikipedia.org/wiki/Clipper_(electronics)

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.

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).
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up