[sane-devel] Progress on CanoScan 3200F

Lauri Pirttiaho lauri.pirttiaho at luukku.com
Sun Dec 4 19:35:32 UTC 2005


Progress report on CanoScan 3200F
---------------------------------

Week ago I managed to get scanning working at 300 dpi with
no processing on in the scanner chip. That's raw 8 bit data
gray scale with no gamma or black/white shading. The experimentation
led me to study in detail the meanings of the various speed
ramps and here are the results.

There seem to be two factors affecting the speed of the
scan head. First there are three interrupt interval time
ramps written to addresses 0xDD00, 0xE500 and 0xF100.
In my previous report I gave them in table 1, and here
is the relevant quote of that table:

========================================================================
offs addr len  Description
---- ---- ---- -----------
0000 DD00 0400 MSB
0400 E100 0400 LSB
                - speed ramp 1 used for moving
0800 E500 0400 MSB
0C00 E900 0400 LSB
                - speed ramp 2 used for deceleration before scan
1400 F100 0400 MSB
1800 F500 0400 LSB
                - speed ramp 3 used for interrupted scanning
========================================================================

Ramp 1 is used in commands repositioning the head. 

Command 23 and 24 are used of moving the head forward and backward.
If the motion is short, less than 1/4" (300 lines) then the
step interval is 2000 units. (I measured the unit and it
seems to be 600 ns). If the motion is larger then 80 first
entries are used to accelerate the head and then at the end
of the move to decelerate the head. Typically the
initial step interval is 1851 units and the interval
at 80th step is 297 units.

Command 71 moves again at constant speed if the move is less than
1/4". Else it uses ramp 1 to accelerate and decelerate. The length
of ramp 1 used is given as short integer at 0xFB10. It goes there
as the fifth short parameter (bytes 8-9) of command 2B index 08.
If the move is less than ( the ramp length x 2 + 100 ) then the
parameter at 0xFB10 is adjusted to ( ( length of the move - 280 ) / 2 ).
Note that this changes parameter at 0xFB10 so that parameter needs
to be rewritten for the next command 71. In some cases the internal
had position counter may be wrong (e.g. if the head has been tried
to accelerate too fast, which happened in my experiments) the
head may ram a stopper before it has decelerated. The ramp is
used first to accelerate and then to decelerate. Typically the
initial step interval is 1388 units and the maximum speed interval
is 69 units.

Also commands 51 and 72 use ramp 1 but since the CanoScan Windows
driver does not seem to use them in a normal case, I have not studied
them.

Command 30, the scan command, uses all three ramps and four first
short integers in command 2B index 08. Each ramp is limited with
start 0 and end that is one of these integers. The first integer
at 0xFB08 tells the end of ramp 1. The integer at 0xFB0A tells
the end of the ramp 2. The integers at 0xFB0C and 0xFB0E tell
the end of ramp 3 in two different cases, first for deceleration
and second for acceleration but in general they are equal.

The scanning movement is as follows. First the head is accelerated
using ramp 1 and then moved at constant speed until near the start
of scanning area. Approaching that line, ramp 2 is used backwards,
from index at 0xFB0A to 0, to decelerate the speed to the scanning
speed (first parameter, bytes 0-1, of command 30). Then the scanning
takes place at constant speed. If the USB buffer gets filled, the
scanning is interrupted and the head is decelerated using ramp 3
from index at 0xFB0C to 0 and then moved 16 steps at a constant speed.
Then it is accelerated backwards using ramp 3 of length indicated by
0xFB0E and then again decelerated and then moved by 16 steps at constant
speed. Then the head is stopped and emptying of the USB buffer is waited for.
When the buffer is empty, the ramp 3 is used to accelerate the head
to the scanning speed and then the scanning is resumed.

That is what I know about the movement control. The curves used
by the Windows driver seem to use some kind of non constant 
acceleration algorithm, which resembles a polynomial speed curve,
but I did not see it necessary to try to copy them. Instead I 
tried quadratic speed curves with acceleration going to 0 at
terminal speed. That kind of curve seems to work well.

Next I will continue with scans involving the internal processing
and 24 bit color.

With best regards,

Lauri Pirttiaho
Oulu
Finland


...................................................................
Luukku Plus paketilla pääset eroon tila- ja turvallisuusongelmista.
Hanki Luukku Plus ja helpotat elämääsi. http://www.mtv3.fi/luukku




More information about the sane-devel mailing list