Generating Biphasic Signal with OpAamp - Page 1
Forum section: electronics / projects

author: A.Ersoz
author_rank: Regular Contributor
timestamp: July 09, 2019, 06:40:17 pm
content: Hello,I use TLV27L1 OpAmp in my circuit. I feed inverting and non inverting inputs with square waves. But as an output, I did not get biphasic signal. Current output of the opamp is just an monophasic sqaure waves. Do you have any idea why I miss negative phase of the signal?

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 09, 2019, 06:50:29 pm
content: Can you show your input signals ("Phase 1", "Phase 2")?

author: patrick1
author_rank: Contributor
timestamp: July 09, 2019, 06:56:50 pm
content: wow, if this is possible without playing silly buggers with the ground reference, i would like too know about this too.

author: A.Ersoz
author_rank: Regular Contributor
timestamp: July 09, 2019, 07:38:37 pm
content: Sure!

author: DaJMasta
author_rank: Super Contributor
timestamp: July 10, 2019, 08:41:22 am
content: To actually verify that your circuit isn't doing what's intended, you need to compare the two channels together on the scope - one by one doesn't show anything about their phase relative to each other, and if they're in phase and combined, your opamp should only have a standard squarewave output.I assume your intended output is a step function when the two input square waves are out of phase? Right now your circuit is configured to attenuate the noninverting input by 1/3rd and apply a gain of 2 to the inverting input signal - I don't know if this is what you actually intended since the resistors chosen are the same values for each side.

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 10, 2019, 09:06:21 am
content: Well, from the OP's schematic, it looks like a very classic opamp-based difference amplifier with a gain of 2. You should get Vout = 2. (VPhase2 - VPhase1)Back to the basics, and a tad more:https://www.analog.com/en/analog-dialogue/articles/deeper-look-into-difference-amplifiers.htmlThe OP needs to check:* VPhase2 relative to VPhase1 (is the difference really going to be negative?),* That they have indeed connected a -5V supply to the "GND" pin of the opamp,* That there is reasonable match between R23/R31, R25/R30,* That they are not expecting the unreasonable: this opamp is very slow, what's the rise and fall times of the input signals?* That the circuit is properly wired...

author: A.Ersoz
author_rank: Regular Contributor
timestamp: July 11, 2019, 04:39:20 pm
content: QuoteYes, I compared two inputs. Phase difference was generated as square wave output (see attached file).QuoteThe rising time of the input signal from phase #2 is 0.22us; The falling time of the same signal is 0.38us.The interesting is that when I solder only the OpAmp and its peripherals on different PCB, then feed phase 1, phase 2, and power signals from existing board, I can get biphasic signal (see the attachment).

author: capt bullshot
author_rank: Super Contributor
timestamp: July 11, 2019, 07:12:21 pm
content: [irony on]That's some neat photos of a nice scope. I'd like to have one of these in my lab.The schematic looks like it's made with Altium, makes me remember I've been a long time ago user of Protel.[irony off]Please add some more description to your photos, e.g. like what trace (colour) is connected to which signal, why is the blue trace set to AC and the others to DC coupling, your biphase signal on the second photo looks like AC coupled, but scope is set to DC, ... otherwise this is a nice guessing challenge.So from what I can guess, your input signals might exceed the common mode range of the OpAmp, or the OpAmp is missing its negative supply voltage.To make your difference amplifier right, you should add an capacitor of the same value as C27 from Pin 3 to AGND. Otherwise, the circuit looks OK and should do the job (even with said capacitor missing).

author: A.Ersoz
author_rank: Regular Contributor
timestamp: July 12, 2019, 04:40:07 pm
content: QuoteThe OpAmp (TLV27L1) input common voltage range is -0.2 to -6.2V. I have measured as -4.990V from negative rail and 4.979V from positive rail from the OpAmp. So I calculated common voltage range -5mV ([(V+) + (V-)] / 2). Do you think the OpAmp is not work due to out of the common voltage range? Ho can I solve this problem?

author: capt bullshot
author_rank: Super Contributor
timestamp: July 12, 2019, 05:06:37 pm
content: Looking at your circuit and the scope pictures again, I think the negative supply voltage is missing (Pin 4 of the OpAmp is at 0V, not -5V). The output swings from 0V to 5V, but doesn't swing to -5V.Your input signal is apparently too large for the set gain, but this shouldn't matter here.

