韓国から愛をこめたカンチョー

ちょっとガキっぽいげど、この下ネタを見逃しません:

Kancho is LOVE. カンチョーはラブである。
Kancho from the back. 後ろ。
Contrary to common design, the bag is supposed to be opened from the middle. Exactly what Kancho does! もちろん、開け口は間中です。カンチョーですから。

中身は生チョッコだから、イメージはぴったりです。

36 total views, 1 views today

EMC PCB Layout Notes

  • Implicit RLC (potentially filters) and antennas formed by traces
  • Large ground/voltage planes serves as EMI shield, low impedance path current sink
  • True differential signals can be generated by current sources
  • Decouple with ferrite beads if radiation inevitable by geometry/placement
  • Avoid / minimize large current swings on analog plane (e.g. buffer digital signals)
  • Star ground when splitting sections: don’t let heavy digital current sink through analog ground by cascading the grounds.
  • Don’t really need to split planes as long as large digital current’s preferred return paths are localized and far away from the analog section.
  • AGND/DGND refers to the grounds responsible for different sections of a mixed-signal IC. Has nothing to do with which actual ground to tie to. (e.g. DGND pin in ADC chips still goes to analog ground plane as it has low switching current)

13 total views, 1 views today

Rick and Morty Quote: What people called love

From Rick and Morty Season 1, Episode 6:

Rick: Listen Morty, I hate to break it to you, but what people calls “love” is just a chemical reaction that compels animals to breed. It hits hard, Morty, then it slowly fades, leaving you stranded in a failing marriage. I (Morty’s grandpa) did it. Your parents are gonna do it. Break the cycle, Morty. Rise above. Focus on science.

A follow up from Episode 9:

With the writers Rick and Morty, you can replace the whole philosophy department in all universities and move all the logicians to the math department:

A follow up from Episode 8:

Nobody exists on purpose 

 

30 total views, 1 views today

Lepy LP-2024A+ Class T Amplifier Mod

My traditional Hi-Fi amplifier drains a lot of power and heats up my room when I’m not using it. The summer heat prompted me to look into Class-D amplifiers as they’re highly energy efficient.

I bought a Lepy LP-2024A+, a Class-T amplifier (It’s Tripath’s improvement over Class-D amplfiers) for $22 shipped. It sounded good over a narrow range of volume, as I can hear the background sound details on my ADS 200 speakers.

Unfortunately, strong bass components in certain music gets distorted, a sign that the amplifier cannot deliver fast energy impulses. To put it simply, I enjoyed the treble but not the bass with this amplifier.

I saw some mods reports on the older TA-2020A+ based units (like LP-2020A+), but as of now, only one Japanese blog site talk about switching out input stage op-amps without other changes. So I decided to do my own mod and post the results here.


First, the unit came with a dinky 2200uF capacitor for power smoothing. I upgraded it to 6800uF. I happen to have a 12uH inductor with thick wires, so I replaced the toroid inductor (as in the LC power smoothing pair) with it while I’m at it. 

Then I replaced all the remaining white-label capacitors with decent brands (Wruth, Nichicon, Panasonic, CDE), all rated at 105 degC, sometimes with higher voltage ratings depends on which brand-name parts Newark has on sale when I order it.

Then I upgraded the 4 output stage inductors with Wruth 7447452100 rated 10uH 4.5A. Tripath’s datasheet says 2A, so I supposed the one populated on board would be less than that. 

I also replaced the SMD (1206) ceramic capacitors at the output stage (very close to the speaker wire terminals) with Polyester Film (for the taller 0.47uF ceramic chips) and NP0/C0G (the thinner 0.1uF ceramic) to improve linearity. I suspect this change helped to reduce the listening fatigue for treble components of the music I’m listening to. Now I don’t have to tone down the treble gain (knob) that aggressively.   

As prompted by the Japanese blog site, I ordered some LT1364, but the improvement isn’t that big since the NE5532 wasn’t bad in the first place:

The bass and drums are much more enjoyable after the mod, since the improved power handling reduced the bass distortion on bass impulses. The amplifier is still 15W (7.5W+7.5W) dictated by TA-2024A+, but I rarely want to crank the music up louder than that anyway.

