Author Topic: Variable voltage full scale ADC conditioning  (Read 6421 times)

0 Members and 1 Guest are viewing this topic.

Offline veryevilTopic starter

  • Supporter
  • ****
  • Posts: 221
  • Country: gb
Variable voltage full scale ADC conditioning
« on: March 20, 2011, 06:42:24 pm »
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
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 17941
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Variable voltage full scale ADC conditioning
« Reply #1 on: March 20, 2011, 07:00:25 pm »
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
 

Offline veryevilTopic starter

  • Supporter
  • ****
  • Posts: 221
  • Country: gb
Re: Variable voltage full scale ADC conditioning
« Reply #2 on: March 20, 2011, 08:53:11 pm »
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
 

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: Variable voltage full scale ADC conditioning
« Reply #3 on: March 20, 2011, 09:18:32 pm »
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?
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 

Offline veryevilTopic starter

  • Supporter
  • ****
  • Posts: 221
  • Country: gb
Re: Variable voltage full scale ADC conditioning
« Reply #4 on: March 20, 2011, 09:19:36 pm »
Its a DC motor.
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 17941
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Variable voltage full scale ADC conditioning
« Reply #5 on: March 20, 2011, 09:26:47 pm »
so why would you use a H bridge to run a DC motor ? aren't you supplying it with AC ?
 

Offline veryevilTopic starter

  • Supporter
  • ****
  • Posts: 221
  • Country: gb
Re: Variable voltage full scale ADC conditioning
« Reply #6 on: March 20, 2011, 09:53:13 pm »
Finally got the picture out of my scope

~50% PWM Duty Cycle


~85% PWM Duty Cycle


~20% PWM Duty Cycle
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19811
  • Country: gb
  • 0999
Re: Variable voltage full scale ADC conditioning
« Reply #7 on: March 20, 2011, 09:53:40 pm »
so why would you use a H bridge to run a DC motor ? aren't you supplying it with AC ?
An h-bridge is required to reverse a DC motor.
 

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: Variable voltage full scale ADC conditioning
« Reply #8 on: March 20, 2011, 09:57:40 pm »
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...
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 

Offline veryevilTopic starter

  • Supporter
  • ****
  • Posts: 221
  • Country: gb
Re: Variable voltage full scale ADC conditioning
« Reply #9 on: March 20, 2011, 09:58:10 pm »
so why would you use a H bridge to run a DC motor ? aren't you supplying it with AC ?

Needed to reverse and also to act as a speed controller by using PWM
 

Offline veryevilTopic starter

  • Supporter
  • ****
  • Posts: 221
  • Country: gb
Re: Variable voltage full scale ADC conditioning
« Reply #10 on: March 20, 2011, 10:19:21 pm »
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
 

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: Variable voltage full scale ADC conditioning
« Reply #11 on: March 20, 2011, 10:41:41 pm »
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.
I 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.
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 17941
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Variable voltage full scale ADC conditioning
« Reply #12 on: March 21, 2011, 06:51:36 am »
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 ?
 

Offline veryevilTopic starter

  • Supporter
  • ****
  • Posts: 221
  • Country: gb
Re: Variable voltage full scale ADC conditioning
« Reply #13 on: March 21, 2011, 07:30:48 am »
I don't need a negative supply the back EMF is positive. It is on either terminal depending on the direction.
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 17941
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Variable voltage full scale ADC conditioning
« Reply #14 on: March 21, 2011, 07:38:02 am »
oh right, that's handy, but what about when you go in the other direction ? or don't you need to measure then ?
 

Offline veryevilTopic starter

  • Supporter
  • ****
  • Posts: 221
  • Country: gb
Re: Variable voltage full scale ADC conditioning
« Reply #15 on: March 21, 2011, 07:47:09 am »
I just take the measurement from the other terminal. e.g. use two ADC inputs
 

Offline DaveW

  • Frequent Contributor
  • **
  • Posts: 284
  • Country: gb
    • WattCircuit
Re: Variable voltage full scale ADC conditioning
« Reply #16 on: March 21, 2011, 11:36:18 am »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf