tirsdag 15. januar 2019

Juno filter: cap values and expo converter musings

After spending the last few weeks experimenting with the Juno filter, I have some thoughts. It seems the exact compnent values along the signal path are not terribly important to how the filter works. A lot of the filter is tweakable as we've seen in my previous posts - the input CV ranges, the VCA gain etc.

I have tried various cap values as well, and today I made a comparison of both cap values and changes to the expo converter.

Expo converter

The expo converter core is dependent on a reference current. Right now that is set up using a 1.5MOhm resistor, but changing this does not change the output curve, it only changes WHAT linear CV gives what output.

I tried swapping for a 1MOhm resistor, and using the base octave trimmer I could still get the necessary output range. Here are the currents through a single I_abc resistor:

Using 1.5MOhm resistor, the output current is:

Full trim and 5V CV range: 3.2nA to 1.377mA
Center trimmed: 165nA to 168uA

Using 1MOhm resistor, the output current is:

Full trim and 5V CV range: 4.9nA to 1.379mA
Center trimmed: 248nA to 238uA

The center trimmed range is well within the total range independent of resistor, with room to spare for additional octaves.

Filter caps

The Juno 106 uses 240pF caps, other Roland synths use 330pF, and we use 270pF. Here are the responses to a center trimmed CV using a 1.5MOhm reference resistor:

0V = 7.7Hz
5V = 6.4kHz
10V = 42kHz

0V = 7Hz
5V = 5.7kHz
10V = 39kHz

0V = 6.1kHz
5V = 4.7kHz
10V = 34kHz

Note that at 10V all of the outputs are at their max (I_abc is 1.38mA) so tracking is off. But all filters reach well above 20kHz. If one aims for a 40k cutoff 240pF and 270pF seem equally suited.

Juno filter: VCA and Resonance CV circuit tweaking

I took a closer look at the Juno 106 circuit for VCA and Resonance CV to figure out what they did to the base-emitter voltage drop in the transistors in the circuit. While simulating it turned out that it actually uses a 10V resonance CV where I put 5V. This confirms my initial testing where I had to use 10V resonance CV to get a proper response.

Juno 106 VCA CV

Anyway, following the tuning instructions in the Juno 106 results in a response where the first 150mV of the CV does not output any I_abc current, because the transistor does not switch on until it sees a high enough voltage. This is practical as it will fully turn off the VCA. In my Xonik VCA I have assumed that 0V CV cuts off the output current, but if there are small differences in the supply lines or something we may still get a tiny output. The Juno does not have this problem because of the 'deadband'.

CV vs I_abc  (red) before calibration - notice deadband at the start of I_abc

CV vs I_abc after calibration, deadband ends at about 150mV

CV vs voltage at opamp output - notice that we get 10V at the start.

After calibrating the trimming I tested the current outputs:

max -301uA

max -205 to -356 uA depending on the trimmer.

I wanted to add a mixing point for the VCA CV. I am not quite sure how to do this on the existing design - I could possibly add a resistor to the positive input of the VCA CV op amp - so I decided to use the current converter from the Xonik VCA.

Using standard component values, I ended up with this version

which has the following params:

max -320uA

max -147 to -405

If trimming the size of the deadband is not necessary, the trimmer and 1MEG resistor may be replaced with a 1.5MEG resistor to -15V. This will give a deadband of about 150mV.

Leaving out the 1MEG resistor will give 0 current at 0V but with the possibility of a tiny current leakage, slightly turning on the VCA.

Frequency CV

I also modified the Frequency CV mixer a bit, now the trimmer lets you add or subtract up to 5.6 octaves.

As a side note, the 390k resistor to -15V adds 3.8V to the output. Switching the resistor from the trimmer from 270k to for example 150k would give the same trimability and remove the need for the 390k, but makes the trimmer slightly more sensitive.

Here is the updated circuit. I still want to add linear FM of the filter cutoff, but other than this I am getting close to a version that can be tested.

søndag 13. januar 2019

Juno filter with higher possible cutoff

While trying to find a suitable 0-5V CV filter range I discovered that my design had some unfortunate limitations.

The maximum cutoff achievable was around 16kHz. I tracked this down to two factors: The 220k resistor from the VCA-OTA output to ground and the output filter capacitor (fixed low pass filter). Removing the output cap helped a lot, but I still could not get higher than 30kHz cutoff independent of control current.

Cutoff is max 30kHz and has very poor tracking at high frequencies. Current is the total current for all four OTAs, divide by 4 to get I_abc

I still had to change the resistor, which meant I could not get proper unity amplification at 5V CV. Compensating elsewhere in the circuit (input buffer or pre-OTA) distorted the signal at my wanted 10V p.p. amplitude (while such a distortion may be desireable, I want control over it and it was not something I planned now).

I switched back to the original design with a 47k output resistor. Then I thought, I can compensate for the loss using additional output amps. I added two inverting amps (to keep the output in phase) and this worked well.

From my previous experiments I knew that I could replace the resistor-to-ground feeding a buffer, into an inverting amp with the same resistor in the feedback loop. Doing this meant I would only need a single additional opamp to get phase correction and unity gain. But doing his also had a surprising effect - distortion and cutoff was immediately improved!

Using this and a constant current input to the OTAs let me run the filter up to at least 130kHz. This is completely unrealistic though, as it would require a higher control current I_abc for the OTAs than they can handle (max is 2mA), but past 60kHz could be achievable

Max cutoff is above 130kHz (though this would break the OTAs) and tracking is near perfect.

Increasing range

I then re-added the expo converter and got a surprise/reminder. I still couldn't push the filter past 24kHz. I simply could not get a control current higher than about 760uA. After trying a few adjustments in the exponential converter itself (changing reference current and emitter resistor) I turned to my exponential converter simulator and quickly discovered the problem - the current is controlled by changing the voltage drop across the resistor connected to the OTAs control pin. The pin is always around -13.3V in the simulator, and the transistor pulls its collector further and further away from this to generate a higher and higher current. But at about one diode drop above 0V it cannot go any further, it simply cuts off.

Plotting the voltage at the right collector of circuit A shows that it cuts off above at approx 0.63mV. 
Similarly, the plot of the current running through the 18k resistor shows that it cuts off at about 860uA. Note that this is slightly higher than the 760uA of the OTA control because the voltage difference is higher (-15.6V here vs -13.9 in the OTA control)

So, to get a higher current than this, I had to reduce the resistor value (remember, U=R*I, to get a higher I from the same U, R must decrease).

Doing this let me generate up to 1.38mA, putting the cutoff close to 40kHz.

Changing to a 10k resistor increases the maximum current.

Tracking using the expo converter

CV response (0.5V/octave) using expo converter. Blue line has 18k resistor to OTAs, red has 10k and no output filter cap, and has slightly better tracking. Also note that the response is the same even if the resistor value changed, the base frequency has not moved up/down.

Note that I have NOT tried to tune tracking when using the expo converter, it is possible that one could get a lot better tracking than this by adjusting U15. It is however also possible that there is something that prevents the expo converter from getting a perfect tracking over the full frequency range.

Output lowpass filter

I've added a 22pF output filter cap in, which seems to give a cutoff around 50kHz. This affects the tracking at high frequencies a bit too, so I'll have to do some testing.

New circuit

Final notes

