Resistence's voltage control

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
AndreaLB
Level 1
Level 1
10 replies posted 10 sign-ins 5 replies posted

Hi,

I have one component composed of a resistence connected to ground and in series to an inductor. My object is to control the voltage of a resistence.  What i planned to do is to read the voltage from the resistence and use an ADC with 12 bit of resolution to convert this value. Then, this output should be compared whit a costant digital valure by means of a digital comparator. If the value of resistence's voltage is higher than digital constant value, the pin connected to the inductor (Pin_2) goes to zero (0 V) and if the voltage is lower than constant digital value the inductor's pin (Pin_2) goes to 1 (5V).I wanna know if this method permits to control the voltage properly. Also, what i noticed is that for low value of the digital constant ( max 800) the control seems to work. For all higher value, the resistence's voltage is 0,85V. Why does this happen?

I attached a screenshoot of the components for sake of clarity.

Thanks.

0 Likes
1 Solution
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

Andrea,

Thank you for the schematic.  This helps.

Is the voltage reading at digit control set point > 800 of 0,85V read from a DMM?

I see a potential issue in reading your R_1 voltage using a DMM.

The circuit you have created is a potential oscillating circuit due to your feedback of the voltage on R_1 controlling the source voltage to L_1.

Here the sequence I see as the oscillation:

  1. The circuit first powers up Pin_2 is 0V.
  2. You start the ADC_1.  This provides a ADC reading of R_1.
  3. The initial voltage across R_1 is 0V.   Pin_2 is now on providing ~ 5V.
  4. The inductor L_1 resists passing current quickly.  This is the normal property of an inductor. (The current lags the voltage).
  5. Eventually (in time) the inductor will allow the maximum current to flow.  I(L_1) = V(Pin_2)/(R_1 + R(L_1))
  6. I am assuming that the series  resistance of the inductor [R(L_1)] is significantly lower than R_1. [R(L_1) << R_1]
  7. Eventually (in time) the voltage across R_1 will try to get to ~5V.
  8. This will cause the digital ADC threshold to be crossed and then Pin_2 will be turned off (=0V)
  9. The stored current in L_1 will degrade quickly and then the voltage across R_1 will reduce below the digital threshold.  This will turn ON Pin_2.
  10. Steps 4 through 9 will repeat causing the oscillation.

This oscillation can be seen as an averaged DC value with most DMMs.

Another issue I see is that quickly switching off the power to L_1 may cause a high voltage transient across L_1 which might be destructive to Pin_2 and/or the input "VOLT".

In the picture below, I have modified your schematic to include a diode across the inductor (D_1).  This should protect the VOLT input and Pin_2 output.

Len_CONSULTRON_0-1628695716022.png

 

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

0 Likes
16 Replies
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

Andrea,

Thank you for the schematic.  This helps.

Is the voltage reading at digit control set point > 800 of 0,85V read from a DMM?

I see a potential issue in reading your R_1 voltage using a DMM.

The circuit you have created is a potential oscillating circuit due to your feedback of the voltage on R_1 controlling the source voltage to L_1.

Here the sequence I see as the oscillation:

  1. The circuit first powers up Pin_2 is 0V.
  2. You start the ADC_1.  This provides a ADC reading of R_1.
  3. The initial voltage across R_1 is 0V.   Pin_2 is now on providing ~ 5V.
  4. The inductor L_1 resists passing current quickly.  This is the normal property of an inductor. (The current lags the voltage).
  5. Eventually (in time) the inductor will allow the maximum current to flow.  I(L_1) = V(Pin_2)/(R_1 + R(L_1))
  6. I am assuming that the series  resistance of the inductor [R(L_1)] is significantly lower than R_1. [R(L_1) << R_1]
  7. Eventually (in time) the voltage across R_1 will try to get to ~5V.
  8. This will cause the digital ADC threshold to be crossed and then Pin_2 will be turned off (=0V)
  9. The stored current in L_1 will degrade quickly and then the voltage across R_1 will reduce below the digital threshold.  This will turn ON Pin_2.
  10. Steps 4 through 9 will repeat causing the oscillation.

This oscillation can be seen as an averaged DC value with most DMMs.

Another issue I see is that quickly switching off the power to L_1 may cause a high voltage transient across L_1 which might be destructive to Pin_2 and/or the input "VOLT".

In the picture below, I have modified your schematic to include a diode across the inductor (D_1).  This should protect the VOLT input and Pin_2 output.

