Quantcast

Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: Digging into the VA7 MD1/VA0~1.8 MD2 Circuit: LM324 Cross-over Distortion and Squeaks

  1. #1
    Outrunner Eep386's Avatar
    Join Date
    Sep 2014
    Location
    Not far from Sacramento
    Posts
    535
    Rep Power
    19

    Default Outdated post, see linked post.

    Please see http://www.sega-16.com/forum/showthr...-how-to-fix-it for a much better write-up on the phenomenon of crossover distortion on LM324 and LM358 type op-amps. Yes, I still provide instructions on where to place resistors on the VA0~1.8's existing op-amps.

    No, don't use the MC3403, I later discovered it had a *lot* of issues, such as not really being able to output a lot of current, not having quite enough gain bandwidth to do a good job as a pre-amp, plus it's no better than an LM324 on noise.
    Last edited by Eep386; 09-20-2019 at 04:15 PM. Reason: outdated, better explanation in a later post anyway

  2. #2
    Hedgehog-in-Training Hedgehog-in-TrainingSports Talker JamesF's Avatar
    Join Date
    Sep 2017
    Posts
    49
    Rep Power
    0

    Default

    Great write-up.

    I wonder if only the pull-down resistor and the cap will be enough to fix the "bad" models with stock opamps.
    Sega Genesis Model1 VA6, Model2 VA4|VA3, Mega Everdrive X5

  3. #3
    Hedgehog-in-Training Hedgehog-in-TrainingSports Talker
    Join Date
    Sep 2015
    Posts
    40
    Rep Power
    0

    Default

    Quote Originally Posted by Eep386 View Post
    There are two ways to fix this: we could re-bias the outputs of the amps into Class-A by adding pull-up resistors to pins 1 and 7 of IC9, and pins 7, 8 and 14 of IC10, but this will also result in increased DC offset in the output which is undesirable. A much better approach which avoids DC bias problems, is to replace the op-amps with MC3403s ...
    Hi,
    why do you say an increased DC offset is undesirable?
    The coupling capacitors will remove it for us. Is the required offset too large, does something saturate?

    Using different opamps is a viable fix but replacing the onboard parts requires money, tools and modder's work hours.
    This isn't something for the average Mega Drive owner.
    I want to spend more effort on the resistor biasing idea, hopefully producing a fix anyone can do.
    It doesn't have to sound like a Mega Amp either. As long as it fixes the worst issues, I think it's good

  4. #4
    Outrunner Eep386's Avatar
    Join Date
    Sep 2014
    Location
    Not far from Sacramento
    Posts
    535
    Rep Power
    19

    Default

    The DC offset issue is mainly of concern here as it can cause two undesirable things:
    1. It can make it so that op-amps down the line saturate more readily, requiring further rework to the circuit to correct it. I've spent HOURS chasing saturation problems, so this is of primary importance to me.
    2. For those recording sounds from the actual hardware, it will require a DC offset correction algorithm to be applied to the captured sound to avoid making loud 'pop' noises when playback begins and ends. The DC offset correction may affect the quality of the recorded sound in some cases. The coupling caps don't always effectively remove this offset, as my own recordings have shown.

    It might be possible to try to minimize DC offset by using pull-down resistors instead of pull-ups.
    Last edited by Eep386; 09-20-2019 at 04:13 PM.

  5. #5
    Hedgehog-in-Training Hedgehog-in-TrainingSports Talker
    Join Date
    Sep 2015
    Posts
    40
    Rep Power
    0

    Default

    Have you tried increasing the coupling capacitor size?

  6. #6
    Outrunner Eep386's Avatar
    Join Date
    Sep 2014
    Location
    Not far from Sacramento
    Posts
    535
    Rep Power
    19

    Default

    No, I haven't yet...

    Well, I decided to put the LM324's back in place (albeit with a 2.5v voltage reference going into the non-inverting Positive inputs) to test out the pull-down resistors, and disconnected the 10K resistors that connect Stereo Left and Stereo Right into the mono mixing op-amp (yes, I terminated that op-amp afterward by removing CE11 and replacing R81 with a jumper - NEVER EVER leave unused op-amps unterminated!).

    And yup, 4.7K pull-down resistors placed between the output pins of IC10 (8 and 14 - don't touch pin 1, that's NOT an audio output) and ground completely got rid of the crossover distortion on that amp, but I still got gross crossover distortion from the LM324 at IC9.

    I then put 4.7K resistors on all four output pins on IC9, but got a weird oscillation: the sound would get more muffled the louder it was. Looking closer, I then realized Sega used unity-gain buffers for the ASIC FM pre-amps, so the 4.7K resistor trick isn't going to work on those. (At least, not with 4.7K resistors - damn my lack of a scope!) So I removed the pull-downs I put on the output pins of IC9, and replaced the LM324 there with an MC33079 I pulled off a crappy old SB Live! PCI card. No more cross-over distortion anywhere. In fact, after removing C20 and C22, and applying 180pF caps at C21 and C23 and 4700pF caps at C56 and C58, the dern thing sounds immensely better. o_O Apparently a Class-A-ified LM324 at IC10 does a pretty good job keeping up with the 33079 at IC9. Not a hint of crackle, chirping or squeaking at all. It's still a little hissy, but nowhere near as bad as it was before.

    So to summarize, this means now that only one op-amp has to be changed instead of two, meaning a rough halving of BOM by using two 4.7K 0805 SMD resistors instead of a second op-amp. We still add 10uF capacitors right before R22 and R24, cut the 2V Vref trace feeding the positive non-inverting inputs of IC9 and IC10, add 10K resistors between pins 4 and 5, and 10 and 11, to create a 2.5V VRef for the amps. We leave the LM324/C324G/BA10324 at IC10 but add 4.7K pull-down resistors to pins 8 and 14. We replace IC9 with a TL074 or (if you're lucky to have one lying about) an MC33074/MC33079. As the mono mixing circuit injects a nasty high-pass effect, the tap resistors at R77 and R78 should be disconnected, the resistor at R81 replaced with a jumper and CE11 removed. This gets rid of the high-pass effect, but also gets rid of the mono output. (Big deal I suppose... though it might not be so good if I wind up with a mono-only, RF-only TV down the line. I wonder if a Y-cable adapter thingy would work in lieu of a dedicated mono output?)

    A picture of what I did to IC10:
    IMG_0423.JPG

    And now for my work on IC9:
    IMG_0424.JPG

    And because I removed the 10K resistors at R78 and R77 to remove the mono amp, I also removed CE11:
    IMG_0425.JPG
    Last edited by Eep386; 11-17-2017 at 03:48 AM.

  7. #7
    Mastering your Systems Shining Hero TmEE's Avatar
    Join Date
    Oct 2007
    Location
    Estonia, Rapla City
    Age
    30
    Posts
    10,093
    Rep Power
    110

    Default

    The best thing you can do is simply increasing power rails and creating a proper Vref to match. What comes out the RGB encoder is full of garbage and isn't even half the power supply level, leading to greatly reduced headroom.
    Increasing power rails will also take care of most of the clipping issue the stock circuit has, normal levels only clip lightly but any louder games will clip very badly. Reducing gain in the later stages can also help with that though, and will bring down some of the noise aswell. Using the DC input as supply and 5V as bias point will pretty much double existing headroom. Getting rid of the garbage opamps is also very much a requirement, though you want to keep one for reset generation because most opamps are not able to work near GND while the stock ones can.
    Death To MP3, :3
    Mida sa loed ? Nagunii aru ei saa "Gnirts test is a shit" New and growing website of total jawusumness !
    If any of my images in my posts no longer work you can find them in "FileDen Dump" on my site ^

  8. #8
    WCPO Agent roadkill's Avatar
    Join Date
    Apr 2014
    Location
    Pennsylvania, USA
    Age
    31
    Posts
    902
    Rep Power
    15

    Default

    After testing out soo many Model 2s that have horrid sound, trying out the VA7 after a while just recently didn't sound so bad to me compared to all the even worse Model 2s. Nonetheless nice research.

  9. #9
    Hedgehog-in-Training Hedgehog-in-TrainingSports Talker
    Join Date
    Sep 2015
    Posts
    40
    Rep Power
    0

    Default

    Quote Originally Posted by TmEE View Post
    The best thing you can do is simply increasing power rails and creating a proper Vref to match.
    Could you clarify this a bit? Power rails means the supply to me, so 5V and ground.
    I imagine you mean something with R72 and R73 though?
    There are several games that easily max out the working range. Some of those arcade to Genesis conversion sound tests are constantly in clipping mode.

    I don't have a replacement opamp for IC9 but I did the 2.5V VRef modification and used 4.7k pulldowns on IC10.
    This sounds fine and looks reasonable on the scope
    Disconnecting the mono amp made a big difference as well.

    Is there a good sound test to use? Something to create single sine waves with?
    Last edited by rama2; 11-19-2017 at 11:40 AM.

  10. #10
    Outrunner Eep386's Avatar
    Join Date
    Sep 2014
    Location
    Not far from Sacramento
    Posts
    535
    Rep Power
    19

    Default

    @TmEE I 100% agree with you on Sega's notion of using the RGB encoder's regulator as a voltage reference! That was unbelievably stupid on their part! Though personally I don't think it's necessary to change Vcc, only the VRef: the LM324 running on 5v Vcc with a 1/2 Vcc / 2.5V VRef (gained by putting 10K resistors on pins 4-5 and 10-11 of IC10, after cutting the trace feeding pin 5) doesn't clip at all, once the cross-over distortion is dealt with.

    The stickler here is IC9: though we can put pull-downs on the side where the FM (coming out of the other side), PSG and 32X audio mixes in, the other side is used as unity-gain buffers / Sallen-Key lowpass filters for the FM so we can't simply just put 4.7K pull-down resistors on those. Replacing IC9 with a TL074 or better works just fine without having to add any resistors though, so long as we're using a minimum 2.5V VRef. So we only have to replace one op-amp, IC9. The mono mixing circuit is also at fault too - I'd just as soon disconnect the mono mixing resistor taps, terminate the mono amp and use a Y-cable if I want mono sound.

    It seems to be wise practice to bias VRef (the voltage going into the noninverting inputs) to about 1/2 Vcc - Sega was just being unbelievably silly, running a nice long antenna lead to the encoder, when two resistors between Vcc and Ground would have done far better.

    I should also mention that the FM will still distort until 10uF caps are added before R22 and R24. JamesF ran a Spice simulation and discovered that Sega really should have added those caps. My own tests verify this too - after adding those caps and doing all I mentioned earlier, it sounds clear and undistorted. Even Comix Zone in all its loudness can't get the remaining LM324 to clip, once that cross-over distortion is done with.

    @rama2 I believe he was talking about Vcc (5V) and Ground when he mentioned power rails. Sega by default supplied 2V as a voltage reference to the LM324s on the board, powered more or less directly from the RGB encoder (dumb idea, as TmEE said) but obviously this is nowhere near sufficient for acceptable sound quality.

    As for a game that outputs a pure sine - huh, that's gonna be tough. The closest I can think of, is taking the Hospital song from Beavis and Butthead, and disabling everything except that really low hanging bass note. An Everdrive with a VGM player might be needed for that though.
    Last edited by Eep386; 11-19-2017 at 02:16 PM. Reason: tl;dr killing (derp)

  11. #11
    Hedgehog-in-Training Hedgehog-in-TrainingSports Talker JamesF's Avatar
    Join Date
    Sep 2017
    Posts
    49
    Rep Power
    0

    Default

    Quote Originally Posted by Eep386 View Post
    As for a game that outputs a pure sine
    http://www.alyjameslab.com/download.html
    YM2612 Instrument Editor - Sega Genesis - Megadrive ROM

    Use this Manual to understand the functions: http://www.alyjameslab.com/alyjameslabfmdrive.html
    FMDRIVE YM2612 USER MANUAL V1
    Pages 15-16 (envelope) and 21-22 (algorithms).

    Have fun.


    EDIT:
    editor.png

    Algorithm 7 makes all 4 oscillators in parallel so you can combine oscillators for max volume (headroom testing).
    I usually disable 3 and leave 1 for scoping.
    TL=0 max oscillator volume.
    MUL is the multiplier of the base note (A-4).
    Read pages 15-16 of the manual carefully.

    Or just set it as in the image and scope away!
    Last edited by JamesF; 11-19-2017 at 03:36 PM.
    Sega Genesis Model1 VA6, Model2 VA4|VA3, Mega Everdrive X5

  12. #12
    Mastering your Systems Shining Hero TmEE's Avatar
    Join Date
    Oct 2007
    Location
    Estonia, Rapla City
    Age
    30
    Posts
    10,093
    Rep Power
    110

    Default

    Algo7 + TL0 on all ops results in clipping of that particular channel. Single operator at TL0 will reach maximum level of the channel so you shouldn't use any more ops if you want a clean signal out that channel. To make YM output max level you simply make all 6 channels use one op at TL0.
    once you do that you'll easily see how the second stage will clip really really badly, and why gain should be reduced there, or power rails increased.

    Another thing to consider is that YM outputs channels one by one and that means ultrasonic components up to even 1MHz range. That amount of bandwidth is devastating for the first stage as the opamps just run out of gain and produce far more distortion than an opamp with several MHz worth of bandwidth.

    Using 2.5V VREF will go a long way but in no way fixes the headroom problem, 5V is not enough to achieve ideal no-clip in any circumstance scenario. once 32X and MCD are in the mix the limited headroom will really show the problem.

    It should be noted that I do not have a schematic at hand to know what all the modifications listed in this thread do due to missing part indexes.
    Death To MP3, :3
    Mida sa loed ? Nagunii aru ei saa "Gnirts test is a shit" New and growing website of total jawusumness !
    If any of my images in my posts no longer work you can find them in "FileDen Dump" on my site ^

  13. #13
    Outrunner Eep386's Avatar
    Join Date
    Sep 2014
    Location
    Not far from Sacramento
    Posts
    535
    Rep Power
    19

    Default

    How about we try adding 68pF active low-pass filter caps to this part, to hard-limit said bandwidth to about 49.8 kHz:
    Bandwidth Limiter.jpg

    Basically we add these caps between pins 1 and 2, and pins 6 and 7 of IC9. With 68pF and the existing 47k Ohm resistors, we'd get 49.8 kHz bandwidth limit for the FM, PSG and 32X. OPN2 FM's sampling rate is ~51 kHz, but it's not like anything over 44 KHz coming out of the FM chip is particularly desirable anyway. In any case this should be sufficient to prevent ultrasonic artifacts from saturating the first stage. If you're worried about this creating a 'second order' filter effect, you can try pushing the corner frequency to 56 kHz using specialty 60pF capacitors. I suggested 68pF as they are a common (aka. cheap in quantity) value.

    Odds are, in order to properly fix the mono mixer, we'll have to relocate the Sega CD outputs to this stage anyway, at the expense of expansion slot audio pass-through. I did try relocating the mono circuit's 10K resistor taps to right after the caps at CE7 and CE9 and before the gain resistors at R42 and R44 on the VA1.8, and that completely eliminated the high-pass filter effect, but then Sega CD audio won't be mixed into mono out. A better fix would be to have both channels of a dual op-amp like a 4558 handle the mono mixing at its original position - this way we can retain the expansion slot pass-through and have Sega CD audio mixed through mono as well, without having to relocate anything.

    I just tested this with 82pF caps (used 82pF because I don't have 68pFs on hand), it sounds pretty good so far. Comix Zone is abusing it with super high volume levels, and absolutely no clipping whatsoever. I did replace IC9 with an MC33079 earlier (16 MHz GBW, 7 V/uS slew rate, 4.5 nV noise) though; IC10 is an LM324 with the 4.7K pull-downs placed on its output pins (except pin 1 of course).
    Last edited by Eep386; 11-20-2017 at 04:15 PM.

  14. #14
    Outrunner Eep386's Avatar
    Join Date
    Sep 2014
    Location
    Not far from Sacramento
    Posts
    535
    Rep Power
    19

    Default

    The output stage uses pretty low impedance (7.5K) for both the gain resistors and feedback, and the gain factor for the FM+PSG+32X and Sega CD inputs is all set at 1. This leaves us with several options:
    1. Try a gain factor of 0.5 on the output amp, which will make the sound MUCH quieter (not particularly desirable)
    2. Try higher-impedance resistors on the secondary while retaining the gain factor of 1; Sega used 20K resistors (with 40K gain resistors) on the stereo outputs of the 315-5684. This may help prevent it from saturating but make it noisier due to the effect of nyquist noise, unless we use expensive low-noise resistors. This will also require us to re-calculate the low-pass filtering capacitors: the existing 5600pF with 20K gain resistors will give a much too low 1.42 kHz corner, but 1800pF caps will give a rather pleasant 4.48 kHz corner. Another option is 2200pF, which will give a 3.61 kHz corner, close to the VA2 Model 1.

    Also, the MC3403 apparently can swing to ground in single-supply applications. To me, this makes the MC3403 a perfect replacement for the LM324 at IC10, as it performs slightly better (1 V/uS slew vs. 0.5 V/uS slew for the 324), does everything we need it to do here, and doesn't have nearly so severe cross-over distortion.
    Last edited by Eep386; 11-26-2017 at 12:53 PM.

  15. #15
    Hedgehog-in-Training Hedgehog-in-TrainingSports Talker
    Join Date
    Sep 2015
    Posts
    40
    Rep Power
    0

    Default

    Great development here!
    I wish I had more time to spend on this. It'll be a great learning experience on opamps in practice.

    Thanks for the schematics and for linking the perfect sound generator tool, as well!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •