Author Topic: 14.4V ground reference for ADC  (Read 14865 times)

0 Members and 1 Guest are viewing this topic.

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20357
  • Country: gb
  • 0999
Re: 14.4V ground reference for ADC
« Reply #25 on: May 19, 2019, 07:44:43 pm »
That won't work. A µC is too slow to react to load changes plus the conversion and communication time of the ADC. Contrary to what youtube channels like Great Scott say using a microcontroller inside such a critically fast control loop does not work.

You could even use the LM358 to measure you current sense resistor now that you have it but specific chips for this job which are essentially a special purpose opamp cost pence/cents.

So what type of voltage regulator is this? what is doing the power control?
The problem with the LM358 is its common mode range does not extend to its positive rail.

An op-amp with inputs which do work up to the positive supply can be used with a transistor to amplify and level shift the signal to the 0V rail.

https://www.analog.com/en/analog-dialogue/articles/high-side-current-sensing-wide-dynamic-range.html

Yea, it can only go to within 1.5V of the positive rail so a voltage divider would be required each side. You loose a small bit of the 1V range but it can be made to work on the budget. there is already a current sense in the circuit that can be used for what the OP wants.
Yes, but accuracy will be poor.

Another option would be to use an op-amp with P-JFET inputs, which will work up to the positive rail and be fine with a total supply voltage of over 15V, thus eliminating the zener diode. The trouble is cheap P-JFET op-amps tend to have a fairly high offset error: 3mV for the TL082, although that can be nulled out. Further cost cutting could be achieved by using a BJT, rather than a MOSFET, at the expense of reduced accuracy, although that could be mitigated somewhat by using one with a high hFE, such as the BC560C.
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 18118
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: 14.4V ground reference for ADC
« Reply #26 on: May 19, 2019, 08:03:15 pm »
Oh I am sure there are more suitable parts than the LM358, i was just trying to explain that what he is trying to do is far harder work that using what he already has to do something better. He wants to drop up to 1V on the shunt resistor, 1.5V on 18V does not require too much of a loss in that range. The circuit he has posted already has a current shunt amplifier. To be honest i am confused as to what he is trying to do here.
 
The following users thanked this post: Arjunan M R

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20357
  • Country: gb
  • 0999
Re: 14.4V ground reference for ADC
« Reply #27 on: May 19, 2019, 10:02:48 pm »
Oh, I think I know what you meant now. Were you talking about the standard differential amplifier configuration?

https://en.wikipedia.org/wiki/Differential_amplifier#Operational_amplifier_as_differential_amplifier

Yes, that should work well enough, as long as a the resistors are fairly well matched and the gain isn't too high, so the inputs remain within the common mode range of the amplifier. The voltage across R1 and R2 must be under 1.5V, which would limit the gain to a maximum of (18-1.5)/1.5 = 11, with a supply voltage of 18V, but at lower supply voltages, the maximum gain will be less.

Another issue with the LM358 is it doesn't have a true negative rail output. Its output is pulled low by a current sink and will not go near 0V, unless the output is sinking a tiny current, so R1 + RF will need to be quite large: over 1M for <18μA of output current sunk would be ideal.
 

Offline Arjunan M RTopic starter

  • Regular Contributor
  • *
  • Posts: 236
  • Country: in
Re: 14.4V ground reference for ADC
« Reply #28 on: May 20, 2019, 03:09:29 am »
Here is the circuit i am using to regulate voltage and controlling the current.Please have a look at it and if you spot any error please notify me.
The dumb thing about this is I don't need that precise 12 bit DAC .But i just used it because it is under my budget. :-//
Because Dave used it in his microsupply(REV A).
So i was sure it will work and I don't haveto respin the pcb.
It is non functional. For example because all opamps are powered from 5V. EDIT: Nope, not all (point stands) powered from 5V but why in the hell would you note +18 V as VCC?  :-//.
+18V is regulated to +5V using L7805.Because +18V is the common supply voltage for everything in this schematic I noted +18V as VCC as I said this is not the full schematic.
 

Offline Arjunan M RTopic starter

  • Regular Contributor
  • *
  • Posts: 236
  • Country: in