I do not know if changing the max cutoff frequency or the output lowpass filter affects the sound. It is possible that this messes with the Juno sound. Maybe the cutoff should not go as high (though the manual says 5-50kHz or 4-40kHz). I like try it at least. One could also squeeze out an even higher cutoff by reducing the resistor even further. The OTA control pin is at -13.3V in the simulator but it could perhaps be even lower in the circuit, but never less than the negative supply (-15V). The transistor never gets past about 0.7V. This means the overall range will be below 16V. As maximum I_abc is 2mA we COULD use an 9.1kOhm resistor and get max I_abc 1.75mA (or an 8.2kOhm and get 1.95mA, but then we are really close to the

onsdag 2. januar 2019

Breadboarding the Juno filter

Such a nice morning, checking my wirings before powering on the juno filter prototype for the first time.

tirsdag 1. januar 2019

A closer look at the responses of the jp6 filter after fixing CV and bug

To make a good state variable filter with 12/24dB HP, LP and 12dB BP I simulated the JP6 filter and tapped it at various places to look at the responses.

For my simulated circuit, setting cutoff CV to 1.35 to get results comparable to my previous erroneous circuit. Resonance CV control is still a bit wonky but now it uses an expo converter. I have set reso to 0.5V (but there is a missing current limiting resistor in the circuit) to get 13dB resonance.

24dB LP:
- Cutoff: 500Hz
- Resonance: 13dB at 1.24kHz

24dB HP:
- Cutoff 3.2kHz
- Resonance: 13.2dB at 1.4kHz

12dB LP + 12dB HP,
12dB HP + 12 dB LP
- LP cutoff: 2.6kHz
- HP cutoff: 694Hz
- Center: 1.33kHz
- 13.4dB attenuation on top
- Resonance: Top has 1.1dB amplification

12dB LP with connection to second stage
- Cutoff: 772Hz
- Base attenuation 1.44dB
- Resonance: Top has 6.6dB amplification over base at 1.25kHz, base is -13dB

12dB LP without connection to second stage
- Cutoff: 769Hz
- Base amplification 1.4dB
- Resonance: Top has 6.6dB amplification over base at 1.25Hz, base is -10dB

12dB HP with connection to second stage
- Cutoff: 2.1kHz
- Base attenuation 1.7dB
- Resonance: Top has 6.4dB amplification over base at 1.4kHz, base is -13dB

12dB HP without connection to second stage
- Cutoff: 2.1kHz
- Base amplification 1.1dB
- Resonance: Top has 6.65dB amplification over base at 1.4kHz, base is -10dB

BTW: I have found another serious issue. The cap on the output amp prevents the filter from getting a higher LP cutoff than 14k. removing it gives a cutoff of about 20kHz at most. This does not seem right compared to the promised 5-50kHz in the datasheet.

mandag 31. desember 2018

Juno/jupiter VCA and resonance CV

I just discovered something surprising.

First of all, my Juno CV runs the output VCA at very low currents, less than 0.2mA, while the LM13700 can be driven up to 2mA.

I have started researching this to see if I can change the CV to get unity gain at 5V on the JP6. For some reason I expected the control circuit to be converting a linear CV to an exponential one, because I didn't think the Juno had it in it to do this elsewhere. But it makes perfect sense I guess, this lets us generate both linear and exponential envelopes in software.

I took a closer look at the juno 106 schematics and discovered that the CV present at R37 in my schema is not 0-5V. It is actually an adjustable voltage, amplified right after the DAC. It is adjustable from min 0.2V/max 10.3V to min 0.32V/max 10.42V.

Now, this means that the max current at the control of the VCA is about 0.3mA, It is not a major change but it is something at least. And without having to worry about changing the response curve of the VCA CV control, I can change the max control current easily.

As for VCA gain adjustment, I can either chose to add a slightly higher than unity gain and adjust this in software, or add a adjustment pot. A CV summing point may be a good idea anyway

PS: Without adjustment, CV below 0.6V will give 0V out due to the diode drop of the transistor.

A closer look at responses for the Jupiter 6 filter

NB: This post was written before i discovered a missing 33k feedback resistor. Results are not correct

To make a good state variable filter with 12/24dB HP, LP and 12dB BP I simulated the JP6 filter and tapped it at various places to look at the responses.

For my simulated circuit, setting cutoff CV to 0.2V (this has nothing to do with 1V/oct CV btw, look at the circuit to see exactly how it is wired) and Resonance CV to 10V (=off, see this post for details), gives the following results:

24dB LP:
- Cutoff: 507Hz
- Resonance (3V CV): 14dB at 953Hz

24dB HP:
- Cutoff 2kHz
- Resonance (3V CV): 13.7dB at 1.05kHz

12dB HP + 12 dB LP
- LP cutoff: 1.77kHz
- HP cutoff: 574Hz
- Center: 1kHz
- 10dB attenuation on top
- Resonance (3V CV): Top has 13dB amplification

12dB LP + 12dB HP
- LP cutoff: 1.77kHz
- HP cutoff: 574Hz
- Center: 1kHz
- 10dB attenuation on top
- Resonance (3V CV): Top has 13.5dB amplification

12dB LP with connection to second stage
- Cutoff: 666Hz
- Base attenuation 1.35dB
- Resonance (3V CV): Top has 6dB amplification over base at 885Hz, base is -1.26dB

12dB LP without connection to second stage
- Cutoff: 666Hz
- Base amplification 1.6dB
- Resonance (3V CV): Top has 7dB amplification over base at 885Hz, base is 1.6dB

12dB LP with connection to second stage
- Cutoff: 1.38kHz
- Base attenuation 1.2dB
- Resonance (3V CV): Top has 6dB amplification over base at 1kHz, base is -1.18dB

12dB HP without connection to second stage
- Cutoff: 1.4kHz
- Base amplification 1.7dB
- Resonance (3V CV): Top has 7dB amplification over base at 1kHz, base is 1.7dB

søndag 30. desember 2018

Moog style ladder filter for the XM8

I have simulated a ladder filter for the XM8. It is based on various designs found around the net - I've studied the original moog circuit, the Schmitzbits one, the Yusynth one, the modified ASM-1 for emphasis voltage control and not least the Memorymoog (which is probably the source for the ASM-1) for the output VCA.

Cutoff CV is 1V/octave, using a 100k resistor to the mixing point at the negative terminal of U10. The point labeled cv in the schematics has a 0.5V/octave response, to allow 10 octaves of control using 5V CV.

U9 tunes tracking, it should be approx 18mV (17.5 - 18.2mV, depending on temperature) for a 1 octave increase.

U4 sets initial frequency (freq when CV is 0). Adjust to whatever you like.

U11 sets output symmetry.

I have suggested two alternatives for R16 and R24 - choose the one with the range you need for the input voltage. the 10Vp.p alternative will probably distort for higher amplitudes while the 20Vp.p is probably more noisy as it attenuates and amplifies more to run the core at the same amplitude.

Simulated circuit

Juno filter for the XM8

UPDATE: This filter circuit has some limitations to its maximum cutoff frequency and high frequency tracking. I will post an updated version that adresses these problems.

I have simulated a Juno filter, based on various designs found on the net. I have made a few deviations from the original Juno filter:

- Frequency tuning happens before the frequency 1V/oct mixing point. The Juno has if after, which means that chaning the tuning also changes the tracking. My change may have messed up other things, no guarantees there. My version makes it easy to set the base frequency over several octaves. NB: The resistor and pot values in my schematics may not be ideal.

- Input audio is attenuated heavily. In my simulations, anything above 1V p.p gets distorted. I have chosen to allow +/- 10V audio. R29/R30 do the attenuation, and changed values for R27 and R26 make up for it in the output stage.

- Resonance control is 0-5V but highest possible resonance equals what we would get from 10V in the juno. This corresponds to a maximum control current of 0.25mA, approximately what I found in the specs in my post about the ba662. I still need to see how this works out i practice. The control curve is different too.

- Output is now in phase with the input

- Filter has unity gain at 5V CV (or slightly above it).

- Freq CV in the schematics is 0.5V/oct to get a 10 octave range from 5V CV, the summing point has 1V/oct when using 100k input resistors.

I have suggested two alternatives for R26, R27 and R38 - choose the one with the range you need for the input voltage. the 10Vp.p alternative will probably distort for higher amplitudes while the 20Vp.p is probably more noisy as it attenuates and amplifies more to run the core at the same amplitude.

R26 may be replaced with a 100k resistor and a 200k potentiometer (for the 20Vp.p version) to be able to tune the output VCA max amplitude.

U15 adjusts tracking, U14 sets initial frequency, U16 adjusts output symmetry.

PS: The filter may be tapped after the second pole (the output of U4) for 12dB instead of 24dB response.

Simulated circuit

0 - 10V resonance (original circuit from Juno 106). 1V/step
0 - 5V resonance, modified circuit. 1V/step

Still to do: check response curve for the VCA CV.

torsdag 27. desember 2018

Filter fact

If current per Hz is constant, a doubling of current gives a tone one octave up, because it will double the frequency.

This is independent of what current gives what frequency, i.e. what cap/resistor values are used. Those are only used to set the base frequency/frequency at a given current.

The filters I've researched do not have a quite constant current/Hz ratio. It is however flat enough to use this fact even though the actual cutoff will be slightly off.

(and by frequency I mean the cutoff frequency, where attenuation is 3dB).

onsdag 26. desember 2018

Minimoog filter research

I'm trying to figure out a bit more about the minimoog filter, to be able to use it in my XM8. I've started by simulating a circuit. I first drew up the Yusynth version, but thought the results were a bit odd so I switched to the Schmitzbits one. I later realised that I probably should have used a 0-10V CV with the Yusynth one to cover the full frequency range, this worked well with the Schmitzbits one.

Anyway, first off I will have a look at the current-to-frequency ratio. Both filters are trimmable so that the initial freqyency offset may be set. To chose a sane offset I will figure out how the core responds to currents. This is the simulated circuit:

I got the following measurements. The -3dB point has been read manually by setting the CV and
running ac analysis with frequencies from 20 to 20kHz in LTSpice. I tried reading the current simultaneously but it seems to vary a bit with frequency. For consistency I did a new run with a fixed frequency of 1kHz and read the current from there.

Plotting the Hz/uA vs frequency gave this:

What we see is that the Hz/uA is a bit higher at the start and then stabilises at around 36Hz/uA (or 0.027uA per Hz).

I tried validating the results by connecting a current source to the common emitters:

Current is what I set the current source to. Expected freq is what I would get if the control current was linear and 27nA/Hz. Measured is what I got. It matches the previous measurements closely.

There is however an important weakness to my measurements. At low frequencies, there is actually a dampening for all frequencies. At 0.84uA the top of the response curve is at -10dB. Similarly, at high currents (500uA) the top is at 1.39dB. This has not been accounted for in the table above. The -3dB falloff is from the TOP of the curve for that current.

Response at 840nA

Response at 500uA

I still think we get usable results, something we can use to set a nice offset current with U3.


I was curious what would happen if I changed the cap values from Schmitz to Yusynth, i.e. 22nF to 47nF. Turns out that by doubling the capacitance, you also double the amount of current needed per Hz. Not really that surprising when you think of it at it takes twice the current to charge the cap with the same speed.

In practice, this means that by doubling the capacitance, but leaving the rest of the circuit - including the control voltage - the same, the cutoff frequency will drop by one octave - see the last column of these measured values:

I then changed the Yusynth variation to use the input/output stages from the Schmitz version to see how all the small changes affected the circuit. Here is a screenshot of the results:

and the circuits for reference:

Quite interestingly, the Yusynth version has a 5kHz cutoff at 10V CV with similar settings as the Schmitz. Tweaking U3 will change this however, for example, a wiper setting of 0.85 instead of 0.92 will result in a cutoff at 14.6kHz instead.

I noticed that I had unintentionally kept the 56k resistor from the Yusynth circuit in the output part of these. Removing it has no effect on the output.

Replacing the 27k on the input with the 10k from the yusynth on the other hand, increases the output from 1.5dB to 9.9dB. It does NOT change the frequency response however, so attenuation on the input and gain on the output will not change the measurements in this post.

Caps and resistors

In general, increasing or decreasing a capacitor value will change the absolute cutoff value a certain control current will result in. But it probably still holds true that doubling the current will double the frequency and thus give a cutoff one octave up. I assume the same is true for changing the resistors between the steps in the ladder.

The Yusynth calibration scheme tells us to make sure the base of Q16 is at 18.2mV when the CV is at 0V, and that it increases by 18.2mV for every additional volt. This is presumably similar to the 17.5mV I have written about in my doc on the exponential converter, but with a slightly different temperature (without temperature compensation, the expo converter requires 18.12mV per octave at 30 degrees celcius).

When one has this dialed in, we know that one volt increase means one octave up. We then need to set the correct starting point by adding a current, which is done using the U3 potentiometer. In other words, the 1V/oct scaling is independent of the caps and resistors used.

Tuning range

By setting the tuning pot to its extremes, we get:

Yusynth with Schmits i/o (47nF):
wiper 0, CV 10: LP: 31.2kHz (HP: 23Hz)
wiper 0, CV 0: LP: 94Hz
wiper 0.96, CV 10: LP: 94Hz
wiper 0.90, CV 0: LP: 31Hz (but with an initial 9dB attenuation)

Schmitz (22nF):
wiper 0, CV 10: LP: > 100kH (HP: 21Hz)
wiper 0, CV 0: LP: 1.1kHz
wiper 0.96, CV 10: LP: 937Hz
wiper 0.94, CV 0: LP: 37Hz (but with an initial 10dB attenuation)

CV control of the emphasis (resonance)

I originally thought about controlling the resonance using an OTA-based VCA. While googling this, I came across a circuit that appears to be from the ASM-1. Initially, I could not get it working with an LM13700 in place of a CA3080, so I started thinking about other synths with moog filter and patch storage. The Memorymoog came to mind after I failed to find the schematics for the little phatty. I found the sheet, and guess what - it is almost the exact same circuit as the ASM-1. I simulated it and it looks good. The resonance is a bit low but I need to try it in real life to see if it is sufficient.

The filter core itself has a nA per Hz of about 33nA/Hz, or 30Hz/uA. The tracking seems quite linear all the way up to around 5kHz.

There is a difference between the response curves of the minimoog and the memorymoog filters. At high frequencies, the minimoog has a HPF part as well, as high as 100Hz for the most extreme settings. This is not there on the memorymoog.

The memorymoog (right) has no visible HPF part above 20Hz

Filter for the XM8

I've tweaked the ASM-1 filter a bit, to get unity gain, 0.5V/oct response from 0 to 5V (to get 10 octaves from a 5V DAC) and a fairly high resonance. I have not yet breadboarded and tested this but it looks promising.

Suggested circuit

I also tried adding an OTA in place of the output opamp, as per the memorymoog circuit. While it works, I get massive distortion at the output, even with very low control currents. I will have to simulate this to see if it is real. The non OTA output may have to be tested to find a suitable gain too, but the values above look promising.

søndag 18. november 2018

PG-200 busy line

When building the MPG-200 for the JX-3P, I discovered that the busy line is hardwired via a pullup resistor to +5V, in effect tying it to logic high.

Because of this, I decided to ignore it altogether. But when trying to get the MPG-200 to work with the MKS-30, I discovered that this synth actually DO control the line.

So what actually happens when the busy line is pulled low?

As expected, the PG-200 does not transmit anything while the line is low. Still, I was curious what happened afterwards, when the line was released again - did the PG-200 just ignore whatever had happened during busy, did it queue up events or did it send the new stable status?

Well, a bit of both really. It keeps the last state from before it was blocked. Then, once busy is cleared, it sends first the state it had before blocking, and then the state after blocking. This happens for both switches and potentiometers.

lørdag 17. november 2018

Fooled by running status. Again and again.

The midi protocol is not very complex. But one thing keeps making me trip: Running statuses. You can send a status byte, and as long as you don't send a new status byte you may keep sending data bytes for the same status. This is very convenient when sending for example filter sweeps etc.

In my work on the MPG-200 this has made me trip several times. Because:

The source for my midi data has mostly been my Moog Little Phatty. It sends running statuses of course. But when I reboot my mpg-200 without restarting the LP or playing a note, the LP don't send the status message again, and the MPG-200, having just booted, has no way of knowing what it is receiving as it has not seen any status message. It has fooled me more than once.

Today it happened again, but in a more subtle way. I have spent the last week trying to figure out a very strange bug I noticed after a large refactoring of the MPG-200 code: After changing the CC for the filter cutoff using sysex, things worked fine when sending the correct CC from my sysex/web midi based pg-200. But after rebooting nothing worked. Sending a sysex clear memory somehow reset things and the CC started working again.

I stripped down the program to the minimum and it still happened. I discovered though, that sending a midi note on had the same effect. Today I had time to think more thoroughly about it and came to the conclusion that it could not be the part of the program that treats the received bytes, it had to happen on reception. So I hooked up my logic probe to the midi rx line and watched what came into the MPG-200.

Guess what - after a restart, the web gui, knowing nothing about the restart, did not resend the status message. That explained almost everything, I had tripped in the running status issue again. But a little more research uncovered a few other interesting things:

Sending a midi note on from the LP actually reset the running status, so the status message was sent again. This surprised me, how does the web gui know that the LP has sent a midi on? I also tried to refresh the web gui to 'restart' the midi interface, but this did NOT work, it still did not send a new status message.

Then it dawned on me. I am using the LP as my midi interface. It is the LP that holds the state, NOT the web midi adapter! So even if the web midi did restart, the LP knew it was currently sending a particular CC, and so did not resent the status - and of course sending a note on merged into the same data stream and made the LP resent the CC status later.

Oh well, I am just glad I figured this out, even though it's a bit embarrassing.

torsdag 9. august 2018

Checking the Xonik Linear VCA performance

Way back in october 2017 I did some research on the BA662 clone. To my surprise I got massive distortion when trying to get unity gain out of it. This made me fear that my Xonik Linear VCA had the same issues.

Yesterday I simulated the circuit:

At 5V CV and 5kHz sine input, I got unity gain with no visible distortion. I then doubled the frequency:

I still didn't get the kind of distortion I expected, but I got SOME distortion (see the blue graph).

Now, this isn't good. I tried both with and without the output filter cap, no change there.

I am however using LT1001 opamps in place of the TL072.

Today I breadboarded the circuit, first without the output cap. The results were very promising. I could see no visible distortion, not even at 20kHz:

Changing to a triangle wave at 40kHz showed a slight distortion at the top of the curve:

Changing again to a square wave showed severe ringing on the output:

I then added a 33pF cap:

It worked wonders for the other waveforms as well:

I then experimented with a lot of other cap values, here are some:



18pF and 10pF in parallel

22pF and 22pF in parallel

It seems that 33pF is still the best match (or 18pF + 10pF if one wants a tiny ring instead of a rounded edge). It has to be said though, that this is not a very scientific method, and it has a huge error factor in that the breadboard itself may contribute massively, making the capacitance higher than expected. 

Just to make sure that I wouldn't get a significantly better result with a lower CV and higher compensating gain, I replaced the CV resistor with 6k8 and the output gain resistor with 22k (I did however not replace the cap. The filter frequency is 1/2*PI*R*C (presumably), so in doubling the R I also halved the output frequency, leading to more rounded corners:

I only realized this right now while writing this post. Still I think the results are quite good, the selected values seem ok though I have to test with both a 33pF and a 47pF cap (specified in the circuit) on the final board to see which one is best.

Anyway, my conclusion is that the Xonik Linear VCA is still a good choice.

fredag 3. august 2018

Bootloader working!

I finally got the midi based bootloader for the mpg200 up and running. I have yet to test it with the mpg200 code but a short test program uploads fine. So happy right now :)

torsdag 2. august 2018

Summer 2018 - DAC Mux, Ring mod

Summer is always kind of productive for me. While off on summer holiday to the western parts of Norway, I get time to do some electronics work. This time I've drawn up and ordered a 16 channel sample and hold circuit (DAC mux) to replace the 32 channel one used in the prototype. This one is easier to place and makes it possible to use only 16 channels for parts of the synth.

I also did a v3 of the linear VCA. This time, as for the first version, the trimmers are off-board, but the components are placed on both sides as in v2. The whole card is sort of a double width DIL thingy with the pins for one VCA on one side and the other on the other side. I imagine it possible to place it in a socket and have other parts of the circuit below it - we'll see.

Finally, I did a ring modulator based on the one from yusynth.net, which in turn is almost entirely a copy of the one in the datasheet. This one uses a surface mount MC1496. The circuit and board are finished (but untested), including logo.

Oh, and I have written a midi/sysex-based bootloader - it's almost finished. I will feel much better if I can remotely update any MPG-200 I sell. The bootloader is very simplistic and does not have any flow control, so sysex uploading must be done through a program made by me. Still better than not being able to update at all.

onsdag 27. desember 2017

YAC, a DAC (floating point)

I started looking for Yamaha OPL2 (YM3812) and OPL3 (YMF262) chips on ebay yesterday, as I thought it would be nice to get some for future use. These vintage FM chips were everywhere in the late 80's and early 90's, particularly on Adlib and SoundBlaster sound cards.

I soon realised that one needs an additional chip - a DAC - as the chips are completely digital.

The DACs used are YM3014B for the OPL2 and YAC512 for the OPL3. Both are serial input DACs with what they call 16bit dynamic range. But they are not 16bit integer DACs. So what are they?

They are in fact floating point DACs, with one "normal" integer DAC (10bit), called the mantissa, and an exponential multiplier, the exponent, that sets the reference voltage. This is just like a floating point number which has a significand (the mantissa) and a base raised to the power of an exponent.

As the exponent changes, the width of each step of the 10bit DAC changes. This means that at the resolution is higher at the lower end of the scale, and it decreases (the step width increases) as one moves upwards.

The circuitry is presumably along the lines of this (though this patent is from 1990 and the YM3014B is much older than that), though the Yamaha datasheets call the exponential part an analog shifter:
Floating point DAC patent
The YAC512 supports two time multiplexed outputs from a single DAC through external sample and hold capacitors. The YM3014B is single channel and requires no sample and hold.

I wonder if it would be a good idea to use such a DAC for my DCO - it seems to be available for less than $1 a piece on ebay, though I'm not sure if those are fakes or not. The exponential nature of the DAC should fit an exponential scale well.

søndag 5. november 2017

JP6 vs Juno 106 filters - Hz per mA

NB: This post was written before i discovered a missing 33k feedback resistor. Results may not be correct.

I've simulated both the Juno 106 filter (with 270pF caps) and the JP6 filter in 24dB LP mode, to figure out their response - what voltage (or rather current) to frequency rate to expect.

Quite interestingly, the two implementations track each other fairly well. Both have around a 30Hz per mA or 30uA per Hz response.

EDIT 26/12-18: It seems I've messed up a bit? (0.1V / 3300Ohm ) / 4 is not 7.57mA, it's 7.57uA. Thus the response is 30Hz/uA or 30nA/Hz?

Also very interesting to note is that the response is not linear. The higher the frequency, the more current is needed for the same change in Hertz.

I measured the 3dB point at 16 selected currents:

The CV is the input to a constant current circuit. It is the voltage across a 3k3 resistor, and the resulting current (buffered to stay constant) is split between the four cells of the filters.

I selected 8 tightly spaced voltages and 8 further apart, as the lower end requires less change to double the frequency. Deltas are the difference between two measurements. F_c is the 3dB cutoff frequency point. This is a linear CV, e.g. without the exponential converter connected.

The result ended up like this:

Note that the y axis is truncated to get a better view of the effect. One would expect a linear response, but in fact, as mentioned, the Hz pr mA drops as the frequency increases. The Juno follows a sharper curve and even if it starts out higher than the JP, it drops below it at some point. In other words, the Juno linearity is worse than that of the JP.

So what does this mean? It means that the V/oct tracking of the filter is not perfect. It will be slightly more closed as one moves up the scale on the keyboard. I have read about this effect earlier, and the writer noted that it didn't seem to matter all that much. I guess a little difference is hard to hear when the base frequency changes a lot.