As a bonus, I took a thermal image with my Seek Thermal Imager:

The input stage ICs LT1634 are 118 deg F:


Actually I wasn’t completely satisfied. After all the mods, if I cranked up the volume, I occasionally hear the output drooping (i.e. some light pops, farts, and volume modulation) at a few time spots of the songs.

I suspect the power smoothing capacitor and inductor combinations aren’t pimped up enough. I chose not to go all the way to get giant inductors and capacitors because there aren’t enough space at the original component location. Anything bigger has go to the right hand side of the box.

I saw the board has split ground planes, so I don’t want to defeat the noise reduction design by flying high current wires all the way from the left side (power), past the middle (digital switching) all the way to the right (analog input stage). And I thought of an idea: why not smooth the power outside?

I happened to have a bunch of conical DC power plug pigtails from Monoprice:

So I made a pass-through circuit with a 380uH inductor in series. I wrapped the wires around the coil so I can have the ferrite core double as the ferrite bead (plus saving space):

Followed by an external capacitor module (loaded in parallel):

So this circuit will sit between the power supply module and LP-2024A+:

I could have shorted the inductor on the PCB and just remove the 6800uF capacitor to move the components outside the enclosure. But why bother? Just leave it there as a two stage LC filter (power smoother)! In case if the external LC module was skipped, the LP-2024A+ will still sound reasonable (as long as I don’t drive it too hard).

With the external power handling mod, even loud music sounds smooth, expressing the 3D acoustic image crisply through my ADS 200 speakers: I felt like a person is talking/singing right in front of me than some loudspeaker generated sound. It’s so crisp that I can hear each individual string pluck. Bass is deep too after I added a ADS sub 6 subwoofer. I’ve been listening to “the Phantom Of the Opera” CDs ever since high school and I’m still rediscovering new musical details with this amplifier + ADS speakers! 

Before the mod, I would hesitate to make it my main amplifier and might want to go back to my Denon AVR-988 for serious listening. It took me quite a while to tune my Denon to sound good, but it works right out of the box on my modified Lepy LP-2024A+!


Update [08/21/2017]: Based on people’s comment (in audiokarma) on TA-2020A+ vs TPA3116, I decided to give it a shot and ordered Nobsound’s 50W model.

Actually before this LP-2024A+, I modded a Pyle TA-2020A and was disappointed at the clarity is totally lacking compared to the lower powered LP-2024A+. I thought it could be Pyle’s terrible implementation of TA-2020A+, but after hearing TPA3316, I observed these:

  • TPA3116 has less distortion than TA-2020A+ and it sounded slightly tighter at all frequencies, especially the low ones
  • Both TA-2020A+ and TPA3116 lack the clarity at vocal frequencies and above. TA-2024A+ beat them both hands down.
  • TA-2024A+ draws 0.15A when no music is played while TPA3116 draws 0.03A. The reading is from my HP 6032A (60V, 50A) power supply.

TPA3316 might have a tighter bass than TA-2024A+, but I wouldn’t trade the vocal and up for that. TA-2024A+ might be marginally OK for N.W.A., but certainly not for parties. It’s an amp for music, not for acting cool.

 

64 total views, 1 views today

TDS 500 600 Series (and TDS 820) Monochrome CRT Horizontal Linearity

I have a batch of TDS 620A which everything looks shiny new, but the display will stretch vertically and eventually gone unstable after turning it on continuously for a long time.

Turns out there’s a specific batch of flyback transformer (120-1841-00) on the monochrome CRT driver board (640-0071-06) that has quite a bit of infant mortality. The newer the unit looks (of the CRT tube looks shiny new without burn-in), the more likely it’s a victim of the bad batch.

The transformer is almost impossible to source (other than getting another CRT driver board), but I was able to find a Chinese supplier who makes it. It was usable, but it’s a nightmare to get it on because it’s really done with the stereotypical Chinese (PRC) manufacturing caliber.  When I received the unit, it’s a WTF moment! Leave me a comment if you want me to write about it.

The replacement transformer is only pin and functionality compatible, but it’s not a drop in replacement (not even geometrically). The characteristics are different and I had to adjust the trimmers all over the place.

