The A6628SEDT is a PLCC 44 packed dual motor driver, running in my old Epson printer.
The idea is to controll the chip by some Arduino and make it print PCBs, like these guys did.
The datasheet for the chip is absent, but thes is connection diagram on the printer’s Service Manual.
It seems the chip is dual version of some Allegro motor controllers, having two indpendent data channels and dual H-bridges (or kind of).
According to the schemacics, paper feeder is controled via data channel 0 on pins 28, 29 and 30 (CLK, Data, Strobe accordingly). The carriage motor is controlled via data channel 1 on pins 40 (CLK), 38 (Data) and 39 (Strobe).
So i hooked up my logic analyzer ( an el chypo clone of 8 chanell Salea Logic) to the data channel ‘1’ and started measurements.
The data is clocked at 6 MHz, so 12 MHz sampling rate is fine. The word seems to contain 16 bits and can be analyzed via SPI protocol.
This is strange, as all the datashhets from the Allegro claims they use either 2× 18-bit words or 4× 16-bit (A3998) words.
The operation of the motor seems strange, it’s possible i’ve done something with the connectors to the enceder strip, as the encoder seems fine.
The motor sequence is:
Left -> Right -> Left – > long pause -> Right -> long run to the left side -> motor is swithed off. I had to removed the timing belt to preserve the carriage from the complete damage right now.
After decoding via ISP protocol:
The init sequence is ‘0x0000 0x8183’. The last recorded sequence is ”0x0000 0x8183′, repeated 4 times. So it seems ‘0x0000 0x8183’ will stop the motor, the sequence is repeated each 0,35 ms, possibly to make sure the receiver got it right.
The next oddity is the first word, which is either ‘0x0000’, or ‘0x3004’. The ‘0x0000’ is allways followed by ‘0x8183’, while ‘0x3004’ is followed by some settings.
According to the analyzed data, the MSB bit of the 2nd word is set to ‘1’ only at the beginning and end of the sequence, so I assume (while reading Allegro datasheets and analyzing data) the MSB bit in the 2nd word is IDLE.
The first bit of every first word is allways ‘0’ and the first bit of every second word is always ‘1’, so I assume they are “Word Select” bits, as stated in all Allegro datasheets.
Let’s make the table:
Word 0 | ||||||||||||||||
Bits | ||||||||||||||||
Value | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
Word Select=0 – Word0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | a | b | c | d | e | f |
Word 1 | ||||||||||||||||
Bits | ||||||||||||||||
Value | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
Word Select =1 – Word1 |
1 | Speed? | 5 | 6 | 7 | 8 | 9 | a | b | c | d | e | IDLE |
Day 2
Sequence analysis
Init sequence
Sequence number | Word0 | Word1 | Word1 (bin) |
1 | 0x0000 | [insert_php]hex_as_bin(‘0x8183’);[/insert_php] |
Motor running left
Occured @0,34 s after init sequence
Sequence number | Word0 | Word1 | Word1 (bin) |
1 | 0x3004 | [insert_php]hex_as_bin(‘0xA448’);[/insert_php] | |
pause for 75 ms | |||
2 | 0x3004 | [insert_php]hex_as_bin(‘0xA050’);[/insert_php] | |
3 | 0x3004 | [insert_php]hex_as_bin(‘0x9C58’);[/insert_php] | |
4 | 0x3004 | [insert_php]hex_as_bin(‘0x9860’);[/insert_php] | |
5 | 0x3004 | [insert_php]hex_as_bin(‘0x9468’);[/insert_php] | |
6 | 0x3004 | [insert_php]hex_as_bin(‘0x9070’);[/insert_php] | |
7 | 0x3004 | [insert_php]hex_as_bin(‘0x8C78’);[/insert_php] | |
8 | 0x3004 | [insert_php]hex_as_bin(‘0x8878’);[/insert_php] | |
9 | 0x3004 | [insert_php]hex_as_bin(‘0x8278’);[/insert_php] | |
10 | 0x3004 | [insert_php]hex_as_bin(‘0x8A78’);[/insert_php] | |
11 | 0x3004 | [insert_php]hex_as_bin(‘0x8E78’);[/insert_php] | |
12 | 0x3004 | [insert_php]hex_as_bin(‘0x9270’);[/insert_php] | |
13 | 0x3004 | [insert_php]hex_as_bin(‘0x9668’);[/insert_php] | |
14 | 0x3004 | [insert_php]hex_as_bin(‘0x9A60’);[/insert_php] | |
15 | 0x3004 | [insert_php]hex_as_bin(‘0x9E58’);[/insert_php] | |
16 | 0x3004 | [insert_php]hex_as_bin(‘0xA250’);[/insert_php] | |
17 | 0x3004 | [insert_php]hex_as_bin(‘0xA648’);[/insert_php] | |
18 | 0x3004 | [insert_php]hex_as_bin(‘0xAA40’);[/insert_php] | |
19 | 0x3004 | [insert_php]hex_as_bin(‘0xAE38’);[/insert_php] | |
20 | 0x3004 | [insert_php]hex_as_bin(‘0xB230’);[/insert_php] | |
21 | 0x3004 | [insert_php]hex_as_bin(‘0xB628’);[/insert_php] | |
22 | 0x3004 | [insert_php]hex_as_bin(‘0xBA20’);[/insert_php] | |
23 | 0x3004 | [insert_php]hex_as_bin(‘0xBE18’);[/insert_php] | |
24 | 0x3004 | [insert_php]hex_as_bin(‘0xBE10’);[/insert_php] | |
25 | 0x3004 | [insert_php]hex_as_bin(‘0xBE04’);[/insert_php] | |
26 | 0x3004 | [insert_php]hex_as_bin(‘0xBE14’);[/insert_php] | |
27 | 0x3004 | [insert_php]hex_as_bin(‘0xBE1C’);[/insert_php] | |
28 | 0x3004 | [insert_php]hex_as_bin(‘0xBA24’);[/insert_php] | |
29 | 0x3004 | [insert_php]hex_as_bin(‘0xB62C’);[/insert_php] | |
30 | 0x3004 | [insert_php]hex_as_bin(‘0xAE3C’);[/insert_php] | |
31 | 0x3004 | [insert_php]hex_as_bin(‘0xA64C’);[/insert_php] | |
32 | 0x3004 | [insert_php]hex_as_bin(‘0xB234’);[/insert_php] |
Occured @1,5 s after the first sequence and is repeated 25 times
Sequence number | Word0 | Word0 (bin) | Word1 | Word1 (bin) |
1 | 0x3004 | [insert_php]w0_as_bin(‘0x3004’);[/insert_php] | 0xA44C | [insert_php]w1_as_bin(‘0xA44C’);[/insert_php] |
2 | 0x3004 | [insert_php]w0_as_bin(‘0x3004’);[/insert_php] | 0xA448 | [insert_php]w1_as_bin(‘0xA448’);[/insert_php] |
3 | 0x3004 | [insert_php]w0_as_bin(‘0x3004’);[/insert_php] | 0xA648 | [insert_php]w1_as_bin(‘0xA648’);[/insert_php] |
4 | 0x3004 | [insert_php]w0_as_bin(‘0x3004’);[/insert_php] | 0xA64C | [insert_php]w1_as_bin(‘0xA64C’);[/insert_php] |
Occured @0,67 s after the second sequence, repeated 25 times
Sequence number | Word0 | Word0 (bin) | Word1 | Word1 (bin) |
1 | 0x3004 | [insert_php]w0_as_bin(‘0x3004’);[/insert_php] | 0xA44C | [insert_php]w1_as_bin(‘0xA44C’);[/insert_php] |
2 | 0x3004 | [insert_php]w0_as_bin(‘0x3004’);[/insert_php] | 0xA448 | [insert_php]w1_as_bin(‘0xA448’);[/insert_php] |
3 | 0x3004 | [insert_php]w0_as_bin(‘0x3004’);[/insert_php] | 0xA648 | [insert_php]w1_as_bin(‘0xA648’);[/insert_php] |
4 | 0x3004 | [insert_php]w0_as_bin(‘0x3004’);[/insert_php] | 0xA64C | [insert_php]w1_as_bin(‘0xA64C’);[/insert_php] |
Motor running right
The sequence seem identical to the 1st one …
Day 3
Actualy, it’s 2016 right now. February. The 17th …
The problem with the crazy motor was on of encoder ribbon. There was a short between two pins when it plugs into the controller’s PCB.
The printer has passed the initialization, moved head assembly forth and back at different speeds.
Now, let’s analyze the stop sequence. Logics attached to the pins, button pushed and …
Just in case: 0x200C in hex is (MSB on the left) 10000000001100.
Sequence number |
Word0 | Word0 (bin) | Word1 | Word1 (bin) | Comments |
Repeated continously | |||||
… | |||||
0x200C |
[insert_php]w0_as_bin(‘0x200C’);[/insert_php] |
Repeated 100 times |
|||
0x1265 |
[insert_php]w0_as_bin(‘0x1265’);[/insert_php] |
||||
0x200C |
[insert_php]w0_as_bin(‘0x200C’);[/insert_php] |
||||
0x1225 |
[insert_php]w0_as_bin(‘0x1225’);[/insert_php] |
||||
0x200C |
[insert_php]w0_as_bin(‘0x200C’);[/insert_php] |
||||
0x3225 |
[insert_php]w0_as_bin(‘0x3225’);[/insert_php] |
||||
0x200C |
[insert_php]w0_as_bin(‘0x3004’);[/insert_php] |
0xA64C |
[insert_php]w1_as_bin(‘0xA64C’);[/insert_php] |
||
Pause for 0.6031 sec | |||||
0x0000 | 0x8183 |
[insert_php]w1_as_bin(‘0x8183’);[/insert_php] |
Assuming “Motor stop” command |
||
Pause for 0.2626 sec | |||||
0x0000 | 0x8183 |
[insert_php]w1_as_bin(‘0x8183’);[/insert_php] |
Assuming “Motor stop” command |
What I’ve noticed, Vref may be used to transmit signal. Not according to Allegro datasheets of the similar products.
The datasheet of A3972, A3973 claims the LSB comes the first, so I have tried to update the table above.
Well, in this case 0x200C and the Rest of The World (except 0xC181) maps to the Word0, which is kind of stupid. So probably the MSB comes first.
The table below shows the possible values, captured on the port.
Value (hex) | Value (bin) | Movement type |
0x8183 | [insert_php]w1_as_bin(‘0x8183’);[/insert_php] | |
0x3004 | [insert_php]w0_as_bin(‘0x3004’);[/insert_php] | |
0xA254 | [insert_php]w1_as_bin(‘0xA254’);[/insert_php] | |
0x9E5C | [insert_php]w1_as_bin(‘0x9E5C’);[/insert_php] | |
0x9A64 | [insert_php]w1_as_bin(‘0x9A64’);[/insert_php] | |
0x966C | [insert_php]w1_as_bin(‘0x966C’);[/insert_php] | |
0x9274 | [insert_php]w1_as_bin(‘0x9274’);[/insert_php] | |
0xA050 | [insert_php]w1_as_bin(‘0xA050’);[/insert_php] | slow speed, forward |
0x9C58 | [insert_php]w1_as_bin(‘0x9c58’);[/insert_php] | slow speed, forward |
0x9860 | [insert_php]w1_as_bin(‘0x9860’);[/insert_php] | slow speed, forward |
0x9468 | [insert_php]w1_as_bin(‘0x9468’);[/insert_php] | slow speed, forward |
0x9070 | [insert_php]w1_as_bin(‘0x9070’);[/insert_php] | slow speed, forward |
0x8C78 | [insert_php]w1_as_bin(‘0x8C78’);[/insert_php] | slow speed, forward |
0x8878 | [insert_php]w1_as_bin(‘0x8878’);[/insert_php] | slow speed, forward |
0x8278 | [insert_php]w1_as_bin(‘0x8278’);[/insert_php] | slow speed, forward |
0x8A78 | [insert_php]w1_as_bin(‘0x8A78’);[/insert_php] | slow speed, forward |
0x8E78 | [insert_php]w1_as_bin(‘0x8E78’);[/insert_php] | slow speed, forward |
0x9270 | [insert_php]w1_as_bin(‘0x9270’);[/insert_php] | |
0x9668 | [insert_php]w1_as_bin(‘0x9668’);[/insert_php] | |
0x9A60 | [insert_php]w1_as_bin(‘0x9A60’);[/insert_php] | |
0x9E58 | [insert_php]w1_as_bin(‘0x9E58’);[/insert_php] | |
0xA250 | [insert_php]w1_as_bin(‘0xA250’);[/insert_php] | |
0xA648 | [insert_php]w1_as_bin(‘0xA648’);[/insert_php] | |
0xAE38 | [insert_php]w1_as_bin(‘0xAE38’);[/insert_php] | |
0xB230 | [insert_php]w1_as_bin(‘0xB230’);[/insert_php] | |
0xBA20 | [insert_php]w1_as_bin(‘0xBA20’);[/insert_php] | |
0xBE18 | [insert_php]w1_as_bin(‘0x8E18’);[/insert_php] | |
0xA44C | [insert_php]w1_as_bin(‘0xA44C’);[/insert_php] | |
0xA448 | [insert_php]w1_as_bin(‘0xA448’);[/insert_php] | |
0xA648 | [insert_php]w1_as_bin(‘0xA648’);[/insert_php] | |
0xA64C | [insert_php]w1_as_bin(‘0xA64C’);[/insert_php] |
Here are some screenshots from the sequences (0xA44C 0xA448 0xA648 0xA64C):
#1 by NePe on 2017-01-06 - 01:00
Quote
Update!
The first bit from the 5bit phase data is the polarity.
The other 4bit is the value but if the decimal value is not 0 then 1 must be subtracted from it to get a nice graph.
Basically the printer simply drives the current from +14 to -14 then -14 to 14 and the phase A and B is 90 degree shifted.
Here is the updated graph:
https://postimg.org/image/nqc17bszd/
The motor direction changes also looks to be correct.
The next step is to find out the other bits in the run word with some measurements.
#2 by NePe on 2017-01-05 - 22:59
Quote
Hello!
I also captured the data from a printer board but i used an stm32f103 in 16 bit SPI slave mode. In my case, the config word is 0x3134(MSBFIRST) for the carriage motor and its transmitted after the power on once.
For the initialization carriage motor slow spinning, the run word:
bit 0-1 always 10 (run word select, 00 for config)
2-7 is constantly changing (phase A current and polarity)
bit 8-9 always 10
9-13 constantly changing (phase B current and polarity)
bit 14-15 always 10
I converted the captured 5+5 bits to decimal (for phase B added 50 for the visibility) value and displayed with excel for 200 run word:
https://postimg.org/image/lyivkj1nt/
It looks almost linear except the high and low side regions.
Something happening with the first and last bits every second period maybe this bits responsible for the polarity change ?
I have captured about 39000 sequential motor commands 5-6 times to ensure every bit is recorded correctly and i always getting the same results.
Sometimes the pattern is changed like this maybe for direction change:
https://postimg.org/image/bu9ja38eh/
I uploaded the captured files to dropbox:
https://www.dropbox.com/sh/x803c7r4xth4y9h/AABWj1rt4nmEb-iqtFnyZXxja?dl=0
I would like to use the printer motors and drivers for a custom laser engraving machine so if some know more about this stuff please share the information with me.
#3 by ejs on 2016-02-13 - 17:28
Quote
Ni Max,
Not sure. I must sniff the second channel with the stepper to be sure.
The sniffed data is for DC motor of the head assembly, so I am not sure if the controller is stepping.
I assume it’s driving motor and expects changes on the optical strip encoder. As there are no changes, it’s shutting down the motor later on.
#4 by Max on 2016-02-05 - 12:32
Quote
Hello!
Thanks for sniffed data
I’m analyzed it, and concluded that
Word1 has following markup:
bits
[0-1] Wordselect
[2-5] bridge 1 current (or something what controls step size)
[6] bridge 1 phase control bit
[7-8] bridge 1 disabled(don’t know why 2 bits)
[9-12] bridge 2 current (or something what controls step size)
[13] bridge 2 phase control bit
[14-15] bridge 1 disabled(don’t know why 2 bits)
from 1st to 32 step motor spins on 180 degrees (easy start)
second sequence it rotates on 25 spins
third sequence it rotates on 25 spins 2match faster