Making a linear CCD camera from pre-made linear CCDs and lenses - Page 1
Forum section: electronics / projects

author: darlingm
author_rank: Newbie
timestamp: September 25, 2015, 02:44:49 am
content: I need to regularly use a linear CCD camera. Color accuracy is paramount to everything else. High number of pixels is also important (likely 7-8k, 16k would be great, would live with 4k if for some reason it gave me better color accuracy.) Speed I don't care about much.Let me explain what color accuracy is paramount means. I don't see any sites that geek out over linear CCD sensors or cameras, comparing them and making reviews. So, the only way I see having the best is to try a bunch of different CCDs, and see which works best for me. Linear CCD cameras are expensive. I can get a used 16k with lenses for about $5k. I can get a used 8k without lenses for about $500. But, I can get what looks to be a top end linear CCD (10k) by itself for about $20-35. So, the only way I see me finding out what has the best color accuracy is for me to test a ton of linear CCD's. I can't see "trying out" a ton of linear CCD cameras. I could handle putting $10,000 into this, but buying top end linear CCD cameras, even used, eats that up in about 1-2 cameras.Let me double check the difference between a linear CCD and a linear CCD camera.The linear CCD camera is just a housing which holds the linear CCD, and has electronics to "convert" the linear CCD's output to something like a CameraLink interface, and a mounting point with lens threads, right?(And, sometimes the camera comes with a lens?)What would be involved in starting with a pre-made linear CCD and a pre-made lens, and making that into a linear CCD camera?My thought is I could do this, and re-use the lenses, and be able to test a ton of linear CCD's for a lot less money.I see the CCD's themselves just have a datasheet that explain the pins, clock cycles, etc.What can the CCD hook up to?Looks like most people are talking about making a custom schematic for each CCD. Some people mention microcontrollers, others saying they aren't needed. Once you've done that,can you put it together using DIY-type things such as bread boards, or do you have to pay to have boards made?Assuming you can use DIY-type things, about how much time and material cost would it take someone EXPERIENCED to do this, on a per-CCD level?(Are we talking 30 minutes and $50, or days and thousands?)Or, is there fast enough general IO devices you can use, so you do much more with software?It appears Raspberry Pi's and Arduino's can't handle the clock speed and/or throughput the high end CCD's give. I have a limited amount of electronics experience, but a ton of software experience. Would much rather write code than solder things.

author: Siwastaja
author_rank: Super Contributor
timestamp: September 25, 2015, 06:24:24 am
content: I built a film scanner prototype from scratch, using bare CCD, standard ADC, FPGA and ethernet controller. The next revision is partly built.Linear CCD requires good analog front end and ADC - these are the most expensive and most complex to design. Fortunately, they are well integrated today, unless for some reason these integrated products cannot meet your requirements.http://www.mouser.com/ds/2/282/snas474d-75520.pdfthis is just the first data sheet I found now, but this should give you an idea. These products are cheap (like $3) and designed for low-quality consumer products, but the thing is, they are designed to exceed the requirements of the said market by a wide margin (I don't know why), which is why I decided to use one (an Analog Devices part) in my Professional Film Scanner Revision 2.The problem gets real when you have to interface the timing-critical data flow to a computer. You can use:- an integrated controller, like in consumer scanners. It does everything, but it probably does everything wrong for you.- FPGA. I did that because it was my field. You can do everything you want and more. No problems with huge data flows and processing that. Professional film scanners do this. I used an FPGA + 100M ethernet MAC/PHY chip to buffer and send the scanned images to PC.- A powerful microcontroller with suitable DMAs.An important question is: how fast do you want to scan? You can do everything slowly, and use a microcontroller and some very easy interface, like a USB Serial converter that can do 1 megabit per second. I needed 100 megabits per seconds. My scanner Revision 2 needs 400 megabits per seconds, thus I'm using gigabit ethernet now.Color accuracy: are you 100% sure you want a "color CCD"? Many color-accurate devices use a monochrome CCD and a modulated light source. I did exactly that in my film scanner prototype, blinking R, G and B LED light source one color at a time, reading the same portion of the film three times. This gives you complete control over spectral response - if bare LEDs are not enough, use specialized optical filters. Heck, you can even go beyond trichromacy!Color theory is interesting and complex; there is more than just "good" and "bad" color accuracy. In fact, you really need to explain better what you are going to do. In some cases, narrow-band spectral spikes are good, and in some cases, a completely flat spectrum (resembling black body radiation) is the way to go. My application was film scanning; it's a good example of the first one.You see, even the "color CCD" scanner produces different colors at the different time, because the CCD lines are next to each other, and worse, there are physical gaps between them. So you can only scan completely motionless subjects anyway; the color records are from different locations, and once you align them, they are from different times. You also need to think about the alignment, which is non-trivial in some cases; a blinked monochrome CCD would give you a perfect alignment automatically, as long as you can keep the subject stopped (for example, stepper motor which has time to stop completely for every pixel).

