05/24/2015 at 14:16 •
i am happy to announce that the Megapixy design files are now available online for your viewing/modding/hacking pleasure.
this took awhile. it turns out, when many of my design files are over a year old, i need quite a bit of time to organize them!
Megapixy is an adventure in sourcing parts. you will probably struggle to find the PCB receptacle for the IPEX micro-coaxial cable, as well as the cable itself. i have spares! contact me and i can help you.
have a great day :)
04/21/2015 at 17:54 •
i ended the last update with these two problems:
- the chassis is stupid. the wood warps when wet, the design wastes material, and the bezel bends under my fingers when i hold it.
- the LCD panel is mounted unevenly, causing backlight bleed.
these are both chassis problems, which require chassis solutions. solutions i built in parallel with Giger board - such is iterative design.
at this point, i was designing my chassis with Eagle and doing all my own lasercutting at danger!awesome. my chassis was still two pieces of plywood screwed together. i wanted a quantum leap in fit and finish,
my Industrial Design friend, M, was in town, and we sketched silly ideas in an empty apartment.
i seemed stuck on two opposing design requirements.
- the chassis had to be as thin as possible, for weight, material cost, and aesthetic reasons.
- i needed enough thickness behind the screen to house the 1/4-20 tripod mount.
alright, M said, you need it to be thick. but can you make it look thin?
by chance, we were sketching on my tinycomputer - a great example of this illusion. Microsoft had to build a thick tinycomputer for thermal reasons, but they wanted it to look thin. so they bevelled the edges. the result is an 'infinity pool' effect, where the chassis depth cannot be seen from the front.
but it is not practical to create a smooth bevel with a lasercutter. could i CAD the whole chassis in 3D, and mill it out with a Shopbot?
so i downloaded a trial version of Rhinoceros.
[attempt #1, modeled around the 'comma' board.]
[rounded edges? no, we want chamfers! or bevels. same thing.]
[with a bevel, the back edge drops away.]
then i tried to actually manufacture it, and got stuck.
i'd found a Shopbot at a local makerspace, and bought an expensive membership. but there was no parking, inconvenient hours, and mysterious closing times. and i spent hours upon hours just defining toolpaths in Mastercam, after which the tool would do something crazy anyways, and commit trepanation on my precious plywood. if rapid iterations create quality, i was getting none of it.
but! this was a fundamentally 2.5D design. to make quick prototypes, couldn't i just lasercut & stack several layers of plywood? i wouldn't be able to create the bevel, but at least i'd know if the basic dimensions were sound.
five stacked layers of plywood approximated my milling profile, so that's what i used.
[side profile: wood wood wood wood wood]
[pretending-to-be-a-Shopbot prototype, front view. using rivet nuts instead of screws for a cleaner look.]
[pretending-to-be-a-Shopbot prototype, rear view.]
janky though it is, this prototype helped set some direction for the next:
- this thing is basically solid wood - wasteful and way too heavy.
- unfinished wood is pretty, but warps when wet, and feels oily under my fingers.
- i need to integrate the cover of the on/off switch into the chassis.
- stacked lasercut layers are actually pretty good! can we just do that, and not need a Shopbot at all?
now abandoning the Shopbot.
so let's use nothing but a lasercutter, and get smart to make it work:
- use laser-etching to create small changes in layer thickness. this reduces the number of layers needed for enough z-height.
- use 2mm clear acrylic on the top and bottom layers. you can see the wood texture, but it's not exposed to fingers & water.
- integrate a switch cover with a living hinge for the on/off switch.
[side profile: acrylic acrylic acrylic wood wood acrylic]
[designed-to-be-lasercut chassis, front view. laser-etched recess for the T-nut in the middle.]
[designed-to-be-lasercut chassis, front view.]
this was much better! the reflective/transmissive acrylic outer layers really complement the texture of bare wood underneath. but i'd been too aggressive with the laser-etching, and the too-thin acrylic was splintering under the screws. plus everything was still too thick & wasteful.
why was it so thick? because i needed a minimum wood thickness to attach the T-nut for the tripod mount. maybe i could use more wood under the tripod mount, creating a raised dais? then i could make the rest of the chassis thinner.
[this allowed me to remove one entire plywood layer.]
[side profile: acrylic acrylic acrylic wood acrylic]
[designed-to-be-lasercut chassis, version 2, front view with bezel removed.]
[close-up of Giger board.]
it also lets you see the Giger board through the rear acrylic, which is awesome.
[designed-to-be-lasercut chassis, version 2, rear view. LCD backlight illuminates the ports, helping you find them in the dark.]
[raised dais for tripod mount - slight cracking caused by bad math.]
[acrylic-on-wood has an amazing sheen.]
and i like it very much, so let's have more photos of the chassis in action.
[can you see the pixels?]
[it looks better than a magazine.]
a happy accident: the living hinge is now made of wood!
and one more photo of Giger board.
next update: open source!
04/11/2015 at 04:02 •
let's detour into visual design - did you notice this on the previous update?
it's the Megapixy logo!
i like Megapixy, and i like making logos. go figure.
in the infinite possibility space of logo (and not-logo) design, some reason must be provided for why anything looks like anything. the Megapixy logo exists because:
- Megapixy uses the embedded Displayport video interface.
- Megapixy has the same 3:2 aspect ratio as the Chromebook Pixel.
with regards to 1, there's a little homage to the Displayport logo:
as for 2, the Megapixy logo also has a 3:2 ratio.
now back to engineering :D
brightness control should be easy, right? nope.
[block diagram of Megapixy brightness control (first try).]
some simple measures were taken to reduce electronic noise:
- a capacitor at the input of the microcontroller's ADC.
- a 128-sample moving average filter.
- a 2-LSB hysteresis filter, to reject small (noise-related) brightness changes.
and then, an interesting bug. when the screen was on, i could hear a tiny whining sound!
and to explain that, i'll have to talk about PWM.
[cartoon of pulse-width modulation (PWM)]
pulse-width modulation (PWM) means controlling something with a series of on/off pulses. the perceived 'on-ness' (e.g. backlight brightness) is based on the fraction of time when the device is 'on'. this fraction is called the duty cycle. the on/off pattern repeats with a fixed frequency.
the backlight driver's on/off pulses were a PWM running at 500Hz. i was powering the Megapixy with a cheap 5V power supply, which was now having to supply more & less power on a 500Hz cycle. this caused my power supply to buzz audibly at 500Hz - the so-called 'coil noise'. how could i fix this?
i could make the sound inaudible by increasing the PWM frequency from 500Hz (repeating every 2ms) to 20kHz (repeating every 0.05ms).
inaudible to humans, anyway. some dogs might notice.
the problem is, the higher your PWM frequency, the shorter your 'on' pulses:
- a 20% duty cycle at 500Hz requires 0.4ms 'on' pulses.
- a 20% duty cycle at 20kHz requires 0.01ms 'on' pulses.
during each 'on' pulse, the backlight driver has to turn on and pump up the backlight voltage. this process takes about 0.01ms. if the backlight driver doesn't have enough time to turn on, it shuts down completely until the circuit is reset. with a 20kHz PWM, this places a 20% minimum duty cycle on my backlight brightness control.
why is this a problem? because people like their screens to be really dim at night!
a 20% to 100% brightness adjustment isn't good enough. so what can i do?
there's this other thing called pulse-frequency modulation (PFM):
[cartoon of pulse-frequency modulation (PFM)]
in PFM, the duration of each 'on' pulse is always the same. to reduce the duty cycle, you can increase the time between 'on' pulses. at very low duty cycles, you will have large gaps between each 'on' pulse, which means a lower (and perhaps audible) frequency.
but PFM is still worthwhile because you can reach a lower duty cycle (brightness) without shortening the 'on' pulse. this gives the backlight enough time to turn on, even at very low brightness settings.
neither PWM or PFM does exactly what i want, but can i combine them to solve my problem?
- above 25% brightness, i could use PWM.
- below 25% brightness, i would automatically switch to PFM
the power supply might make sounds in the lowest brightness settings, but at least i would have lower brightness settings.
[partitioning of brightness control into smoothly-transitioned PWM & PFM.]
getting a smooth transition requires a teeny bit of math.
[featuring a random notebook from a random hotel.]
the net result is a brightness dial which adjusts from 100% (silent) to 2% (almost silent).
[cartoon of hybrid PWM/PFM brightness control.]
that's enough about brightness control!
i'm still not satisfied
with the Megapixy. why? let me count the ways.
- the 'comma' board looks stupid and wastes space. it's a sure sign that i haven't constrained it enough.
- the Displayport cable sticks out at a stupid angle, like an awkward elbow. it should attach neatly, next to the screw mount.
- the chassis is stupid. the wood warps when wet, the design wastes material, and the bezel bends under my fingers when i hold it.
- the LCD panel is mounted unevenly, causing backlight bleed.
let's address 1. why does the 'comma' board waste space?
- it stretches left to reach the LCD cable, as the cable comes straight up from the panel.
- it stretches right to reach (and house) the on/off switch & brightness dial.
- it requires too much z-height, because the tallest components (backlight capacitor & inductor) must fit under the screen.
to fix 2, i want to reposition the Displayport video connector, so i definitely have to move the LCD cable connector. i might as well move it closer to the controls, to reduce board size.
how can i make the cable reach its connector's new position? i can bend it. duh.
i can also move the tallest components out from under the screen. it saves a precious millimeter.
this was around the time that H.R. Giger died, which made me sad. being in a Giger-ish state of mind, i ended up making a PCB which looks.. strangely organic.
i call it the Giger board.
[schematic of Giger board.]
[layout of Giger board.]
[Giger board, front.]
[Giger board, back.]
[assembled Giger board in chassis (TBA).]
[LCD cable, bent to reach new connector position.]
[backlight capacitor & inductor, no longer under the screen. the on/off switch cover has a living hinge.]
the result is a smaller, denser, more beautiful board which scratches my artistic itch.
but there's still two problems to solve!
- the LCD panel is mounted unevenly, causing backlight bleed.
and that's what we'll talk about next time.
next update: fancy chassis design, lasers, lasers, lasers.
04/07/2015 at 04:21 •
Let's revisit that photo from my last post:
[why is the bottom-right footprint not like the others?]
in my last post, i got the Retina iPad LCD panel working. but it was buggy & small & rather underwhelming.
although! that is just one LCD panel in a world full of LCD panels. my approach should work with any panel which communicates through embedded Displayport (eDP). what other eDP panels are easily obtained, which are more worthwhile to hack into?
bear in mind that this is 2013, a year where only Apple computers have screens worth giving a damn about.
except one other computer.
the Chromebook Pixel.
running a stunted operating system on beautiful hardware, the Chromebook Pixel is a mixed bag.
but that screen! it's glorious.
2560x1700 pixels, 13 inches across. that's 4.3 million pixels at 239 pixels per inch. 3:2 aspect ratio. massive contrast, huge viewing angles, colors out to infinity. it's IPS at its best.
apparently it's got some whacko connector on there - an IPEX 20474-040E-12. how do you connect to that?
i'm guessing that this is where most hackers get stuck. but i really, really like screens, so i keep going.
so i randomly ping LCD cable manufacturers on Alibaba. they're all in China.
has anyone heard of the 20473-040T-10? can you take two of those and build me a 40-wide micro-coaxial array? everyone wants this, right?
and amazingly, someone gets back to me! they want a technical drawing. what?
ok, i made that in Powerpoint. can i has cables?
they say i must pay for cables. but how? ESCROW?
no, not ESCROW! the correct answer is Paypal.
Paypal is how you send money to cable people in China.
[omg LCD with cables!]
now to make a crude test board which connects to the LCD panel through that cable.
and does the crude test board work?
yes it does!
even with long cables!
so obviously the Chromebook Pixel LCD panel is the way to go. and it's big enough that people might actually use it at a desk. so let's jettison all the internal-battery stuff, and focus on making a really solid wall-powered screen.
this is when i actually start making the thing.
i'd like to point out: at this point in my career, i had no idea what i was doing.
i was supposed to design a circuit board? and some kind of chassis? to hold the screen in place?
[i am drawing things! with computers!]
i'll ask a friend to lasercut the frame, because idk lasers.
and idk mechanical design either. so instead of an enclosed frame, let's make a crappy rollcage with a front bezel and a back panel. but how to hold the panel in place?
let's hold the panel with a 'lip' made from standoffs & Nylon washers:
and now, a PCB!
i call it the 'L' board.
[schematic of 'L' board]
[layout of 'L' board]
['L' board, front view]
['L' board, back view]
as per my war on identical rows of buttons, there are only two controls:
- an on/off switch
- a brightness dial
it's obvious, even in the dark. a dial is ideal for adjusting brightness, and doesn't feel like a button at all.
but this board is horribly flawed, because the Displayport cable and delicate LCD cable end up bumping into each other.
[not so good!]
why is this happening? because the 'L' board is a crude extension of my test board. i tried to keep my high-speed traces as short as possible on the test board, which created that awkward cable collision.
so i have to make a new test board, to put some distance between those cable connectors.
time for more shotgun engineering!
[the lowest board worked the best.]
now there's a 90-degree bend between connectors to prevent cable collisions! and with this, i built the 'comma' board.
[schematic of 'comma' board]
[layout of 'comma' board]
['comma' board, front]
['comma' board, back]
did you notice all those holes at the neck of the comma? they let you snap off the on/off button and brightness dial.
this lets you build a mega-screen with multiple LCD panels and control boards. you only need controls on one board, which communicates with the rest.
i also began doing basic mechanical drawings in Eagle.
[mechanical drawing, showing position of control board relative to LCD panel]
and now, with lasercut chassis. it's alright.
[lasercut chassis with 'comma' board, front view]
[lasercut chassis with 'comma' board, back view. note the 1/4-20 tripod screw mount.]
[on/off button and brightness dial, coplanar view]
[on/off button and brightness dial, angled view]
as compared to my first disaster, it's much lighter, with a more even weight distribution. this means i can mount it on a flexible boom arm instead of a heavy tripod.
[chassis mounted on boom arm.]
i guess it's.. basically functional? but i'm not satisfied.
the LCD panel is held in place by a 'lip' mount below the bezel. this puts uneven stresses on the panel, causing backlight bleed.
and it's ugly.
my work is not done.
next time: Megapixy logo, Giger board, the beginnings of beauty.
03/23/2015 at 13:52 •
[old-fashioned LCD panel requiring an LVDS converter to connect to a computer.]
but LVDS is losing popularity. as our phones & tablets keep shrinking, how can anyone make room for that LVDS-converter chip? the logical solution is to build a standard ('not LVDS') video interface into the panel, to connect it directly to your graphics card.
the embedded Displayport (eDP) standard was introduced in 2008 to do exactly that. Displayport is the best video interface, LCD manufacturers can build eDP interfaces directly into their panels, and those panels no longer need an LVDS converter.
[LCD panel with embedded Displayport. the video interface connects directly to computer's graphics card.]
do note that eDP, while electrically identical to Displayport, does not use the standardized Displayport connector. every manufacturer has their own favorite connector which can vary from panel to panel. this is why all eDP hobby projects boil down to 'how do i connect these super-high-speed RF signals from my Displayport connector to this crazy LCD panel connector?'
at this point, since all the cool kids were hacking the 9.7" Retina iPad panel, i decided to do it too. and why not? it's a great (if small) IPS panel with awesome contrast & colors & viewing angles. it's made by LG and the datasheets are everywhere.
so what is actually needed to get it working?
- an electrical connection from a full-sized Displayport jack to the tiny Molex connector which fits the panel's ribbon cable.
- a 3.3V supply voltage to run the panel's logic circuits.
- eight ~20mA bias currents for the LED backlight - this could be as simple as eight current-limiting resistors.
it would have been sensible to build the bare minimum first, and get fancy later.
but i was impulsively complicated, so i added a fancy boost-converting backlight driver IC, power-management IC and Li-ion battery into the screen, to keep it running on the go. plus an ATtiny48 to talk to everything through I2C. keeping in mind that two years ago:
- i had zero experience routing differential RF traces, yet was trying to route Displayport signals, which are differential & ultra-ultra-high speed.
- i barely knew how to solder surface-mount components, yet i insisted on using QFN and 0402 packages for everything.
- my PCB skills were in the 'fledgling' stage and this project was hitting way above my weight.
but what the heck, i did it anyway. and here is the result:
[Retina iPad interface board, attempt #1 - schematic.]
[Retina iPad interface board, attempt #1 - layout.]
[first attempt at soldering - i couldn't even get the Displayport connector on without wrecking it.]
[second attempt at soldering. note the awkward jumper wire on one of the high-speed differential traces.]
did it work? not at all. it certainly didn't work aesthetically.
i'd also used the Displayport source pinout instead of the sink pinout, which doomed my board from the start. i hadn't even realized there were different source & sink pinouts. i should have dumbed things down, and got the basics right.
instead i designed another ugly and overly-complicated board because i was clueless in 2013.
[Retina iPad interface board, attempt #2 - schematic.]
[Retina iPad interface board, attempt #2 - layout.]
[Retina iPad interface board, partially-assembled, top view.]
[Retina iPad interface board, partially-assembled, bottom view.]
did this work? not even a tiny bit. i still had no idea how to route those high-speed Displayport traces.
this was pretty frustrating. each round of PCB-fabbing cost me a bunch of money. i was buying lots of tiny parts and painstakingly soldering them. nothing was working and i had no clue what i was doing. then i found OSHpark.
OSHpark is a PCB ordering service where the price scales linearly with PCB surface area, with no penalties for number of unique designs. this is unlike my previous PCB source, where i would pay (a lot) for every unique design. this forced me to (rarely) fab-out a very small number of very-complete designs. it didn't encourage experimentation
through OSHpark i could fab PCBs recklessly, ordering a Frankensteinian collection of cheap, small & subtly different boards until i figured out which designs actually worked. i could speed up my development through 'shotgun engineering', trying every possible thing until i pinged upon something which worked.
so in one afternoon, i designed many utterly crude new boards. no more power management, no more fancy backlight, certainly no battery. just a few resistors and two video connectors, connected by those crucial and mysterious high-speed traces. each board had a slight variation of those traces. something, i figured, just had to work.
and one did work!
what should i do with my new Retina screen with super-tiny pixels?
send strange photos to my friend. obviously.
it would be nice to call this a success, but i still didn't trust those high-speed traces. so i decided to test their robustness, by amassing a Displayport cable collection of various lengths.
[a tiny subset of my cable collection.]
how sensitive was the screen to Displayport signal quality? i had been testing the screen with a 3-foot long Displayport cable, which was hardly strenuous. would it continue working with a 6-foot cable? a 12-foot cable? a 20-foot cable?
alas, anything longer than a 3-foot cable left a garbled mess on the screen. i think it's much harder to get it working over longer distances, which might be why Adafruit previewed this.
at any rate, even the best 9.7" screen is quite useless on a full-sized computer. it was time to move on.
next time: goodbye iPad; tiny cables adventures.
03/22/2015 at 04:58 •
to write about Megapixy is to write about the last 2 years. this project has tested my patience and perfectionism and pursuit of beauty as few have.
Megapixy was an adventure in sourcing parts. it was my first self-directed surface-mount PCB design, my first try at soldering QFN & DFN packages, my first attempt to route high-speed differential signals, my first non-Analog system design.
Megapixy was my first lasercut design. it birthed my Eagle-mechanical workflow and represents my highest level of electro-mechanical integration to date.
Megapixy was very, very confusing.
let's say you were to build a small music studio. wouldn't it be great to have a small laptop-sized screen above the MIDI keyboard, so you could see what you were doing?
it turns out that hardly anyone makes nice small screens. Lenovo makes an awful battery-powered thing called the LT1421, with terrible colors, terrible brightness & contrast, USB-input only and pixels the size of your head. there's also this other thing with equally bad contrast and colors and general DGAF-ness. this was 2013 - the Retina iPad was just a few months old, and 1080p screens were finally beginning to trickle into Windows laptops. i would settle for nothing less.
the solution, of course, was to build something. i zoomed around the internet looking for laptops with good screens, bumped into the (otherwise uninteresting) Dell L502x, and identified its LCD panel as an AU Optronics B156HW1. a quick trip to eBay nabbed that and an HDMI-compatible control board to drive the panel, and i was in business.
[this is really the best picture i could find.]
you need that control board because the LCD panel communicates through LVDS, and your computer does not. the control board also contains the backlight driver to run the backlight LEDs inside the panel.
[Shen's handwriting, circa 2015.]
it works as well as you'd expect from a generic off-the-shelf solution. it turns on and it's definitely a screen, but you won't feel any joy in it.
a screen is only useful in front of your face, so i slapped together a chassis. having hardly any tools in 2013, i asked a frame shop to frame the LCD panel like a painting, and built the rest of the chassis to screw into the rear of the frame.
[Shen's handwriting, circa 2013.]
after much drilling, sawing, gluing & screwing:
[the front looks alright.]
[but those colors are definitely off.]
[and those pixels are still pretty pixelly.]
[the back is.. not so good.]
i used a 1/4-20 T-nut to mount the chassis to a tripod, as i often do. i'm not thrilled, but it works. what should be better?
- really bad viewing angles. you can calibrate the colors, but they'll only look right from one direction.
- 'Full High Definition' be damned, 1080p is still not enough pixels.
- it is too heavy, with asymmetrical weight distribution.
- why are the buttons on the back?
no seriously, why do all monitor controls suck?
[identical row of control buttons (left), on-screen settings (right).]
even the most crazy-expensive professional LCD monitors use a row of identical, nasty-clicky buttons. you have to look at them since they all feel the same, but you also have to look at the screen to see your on-screen settings. so your eyes will dash back and forth, between buttons and screen, until the controls time-out and the on-screen settings vanish. and then you'll have to start over.
*cue much wailing & gnashing of teeth*
[HP Professional Dreamcolor Monitor, now featuring more identical buttons.]
isn't this crazy? doesn't this drive you nuts? am i just weird?
i mean, your computer's operating system already has color, brightness and gamma controls. the advice of professionals is to keep your screen unadjusted (except for brightness) and do all adjustments in software. why do our screens need anything beyond a power button and brightness control?
and how can i make a better screen without relying on someone else's crappy control board?
then someone clued me in on a very interesting Hack-A-Day article, and i started thinking very hard. one thing was clear - embedded Displayport (eDP) was the way forward, and everything else was a sideshow.
i promptly forgot about the music studio, and started tackling this for reals.
next update: hacking the Retina iPad.