Re: 14.4V ground reference for ADC
« Reply #29 on: May 20, 2019, 03:16:36 am »
Well there is already a current sense circuit there, you just need to connect your ADC input to that. You have an independant voltage regulator LT3080 so I'm not sure what your trying to do.
Yes you are right.I will change the circuit.I will connect the ADC input to the current sense amp output so i can get rid of that 14.4V GND REF.It was a differential ADC so I thought i can just measure across that shunt :-DD |O.
 

Offline Arjunan M RTopic starter

  • Regular Contributor
  • *
  • Posts: 236
  • Country: in
Re: 14.4V ground reference for ADC
« Reply #30 on: May 20, 2019, 03:18:12 am »
If i do that I can get rid of that 1 \$\Omega\$ and go to milliohms. ;D
 

Offline Arjunan M RTopic starter

  • Regular Contributor
  • *
  • Posts: 236
  • Country: in
Re: 14.4V ground reference for ADC
« Reply #31 on: May 20, 2019, 03:24:14 am »
Oh I am sure there are more suitable parts than the LM358, i was just trying to explain that what he is trying to do is far harder work that using what he already has to do something better. He wants to drop up to 1V on the shunt resistor, 1.5V on 18V does not require too much of a loss in that range. The circuit he has posted already has a current shunt amplifier. To be honest i am confused as to what he is trying to do here.
Yes you are right I am over complicating everything myself |O.I will measure the output of the current sense  amp using ADC so i can get rid of that GND REF.If i do that i can  use shunt with lower resistance.So higher efficiency :D :-+.
 

Offline Arjunan M RTopic starter

  • Regular Contributor
  • *
  • Posts: 236
  • Country: in
Re: 14.4V ground reference for ADC
« Reply #32 on: May 20, 2019, 03:33:47 am »
hahaha, i had not noticed. I say again to the OP, if your a programmer start on something simpler......
Yes i need to start on something simpler.But I decided to built this because i don't have a PSU and i needed one and i thought  i can  build one myself.Yes there are cheaper PSU s than my whole project costs and with more power(mine is only 18W) but they don't have that much precision.
 

Offline Arjunan M RTopic starter

  • Regular Contributor
  • *
  • Posts: 236
  • Country: in
Re: 14.4V ground reference for ADC
« Reply #33 on: May 20, 2019, 03:45:20 am »
Here is the full schematic.Note that i recently changed the MCU and didn't connect all the connections.
I have made some changes now.Written on black is net labels.
 

Offline Arjunan M RTopic starter

  • Regular Contributor
  • *
  • Posts: 236
  • Country: in
Re: 14.4V ground reference for ADC
« Reply #34 on: May 20, 2019, 03:47:22 am »
Here is the image of the full schematic.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 17952
  • Country: lv
Re: 14.4V ground reference for ADC
« Reply #35 on: May 20, 2019, 03:54:58 am »
Because +18V is the common supply voltage for everything in this schematic I noted +18V as VCC as I said this is not the full schematic.
VCC is not common voltage. It literally means "Voltage Collector Collector" and was used for describing positive supply of logic/digital ICs. Modern digital ICs no longer use BJT transistors but MOSFETs so it became VDD (Voltage Drain Drain) but VCC is still commonly used along with latter. Naming 18V supply as VCC is counterproductive, especially if other people will see your circuits.
« Last Edit: May 20, 2019, 04:06:24 am by wraper »
 
The following users thanked this post: Arjunan M R

Offline Arjunan M RTopic starter

  • Regular Contributor
  • *
  • Posts: 236
  • Country: in
Re: 14.4V ground reference for ADC
« Reply #36 on: May 20, 2019, 04:00:38 am »
Because +18V is the common supply voltage for everything in this schematic I noted +18V as VCC as I said this is not the full schematic.
VCC is not common voltage. It literally means "voltage common collector" and was used for describing positive supply of logic/digital ICs. Modern digital ICs no longer use BJT transistors but MOSFETs so it became VDD (Voltage Drain Drain) but VCC is still commonly used along with latter. Naming 18V supply as VCC is counterproductive, especially if other people will see your circuits.
Sorry I don't know that :(.so I will rename 18V as +18V and 5V as VCC :D
« Last Edit: May 20, 2019, 05:52:00 am by Arjunan M R »
 

Offline Arjunan M RTopic starter

  • Regular Contributor
  • *
  • Posts: 236
  • Country: in
