Old oscope V preamps recycling - Page 1
Forum section: electronics / projects

author: mushroom
author_rank: Regular Contributor
timestamp: March 16, 2015, 12:18:46 am
content: Hello,Last week was a bad week. My nearly 50 years old HP 1200B oscope died on me. Really bad week : the previous day, it was my 25+ years old Fluke 12… So, I ordered (and received) a DSO.I loved this old HP oscope for two reasons. I saved it from a junkyard, and it has two *differential* inputs. This oscope was only 500 KHz BW, but perfect for audio electronics with its high sensivity : 100µV/div, and its differential inputs. It is definetly dead : fried CRT filament (not a short with the cathode, unfortunaletly…).The V preamps are modular, and could easily be reused for my new DSO.Diff inputs are very useful, for example to deal with bridged amps. I had a look to these accessories. Incredibly expensive !So, I plan to build a 2 channel active differential preamp.I did some testing on these V preamps as an exercise to learn how to use my new DSO. I got interesting results. About 5 MHz BW, and gain 1:1 when set to 0.2V/div, with 3Vpp input before clipping. But there are some problems to solve :1 - relatively high voltage needed to feed them : 2x50V2 - a huge output offset : about -20V (see schematics)The PSU and circuits seem to be in perfect shape. All measured values are still within specs, according to workshop manual.These amps are usable as is, as long as they are AC coupled. They just need an OP amp to do "A-B" for each channel. But i'd prefer DC coupling : need to offset by 21 to 22 V ; what op amps could I use ?I'd also like to make these amps 100% isolated with optocoupled outputs, in order to view and measure mains current, voltage, and cos phi, for a powermeter I'm building around an Arduino and I will have to calibrate. (but metal axles are certainly an issue !)I am not really a beginner, but I need help ! Particularly for the optocoupling. My DSO and I are too young to die...

author: moffy
author_rank: Super Contributor
timestamp: March 16, 2015, 01:46:49 am
content: 1. Your PSU issue is fairly easy, either salvage the PSU from the scope or build your own. Straight forward.2. For the differential outputs you need a suitable instrumentation amp or a pseudo instrumentation amp(composed of 3 opamps typically) with suitable bandwidth and input voltage attenuation. You'll possibly need a trim pot for offset compensation as well. This is for DC coupled.3. Adding voltage isolation is non trivial. Not sure what the best approach would be.

author: mushroom
author_rank: Regular Contributor
timestamp: March 16, 2015, 05:32:51 pm
content: Thanks for your answer.The PSU is not an issue : I have the scope PSU, and it works fine. The issue is the op amps choice : what high voltage op amp with good freq response could I use ? I can not use standard ones and dividers, as this would also reduce the signal, reduce sensivity and degrade S/N ratio.After some google-ing, I am skeptical about opto isolation : isolated amps seem to be very expensive. See Texas Instruments ISO121 : 50 USD. I think I will stick to my voltage transformer (a good brand one, not a recycled wall adapter crap), and my current transformer. The problem is calibration : needs a pure resistive load for cos(phi)=0. This load has to be 1000W, and in general, a heater is not purely resistive. (I need at least a 1000W test load).

author: LaserSteve
author_rank: Super Contributor
timestamp: March 16, 2015, 06:08:36 pm
content: If you need 1Mhz of isolation, Analog Devices makes fast Optos, and faster isolators that use magnetic or capacitive coupling.Agilent also makes fast optos, but just using a plain opto may need a feedback network using a second, series, opto for compensation.Make sure the one you select truly goes down to DC and has a good enough noise floor.Steve

author: moffy
author_rank: Super Contributor
timestamp: March 16, 2015, 11:33:04 pm
content: Quote from: mushroom on March 16, 2015, 05:32:51 pmIf you don't want to use resistive dividers, then you need to level shift from the +20v to gnd. What is the actual signal level you need to cope with?

author: mushroom
author_rank: Regular Contributor
timestamp: March 18, 2015, 01:13:46 am
content: Hello moffy,I measured again. When the preamp button is set to 0.2 V/div, output=input (gain 1:1 exactly). The signal is offsetted by -20V. It would be easy to use a 1:5 divider between the preamp outputs and the inputs of the non inverting op amps, in order to get voltages allowing the use of ordinary op amps (+-15V or +-18V supply). Doing this, I would get only 500 µV/div sensivity instead of 100µV/div. I'll have try, it is worth it : 40x better than my 20mV/div DSO... 1:5 and 1:10. 1:10 is easier to calculate when reading the scope (no 1:5 option in probe menu) !Another reason why I am thinking of high voltage op amps is that the signal can reach a maximum of 40V peak to peak if the preamp gain is set too high. There is no limitation at input, just clipping at output.