author: darlingm
author_rank: Newbie
timestamp: September 25, 2015, 08:33:58 am
content: SpeedI'm using a USB 2.0 18x24 flatbed scanner. It takes around 2.5 minutes at its optical maximum, 400ppi. It appears current CCDs can go way faster than this. Image quality is much more important to me than speed. I want the data to flow into a computer as fast as the CCD is generating it, but I'd slow the speed down if it gave better color accuracy or lower noise. (My current scanner can run in "high quality mode" which takes twice as long, reducing noise in very dark areas, and I always use that mode.)I'm comparing my options to buying a linear CCD camera using a PCI Express x8 frame grabber. (Cost is a factor, but more importantly is the control over how things are processed, the ability to try multiple CCD's, and the modularity to upgrade parts as needed rather than replace the entire system.) Ideally, I'd love to bring data into the PCI Express bus, but I'd be OK starting with gigabit if it got me up and running faster.Color Accuracy & "color CCD"No, I'm not 100% positive of anything at this point. I do see a lot of places saying CMOS is catching back up to CCD. I'll probably wind up trying both. The commercial scanners (Cruse, WideTek, BetterLight) like I'm trying to build use trilinear CCD's. I'll be using specialized, full-spectrum, D50/5000K lighting. Not buzzword full-spectrum lighting, but as close to artificial sunlight as possible. Planning on testing Solux, UltraLux, and others in that category. Probably can't use a modulated light source. I know sunlight isn't equal to D50/5000K, and sunlight's temperature changes through the day. But, it's what printing color management is typically based upon.ExtraWhat I'm looking for is pretty much the simplest path to getting the CCD's data as unmodified as possible into a computer. I'm very much a software guy. I took a few high school electronics and robotics classes, and have built a few projects, but this is definitely stepping outside my knowledge area.Given that limited experience, and better familiarity with software, what do you think the easiest way for me to interface this would be? And, how would I go about learning how to hook everything up?Also now wondering if a XMOS would be helpful in my situation, and able to handle the speed.

author: darlingm
author_rank: Newbie
timestamp: September 25, 2015, 08:51:12 am
content: Hmm. Wonder if any of ICPDAS's PCI Express I/O Boards would simplify things for me.http://www.icpdas.com/root/product/solutions/pc_based_io_board/pc_based_io_board_products.html#PCI.They have analog input and a timer on their PEX-1202, no idea if it would handle the bandwidth. Says 12-bit resolution, 32 SE/16 diff channels, 110 L Ks/s or 40 H Ks/s sampling rate, bipolar/unipolar input range, and 1k (8k option) built-in fifo... With a 1 channel 16-bit resolution timer/counter.

author: kony
author_rank: Regular Contributor
timestamp: September 25, 2015, 09:48:51 am
content: Nuh-uh - topend in linear sensors is ex-Kodak development devices, now owned after two aquisitions by ON semi, with prices around 1k USD per piece - just for the sensor. Look for dynamic range, uniformity and dark noise.CMOS vs. CCD - does not matter, use what has higher dynamic range and can achieve required sampling speed. Also, if you can afford cooling, do it! +6dB in DR for each 6 to 9K down in temperature.Regarding to lightsource - I reccomend picking specific center wavelength R+G+B LEDs and using good diffuser. Reason is simple - you can minimize color channels crosstalks this way easily, simply by placing wavelength centers so that it does not leak much to next channel sensitivity and same with the negative emulsion (let's say it's double convolution). There is exactly no reason for full spectrum light when a) it gets filtered by 3 dyes in negative/positive emulsion and then b) gets caputred again by 3 different channels that integrate over wider spectra section. You see now that it is actually contraproductive to use broadband illumination. Also having each excitation channel separate, you can easily maximize system dynamic range for given positive/negative material, as maximal densities varies for each film and emulsion layer to some extent. Better yet would be using narrowband dichroic fllters, but that might be cost prohibitive. As mentioned, even better yet is using monochrome sensor and lightsource modulation, then there is none sensor spectral response leakage at all to take care of.Getting data out fast is easy task with FPGA and integrated AFE, but remember you will have to do plenty of procesing afterwards on each pixel, containing at least subtraction of dark image, offset, compensation of sensitivity and possibly also oversampling, so it is good idea to push this into dedicated HW instead os SW processing. PC interface either gig Ethernet, USB3.0, PCI or PCIe (in order of implementation difficultness). Not sure if this is in "hobby level" territory, trough.Those DAQ cards won't help much, you are in 10-100s of MS/s territory, not KS/s. Also those sensors are quite picky on correct timing.