author: A.Ersoz
author_rank: Regular Contributor
timestamp: July 12, 2019, 06:49:32 pm
content: But I measure many times that the OpAmp gets -5V and 5V. The interesting point is that two days ago the same circuit works properly.

author: capt bullshot
author_rank: Super Contributor
timestamp: July 12, 2019, 07:12:03 pm
content: No idea anymore.Just double check all your components and signals.

author: A.Ersoz
author_rank: Regular Contributor
timestamp: July 12, 2019, 07:24:05 pm
content: Thank you!

author: A.Ersoz
author_rank: Regular Contributor
timestamp: August 27, 2019, 01:24:02 pm
content: I fixed the problem with connecting the -5V power with a jumping cable. Because one of the IC doesn't have -5V power.I have one more question.When I measure signal after a resistor (R1=25k in TINA TI design) which at inverting input of the opamp, I get this signal which is attached to this post. But when I measure from another howland pump configuration, I didn't get same signal at same node. The measured signal is just zero. Why is that happen?

author: A.Ersoz
author_rank: Regular Contributor
timestamp: August 27, 2019, 02:04:04 pm
content: I have just solved the problem couple of minutes ago.I check one by one each of the component with a SMD tester (http://www.mastech-group.com/products.php?cate=104&PNo=76). I realized that R2 resistor value supposed to 34k but I measured 20 Ohms. So I removed the component and check the its pads. I found that there had been a short circuit between of them. When I double check the layout, GND connection makes a short circuit a trace which is connecting R2 to noninverting input of the OpAmp. Hence, I broke the trace and solder a jumping cable according schematic design.Actually I did this design with Altium. I run design rule check before the fabrication and the program didn't report any short circuit.Anyway, the problem and its solution is for your information.

author: StillTrying
author_rank: Super Contributor
timestamp: August 27, 2019, 02:14:05 pm
content: The bottom op amp needs a DC path from its +ve input to 0V.

author: A.Ersoz
author_rank: Regular Contributor
timestamp: August 28, 2019, 01:38:15 pm
content: Can you describe a little more your commentQuote?

author: A.Ersoz
author_rank: Regular Contributor
timestamp: August 28, 2019, 01:48:57 pm
content: I have one more question. How can I make biphasic signal as sharp rising and falling edge? In my signal which is attached, there is a little ramp 0 to positive and positive to negative changing?Here is my code:Code:// DAC Conversion// Output A of the DACHAL_GPIO_WritePin(DAC_SYNC_GPIO_Port, DAC_SYNC_Pin, GPIO_PIN_RESET);DACA_Buf = DAC_A_Write<<12 | testdata_out<<4;HAL_SPI_Transmit(&hspi2,(uint8_t*)&DACA_Buf,16,100);HAL_GPIO_WritePin(DAC_SYNC_GPIO_Port, DAC_SYNC_Pin, GPIO_PIN_SET);// Output B of the DACHAL_GPIO_WritePin(DAC_SYNC_GPIO_Port, DAC_SYNC_Pin, GPIO_PIN_RESET);DACB_Buf = DAC_B_Write<<12 | testdata_out<<4;HAL_SPI_Transmit(&hspi2,(uint8_t*)&DACB_Buf,16,100);HAL_GPIO_WritePin(DAC_SYNC_GPIO_Port, DAC_SYNC_Pin, GPIO_PIN_SET);// Switch 1st for supplying square signals to the inverting input of the OpampHAL_GPIO_WritePin(SW_1st_GPIO_Port, SW_1st_Pin, GPIO_PIN_SET);DWT_Delay_us(100);HAL_GPIO_WritePin(SW_1st_GPIO_Port, SW_1st_Pin, GPIO_PIN_RESET);// Switch 2nd for supplying square signals to the noninverting input of the OpampDWT_Delay_us(40);HAL_GPIO_WritePin(SW_2nd_GPIO_Port, SW_2nd_Pin, GPIO_PIN_SET);DWT_Delay_us(100);HAL_GPIO_WritePin(SW_2nd_GPIO_Port, SW_2nd_Pin, GPIO_PIN_RESET);

author: patrick1
author_rank: Contributor
timestamp: August 28, 2019, 01:56:03 pm
content: loading it, sir, would be my suggestion

author: A.Ersoz
author_rank: Regular Contributor
timestamp: August 28, 2019, 02:02:07 pm
content: Actually, I didn't understand with 'loading it'? What do you mean that?

author: schmitt trigger
author_rank: Super Contributor
timestamp: August 28, 2019, 02:04:34 pm
content: Quote from: A.Ersoz on August 28, 2019, 01:48:57 pmSlew rate limitation perhaps? Please post the opamp's data sheet.And with your scope, measure the slope of the little ramp.Lastly, Increase both the vertical sensitivity and the horizontal timebase, such that the ramp may be measured accurately.

author: A.Ersoz
author_rank: Regular Contributor
timestamp: August 28, 2019, 02:28:01 pm
content: The Opamp is TLV27L1 and its datasheet is attached.

author: StillTrying
author_rank: Super Contributor
timestamp: August 28, 2019, 03:13:38 pm
content: Quote from: A.Ersoz on August 28, 2019, 01:38:15 pmAt DC the cap C2 330nF is open circuit, and so is the op amps +ve input because of it's very high input impedance, so the voltage there just floats about, sometimes it might be floating near 0V other times it will float towards the +5 or -5V rails.A 1M resistor between the op amos +ve input and 0V would do to keep thefloating voltageclose to 0V.With 2 inputs, 2 op amps, 2 outputs, and only using 1 scope channel at a time it's impossible to work out what your trying to do.

author: A.Ersoz
author_rank: Regular Contributor
timestamp: August 28, 2019, 05:32:25 pm
content: Actually, the opamp at the bottom is connecting with a mux. So it is not floating.What do you think about the ramp of the signal in the previous post?

author: schmitt trigger
author_rank: Super Contributor
timestamp: August 28, 2019, 08:44:13 pm
content: Page 4 of the datasheet, indicates an unity gain slew rate (at 25C) of 0.06 V/usectypical.Could be a little better, could be a little worse. Nevertheless, this is one slow opamp.Also you have a cap in parallel with the feedback resistor, which would also further limit the slew rate (and no, I have not made the corner frequency calculations).Your image indicates that the slew rate is approximately 0.052 V/usec.Thus, I believe you are indeed hitting opamp slew rate limitations. You require to find a faster opamp. Use the selector data sheets from the supplier's web pages.

author: A.Ersoz
author_rank: Regular Contributor
timestamp: September 12, 2019, 09:49:48 pm
content: Thank you for your responses!I have another question. I have made up the phase 1 and 2 signals with a timer. I set the timer parameters for generating square waves with 20us pulse width. Then, I got the pulses successfully. But I didn't get the biphasic signal at the end of the opamp circuit. Do you have any idea how I can solve this problem? I have attached the input phases and output signal.Thank you!

author: StillTrying
author_rank: Super Contributor
timestamp: September 12, 2019, 10:22:39 pm
content: What happened to your other 3 scope probes?

author: MarkF
author_rank: Super Contributor
timestamp: September 12, 2019, 10:26:43 pm
content: Are you using a "single" channel scope?Nice pretty square waves. But, useless.Again, we can NOT tell anything about phase if you have separate pictures with just one signal.You can NOT see or measure phase differences if you only look at one signal at a time.You loose all phase and timing information unless you have all the signals referenced to the same time (i.e. all three signals triggered to the same time).You NEED to have all three (the two inputs and the output) signals on the scope so we can see the relative timing.

author: A.Ersoz
author_rank: Regular Contributor
timestamp: September 13, 2019, 02:25:47 pm
content: I am sorry guys for not sharing informative captures.Now I share all signals what I captured with oscilloscope. Green one is phase 1; yellow is phase 2; blue is output.

author: MarkF
author_rank: Super Contributor
timestamp: September 13, 2019, 03:48:27 pm
content: Quote from: A.Ersoz on September 12, 2019, 09:49:48 pmI don't know what you expect.You have a differential amplifier. It amplifies the differences at its inputs.Your two inputs appear to be identical. Totally in phase with one another.All you are seeing is amplified noise.