Wednesday 17 September 2014

Tek 475 Triggering

It was the paraphase amplifiers!

Unfortunately I've not had much time to work on the old scope lately. I've been flat out with work every day and evening as well as the weekends.

So anyway - I placed an order with QService for a pair of the Tektronix custom paraphase amplifier chips and a pair of 2N4258s (NOS Tektronix parts) to replace the 2N2907 I temporarily put in the input source followers of the trigger circuits. Then I waited... and waited... and eventually my parcel turns up.

Overwhelmed with the excitement of possibly making some progress I whipped out the A trigger amplifier, stuck in the new chip (which was tricky as the pins were not as straight as I would like and the metal is very soft!) and... It worked! I have A trigger!


I replaced the B trigger chip too but still no B trigger. Oh well.

I replaced the 2N2907s and while this didn't have a huge effect I did notice it triggers off the centre of the waveform now when the trigger is in the centre.

B Trigger

So then I looked at the B Trigger in more detail. Initially I thought I might have mixed up the replacement chips but I carefully swapped the chip in the A trigger circuit and found I had exactly two (of four) that worked. So both the the paraphase amplifiers were stuffed allright.

The nice thing is that as the two trigger circuits are nearly identical so I can compare voltages and waveforms.

First off I compared the output of the amplifier (pin 8 and 9 of the chip) and noticed this seemed distorted. I figured out if I twiddled the trigger level knob far off centre I could nearly get it to look normal. I looked at the input (pin 3 and the testpoint) and it looked correct. I remembered that the source follower has to have unity gain and has a DC bias of about 0.6V and so I checked this. The gain was quite close to unity but the offset was more like 1.4V.


I spent ages looking at what could be causing the bias. The base of Q746 already had a bias so it had t be before that. It wasn't any of the resistors or capacitors around the two JFETs. There was no bias on the input to the source follower. That at least narrows it down! The voltage drop over R739 was zero so the diode wasn't leaking (it's only there to prevent big negative going signals damaging things).

The JFETs are a matched pair and have the aluminium bracket around them so they are thermally bonded (see photo below). I undid this and swapped the JFETs around and noted that then the offset changed! This shouldn't happen as the JFETs should be identical. I put each into my trusty transistor tested and both tested Ok but with a very marginal difference in characteristics. So they are no longer matched? I had some other JFETs of equivalent type from the sweep circuit work but none of these were close to a matched pair.


Back to QService again... I ordered a matched pair of these JFETs. A week and a bit later they came, I put them in and now the input source follower is working correctly - the gain is right, offset is right etc but still no B trigger!

Starting to wonder if this thing will every fully work!


Thursday 4 September 2014

Vexing C++ template issue

This is a pretty well know difference between the Visual Studio C++ compiler and GCC.

I wanted something that can clone a vector of pointers so I created

    template< class ContainerType, class ElementType >
    ContainerType *copySTLContainerPtr(
        const ContainerType *rhs )
    {
        ContainerType *returnValue = new ContainerType;

        ContainerType::const_iterator i;
        for(i=rhs->begin();i!=rhs->end();i++)
        {
            returnValue->push_back( new ElementType(*i));
        }

        return returnValue;
    }

Now this compiled just fine in Devstudio but GCC complained that const_iterator effectively didn't exist - it said it expected a ; before 'i'

Turns out that to make this work you have to say this instead

     typename ContainerType::const_iterator i;

This is pretty well documented on stack overflow here  

In honesty I've had this problem before but it took a while to dredge my memory. While searching for this I also found a really neat page describing some quite obscure C++ features includes templated template parameters, pointer to members and other cool stuff you may not have seen. Check it out here if this is of interest.