author: Pjotr
author_rank: Frequent Contributor
timestamp: September 25, 2015, 10:37:32 am
content: Quote from: darlingm on September 25, 2015, 02:44:49 amThen you are unlucky, CCD's are basically hardware thingsThey need an accurate high speed complex clocking scheme, with noise issues about that to tackle. And the various chips need different clocking schemes. That is not simply feasible with an Arduno with some software in it.Best is to control them on the hardware level with FPGA's or CPLD's. But don't be afraid that it does not involve software. You need to master VHDL, ABEL or an other hardware description software. And that is also great fun! Here you are on the level of optimising and balancing between hardware and software.

author: LaserSteve
author_rank: Super Contributor
timestamp: September 25, 2015, 03:47:25 pm
content: There is Spectronic Devices, Eureca, and one company in Germany that make ready made CCD driver kits and chipsets for acquisition . The German stuff is really good, coming as a module or a preprogrammed FPGA. I'm looking for their website now.. Will post when I find it. Other then that, its roll your own, or buy a specialized CCD digitizer chip from TI etc ...http://www.spectronicdevices.com/linecameras/OEMElectronics.htmlhttp://www.eureca.de/english/index.htmlAlso you can buy evaluation kits and stock designs from ON Semi...What you call color accuracy is really a complex function of the dichroic filter coatings on the chip, sensitivity of the CCD, noise factors, and how well the signal is digitized. It really is not just the CCD, but the sample and hold for each pixel, the digitization etc.. You can try different CCD chips till the cows come home, but you really need to evaluate the electronics as well.You rapidly get into things like Spectalon reflectance standards, using glow discharge tubes, monochromators, and gas lasers to generate standard colors etc...I've played with a few black and white chips on the bench, as well as some working Reticon cameras, and found this is a project that maybe 5% of electronic hobbyists could do at home... Its not easy.Steve

author: darlingm
author_rank: Newbie
timestamp: September 26, 2015, 04:11:12 am
content: @kony, ahh. Thanks. My gut was saying the linear CCD's I was seeing were too cheap, but I hadn't seen anything more expensive. You're right, looks like the On Semi KLI-8023 runs about $1,000. I'll definitely be building in cooling, quite possibly liquid. I'm now seeing your and Siwastaja's point, especially with the response leakage. Getting the colors in the system perfectly is not the goal, it's getting them in predictably, so profiling and other post-processing can do a good job. Yeah, this is probably over hobby territory, but I'm going to make a go at it. Do you think a lot of that post-processing could be handled in a reasonable timeframe on a hex-core (12 thread) i7 5820K with 64GB of memory, and a 1.2GB/s RAID?@Pjotr, OK, I'll have to stretch much farther out into new territory for me then.@LaserSteve, great, I'll take a look into their products as well as TI's. Getting information out of On Semi and their resellers about these is like pulling teeth. Spent hours at it today and got no where. Most sales and tech reps haven't heard of this, were unable to get a price quote together before the weekend, and have no idea where the evaluation kits and stock designs get you... Do you know if getting one of these from On Semi basically means add the optics and get the data into the computer, or does it not take you that far? And, do you know if things it does is configurable, or pretty hard-wired? I would like to have control over the post-processing.Samples/secHow is the samples per second needed calculated? If the On Semi (Kodak) KLI-8023 runs at 2 MHz (it can run at 6 MHz, but I'd always run it in the extended dynamic range mode which slows it to 2), does that simply translate to 2 MS/s, or is there a calculation based on other factors?To get the best color & image quality, is On Semi the only one worth looking at?Would the On KLI-8023 be the absolute top of the line right now, or would testing it against other CCDs be worthwhile? Are there other manufacturers' linear CCD's that are in the ~ $1,000 price range? (Going out on a limb here, and thinking you sort of get what you pay for, that the ultra-cheap ones aren't worth even considering.)Multiple light sourcesCan blinking R/G/B LED light one at a time be done fast enough to scan 24" within 2.5 minutes? (My current scanning speed, going way faster is a bonus but not a primary objective of my project.) Not sure how long an LED light can switch on/off.Is a traditional flatbed scanner that appears to be making a continuous motion actually starting and stopping many times per second? Can a stepper motor handle 400ppi, at a speed of 24" within 2.5 minutes, or faster as the CCD allows?Also wondering if it might be better to do a full pass with one LED source, reset to home, and do more passes for each other LED source. I'm betting resetting to home wouldn't be close enough, so I'm betting the pixel locations would be off.Danger of blowing out CCDSo, now that I'm looking at a $1,000 CCD, the cost in blowing out the CCD during design & testing becomes painful. How likely is it to blow up a few of these before ever getting it right? Can I pretty safely set up a scenario that prevents this? I'm going to look at if I can find a less expensive CCD from On (or maybe someone else) that would be interfaced with similarly, get that working, then put in the good one and make necessary modifications.

author: darlingm
author_rank: Newbie
timestamp: September 26, 2015, 04:15:15 am
content: PS (maybe LaserSteve), any idea of an order of magnitude on evaluation kits and/or stock designs from On Semi? If the linear CCD is $1,000, are we talking hundreds, a thousand, or $10,000 for the kits/stock designs?