Re: 14.4V ground reference for ADC
« Reply #37 on: May 20, 2019, 05:44:51 am »
The nice thing about the current sense amp(LT6105) is that its common mode input voltage can be higher
than its supply voltage. :-+
« Last Edit: May 20, 2019, 05:50:27 am by Arjunan M R »
 

Offline Arjunan M RTopic starter

  • Regular Contributor
  • *
  • Posts: 236
  • Country: in
Re: 14.4V ground reference for ADC
« Reply #38 on: May 20, 2019, 06:05:01 am »
Right I decided to use a 100m \$\Omega\$ 25W 1% current shunt. :D
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 18118
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: 14.4V ground reference for ADC
« Reply #39 on: May 20, 2019, 06:28:25 am »
The nice thing about the current sense amp(LT6105) is that its common mode input voltage can be higher
than its supply voltage. :-+

That is the whole point of using a current sensing amp like I was trying to explain. While they are opamps they are specifically designed to do this will do what a regular opamp will not.
 
The following users thanked this post: Arjunan M R

Offline Arjunan M RTopic starter

  • Regular Contributor
  • *
  • Posts: 236
  • Country: in
Re: 14.4V ground reference for ADC
« Reply #40 on: May 20, 2019, 06:30:35 am »
The nice thing about the current sense amp(LT6105) is that its common mode input voltage can be higher
than its supply voltage. :-+

That is the whole point of using a current sensing amp like I was trying to explain. While they are opamps they are specifically designed to do this will do what a regular opamp will not.
:D :-+
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 18118
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: 14.4V ground reference for ADC
« Reply #41 on: May 20, 2019, 06:33:49 am »
hahaha, i had not noticed. I say again to the OP, if your a programmer start on something simpler......
Yes i need to start on something simpler.But I decided to built this because i don't have a PSU and i needed one and i thought  i can  build one myself.Yes there are cheaper PSU s than my whole project costs and with more power(mine is only 18W) but they don't have that much precision.

You have the LT3080 regulator in your schematic. that is all you need for a basic PSU.
 

Offline Arjunan M RTopic starter

  • Regular Contributor
  • *
  • Posts: 236
  • Country: in
Re: 14.4V ground reference for ADC
« Reply #42 on: May 20, 2019, 06:36:38 am »
hahaha, i had not noticed. I say again to the OP, if your a programmer start on something simpler......
Yes i need to start on something simpler.But I decided to built this because i don't have a PSU and i needed one and i thought  i can  build one myself.Yes there are cheaper PSU s than my whole project costs and with more power(mine is only 18W) but they don't have that much precision.
You have the LT3080 regulator in your schematic. that is all you need for a basic PSU.
I dont want just voltage regulation i also want constant current output to make sure my circuits don't blow up as i constantly makes mistakes :-DD |O
« Last Edit: May 20, 2019, 06:38:17 am by Arjunan M R »
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 18118
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: 14.4V ground reference for ADC
« Reply #43 on: May 20, 2019, 06:59:31 am »
Well.... you have the current sense amp and the LM358. i am not an opamp wiz but I think that if you connect the LM358 as a non inverting opamp with a little gain I think so that at full voltage drop on the sense resistor for 1A you have 18V out. Then connect a potentiometer to the inverting input of the LM358 so that you control the offset. Then connect the voltage setting resistor of the LT3080 to the output of the LM358 instead of ground. This way solong as the voltage from the current sense amplifier is less than the voltage on the inverting input to the LM358 the output of the LM328 will pull the voltage setting resistor to ground allowing full voltage. As the current rises and the voltage from the current sense amp increases above the set threshold on the -input of the LM358 the output of the LM358 will rise which will reduce the current in the voltage setting resistor of the LT3080 because there is less voltage difference across it and the voltage will "fold" to maintain the current.

Your valtage regulation will change by putting the LM358 into the voltage setting because it has some voltage dro so you need to experiment.
 
The following users thanked this post: Arjunan M R

Offline Arjunan M RTopic starter

  • Regular Contributor
  • *
  • Posts: 236
  • Country: in
