I think I understand the "how it works", but why was done this way?

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ac2ev
 
Posts: 76
Joined: Mon Sep 16, 2013 5:13 pm

I think I understand the "how it works", but why was done this way?

Post by ac2ev »

I've gotten lost in a rabbit hole with the Epson HX-20. Currently I've got the printer wired up on a breadboard along with the circuit in the picture. The Slave CPU in this case is an Adafruit Feather RP2040 (it's what I had on hand). The circuit is all wired up and working with simple switches. I'm still working on the code to print characters but while I understand how the circuit mostly functions, I'm at a loss as to why it was designed this way.

The HX-20 was built in the mid 1980's.
Since I'm replacing it with a modern microcontroller, I'm thinking some of this can be removed.

If I'm incorrect in anything let me know what is correct.

Things to know:
SL is tied to 5V and the solenoids in the printer
The detecting mechanism of this printer consists of a timing detector and a resetting detector.
(1) Timing Detector
The timing detector is a tachogenerator coupled directly to the motor. It generates sinusoidal waves Tn (timing pulses: T1 to T252 for each dot-line) of which the frequency is proportional to the motor speed.
(2) Resetting Detector
The resetting detector consists of a reed switch (normally open) and a permanent magnet
fixed to the lead cam. It generates one pulse per dot-line. One reset pulse per print cycle
is used for resetting the timing pulse counter.
  • Let's start with P41 which functions to run the motor. Why are there 3 inversions of the signal before it feeds Q13?
  • Q9 and Q12 form a Darlington Transistor, which I believe is to be able to handle the current of the motor. It's a bit odd to me that you're switching on/off both the + and - paths. The motor requires a logic 0 on P41 and P14 in order to run. My assumption is that using a logic 1 to turn off ensures a floating/noisy signal won't erroneously run the motor.
  • What is the reason for the double inversion on the TS signal? Is this just a way to ensure this circuit smooths out the signal producing a nice square wave to the microcontroller. But why the inversion?
  • P10-P13 are the print head solenoids. The inverters shown are shorthand. The device is a STA401A which is actually a darlington transistor array with all the protection built. I believe this is done to avoid the in-rush and backfeed of the solenoid coils into the CPU.
  • What is the purpose of D9?
  • What is the purpose of R76? Why feed forward the TS?

Epson Hx-20 Printer driver.jpg
Epson Hx-20 Printer driver.jpg (49.85 KiB) Viewed 96 times

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: I think I understand the "how it works", but why was done this way?

Post by adafruit_support_mike »

ac2ev wrote: Thu Mar 30, 2023 11:24 am Let's start with P41 which functions to run the motor. Why are there 3 inversions of the signal before it feeds Q13?
That's probably timing control.

Q12 and Q13 form a rail-to-rail output: if Q12 is on, M- will be pulled within about 200mV of GND. If Q13 is on, M- will be pulled within about 200mV of M+.

If both Q12 and Q13 are on at the same time, they'll form what amounts to a low-resistance short between M+ and GND.. a condition called 'shoot through' which wastes power at best, and stresses transistors badly at worst.

To avoid that, such output stages usually have some kind of break-before-make circuit. The two extra inverters in the path from P41 to Q13's base will add a small amount of delay in that path, giving Q12 time to shut off before Q13 turns on.
ac2ev wrote: Thu Mar 30, 2023 11:24 am Q9 and Q12 form a Darlington Transistor, which I believe is to be able to handle the current of the motor. It's a bit odd to me that you're switching on/off both the + and - paths.
From the look of things, M+ is a power supply rather than one side of the motor coil.

Q13 can only draw current from M+, and that current can only go to M- or Q12. Going through Q12 would be shoot-through as mentioned above, so it looks like Q13's job is to send current from M+ to M-.

If the motor is bidirectional, I'd expect the far end of the coil to be connected to a voltage between M+ and M-. Then when Q13 is on, current flows from M+ through Q13 and out to M-, making the motor rotate one direction. When Q12 is on, current would flow from M- through Q12 to GND, making the motor rotate the other direction.
ac2ev wrote: Thu Mar 30, 2023 11:24 am What is the reason for the double inversion on the TS signal? Is this just a way to ensure this circuit smooths out the signal producing a nice square wave to the microcontroller. But why the inversion?
The resistors and capacitors form a Wein Bridge filter, so that's a frequency selection circuit.

Wein bridges are also highly stable once they get started, so I'd expect the circuit to keep TS more or less phase-locked to its average frequency.

The overall signal path has two inverters, so it's a buffer. The output at P17 will be a phase and frequency correct version of whatever is happening at TS.
ac2ev wrote: Thu Mar 30, 2023 11:24 am What is the purpose of D9?
That looks like a disable signal. If P14 is high and Q9-Q12 is on, D9 will pull the input of the first inverter high, cutting off output to P17.
ac2ev wrote: Thu Mar 30, 2023 11:24 am What is the purpose of R76? Why feed forward the TS?
It looks more like feedback from the output of the second inverter to the input of the first. I don't think the loop is an oscillator, but it's close.

Back in the 1980s it was fairly common to use inverters as high-impedance linear amplifiers with gain of about 20, and the resistor R54 in parallel with capacitor C26 makes me think that's what's happening here. R54 wants to discharge C26 to 0V, which would put the inverter's input and output voltages at VCC/2, right in the middle of its highest gain for any small input.

Let's assume the output of the second inverter is also VCC/2, leaving the whole loop in (unstable) equilibrium.

Now let's add a small disturbance from TS that sends the first inverter's input (which from here on I'll call the 'summing node') toward VCC. The node between the inverters (which I'll call the 'output node') swings 20x as far toward GND, and the second inverter's output swings 20x of that toward VCC.

The summing node voltage stays at VCC, but the current flowing through R76 goes into C26 and allows the output node to ramp down toward GND. That will continue until the voltage across R54 is about VCC/10, and all the current that flows through R76 to the summing node then flows through R54 instead of charging C26 further.

That gives us another equilibrium.

Then if TS goes low, C39 will pull current from the summing node through R60. That discharges C26 and pulls the output node up toward VCC/2 again. That won't have any effect on the second inverter until the output node voltage rises slightly above VCC/2, but then the second inverter will send P17 low and start pulling current away from the summing node through R76. That allows the voltage at the output node to rise toward VCC until the voltage across R54 is about VCC/10, at which point all the current flowing through R76 comes from R54 instead of charging C26 further.

And that's a complementary equilibrium.

The overall circuit is sensitive to input from TS, but has enough lag to ignore noise. And given that the passives connected to the summing node make a Wein bridge, there will be strong selection for signals at the bridge's resonant frequency.

User avatar
ac2ev
 
Posts: 76
Joined: Mon Sep 16, 2013 5:13 pm

Re: I think I understand the "how it works", but why was done this way?

Post by ac2ev »

Thank you Mike. That’s a great explanation.

The printing carriage is on a mechanical cam and printing is currently in the forward direction only.

The technical manual stresses the importance of the timing signal to determine when the motor speed is stable.

When I was looking at the signals as it was printing I found it interesting that after motor stability is achieved (>95 TS pulses after a RS pulse), the slave CPU doesn’t appear to use the TS for the actuation of the solenoids. I don’t see the solenoids duty cycle or timing directly related to TS or TS/n. This leads to a printout that has variation in the dot position. The output is still quite legible. All that effort…

I never got this far in signal design so it’s great to learn about it.

User avatar
ac2ev
 
Posts: 76
Joined: Mon Sep 16, 2013 5:13 pm

Re: I think I understand the "how it works", but why was done this way?

Post by ac2ev »

Because the motor outputs need to be logic 1 to stop the motor, I find that there is brief delay when the feather RP2040 is powered on and the outputs are set to logic 1. This boot time causes a small delay in the signals going to logic 1. I'm trying to figure out the best way to prevent this.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: I think I understand the "how it works", but why was done this way?

Post by adafruit_support_mike »

Try adding a 10k pull-up resistor.

In analog design, it's fairly common to build circuits so they default to the right value, then can be changed.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”