Measure reversible voltage without PD drop? - Page 1
Forum section: electronics / beginners

author: 12407622
author_rank: Contributor
timestamp: August 10, 2019, 03:21:30 am
content: Hi,I want to measure a voltage with the ADC of a micro-controller. It's easy, I just use a simple voltage divider to condition the 0-5V back EMF of a brushed DC electric motor, so I can measure and control it's speed.Okay, so I want to measure this motor's back EMF voltage when it rotates in either direction. I guess I just rectify the original +-5V back EMF signal, but that leaves me with a huge gap in the lower end of the measurement, associated with the forward voltage drop of the rectifiers. I think I'm then measuring in the range of ~1.2-5V, which won't help me at all.Any clues how I might condition the -5V to 5V back EMF voltage from the motor, so it can be accurately read by an ADC?All links and suggestions appreciated.12407622

author: ledtester
author_rank: Super Contributor
timestamp: August 10, 2019, 03:38:25 am
content: You can use an op amp to translate a -V to +V range to 0-5V.Here's a TI applications note on how to translate a -V to +V signal to 0-5V for use with an ADC:http://www.ti.com/lit/ug/tidu015/tidu015.pdf

author: 12407622
author_rank: Contributor
timestamp: August 10, 2019, 04:09:43 am
content: Thanks ledtester,Bit of study to do, but I think you've hit the nail squarely on the head.Muchly appreciated.12407622

author: 12407622
author_rank: Contributor
timestamp: August 10, 2019, 08:49:42 am
content: Urgh! Looks like I'm not out of the woods just yet.To measure the speed of my brushed DC motor, I'm to periodically, briefly disconnect it from the PWM driven H-Bridge outputs, then read the voltage generated by the still rotating motor before it slows. That leaves me no ground reference, so op-amps are (I think) out for now.I suspect I'm back to the full-wave bridge rectifier and voltage divider option, but that still leaves the rectifier's forward voltage drop...the first 1.2V of the 5V total generated (the important bit in my low speed application).Any clues on what type of diode I might use for the bridge, so that I can get the least forward voltage drop, and the least initially diminished voltage available for measurement with an ADC?...still open to other options. My knowledge of what might be available is quite limited. Maybe op-amps are still my solution, but I don't quite get how to employ one gainfully? - Oh, I feel a cluck!Thanks,12407622.

author: MosherIV
author_rank: Super Contributor
timestamp: August 10, 2019, 09:17:22 am
content: Try looking at making the ADC differential. That means the ADC measures the voltage between 2 input pins.Right now, the ADC is in absolute mode, referenced to the 0V of the circuit.In differential mode,the ADC is not referenced to 0V, hence allowing measuring between 2 inputs.Now, the ADC can measure +5V or -5V. The ADC will tell you the voltage but not the polarity.

author: nugglix
author_rank: Regular Contributor
timestamp: August 10, 2019, 09:22:06 am
content: Videos that might help:

author: ledtester
author_rank: Super Contributor
timestamp: August 10, 2019, 09:29:37 am
content: How about this:https://electronics.stackexchange.com/questions/54997/how-can-i-measure-back-emf-to-infer-the-speed-of-a-dc-motor

author: 12407622
author_rank: Contributor
timestamp: August 10, 2019, 09:42:08 am
content: Thanks nugglix, ledtester and MosherIV,That's 3 excellent avenues of enquiry, I expect I would never have found Googling about.Very greatly appreciated.Regards,12407622

author: ledtester
author_rank: Super Contributor
timestamp: August 10, 2019, 09:53:30 am
content: Here's another paper that has some interesting ideas:"Sensorless speed measurement for brushed DC motors"https://www.researchgate.net/publication/283201650_Sensorless_speed_measurement_for_brushed_DC_motors

author: 12407622
author_rank: Contributor
timestamp: August 10, 2019, 11:52:23 am
content: Quote from: MosherIV on August 10, 2019, 09:17:22 amThanks, MosherIV.You've said something that's piqued my interest, but I'm not sure I fully understand.So I find a micro-controller with a fully differential ADC. It has AN+ and AN- inputs. I connect these across the the brushed DC motor terminals, via a suitable voltage divider, and the difference between the terminal voltages may be read by a suitably referenced ADC as the motor runs down.What then happens when I want to measure the motor's terminal voltages difference, when the motor spins the other way, and now the AN- input is at a higher voltage than the AN+ input?I ask this because I'm basically clueless, and because you've mentioned something about the differential ADC being capable of measuring voltage, but not the polarity (?).Do you suppose I might alternate the AN+ and AN- input polarities to the differential amplifier without damage, and reliably get sensible conversion magnitude data as a result?TIA,12407622

author: David Hess
author_rank: Super Contributor
timestamp: August 10, 2019, 02:23:51 pm
content: If you have a second ADC channel, then add a second divider in parallel with the first divider which goes to the positive supply voltage or reference instead of ground. Now one ADC channel reads positive voltage from ground and the second ADC channel measures negative voltage from the positive supply or reference.

author: ledtester
author_rank: Super Contributor
timestamp: August 10, 2019, 02:28:07 pm
content: Differential ADCs can measure negative voltages.

author: coppice
author_rank: Super Contributor
timestamp: August 10, 2019, 02:41:51 pm
content: Quote from: ledtester on August 10, 2019, 02:28:07 pmDifferential ADCs can normally measure negative differences, but many cannot tolerate either leg falling below ground.

author: David Hess
author_rank: Super Contributor
timestamp: August 10, 2019, 03:49:12 pm
content: Quote from: coppice on August 10, 2019, 02:41:51 pmSome ADCs can measure negative voltages directly while operating only on a positive supply but few if any differential ADCs can operate this way because of input common mode limits.

author: coppice
author_rank: Super Contributor
timestamp: August 10, 2019, 04:02:41 pm
content: Quote from: David Hess on August 10, 2019, 03:49:12 pmThere are a number of ADCs designed specifically to interface to current shunts, which run from a single rail but allow the ADC input pins to go slightly below ground. Typically 0.1V, which is enough to allow a well laid out shunt circuit to function properly. Most electrical energy measurement chips have a front end like this.

author: David Hess
author_rank: Super Contributor
timestamp: August 10, 2019, 04:19:43 pm
content: Quote from: coppice on August 10, 2019, 04:02:41 pmTheLTC1609with an input range to -10 volts with only a +5 volt supply is an example of the kind of part I was referring to.But referencing the input divider to a positive voltage like the positive supply voltage or positive reference voltage allows a negative input voltage to be measured with an ADC which only accepts positive voltages. A more common way is simply to use an inverting amplifier however this requires an additional operational amplifier.

author: coppice
author_rank: Super Contributor
timestamp: August 10, 2019, 04:32:35 pm
content: Quote from: David Hess on August 10, 2019, 04:19:43 pmIt would be interesting to see how they do the input protection in that device. Its only single ended, though. Do you know what causes the common mode limits you referred to? In the sigma delta converters typically used for shunt sensors the CMRR is usually very good. It has to be when you are looking for a small differential signal from the shunt. Most use switched cap discrete time front ends, which can have an extremely good CMRR figure. Some use continuous time front ends, which are not as good, but still have a fairly respectable CMRR.

author: MosherIV
author_rank: Super Contributor
timestamp: August 10, 2019, 09:23:34 pm
content: QuoteADCs in differential mode only measure the voltage between the pins AN+ and AN-This is what I meant about voltage only but not polarity.You must always obey the input limits of the ADC device or processor ADC.The others are correct that you may not be able to put a true negative voltagr to either AN+ or AN-.If you use a pick a ADC decive/chip that allows seperate ADC Vref and ground point to the device power then you can measure true negative voltage.The other are correct.You must still obey the input limits of the device though.I believe that in differential mode, the ADC does not mind if AN1- is higher voltage than AN+The ADC should have a non signed mode and a signed (polarity) mode.Non signed mode will only tell you the voltage difference (that was the mode I was thinking about)The Signed mode will tell you the polarity of the voltage as well (I forgot this mode - though not all ADCs have this, you will need to check)Can you measure the speed and direction of a motor by measuring the motor terminal voltage?Yes. It is not simple as you are finding out.Why (how) would a motor suddenly change direction if the micro is controlling the speed and direction of the motor

author: 12407622
author_rank: Contributor
timestamp: August 11, 2019, 12:45:07 am
content: Thanks everyone for the super support.For just now I'm going to go with 2 x full-wave rectifiers (and voltage dividers) for each of the two motors, with low forward voltage drop germanium diodes. My present setup uses an 328P controller, and I can spare the requisite 2 x single-ended ADC channels for now.If there's a better choice than a commonly available 1N60P (Vf ~0.24v @ 1mA), then please lemmy know.If that doesn't give me the low rpm control needed for the application, then I'll be back for a much closer look at all the excellent links and suggestions provided. I suspect that I'll have to study op amps a little further, and implement one of these precision op amp rectifier circuits to feed my present ADCs.Sorry, I'm not too lazy to go through all contributions in full depth, just a bit dotty nowadays, and time is becoming very precious.Thank you all again, so much.12407622.