Re: 14.4V ground reference for ADC
« Reply #44 on: May 20, 2019, 07:10:28 am »
Well.... you have the current sense amp and the LM358. i am not an opamp wiz but I think that if you connect the LM358 as a non inverting opamp with a little gain I think so that at full voltage drop on the sense resistor for 1A you have 18V out. Then connect a potentiometer to the inverting input of the LM358 so that you control the offset. Then connect the voltage setting resistor of the LT3080 to the output of the LM358 instead of ground. This way solong as the voltage from the current sense amplifier is less than the voltage on the inverting input to the LM358 the output of the LM328 will pull the voltage setting resistor to ground allowing full voltage. As the current rises and the voltage from the current sense amp increases above the set threshold on the -input of the LM358 the output of the LM358 will rise which will reduce the current in the voltage setting resistor of the LT3080 because there is less voltage difference across it and the voltage will "fold" to maintain the current.

Your valtage regulation will change by putting the LM358 into the voltage setting because it has some voltage dro so you need to experiment.
No i am not doing it this way i am using a rotary encoder to set both voltage and current thats the main purpose of MCU . Using a pot. you cant accurately set the current. In my circuit i also have an lcd to display set and out I and V.And an opamp to set the current  like shown in the schematic.The non inverting input of the opamp will be connected to output of the current sense amp and inverting input to the DAC(MCP4922 has 2 channels).So I can set the current using the DAC.

Note that i recently changed the MCU and didn't connect it
« Last Edit: May 20, 2019, 07:25:28 am by Arjunan M R »
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 18118
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: 14.4V ground reference for ADC
« Reply #45 on: May 20, 2019, 07:41:47 am »
Well you can still do the current limit my way just use a low pass filtereid PWM to set the threshold voltage. I fact you can also do the same to the mosfet you are controlling to control the voltage setting or your DAC. But like I say you just want to get going so keep it simple first.
 
The following users thanked this post: Arjunan M R

Offline Arjunan M RTopic starter

  • Regular Contributor
  • *
  • Posts: 236
  • Country: in
Re: 14.4V ground reference for ADC
« Reply #46 on: May 20, 2019, 09:09:54 am »
Well you can still do the current limit my way just use a low pass filtereid PWM to set the threshold voltage. I fact you can also do the same to the mosfet you are controlling to control the voltage setting or your DAC. But like I say you just want to get going so keep it simple first.
I don't want to go in trouble finding the value of the capacitor and resistor and the pwm frequency of the MCU. I will stick with DAC . It will be much more simpler for me.
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 18118
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: 14.4V ground reference for ADC
« Reply #47 on: May 20, 2019, 11:41:27 am »

I don't want to go in trouble finding the value of the capacitor and resistor and the pwm frequency of the MCU. I will stick with DAC . It will be much more simpler for me.


If you can't do that then you are wasting your time with electronics, it's a free DAC and you are budget constrained yet you are using all of the over the top expensive solutions. What you want to do is feasible provided you do not put anything digihal in a regulation feedback loop. Current limiting you may get away with but there will be a delay.
 
The following users thanked this post: Arjunan M R

Offline Arjunan M RTopic starter

  • Regular Contributor
  • *
  • Posts: 236
  • Country: in
Re: 14.4V ground reference for ADC
« Reply #48 on: May 20, 2019, 12:07:42 pm »

I don't want to go in trouble finding the value of the capacitor and resistor and the pwm frequency of the MCU. I will stick with DAC . It will be much more simpler for me.


If you can't do that then you are wasting your time with electronics, it's a free DAC and you are budget constrained yet you are using all of the over the top expensive solutions. What you want to do is feasible provided you do not put anything digihal in a regulation feedback loop. Current limiting you may get away with but there will be a delay.
I can use a PWM but is there any advatage over a DAC (because i already ordered it |O |O |O |O |O )
Mainly i am concerned with PWM because i don't have a scope to see the output of the DAC  .So if any issues were found  :-BROKE i can't fix it thats why i said i will stick with DAC. What delay are you talking about.The DAC is just setting the voltage at the inverting input of the opamp. The DAC's output will only change when we set the current. It doesnt  change when the max. current limit is reached.When the max current limit is reached the output of the current limit opamp will go high and the mosfet will turn on and it will pull the set pin to ground.The DAC is not in the feedback loop.So i don't expect any delay.
 

This is the feedback loop i think
 

Offline Arjunan M RTopic starter

  • Regular Contributor
  • *
  • Posts: 236
  • Country: in
Re: 14.4V ground reference for ADC
« Reply #49 on: May 20, 2019, 12:09:40 pm »
Then how is the DAC on the feedback loop  :o
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf