Monday 30 January 2017

Ramp Generator: Level Shift and Gain

Introduction

In the last blog entry I outlined the design of the ramp generator's oscillator, using the NE555 timer chip. Using a constant current source for charging the capacitor, a linear ramp was generated by the timer chip. We also noted that we need to level shift and change the range of VC1 for our use with the FG (Function Generator).

Since the entire circuit is operating from 5V, it is necessary to use a low voltage opamp. In order for the output signals to include ground and near +5V, it is necessary to use a low voltage rail-to-rail opamp. The MC33202 is a low cost opamp that will serve the purpose in this low frequency application.

The temptation to use opamps like the LM358/LM324 should be avoided since these can't go to the +5V rail. If you were determined to use these, it could be accomplished if you changed the 7805 regulator circuit to provide +6.5V (or more) because about 1.5V of headroom will be required. This can be done by adding two diodes in the ground leg of the 7805 circuit.

We'll assume the use of the MC33202 or equivalent rail-to-rail opamp and a supply of +5V. Figure 1 illustrates the circuit surrounding IC3A.

Figure 1. MC33202 Level Shift and Gain Opamp (IC3A)
The top of the pot (R15) is +5V, and the bottom of the same pot goes to ground. The middle wiper arm is adjusted to about 1/3VCC (1.67V) so that pin 2 of the opamp IC3A sees that as its reference voltage. Note that IC3A is operating in single ended mode with +5V and ground for power.

The input is VC1 from the 555 timer circuit, which is delivered through the 10k R5. With R5 and the high input impedance of IC3A in the non-inverting configuration, no disturbing effects are felt by the capacitor C1.

Level Shifting

Level shifting occurs when R15 is adjusted to match VC1 when the ramp is at its lowest point (1.67V). In this way, when VC1 and V15 (wiper) match, the output of IC3A will be ground (0V). Also, when VC1 is less than the wiper level, IC3A will also output 0V when R15 is misadjusted.

As VC1 rises above R15 (wiper), IC3A will see a rise above its comparing inverting input. This causes the IC3A output to rise also. The use of pot R15 and IC3A allows us to shift 1/3VCC down to ground level at the output. The high point of the IC3A output is determined by gain.

IC3A Gain

Normally the non-inverting opamp gain is simply determined by the formula:

Av = 1 + Rf / Rin

where:
  • Rf is the feedback resistor (R8 in figure 1)
  • Rin is the input resistor (R15 in figure 1)
  • Av is the opamp's gain
The slightly tricky part is to determine what to use for Rin in this particular circuit.

Normally, opamps are described using bipolar power supplies where you have:
  • +VCC
  • Ground
  • -VCC
and Rin is always shown with respect to ground.

It should be remembered that in bipolar supply circuits, that the ground connection is actually a low impedance path to the rails in the Thevenin sense. This allows single ended opamp circuits to work equally well as the bipolar supply circuit.

Thevenin Rin

So what is Rin in IC3A's case at pin 2? It's a little bit tricky because this first depends upon where the wiper arm of R15 is adjusted to. We know that VR15 (wiper) is adjusted to match VC1 at its minimum. VC1min should be 1/3VCC (1.67V). With R15 adjusted to match, its wiper should be at 1/3 of its range, or:

  10k / 3 => 3333 ohms

This means that the other side of the wiper has 10k - 3.333k => 6667 ohms. If we treat R15 adjusted to 1/3, then in the Thevevin sense, we need to know the parallel resistance of 3333 || 6667 ohms. This turns out to be 2.22k.

What this means is that IC3A's (-) input sees a Rin of about 2.22k.

Computing Rf

Since VC1 has a range of one third of the 5V, we know that we need a gain of 3 to maximize the output ramp range (0 to +5V). So what Rf do we need to achieve that? Some simple algebra can re-arrange the formula for gain so that we solve for Rf. But if your algebra is too rusty, you can call upon wolfram alpha to help:

Figure 2. Wolfram Alpha solves for Rf

Wolfram Alpha needs single letter variables, so we have used:
  • g = Av
  • a = Rf
  • b = Rin
  • and asked it to solve for Rf, which is a
The formula was solved as:

  Rf = Rin ( Av - 1 )

Plugging in:

  Rf = 2.22k ( 3 - 1 )
  = 4.44k

In figure 1, I chose the value 4.7k, which is the nearest E12 value for Rf. This value introduces about a 6.9% errror, which is close enough.

Once IC3A is added to the ramp generator circuit, we get the following scope trace from IC3A's output pin 1, in Figure 3:

Figure 3. Output of IC3A, with level adjusted and full gain
From the Rigol measurements, we see that the output has a minimum of 0.36V and rises to 4.76V, which represents nearly the full 5V range. We also notice that the 1/3VCC has been shifted down to the ground level (360 mV). 

Next Steps

At this point, I thought I was pretty much done. But I discovered that the Topward 8110 Function Generator requires an inverted ramp signal, if we are to generate low to high frequencies in a given sweep! Instead, the Topward generates high frequencies when the ramp was low and low frequencies at the high point!

Fortunately this isn't too much of a hardship, since we have IC3B available. This stage can invert the beautiful ramp that we have presently. That will be the topic of the next post.

Thanks for reading.




Saturday 28 January 2017

Ramp Generator: Oscillator

Background

A while back, I purchased a Topward 8110 Function Generator from eBay at a pretty good price. The unit had a dent in the front panel and was marked as needing repair.   I was able to remove and then flatten the front panel. No other physical damage was found. I did have to replace two driver transistors to get the unit working. But at the end of it all, I was pleased with the unit. Figure 1 shows the front panel.

Figure 1. Topward 8110 Function Generator
One of the reasons I wanted this unit, was that it had a VCF input (Voltage Controlled Frequency). Using a ramp signal, the FG (Function Generator) could be made to sweep a range of frequencies (1000:1 range). Using a scope, it is possible to view a filter response as the frequency is swept through its range.

Some FGs provide this sweep capability as a built-in feature. But to use the Topward 8110 in this way, I needed a ramp generator circuit. So why not build it myself?

Oscillator Design

The Topward FG accepts a range of 0 to +5V in the VCF input. So I decided that the entire circuit would run from a regulated power source of +5V.

The sweep (ramp) frequency was chosen to be under 100 Hz. It didn't need to be high and there was no reason to make it higher. The requirements so far, allowed the use of a NE555 timer and some low voltage rail-to-rail opamps.

The ramp could be generated using opamps but I settled on the 555 timer in order to keep this project simple. This would be the main generator for the whole unit. The one feature of the 555 timer that I liked is that the timing capacitor is charged and discharged within a strict range of 1/3 to 2/3 VCC. Using a +5V supply, this means that the capacitor would operate within a 1.67V to 3.33V range.

The next design problem is that normally a capacitor charges according to an exponential curve. What I needed was a linear ramp. So a constant current source for the charging circuit would be necessary. Figure 2 shows the NE555 circuit.

Figure 2. NE555 Ramp Generator

The LED1 componentwas chosen to have a forward voltage drop of about 1.2 V at about 10 mA. Red LEDs usually have some of the lowest VF values, so a red one was used. In this circuit however, the VR1 turns out to be 3.28V due to the lower current flow (VF=1.72V). It would have been best if VR1 was 2/3VCC + Vbe or higher, but I found that it worked well enough (ideally VR1 >= 3.93V). Voltage at the emitter of Q1 was measured to be 3.38V, with its base at 3.32V.

The PNP transistor Q1, combined with the LED1/R1 divider forms a simple constant current source with the caveat that some loss of linearity occurs at the top of VC1. The remainder of the 555 timer circuit is your standard astable timer configuration. The output on pin 3 will provide a square sync pulse, while the ramp signal of interest forms across C1.

Figure 3. NE555 timer signals C1, and output Pin 3.
From figure 3 you can see the square sync output on the scope channel 2, which varies between ground and about 4.57V. The signal output goes high until the capacitor starts to discharge. At the end of the discharge cycle, the sync output returns high again.

The VC1 is the sought after ramp signal. It rises after the discharge cycle completes. The ramp is very linear except perhaps at the end. Any non-linearity appears unnoticable here. On average, the ramp ranges in voltage from 1.65V to 3.32V before being discharged.

Next Objective

This circuit is not usable yet. We can't feed VC1 into the FG until we:
  1. Buffer VC1
  2. Level shift it for greater range
The charging circuit would be disrupted if we tried sending VC1 to the FG directly. It needs some kind of a buffer circuit. Further, we desire the full 0 to 5V sweep range, rather than the limited 1/3 to 2/3VCC. This will allow a greater frequency sweep.

In the next instalment, we'll design the level shift and correct the voltage range.

Thanks for reading.

Monday 2 January 2017

Panasonic SV-3700 Repair

I have this used Panasonic SV-3700 digital audio tape unit, which I've had for some time now. This was a unit that I really liked owning but the problem was that I hadn't used it in probably over a year.

The service manual is available from here: http://elektrotanya.com/panasonic_sv-3700_sm.pdf/download.html

I recently needed a source of digital audio so when I went to use it, the old adage became real - "If you don't use it, you lose it!". I could eject and insert a new tape cassette but attempting to play or record only caused the unit to stop and refuse to respond to the play/record controls. The only way I could retry was to eject and insert a tape again. And of course, I tried several other tapes with the same result.

After some sputtering and muttering, I decided to clear the workbench and see if a fix could be had. Figure 1 shows the unit opened up, with the transport unscrewed and placed sideways over a folded piece of paper to avoid short circuits. This afforded greater visibility for troubleshooting. The transport is seen in the center behind the front panel.

Figure 1. Opened Panasonic SV-3700, with transport moved for better viewing and servicing.
I was of the opinion that the belts were probably ok. After all, the transport seemed to load, unload, and rewind ok. The problem only occurred when a play or record function was selected.

With the transport repositioned so that I could better view the action of the tape as it wrapped around the heads, I noticed that the head cylinder was never spinning. Could it really be this simple?

Figure 2.  View of the head cylinder from the end of the transport.
Reaching in carefully with the unit off, I touched the cylinder on the corner between side and top, to avoid putting any oil on the head. I noticed some resistance at first as I tried to make it turn. Then it seemed to break free but still had a noticeable amount of resistance. It was time for a power on test!

I powered the unit on and loaded a tape. I set it to record and then I saw a reluctant but spinning cylinder! Shortly after, the spinning overcame all resistance and seemed to continue with a proper smooth spinning action.

Rather than buttoning up the unit right away, I chose to allow it to continue recording for an hour or so (the length of the tape). I wanted to make sure that any built-in lubricants had a chance to reach places where they were meant to be. I also wanted any current "stickiness" to be eliminated by active wear.

And then there was more..

After it successfully recorded for an hour or so, I stopped the unit and requested a full rewind. The unit surprised me by doing a slow rewind and then stopping after about 10 seconds. And then it would retry about three more times. After the third stop, it simply gave up.

This didn't look hopeful but I unloaded the tape. Then I manually turned the spindle drives back and forth with my fingers to overcome some other potential "stickage". 

I reloaded the tape but was not at first successful. Then all of a sudden during a slow rewind attempt, the spindle sped up to full speed and has worked ever since. I naturally spun the tape back and forth a few more times to make sure.

Epilogue

I have since put the unit back together and it continues to work ok (though probably needs a head cleaning). 

So if you have mechanical devices, particularly tape devices, take them for a spin today. If you don't use them, you may lose them.

Thanks for reading!