author: moffy
author_rank: Super Contributor
timestamp: March 18, 2015, 03:53:05 am
content: You could level shift by using 2 pnp transistors (BCM857) as a diff amp with emitter degenerating resistor for linearity, and a resistor/or current source. Connect the collectors to gnd through resistors and you have your output translated to gnd.

author: mushroom
author_rank: Regular Contributor
timestamp: March 25, 2015, 01:49:34 am
content: Designing a diff amp by myself is certainly too much for me !I modelized a circuit with an op amp, and Vbe multipliers that level shift the outputs. Note that the op amp *cannot* deal with +-50V (+-40V nominal). This is for Spice only. And hi voltage op amps are not really needed : more common +-15V with zener protected inputs would be sufficient, as inputs are shifted to 0V.Simulation gives a perfect result. But it is just modelization...Components prefixed "A2A1xxxx" are V preamps output components. Emitters voltage is -22.4V.Could this work, is it correct, or is such a design to be avoided ?About insulated probes, I found an interesting circuit using analog optocouplers (HCNR200) :http://kudelsko.free.fr/Isolateur_optic/Realisation/Isolateur%20page%202.pdf

author: DanielS
author_rank: Frequent Contributor
timestamp: March 25, 2015, 05:57:52 pm
content: If you need to measure line current, can use a resistive shunt to sense it and do not absolutely require an isolated measurement, you might want to consider using something like an AD629B for ~$15. Almost 100dB of common-mode rejection up to 400kHz, 270V common-mode range, 500V input protection, 0.03% gain accuracy. All it needs is +/- 15V, power decoupling capacitors, input/output connectors, the shunt resistor and that's it. Great little chip for measuring voltage across a sense resistor.I needed an instrumentation amplifier to do this sort of measurement which I could not do with any degree of satisfaction since I had tons of common-mode noise showing up when I did. I tried putting together my own using the first op-amps I could find in my parts bins, only managed ~45dB CMRR and continuously had to re-adjust zero offset due to drift, so I went through my parts bins to see if I had any better amps in there, found a few AD629, tried that, and then felt silly for wasting a day on my DIY solution when I had a single chip solution that performed 50X better with next to no effort right under my nose all along. I can't remember if I got those as free samples or on a whim for a project I ended up not doing.

author: mushroom
author_rank: Regular Contributor
timestamp: March 25, 2015, 11:48:40 pm
content: Thanks for your answer.The AD629 could drive an optocoupler... I prefer galvanic isolation ! Too risky for the new oscope. I never did this sort of measurement directly on line current, but I can do some testing with an isolation transformer (made of two : 230->15->15->230)At the begining, I wanted to reuse the old oscope preamps, and add isolation. Now I am sure it is not feasible : metal everywhere (potentiometers axles and switches, and it cannot be solved).Next week end, I will test the Vbe multiplier shifter. No idea of the results... What do you think about this circuit ?I come back to electronics after nearly 25 years without doing/reading anything ! I come back because of Arduinos.

author: mushroom
author_rank: Regular Contributor
timestamp: March 28, 2015, 02:10:22 am
content: I tested the Vbe multiplier as voltage shifter (30x 0.7V). Results are disappointing because of thermal drift. It takes time to "stabilize" after power on, and I could not get better result than +-20 or 30 mV. Blowing on the transistor changes voltage by 50 mV or so ! Usable for oscope visualization (drift cannot be seen), but not for anything else (measurements).(voltage offset at preamps outputs is rock steady : 1 or 2 mV)Is it possible to compensate this thermal behaviour ? I did not find anything with Google.Nonetheless, I will try something else : a series of 5.6V zener, with or without a Vbe multiplier. Fine adjustments could be achieved using the offset adj pot on the V preamps... I can't believe it could be worse than the previous experiments !

author: Marco
author_rank: Super Contributor
timestamp: March 28, 2015, 05:21:39 am
content: If you want to use a linear optocoupler there is no real need for a differential amplifier ... you just need an isolated supply with low capacitance (can be a battery) and a single ended amplifier. You just connect the ground for the amplifier to one point on the DUT and you probe another. The amplifier will only have a couple of pF of parasitic capacitance ... that's not going to be a significant load, especially since linear optocouplers are only useful for relatively low bandwidth.PS. when I think of a discrete differential amplifier I think something more along the line ofthis. If you are going to use transistors to buffer the input voltages it's a crying shame to still rely on matched resistor dividers to make a differential amplifier.

