Measuring positive and negative voltages

I am powering a DC motor (up to about 15v) and recording the running voltage using a voltage divider. No problems.

I'd like to record the voltage the motor generates on the overrun when the power is cut and it turns into a generator. As this will now be negative voltage the analog pin won't read it...

My Internet searches/research indicate an op amp type of solution and also one that uses three resistors. I'd need a pretty specific example to follow for the op amp option as my analogue electronics is pretty basic.

The attempts to use the three resistor approach have not been too successful Can't seem to get the resistor values worked out properly. I also suspect that the relationship between input voltage and output signal is not linear (correct me if I'm wrong) Microcontroller Interfacing and http://e2e.ti.com/support/data_converters/precision_data_converters/f/73/t/299098.aspx show the three resistor approach.

Ideally the relationship between input and output would be linear. Also using diodes in the circuit would cause a 'deadspot' around the +0.7 -0.7v range whilst they need this voltage to start working and this is an important area for me.

I am happy to use two analog pins but an analog and digital pin for positive/negative signalling would be better as I have a shed load of digital pins but running out of analog.

I don't excpect the overrun voltage to be greater than -15v, if that.

acboother:
I'd like to record the voltage the motor generates on the overrun when the power is cut and it turns into a generator. As this will now be negative voltage the analog pin won't read it...

No it won't, it'll be positive.

I would choose the 3 resistors.

Create a mid-point with two 4k7 resistors.
Let's lift the mid-point by 1.5V for 15V battery.
The resistor from midpoint to battery would be 22k.
Measure the mid-point.

It is (very) linear.

acboother:
I'd like to record the voltage the motor generates on the overrun when the power is cut and it turns into a generator. As this will now be negative voltage the analog pin won't read it...

Are you sure it will be negative volts?

Pelle

Microcontroller Interfacing this three resistor approach works well.

Pelleplutt:

acboother:
I'd like to record the voltage the motor generates on the overrun when the power is cut and it turns into a generator. As this will now be negative voltage the analog pin won't read it...

Are you sure it will be negative volts?

Pelle

Hmmm. I see the current going negative on the overrun... I wonder now

Yes the current goes negative, that's related to torque, but voltage
is speed/direction. Google "four quadrant" ?

MarkT:
Yes the current goes negative, that's related to torque, but voltage
is speed/direction. Google "four quadrant" ?

Are you Eric P. Dollard?

Are you Eric P. Dollard?

Googled for a good laugh, thanks.

acboother:

MarkT:
Yes the current goes negative, that's related to torque, but voltage
is speed/direction. Google "four quadrant" ?

Are you Eric P. Dollard?

OK, back to DC motor basics:

V = k w (no-load voltage = motor-constant x angular velocity)
T = k I (torque = motor-constant x current)

If the angular velocity doesn't change sign the voltage won't change sign
If the torque is reversed (over-run), the current changes sign (generating
rather than motoring).

The four quadrants are the four possible sign combinations for w and I

Here I use k as the motor constant in Nm/A or V/(rad/s) - they are the same

In a real motor you have voltage lost in the winding resistance and friction
and other issues, but basically the same relationship holds.

Those equations above directly relate to the simple physics of a current-carrier
in a magnetic field at right angles.

F = B L I (force = B x length x current, B is the magnetic flux density)
V = B L v (EMF = B x length x velocity.

k, the motor constant depends on the B, L and r values (r being the radius),