Variable voltage full scale ADC conditioning - Page 1
Forum section: electronics / projects

author: veryevil
author_rank: Unknown
timestamp: March 20, 2011, 06:42:24 pm
content: Hi, I'm making a motor controller and I would like to read the Back EMF from the motor. I have the drive circuit all designed and working but I am interested in reading the voltage on both of the motor terminals.The main difficulty is that I want to condition the high voltage from the motor down to a 0v to 5v signal to feed into a PIC. This wouldn't be a problem if I was designing this circuit to work with a fixed motor voltage e.g. 12v or 24v but I want to make this motor controller very generic and able to drive a wide range of motors.The motor controller chip I'm using allows maximum voltage of 80v so I would like to be able to have some signal conditioning before the ADC which would automatically scale the attenuation of the terminal voltages.I do not know of a circuit that will do this.I hope the EEV community can help me out with this one as currently I'm stumped.Steven

author: Simon
author_rank: Unknown
timestamp: March 20, 2011, 07:00:25 pm
content: Why do you want to "recover" the back EMP voltage/power ? I've thought of this myself before but to be honest after all of the transformations take place you may not have much left. Knowing the exact back EMF voltage will be hard as it will depend on the specific motor and drive voltage. I'd expect that the load put on it will also have an effect on the votlage. I've measured up to 400V on two 24V 11A fan motors if that is any guide. Usually back EMF is completely eliminated with a reversed diode so you also need to check that having a reversed voltage on the motor will not be an issue (it may have a breaking effect ? that will just eliminate any gain in efficiency ?).Of course the input voltage will be oposite polarity. I suppose you could use an inverter SMPS but you still need to make sure the back EMF does not go to harmful levels

author: veryevil
author_rank: Unknown
timestamp: March 20, 2011, 08:53:11 pm
content: I wish to use the back-emf as the feedback for a PI(D) controller. To allow me to maintain a constant speed under varying torque.I can already read the back-emf produced on my scope and it varies between 0v and ~23v on my 24volt motor.My H-Bridge and drive system allows me to get the back-emf just fine.I'll try to include pictures from my scope but at the minute I cannot get it working.Steven

author: scrat
author_rank: Frequent Contributor
timestamp: March 20, 2011, 09:18:32 pm
content: There are ICs called digital potentiometers, which work like a digitally programmable variable resistor, and digitally programmable Variable Gain Amplifiers (VGAs). Then you can use one of the two for letting the MCU program set the measure gain.BTW is it a DC of BLDC motor controller?

author: veryevil
author_rank: Unknown
timestamp: March 20, 2011, 09:19:36 pm
content: Its a DC motor.

author: Simon
author_rank: Unknown
timestamp: March 20, 2011, 09:26:47 pm
content: so why would you use a H bridge to run a DC motor ? aren't you supplying it with AC ?

author: veryevil
author_rank: Unknown
timestamp: March 20, 2011, 09:53:13 pm
content: Finally got the picture out of my scope~50% PWM Duty Cycle~85% PWM Duty Cycle~20% PWM Duty Cycle

author: Zero999
author_rank: Super Contributor
timestamp: March 20, 2011, 09:53:40 pm
content: Quote from: Simon on March 20, 2011, 09:26:47 pmAn h-bridge is required to reverse a DC motor.

author: scrat
author_rank: Frequent Contributor
timestamp: March 20, 2011, 09:57:40 pm
content: With an H bridge you can do the complete (4 quadrant) current control, allowing to fully exploit its capabilities (fwd/rev, fast braking).If it's a DC motor, to measure the back-EMF you must turn off the switches and wait for the current to go to zero, since otherwise the diodes are conducting and you measure the R-L drop too...

author: veryevil
author_rank: Unknown
timestamp: March 20, 2011, 09:58:10 pm
content: Quote from: Simon on March 20, 2011, 09:26:47 pmNeeded to reverse and also to act as a speed controller by using PWM

author: veryevil
author_rank: Unknown
timestamp: March 20, 2011, 10:19:21 pm
content: As the screen shots show I have the back EMf on the motor terminals I just need to find a way to read that on a 0-5v scale no matter what the motor voltage is.Cheers

author: scrat
author_rank: Frequent Contributor
timestamp: March 20, 2011, 10:41:41 pm
content: Quote from: veryevil on March 20, 2011, 10:19:21 pmI see in the figures the voltage goes away from zero (diode clamping) after a little time. However, for higher current levels and high duty-cycle values (current never reaching zero) you won't actually read the back EMF.

author: Simon
author_rank: Unknown
timestamp: March 21, 2011, 06:51:36 am
content: you will need a negative supplied circuit to measure the back EMF or find a way of reversing the polarity of the back emf. Of course having a H bridge means you could run the motor on a negative drive so that you get positive back EMF ?

author: veryevil
author_rank: Unknown
timestamp: March 21, 2011, 07:30:48 am
content: I don't need a negative supply the back EMF is positive. It is on either terminal depending on the direction.

author: Simon
author_rank: Unknown
timestamp: March 21, 2011, 07:38:02 am
content: oh right, that's handy, but what about when you go in the other direction ? or don't you need to measure then ?

author: veryevil
author_rank: Unknown
timestamp: March 21, 2011, 07:47:09 am
content: I just take the measurement from the other terminal. e.g. use two ADC inputs

author: DaveW
author_rank: Frequent Contributor
timestamp: March 21, 2011, 11:36:18 am
content: I've just been building this circuit-I've attached a pic of the circuit I'm currently using (although I've missed out the gate drive resistors and some protection)I'm simply using a passive voltage divider to scale down the 15V motor voltage to 2.5V, then using a differential amplifier, which is running off a +-2.5V supply due to a virtual ground circuit. This means that at rest the feedback is 2.5V, with 0V being full reverse and 5V being full forward, ideal if you're controlling this off a potentiometer or r/c system.Even with the freewheeling diodes you will get some voltage spikes so it's best to include some fast clamping diodes at the input of the differential amplifier.