Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Voltage controlled thru opamp playing up?

Status
Not open for further replies.

diagnostix

Newbie level 3
Newbie level 3
Joined
Apr 2, 2014
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
42
Hi everyone, we have a project which has the following problem. We are reducing a variable voltage on a cars sensor which ranges from 0-5v. We are using a PIC18 and MCP6004 opamp as a buffer with 56k 33n 56k 4.7n RC filters in and out. The problems we are having are:

1. At around 1.0v - 1.5v we are getting a small surge, and variable voltage which is like a pulsating surge. Beyond this voltage all seems to work fine.

2. At 0.9v instead of reducing the voltage out, what seems to be happening is the voltage in rises instead?

Has anybody an idea as to why this is, and perhaps a solution? We thought maybe it's opamp oscillation, or a feed back issue?

Hope someone can help me.

Thanks

Mike
 

Has anybody an idea as to why this is, and perhaps a solution? We thought maybe it's opamp oscillation, or a feed back issue?

Please clarify the circuit. I don't see where there should be a feedback, except input to output connection of the unity gain buffer. I further assume that you avoid direct capacitive load of the OP output.
 

Thank you for your reply.

Input channel voltage has 820k to VSS, then cleaned through 56k 33n 56k 4.7n to opamp, exit opamp thru 1k 33n to PIC, exit PWM through 820k to VDD, then 56k 33n 56k 4.7n to opamp, exit opamp through 47ohm 100n. Opamp has 100n CAP, opamp VOUT connected to VIN- directly.
 

I expect that the unwanted signal can be located in a specific part of the signal chain, input amplifier, output amplifier or digital signal processing.
 

Please clarify the circuit. I don't see where there should be a feedback, except input to output connection of the unity gain buffer. I further assume that you avoid direct capacitive load of the OP output.

Out of interest, we removed the PIC18 from the board and put jumper between voltage in and voltage out and the opamp circuit worked perfectly? We use PWM at 1250Hz. Confused.
 

Attachments

  • Scheme1.png
    Scheme1.png
    485.8 KB · Views: 114

I would primarly expect a software problem. 47 ohm isolation resistor for the output is lower than the suggested datasheet value but not much, instability with capacitive load would be the other explanation.
 

I would primarly expect a software problem. 47 ohm isolation resistor for the output is lower than the suggested datasheet value but not much, instability with capacitive load would be the other explanation.

Anything obviously wrong here?

const unsigned short VREF = 5.00;
unsigned short pwm_duty, pwm2_duty;
int res = 0, res2 = 0;
float R_IN, R_OUT, R2_IN, R2_OUT;

void main() {
ANSELA = 0; // Digital
ANSELB = 0; // Digital
ANSELC = 0; // Digital
ANSELD = 0; // Digital
C1ON_bit = 0; // Disable comparators
C2ON_bit = 0;
TRISA0_bit = 1; // RA0 pin Input
TRISA1_bit = 1; // RA1 pin Input
TRISA2_bit = 1; // RA2 pin Input
TRISA3_bit = 1; // RA3 pin Input
TRISA4_bit = 0; // RA4 pin OUTPUT
TRISD4_bit = 1; // RC4 pin Input
TRISD5_bit = 1; // RC4 pin Input
TRISD6_bit = 1; // RC6 pin Input
TRISD7_bit = 1; // RC7 pin Input
ANSELE = 0; // Configure RE pins as ANALOGUE
TRISE1_bit = 1; // Configure RE1 pin as Input for Channel 1
TRISE2_bit = 1; // Configure RE2 pin as Input for Channel 2
PORTC = 0; // set PORTC to 0
TRISC = 0; // designate PORTC pins as output
PWM1_Init(10000); // Initialize PWM1
PWM1_Start(); // Start PWM1 on Pin RC2 CH2
PWM2_Init(10000); // Initialize PWM2
PWM2_Start(); // Start PWM2 on Pin RC1 CH1
ADC_Init(); // Initialize ADC


do {

res = ADC_Get_Sample(6); // Get 10-bit results of ADconversion
R_IN = res * VREF/1024.0; // Calculate R1-IN in Volts

res2 = ADC_Get_Sample(7); // Get 10-bit results of ADconversion
R2_IN = res2 * VREF/1024.0; // Calculate 2-IN in Volts


if (RD4_bit &&RD5_bit &&RD6_bit){
R_OUT = R_IN * .82;
R2_OUT = R2_IN * .82;
}

pwm_duty = R_OUT * 51.2; // PWM Duty equals R Out x 51.2
PWM2_Set_Duty(pwm_duty); // Set PWM Duty

pwm2_duty = R2_OUT * 51.2; // PWM2 Duty equals R2 Out x 51.2
PWM1_Set_Duty(pwm2_duty); // Set PWM2 Duty

while(1);
}

Also, by removing channel 2 from the program, or also interestingly by using an external 16MHz crystal instead of the internal 16MHz osc, problem dissappears, any significance I am missing?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top