I was able to get the screen width I want by adjusting the variable inductor (L105, HOR SIZE) by nearly pulling ferrite rod out, but the horizontal linearity was way off (the left side is very squeezed):

I looked into the TDS520B Component Service Manual (Same CRT board circuit diagram) and found this:

But L100 looks like this, which doesn’t seems trimmable:

The right hand side is the same L100 choke I extracted from a CRT driver board (same model) that I’ve disposed of. I saw two suspicious pieces of metal-like objects strapped on the choke on the left (installed) which I haven’t seen in other identical boards. 

Thinking that by changing the magnetic property of the core, I can adjust the inductance of an otherwise non-adjustable inductor. I took a few bits of magnets sitting on my bench and swing it around the L100 choke, the horizontal display widens/narrows depending on which pole of the magnet is facing the L100 choke.

After a few trial and error, I picked the right amount of magnet discs to correct the horizontal linearity so the squares have roughly the same width:

I guess I cracked the code! Here’s the result of correction by magnet:

 

85 total views, 1 views today

RTC / NVRAM in Test Equipment

HP Infiniium Series Atlas III Motherboard (Oldest generation Infinium oscilloscopes still branded as HP):

  • [RTC. There’s no exposed batteries] bq3287AMT = DS1288

Tektronix TDS Series (500, 600, 700, 800)

  • Older TDS (without alphabet suffix): Dallas DS1245Y
  • Model number that ends with ‘A’:  Dallas DS1650Y

The NVRAM in TDS series only contains the options data. Since I can reprogram the options, I can start with a blank NVRAM without reprogramming it). 

Will keep updating this page when I came across more test equipment.

65 total views, 1 views today

C Traps and Pitfalls

Here’s a concise paper describing common C programming pitfalls by Andrew Koening (www.literateprogramming.com/ctraps.pdf) corresponding to be book with the same title. 

As a reminder to myself, I’ll spend this page summarizing common mistakes and my history with it.

Here are the mistakes that I don’t make because of certain programming habits:

  • Operator precedence: I use enough parenthesis to not rely on operator precedence
  • Pointer dereferencing: I always do *(p++) instead of *p++ unless it’s idiomatic.
  • for() or if() statements executing only first line: I always surround the block with {} even if it’s just one line. Too often we need to inject an extra line and without {} it becomes a trap.
  • Undefined side effect order: I never do something like y[i++]=x[i]
  • char* p, q: very tempting since C++ style emphasize on pointer as a type over whether the variable is a pointer. I almost never declare multiple variables in one line.
  • Macro repeating side effects: use inline functions instead whenever possible. Use templates in C++.
  • Unexpected macro associations: guard expressions with (). Use typedef.

Did these once before, adjusted my programming habits to avoid it:

  • counting down in for() loop with unsigned running variable: I stick with signed running variables in general. If I’m forced to use unsigned, I’ll remind myself that I can only stop AFTER hitting 1, but not 0 (i.e. i=0 never got executed). 

Haven’t got a chance to run into these, but I’ll program defensively:

  • Integer overflow: do a<b instead of (a-b)<0. Calculate mean by adding halfway length to the smaller number (i.e. (a+b)/2 == a + (b-a)/2 given a<b). Shows up in binary search.
  • Number of digits to shift is always unsigned (i.e. -1 is a big number!)

What I learned from the paper:

  • stdio buffer on stack (registed with setbuf()) freed before I/O flushed: use static buffer (or just make sure the buffer lives outside the function call).
  • char type might be signed (128 to 255 are -128 to -1) so it sign extends during upcast. Use unsigned char go guarantee zero extend for upcasting.
  • toupper()/tolower() might be implemented as a simple macro (no checks, incorrect /w side effects)
  • Can index into a string literal: “abcdefg”[3] gives ‘d’

Mistakes that I usually make when I switch back from full-time MATLAB programming:

  • Logical negation using ~ operator instead of ! operator.

Common mistakes I rarely make because of certain understanding:

  • Forgetting to break at every case in switch block. It’s hard to forget once you’re aware of the Duff’s device.
  • sizeof(a[])/sizeof(a[0]) after passing into a function does not give array length: hard to get it wrong once you understand that array (declared on stack) has meta-info that cannot be accessed beyond the stack level it’s initialized. 

44 total views, 1 views today