Len_CONSULTRON_0-1628695716022.png

 

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Thanks for the reply.

That's exactly what i planned to do. Yes, i read the resistence's voltage with a DMM. What could be the issue with the voltage reading with DMM?. I still not seeing that.

0 Likes

AndreaLB,

A capacitor across R2 would be appropriate. Pin_2 should be in Open drain, drives high configuration. The ADC has >1us lag, so LC values must be high enough to make at least 10us rise time.

     The circuit of this type called a hysteretic control. It is typically build using a fast voltage comparator instead of ADC. Consider that option

 

0 Likes
lock attach
Attachments are accessible only for community members.

Thanks for the reply.

I can't modify my scheme, so i can't add a capacitor. I tried to use a fast voltage comparator like you said. I used a DAC with initial value as a voltage reference. It seems to work with certain voltage. For voltage higher than 1,5V, DMM read a lower voltage than the reference. This problem can be related to the need of a capacitor?

I attach a scheme's screenshot.

0 Likes

AndreaLB,

What is the purpose of this circuit? Note that the digital pin can source only 4mA max, so not much current can be obtained from such DC-DC converter. Even an Opamp can source more current (20mA), so a simple VDAC8+Opamp will be better.

      If you already made a PCB, a capacitor may be placed on top of a resistor R2

 

0 Likes

Thanks for the reply.

My resistor has 1,8k ohm. What i want to do is to prevent the current accross the resistor to be higher than 2mA. So what i did was to calculate what voltage must have my resistor (V=RI=1,8K*2m=3,6V). So, i was going to control the voltage in the resistence with the digital comparator or a voltage comparator. Can i do that without adding a capacitor?.

0 Likes

AndreaLB,

Are you trying to make a 2mA current source?

0 Likes

No, Just make sure that current is not higher than 2mA.

0 Likes

Just use an IDAC8 or VDAC8 to set output current /voltage.

 

I also recommend this video tutorial on buck voltage regulator

0 Likes
lock attach
Attachments are accessible only for community members.

Hi,

With this method i wouldn't use the inductor, right? I'll explain clearer. This study is for an univerisity work. They asked me to use the psoc to control the resistence's current. For this goal, i must use the ADC. I attached the current's function that i want to get. To do that, i need to use the inductor.

 

0 Likes

Please study the video I provided in previous message. Particularly first part covering theory of operation. The approach used in the video uses more gentle control, varying the PWM duty cycle, which can operate slower, since it is not blasting the inductor with all Vdd full time.

   The SerialPlot chart indicates that voltage is jumping all over the scale. It happens too quickly, probably at <1usec timescale, so all you see is a random values. The ADC response is 1us at best, it is too slow to control feedback. You must add a capacitor of sufficient value, start with 1-10uF. You must use oscilloscope to do this kind of research. Note that SerialPlot is 100 times slower than the feedback loop. It slows down feedback so it becomes unusable. You should try to turn UART off.

0 Likes
lock attach
Attachments are accessible only for community members.

Hi

I attached the project of the serial plot which we talked about in private message.

 

0 Likes

Andrea,

Most DMMs use an low-pass input filter (usually a small cap) and multi-sample averaging (this is to make the reading more stable and consistent if noise is present.

If the signal is bouncing from 0 to 5V, your 0,85V that you read may be a kind of average of the oscillation.

The best means is to use an oscilloscope to see the actual signal.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Thanks for the reply.

I don't have a oscilloscope. I tried to use Serialplot but i can't use that. Anyway, can this be a solution to see the actual segnal?

0 Likes

Andrea,

If you use the DC voltage of the DMM, you will get an averaged value.

If you use the AC voltage of the DMM, you will see an approximate RMS reading of the signal.  If you read 0V, then the signal is near constant.  Any value more than 0V represents the switching.

The period of resonance frequency will be at most the time of your SAR sampling rate.

Why aren't you able to use SerialPlot?

If you can use it, I would use the Delta_sigma ADC at a sampling rate about 10X the sampling rate of your SAR.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
lock attach
Attachments are accessible only for community members.

Hi,

I attached a scheme. Do you mean something like this? If so, i got two problem. The first one is that i can't get a sampling rate of the delta ADC about 10X of the sampling rate of the SAR because of the limitation on the clock  frequency ( It must be between 1 and 16Mhz) and the range of SPS. The second one is related to the serial plot. I attached a plot of the voltage of the resistence. I don't understand if this plot is the true voltage dynamic or i just messed up with settings.

0 Likes