author: mushroom
author_rank: Regular Contributor
timestamp: March 28, 2015, 05:55:18 pm
content: At the moment, I did not learn about linear optocouplers. It seems to be the way the preamp I found is designed (see pdf above). There are two power suplies : one for the hot side, one for the cold one (it seems obvious to me). But I had a (very) quick look at the oc datasheet, and I don't really undestand the component !I just tried offseting with a 20V zener : results are better than a x30 Vbe multiplier, it still drifts, but it drifts significantly less. Now, I will test with a series of 5.6 zeners + a Vbe multiplier for fine offset ajustment. It seems to me that it is the better solution (at least thermally). Maybe, is it possible to get a nice voltage source with a good combination of zeners and Vbe multiplier that could compensate each others...I will also see if the diff amp totally or partially solve the problem with A-B math (I have NE5534's).A question : The datasheet says "NE5534 is internally optimized for gain >= 3". Do you know of an op amp optimized for 1:1 ?This is the first time I really play with measurement instruments at mV level, and I have to deal with thermal behaviour : experience level = zero (Kelvins)

author: Marco
author_rank: Super Contributor
timestamp: March 28, 2015, 10:25:59 pm
content: You really need to decide what exactly you want.If you just want to have say a +/-45V common mode range differential amplifier, then you'll need something like the mic amps from the link I posted (bootstrapped cascode or full monty, I'd use matched FETs for the inputs though ... FETS allow easy input protection, you can just put say a 270K resistor with a 10n bypass capacitor in series with the gate which together with clamping diodes means you won't blow anything by probing mains). You'll still need to refer the voltage back to ground, Moffy's idea for an extra PNP differential amplifier stage is probably the way to go.If you want an optically isolated input then something like the PDF you posted makes the most sense.If you want to measure high frequency differential signals with mains voltage range common mode then a traditional HV differential amplifier with matched/compensated resistor dividers makes the most sense.PS. I haven't tried, but the rule of thumb on the web seems to be that a 22pF capacitor as compensation will make the NE5534 unity gain stable.

author: mushroom
author_rank: Regular Contributor
timestamp: March 29, 2015, 12:00:27 am
content: Sorry for the misunderstanding. English is not my first langage.At the begining, I wanted to reuse the V preamps and build isolated diff probes with them. But safe isolation is not possible (metal axles and switches).I splitted the project in two subprojects :1 - non isolated diff amps for general use, with the old Hewlett Packard V preamps ; this is what I am currently experimenting ; I begin to get acceptable results2 - isolated diff probes for measurings on 230V mains ; 2nd project, apart from #1 : in a near future, but I record informations !I just tested a very simple circuit for the general purpose diff amps : I dropped the Vbe multipliers, replaced them with vanilla 20V zeners, wired a NE5534 to operate as a diff amp, and used the op amp offset pot. Results are not too bad. Shifters drifts don't perfectly compensate, and output constantly changes by +- a few mV (about +-5 to +- 10 max). Another problem is ringing on square signal, but it is on breadboard, with non coax wiring, no compensation, random groundings, etc. It has to be tuned.Some 500 KHz ringing appeared with the NE5534 (no comp, etc.):

author: dom0
author_rank: Super Contributor
timestamp: March 29, 2015, 12:21:27 am
content: It's way simpler to slap together a full analog frontend with a nice dual/synchronous ADC and isolate the digital signals. Especially for low bandwidth (<10 kHz) stuff like mains power analysis.The huge ringing really screems for compensation, such strong ringing (looks like 1/3 of the signal amplitude) implies strong peaking in the frequency domain and near-instability of the amplifier.

author: mushroom
author_rank: Regular Contributor
timestamp: March 29, 2015, 01:11:09 am
content: Quote from: dom0 on March 29, 2015, 12:21:27 amGreat idea !Do you think that the ATmega168 ADCs could do it ? I ask because I will soon receive two of them. (Arduino Pro Mini)One could encode, send data through an optocoupler, and the other decode and rebuild an analogue signal to PWM outputs (probably not fast enough) or digital outputs + R-2R DAC. I also have some CA3130 (single rail power supply). I know the ADCs are not synchronous (at least they have to be read one after the other), but the difference is known and can be taken into account. Same on the ouput side. It can be compensated at software level. The idea comes from there :http://openenergymonitor.org/emon/buildingblocks/explanation-of-the-phase-correction-algorithm(sampling could be much faster on the emitter side as there is no math between samples)

author: dom0
author_rank: Super Contributor
timestamp: March 29, 2015, 01:14:18 am
content: Sure, there's even an appnote about power meters using AVRs.

author: mushroom
author_rank: Regular Contributor
timestamp: March 29, 2015, 05:45:48 pm
content: I googled and found lots of examples, appnotes, etc. about isolated ADC/DACs. I also had a look at ADC ICs and found interesting information.Then, I built a R-2R ladder using 2K and 1K 1% metal film resistors, and wrote a very basic sketch for the Arduino Mega 2560 (16MHz)...Code:int sine;void setup(){pinMode(22, OUTPUT);pinMode(23, OUTPUT);pinMode(24, OUTPUT);pinMode(25, OUTPUT);pinMode(26, OUTPUT);pinMode(27, OUTPUT);pinMode(28, OUTPUT);pinMode(29, OUTPUT);for(int i=0;i<255;i++)sine=sin((i/255.0)*2.0*PI)*128.0+128.0;}void loop(){static unsigned char i = 0;digitalWrite(22, sine&B00000001);digitalWrite(23, sine&B00000010);digitalWrite(24, sine&B00000100);digitalWrite(25, sine&B00001000);digitalWrite(26, sine&B00010000);digitalWrite(27, sine&B00100000);digitalWrite(28, sine&B01000000);digitalWrite(29, sine&B10000000);i++;}With digitalWrite, the maximum freq I got is... 83 Hz ! But I get a sine (full of spikes : commutation that has to be filtered). A slow sine, but a sine... Incredibly slow sine !I am not used to code at hardware level. It would need direct pins access. To be investigated...

author: dom0
author_rank: Super Contributor
timestamp: March 29, 2015, 07:23:38 pm
content: Also you would typically use a LUT for a sine and not actually calculating it in real time (performance, code size). And, of course, write the whole port register at once and not with many function calls or many register writes.

author: mushroom
author_rank: Regular Contributor
timestamp: March 29, 2015, 09:36:59 pm
content: There is no calculation in real time : the LUT (the array *IS* a LUT) is filled once, in setup() function. (it should have been declared as unsigned char array, but it does not make any difference)This little crappy piece of code was just ran to test the ladder ! And also test the analogWrite() function : it is absolutely unusable, even for an ultra low frequency test ! Incredibly slow. digitalWrite() is definitely *NOT* usable for that. I do not know about direct port manipulations, and have to learn about. I did'nt code at hardware level since late '80 (Turbo C 1.5 and TASM, 25+ years ago). In the Arduino world, I always found people who wrote smart hi level libraries to do the hard job...As a test, and exercise, I want to copy ADC rezadings to the ladder. It will be the first step before serializing data to an optocoupler and a 2nd Arduino.Done !At first, I got strange results : the DAC seemed to be limited to 1KHz. 1KHz seemed to be related to some obscure prescaler, as analogWrite (500 KHz PWM by default). After some readings and some more testings, I discovered someone who already did exactly what I am trying to do. Why reinventing the wheel?http://www.instructables.com/id/Arduino-Audio-Input/?ALLSTEPSJust a few keystrokes, and here is the test code :Code://Audio out with 38.5kHz sampling rate and interrupts//by Amanda Ghassaei//http://www.instructables.com/id/Arduino-Audio-Input///Sept 2012/** This program is free software; you can redistribute it and/or modify* it under the terms of the GNU General Public License as published by* the Free Software Foundation; either version 3 of the License, or* (at your option) any later version.**/void setup(){for(int i=0; i<8; i++)pinMode(30+i, OUTPUT);cli();//disable interrupts//set up continuous sampling of analog pin 0//clear ADCSRA and ADCSRB registersADCSRA = 0;ADCSRB = 0;ADMUX |= (1 << REFS0); //set reference voltageADMUX |= (1 << ADLAR); //left align the ADC value- so we can read highest 8 bits from ADCH register only////////////////////////////////////////////////////////////////////////////////////////////////PRESCALERADCSRA |= (1 << 0/*ADPS2*/) | (1 << ADPS0); //set ADC clock with 32 prescaler- 16mHz/32=500kHz////////////////////////////////////////////////////////////////////////////////////////////////ADCSRA |= (1 << ADATE); //enabble auto triggerADCSRA |= (1 << ADIE); //enable interrupts when measurement completeADCSRA |= (1 << ADEN); //enable ADCADCSRA |= (1 << ADSC); //start ADC measurementssei();//enable interrupts//if you want to add other things to setup(), do it here}ISR(ADC_vect){PORTC=ADCH<<1; // magic number for test signal scaling..}void loop(){}With an even more reduced prescaler, the Mega can process 10 KHz sinus quite well. 1 or 2 KHz BW (Shanon...) will probably be enough for 50 Hz signals (it is intended to run on 8MHz MCU, and with 2 ADC + 2 R2R DAC).There will be to code a communication protocol. Probes and receiver could be connecteed via optic fiber. The ATmega168 offers 10-bit ADC ; it could be interesting to use 10 bits...The scope shows 10 KHz signals : blue = analog input from signal generator, yellow = 8-bit R2R output.Next experiments : 10 bit ADC/DAC, "probe" = Arduino Mega, "receiver" + DAC = Arduino Due (still waiting for the Pro Mini's), and UART communications.