author: langwadt
author_rank: Super Contributor
timestamp: August 11, 2019, 01:51:04 am
content: Quote from: 12407622 on August 11, 2019, 12:45:07 amif everything is on the same ground you will short half the diodes. How about two diodes one from each terminal of the motor, when measuring turn on low side fet on the low voltage side

author: David Hess
author_rank: Super Contributor
timestamp: August 11, 2019, 03:43:23 am
content: Quote from: coppice on August 10, 2019, 04:32:35 pmThe first problem is that if a common junction isolated semiconductor process is used, then most or all semiconductor nodes are isolated from the substrate by a junction diode which is why no pin can be pulled negative. Older ICs sometimes had a separate substrate connection but modern parts tie the substrate to the negative most input which is usually the negative supply pin. For instance the LM317 has the substrate tied to the adjust pin and the LM337 has the substrate tied to the negative input pin. This is why these regulators have different pinouts; the center pins connect to the tabs and that is where the substrate connects.But for an input that goes to an inverting amplifier, the junction at the input after the series resistor is held at ground. Linear Technology makes some switching regulator controllers which use this method to allow feedback from negative voltages. I think some ADCs and DACs do this also.Dielectric isolated semiconductor processes avoid this problem entirely.

author: 12407622
author_rank: Contributor
timestamp: August 11, 2019, 04:10:08 am
content: Quote from: langwadt on August 11, 2019, 01:51:04 amHi langwadt,I drew it out, but can't get my head around the diode shorting you've alerted me to. Yes, I think the ground is common, at least while the H-Bridge is energised. I need to be cautious, both when the motor is driven, and disconnected and freewheeling, it sounds like?Not sure I can isolate any one leg of the H-Bridge chip I'm using, but low PD drop through 'active' rectification, by switching of an additional 'measurement' network of FETs sounds interesting.Thanks for the tips,12407622

author: digsys
author_rank: Unknown
timestamp: August 11, 2019, 06:00:31 am
content: I've used these in the past, for HV battery packs -https://datasheets.maximintegrated.com/en/ds/MAX9928-MAX9929.pdfRan multiples on isolated supplies, up to 300V. What I like about them, single FS ADC output, with a sign pin for direction. Pretty fast as well. May be useful info

author: coppice
author_rank: Super Contributor
timestamp: August 11, 2019, 10:37:40 am
content: Quote from: David Hess on August 11, 2019, 03:43:23 amIts rare for an ADC to have an actual amplifier at its input, despite them appearing in many block diagrams. Those diagrams only represent the functionality, not the implementation details.

author: Zero999
author_rank: Super Contributor
timestamp: August 11, 2019, 11:24:09 am
content: Why not simply use a differential amplifier?http://www.eetimes.com/document.asp?doc_id=1272328For a single supply application, the output can be biased, so it's centred around half the power supply voltage, say 2.5V, for a 5V supply. If the input voltage is +1V, then the output will be 2.5+1 = 3.5V and if the input voltage is -1V, then the output will be 2.5+(-1) = 1.5V.If you need to handle +/-5V, then the circuit will need to have a gain of 0.5 and the op-amp a rail-to rail output.

author: 12407622
author_rank: Contributor
timestamp: August 14, 2019, 11:06:50 am
content: Well, that worked out much easier than had been anticipated:https://youtu.be/1_PeoERrCLw12407622

author: ledtester
author_rank: Super Contributor
timestamp: August 14, 2019, 06:40:50 pm
content: Can you post a schematic of what you eventually went with?Thanks - and congratulations on getting it working!

author: 12407622
author_rank: Contributor
timestamp: August 15, 2019, 12:55:08 am
content: Quote from: ledtester on August 14, 2019, 06:40:50 pmHi ledtester,Boring old germanium diode bridge wired across the motor terminals, 10K pot from +output of that to gnd, with very tiny greencap (3mm x 8mm x 2mm) and 4V7 clamp zener from wiper output to gnd.The running motor is disabled for 2ms, each 1/12th of a second, after which period the back EMF from 2 successive measurements is averaged.Yet to be properly tuned PID does the rest. A small Kp, much larger Ki, and almost none, but some very small Kd.Sorry, a diagram would be just scribble, as I'm still recovering from an 'accident' with the hard drive I kept all those type of programs on. I hope the description was clear enough for anyone to follow.Thanks very much for your interest, and fabo suggestions, everyone.12407622

author: 12407622
author_rank: Contributor
timestamp: August 22, 2019, 08:34:23 am
content: Hi,A little larger smoothing capacitor added for better noise immunity, and a stop on collision facility added.https://youtu.be/doWnCFVbF9YCircuit attached:T.