arduino:sansui-repair
Differences
This shows you the differences between two versions of the page.
Previous revision | |||
— | arduino:sansui-repair [2024/11/22 12:02] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Repair and bring back to life a 27-year old Sansui AU-X517R audio amplifier with Arduino ====== | ||
+ | {{htmlmetatags> | ||
+ | metatag-description=(Repair an old Sansui audio amplifier with Arduino) | ||
+ | }} | ||
+ | |||
+ | ===== Introduction ===== | ||
+ | |||
+ | This article describes the repair of the " | ||
+ | |||
+ | {{arduino: | ||
+ | |||
+ | For those sceptics who shall ask immediately why spend so much time and effort to engage in such an endevour, I am responding right away that the goal is to prove now and again the capabilities of a micro-controller in supporting any application that requires any form of logic, as well as exercise control over both digital and analog circuits alike. | ||
+ | |||
+ | In addition, I present two " | ||
+ | - The software model which mimics the behaviour of a rotary switch | ||
+ | - The control of a resistor ladder using the Arduino pins either as Inputs or Outputs | ||
+ | |||
+ | ===== Preface ===== | ||
+ | |||
+ | Ageing is a nasty thing, applying also to electronics equipment. In a properly designed circuit where proper thinking has been exercised in avoiding thermal stress and excessive vibrations, components such as resistors, ceramic capacitors, transistors etc. may survive for several decades. Unfortunately, | ||
+ | |||
+ | This was the case for a 27-year old audio amplifier. It came from the age when HiFi systems were composed of discrete elements, such as a turntable, a CD player, a radio, a cassette player and an audio amplifier. The buyer would select the best (according to his criteria) in each category, mixing and matching components of various manufacturers. Back in the nineties, integrated systems did not exist. Actually, there were some but were usually neglected by HiFi enthousiasts as low quality equipment. How to pack several functions in a single box, at the time when surface-mount components did not exist and keep a true HiFi experience? | ||
+ | |||
+ | HiFi systems started coming to market with remote control capability as an extra. Personally, and in relation to the audio system, I have never, ever used any of those individual remote controllers, | ||
+ | |||
+ | The reason for mentioning the remote control is because the design of the system for supporting remote control was the main reason for the failure. | ||
+ | |||
+ | ===== Symptoms ===== | ||
+ | |||
+ | The problematic behaviour of the audio amplifier started to manifest itself when the user attempted to change the input audio source, e.g. from CD to tuner. The AU-X517R is equipped with a rotary selection knob. You select the source by turning the knob left or right to the desired position, you hear the sound of movement of a motor for a couple of seconds and finally the audio of the selected source is heard from the speakers. | ||
+ | |||
+ | The problem started to appear when the system started to skip some sources and seemed to rotate through all possible audio sources, before settling to the selected one. After several months, the selection of audio source became impossible, rendering the system inoperable. | ||
+ | |||
+ | ===== Theory of operation ===== | ||
+ | |||
+ | The Sansui AU-X517R is a 2x65W audio amplifier, manufactured in the early nineties. There are no SMD components inside. Only through-hole components, mounted on several single-layer PCBs. Yet, it is a computer controlled systems. Its heart is a Toshiba '' | ||
+ | |||
+ | {{arduino: | ||
+ | |||
+ | The "INPUT SELECTOR CONTROL" | ||
+ | |||
+ | Upon identifying the requested audio source, the controller orders the "INPUT SELECTOR DRIVE" motor to rotate left or right. The controller software is clever enough to identify the shortest path to the new position, even if the user moves the knob through several positions. Two of the controller pins are used to control the motor. When pin 13 is HIGH and pin 14 is LOW, the motor rotates clock-wise. When pin 14 is HIGH and pin 13 is LOW, the motor rotates anti-clockwise. When both pins 13 and 14 are LOW, the motor is in a braking state. | ||
+ | |||
+ | The signals from the controller are applied to an '' | ||
+ | |||
+ | The motor assembly is an '' | ||
+ | |||
+ | |||
+ | {{arduino: | ||
+ | {{arduino: | ||
+ | |||
+ | After all the above, we understand that the system works like this: | ||
+ | |||
+ | - The user selects an audio source. This modifies the voltage of the "INPUT SELECTOR CONTROL" | ||
+ | - The controller understands from the applied voltage how many positions to the right or left it needs to move | ||
+ | - The controller sends HIGH-LOW or LOW-HIGH to output pins 12 and 13 respectively. | ||
+ | - The motor driver applies voltage to the motor with the selected polarity. The motor rotates right or left | ||
+ | - The controller monitors the movement of the motor by checking the voltage of the "INPUT SELECTOR" | ||
+ | - When the voltage of the "INPUT SELECTOR" | ||
+ | - The controller turns on the appropriate LED in the "INPUT SELECTOR CONTROL" | ||
+ | |||
+ | The controller implements a safety mechanism regarding the position control. If the requested position is not achieved in a reasonable amount time (a few seconds), the motor brakes in order to protect itself and the rest of the circuitry. | ||
+ | |||
+ | We also need to remember that the infrared remote control can also be used to select an audio source. In that case, the system will implement the above actions starting from step 3. This operation has a significant implication: | ||
+ | |||
+ | It is worthwhile to note at this point that the TMP47C440AN micro-controller is powered from a 5V power supply which remains always on, while the amplifier is connected to the mains. This happens because it remains at a standby mode, allowing to be powered-on completely via the remote control. In contrast, the motors are powered via another 7.8V power supply. | ||
+ | |||
+ | ===== Fault identification ===== | ||
+ | |||
+ | The amplifier was placed on the surgical bed of the lab. After removing a huge amount of screws, the top and bottom panels were removed as well as the front face. The ALPS rotary switch was identified. Trying to rotate the axle manually with a screwdriver, | ||
+ | |||
+ | Next step was the removal of the ALPS assembly. I removed several more screws and freed the PCB on which the assembly was soldered. I had to remove several connectors which wired the PCB to other boards. Very important, I labelled all the cables in order to place them back again at re-assembly. Have also taken several pictures. | ||
+ | |||
+ | De-soldering a 3x12 contact could prove to be a nightmare without having an advanced de-soldering station. But the beauty of the nineties, with the single layer PCB and the fully leaded solder, was that I managed to de-solder all 36 contacts only with a simple hand-operated solder sucking pump. All PCB holes were beautifully exposed with just a single action of the solder pump in each of them!!! The fumes were of course ventilated, since we may become happy with old memories but cannot forget the nasty nature of the old materials. | ||
+ | |||
+ | After removing the plastic cap of the ALPS module, the problem became apparent. | ||
+ | |||
+ | {{arduino: | ||
+ | |||
+ | A plastic gear which was originally transferring the movement from the motor to the axle of the rotary switch was broken in four pieces. The teeth in one of the pieces were worn, as shown in the picture where all pieces are " | ||
+ | |||
+ | Now, it is becoming obvious why I mentioned at the beginning of this article that the remote control was the main reason for the problem. Without the remote control, the audio source selection would be accomplished via a simple rotary switch, controlled directly from the front panel. Even if the switch would need to be placed in the far back side of the equipment, there have been designs where a long rod transferred the rotation from the front knob to the back switch. To support control from both the knob as well as the remote control, designers had to use this motor-operated switch. This design selection caused an additional bad behaviour of the system, in the sense that in order to select an audio source which was not at the immediate next position, the system had to pass through other audio sources and hear them at the speakers for a small amount of time. Contrast this behaviour with the selection of an audio source via buttons. You press the desired button and you hear what you want! Yet, it seems that no better solution than the motor-operated switch could be found at the time. | ||
+ | |||
+ | | ||
+ | ===== Repair strategy ===== | ||
+ | |||
+ | An online search showed that a replacement module does not exist in the market. A similar motor-controlled switch from the ALPS company was found but the physical distance between the three sets of switches was different than the original. | ||
+ | |||
+ | Another option would be to search for a used component. But such an old mechanical switch may also suffer from corrosion problems, which could appear as audio " | ||
+ | |||
+ | Another option would be to build a gear with a 3D printer or order a gear online. Unfortunately, | ||
+ | |||
+ | All the above, along with the desire to replace electromechanical components with digital components, led me to design the complete replacement of the ALPS assembly with a set of relays controlled by an Arduino Nano. The new module would be controlled by the original TMP47C440AN micro-controller, | ||
+ | |||
+ | Finally, the list of tasks to perform the repair will be: | ||
+ | |||
+ | - We need six DPDT relays, each to connect one of the six possible audio sources to the common input of the amplifier. We need DPDT relays because we will serve the L and R audio channel with one relay. | ||
+ | - We need a way to control the "INPUT SELECTOR" | ||
+ | - We need to identify the orders to rotate from the controller | ||
+ | - And finally, we need our Arduino Nano to implement the logic which controls all the above | ||
+ | |||
+ | ===== Circuit description===== | ||
+ | |||
+ | Starting from the selection of the audio sources, we use six digital I/O pins of the Nano to control the six relays. I happened to have in my laboratory several 5V relays and decided to use them. Each of them requires 75mA to remain armed, so I started to have second thoughts regarding providing power from the continuously-on 5V supply. I therefore decided to use the 7.8V supply which is ON only when the amplifier is out of stand-by mode and since it operates the motor, it is capable of providing a higher amperage. I also wired the circuit so that the Nano may receive power from the 5V source and the relays from the 7.8V, but did not implement in the final version, for reasons that I will present below. | ||
+ | |||
+ | In order to drop the voltage from 7.8V to 5V, and due to the lack of space for the placement of a proper circuit, I went with the dirty way of placing a few diodes in series. Relays are forgiving if a bit higher voltage is applied. In addition, only one relay is active at a time because only one audio source can be enabled and therefore the current through the diodes will be constant and so will be the voltage drop. | ||
+ | |||
+ | The Arduino Nano is powered by the 7.8V source through the '' | ||
+ | |||
+ | In order to receive orders for movement from the TMP47C440AN, | ||
+ | |||
+ | Finally, for the position control we could use SPST relays to control the resistor ladder. Since the current passing through the ladder is really small, a better solution to relays would be to use the Arduino pins as outputs and source current through them, effectively acting as a ground connection. This will save a lot of space and power in contrast to the relay solution. I decided to use the A0 to A5 pins for this task. | ||
+ | |||
+ | {{arduino: | ||
+ | |||
+ | The pins will not operate in a normal LOW-HIGH manner but will operate in two states: | ||
+ | |||
+ | * the first state will be high-Z. The pin will be set as Input and no current will flow through the pin. | ||
+ | * the second state will be a grounded switch. The pin will be set as Output at the LOW state (0V), which will forward current from the resistor ladder to ground. | ||
+ | |||
+ | Our Arduino software will activate the '' | ||
+ | |||
+ | An additional benefit of using the analog pins is that we are able to use the '' | ||
+ | |||
+ | I also wired pin 3 of the TMP47C440AN to analog input '' | ||
+ | |||
+ | That's about it in terms of functionality. The schematic is shown below: | ||
+ | |||
+ | {{arduino: | ||
+ | |||
+ | Header pins J1 are used to power the Arduino board. Pin 2 is connected to the 7.8V power supply. A set of four diodes drop the voltage to make it more suitable for the the operation of the 5V relays. Pin 3 is wired to pin 2, but could be used in the future to power the Nano independently of the relays. A 1N4007 diode is placed between pin 3 and Vin, to block current going back to the amplifier circuits, when the Arduino is programmed and subsequently powered via the USB port. | ||
+ | |||
+ | Header pins J3 are used to receive the motor control orders from pins 13 and 14 of the TMP47C440AN. Two **1N4148** diodes are fixing the voltage mismatch and provide the proper TTL voltages to pins '' | ||
+ | |||
+ | Header pins J4 and J5 are the Left and Right audio channels. Each source signal comes into pins 2 to 7 and when one of the six relays RL1 to RL6 is activated, the signal is connected to the common which is wired to pin 1 of the header of the respective channel. The normally-closed pin of the relays is left unconnected. All common relay pins of each audio channel are wired together and are connected to pin 1 of J4 and J5. | ||
+ | |||
+ | The schematic shows two of the source control sub-circuits, | ||
+ | |||
+ | Header J2 pins 1 to 7 are used for the input selector resistor ladder, where the motor reports its position. Pin 8 of J2 is used to read the input control resistor ladder. Perhaps the decision to place this pin along with the others was rather unfortunate, | ||
+ | |||
+ | ===== Construction ===== | ||
+ | I placed all components in a perforated all-purpose 7x9cm board, from which I cut a few cm to make it fit into the space available in the amplifier rack. The new board dimensions were a bit larger than the ALPS module, but I managed to squeeze it in. | ||
+ | |||
+ | {{arduino: | ||
+ | |||
+ | The most time consuming action was the preparation of the strip wires connecting the Arduino PCB to the original amplifier board, in place of the direct connections of the 3X12 pins of the ALPS module. I used male-female headers in order to be able to remove the wires for service. Yes, of course I am aware about crosstalk and other audio problems with parallel strip wires, but when you are dealing with such a situation, those problems are of minor importance. | ||
+ | |||
+ | As shown in the picture below, the cable strips have a female header at one end. The other end is stripped from insulation in each of the wires and will be soldered to the amplifier board, in the holes of the ALPS module. | ||
+ | |||
+ | {{arduino: | ||
+ | |||
+ | Since there is no numbering on the ALPS connectors, I used an arbitrary numbering scheme, considering as number 1 the common pin in each of the three rotary switches of the module. The wiring is the same to all three rotary switches. Pin 1 of J2, J4 and J5 is wired to the common pin of the amplifier board designated as pin 1. In the audio channels, pins 3, 5, 7, 9 and 11 of the rotary switch are connected to the analog ground. Since our board does not use the analog ground, we do not connect anything to them. We have tried of course to keep the length of the strips to the absolute minimum to avoid any interference between the audio sources. | ||
+ | |||
+ | From the 12 contact of the third part of the rotary switch which is used for the motor position control, pins 3, 5, 7, 9 and 11 of the rotary switch are not connected. Pin 1 is the common and pins 2, 4, 6, 8, 10 and 12 are connected to the on-board resistor ladder. As with the audio signals, a 7-wire cable strip is used to connect our Arduino circuit to the amplifier board. | ||
+ | |||
+ | |||
+ | {{arduino: | ||
+ | |||
+ | Please note that the motor position control rotary switch is the one which is more close to the motor. The traces on the amplifier board are really easy to follow and identify the purpose of each pad. | ||
+ | |||
+ | The board along with the soldered cable strips is shown below: | ||
+ | |||
+ | {{arduino: | ||
+ | |||
+ | Finally I placed the Arduino board on top of the amplifier PCB and used plastic spacers to maintain the distance between the two boards. To avoid drilling holes on the amplifier board, I kept everything in place with a few drops of hot glue, using a glue gun. If, in the future, we need to move the Nano board, the glue material can be removed easily. I also made sure that the Arduino Nano USB socket is easily accessible from the top side, so that I can re-program if necessary by only removing the top cover of the amplifier. | ||
+ | | ||
+ | ===== Software ===== | ||
+ | |||
+ | Writing the code was an experience. Since I did not know the exact code programmed in the TMP47C440AN, | ||
+ | |||
+ | **I finally realized that in order to mimic a " | ||
+ | |||
+ | There are cases when the switch does not link any contacts. At those times, the resistor ladder provides the highest voltage. Therefore, when moving from 0.7V to 1.4V, there is some time while the output continues to remain at 0.7V, then, when the connection is broken, the ladder output raises to 3.5V, then we have a new contact and the voltage goes to 1.4V, and finally, the motor continues to move in order to reach the middle of the new contact keeping the voltage to 1.4V. | ||
+ | |||
+ | To simulate this behaviour, I wrote the code as a contact going through each of the 360 degrees of the circle. Our six audio sources are modelled as 6 segments of 60 degrees each. In each of those areas and considering that our switch has 12 pins from which only 6 are connected and the other six are left floating, our model behaves like this: | ||
+ | |||
+ | - The circle is divided in 6 segments, each of 60 degrees, from 0 to 59 | ||
+ | - From 0 to 7 we have the half of the unused contact (pins 3, 5, 5, 7, 9 and 11 of the rotary switch). There is no connection to the resistor ladder and all grounding switches are off. | ||
+ | - From 8 to 21, we have a gap. All switches are off. | ||
+ | - From 22 to 37 we have the valid contact. The relevant switch is activated and provides a ground connection to the ladder. | ||
+ | - From 38 to 51 we have a gap. All switches are off. | ||
+ | - From 52 to 59 we have the half of the next unused contact. All switches are off. | ||
+ | |||
+ | {{arduino: | ||
+ | |||
+ | Actually, our 12-pin switch has one common and 11 contacts, so we would have to divide the circle in 11 parts of 32.7 degrees each and the position where the physical contacts start and end, as represented by integers, would not be easy to replicate in each of the 6 segments. In addition, the physical construction of the rotary switch is not known in detail because the contacts are not visible and I have noticed (just a feeling, with no proof) that the rotation from an active pin 12 to an active pin 2, takes more time than rotating from pin 2 to 4. Yet, the model above with the six 60-degree segments is within the error limits allowed by the TMP74C440AN and works perfectly. | ||
+ | |||
+ | **UPDATE**: I found some time to place the ALPS module on the surgical bed to have a deeper look on the contacts. After removing the axle, I was able to remove the rotating part of each switch and see what happens inside. The two pictures below show the stator and rotor of the switch. | ||
+ | |||
+ | {{arduino: | ||
+ | {{arduino: | ||
+ | |||
+ | In the stator, the common pin is wired to a metal ring near the center. Twelve contacts are placed around the perimeter. One contact is a bit wider than the others and is electrically connected to the internal ring. The rotor has two contacts, which are wired together. One maintains contact to the ring and the second rotates around the stator contacts, connecting with each one of them while rotating. This means that my conceptual 12-contact model was mostly accurate, including the " | ||
+ | |||
+ | **END OF UPDATE** | ||
+ | |||
+ | |||
+ | | ||
+ | The software model moves through each of the 360 positions, one step at a time. The delay between each step can be programmed so that a full rotation is achieved in approximately two seconds, as the physical motion of the original motor allowed. The ROTATION_SPEED constant is set to 5 milliseconds, | ||
+ | |||
+ | The code is documented well enough to present what happens in every step [[arduino: | ||
+ | |||
+ | |||
+ | ===== Grey areas and Ideas for improvement ===== | ||
+ | |||
+ | ==== Startup process issue #1 ==== | ||
+ | As we have described above, the "INPUT SELECTOR CONTROL" | ||
+ | |||
+ | In our case where we have no memory upon start-up, which source would be selected as the initial one? We could hard-wire one in our code. A more intelligent option would be to read the current position of the "INPUT SELECTOR CONTROL" | ||
+ | |||
+ | Unfortunately, | ||
+ | |||
+ | Anyway, the problem is really minor. Just turn on the amplifier and select the desired audio source. It may be different than the one selected when we turned off the amplifier, but it is not a big deal. | ||
+ | |||
+ | Another solution would be to write the current position to the EEPROM but that would cause extensive wear to the memory and should not be considered at all in a " | ||
+ | | ||
+ | |||
+ | ==== Startup process issue #2 ==== | ||
+ | |||
+ | A rather peculiar behaviour was experienced in the '' | ||
+ | |||
+ | The problem was that the '' | ||
+ | |||
+ | Although the code now behaves perfectly at this point, the incident is rather suspicious and requires further investigation by anyone who likes to dig deeply. Unfortunately, | ||
+ | |||
+ | |||
+ | ==== Power-save mode ==== | ||
+ | |||
+ | As described above, in the current version the Nano is powered by a 7.8V power supply which turns off upon setting the amplifier to standby. We could leave the 7.8V to power the relays and use the 5V power supply to power the Arduino itself. This would maintain a complete synchronization between the Arduino and TMP47C440AN. | ||
+ | |||
+ | In such a case, we could use the ATMega328P sleep mode to minimize power consumption. Instead of using pins '' | ||
+ | |||
+ | Again, this improvement has not much of practical significance (unless we powered the amplifier from a UPS) and can be implemented simply as an exercise from anyone who feels conscious in power consumption matters, but requires electronics to remain on standby. | ||
+ | |||
+ | ==== Inherent design flaw ==== | ||
+ | |||
+ | All design decisions, in spite of having been taken to resolve a problem, they have a tendency to create another problem or to be subject to a condition that may be a disaster waiting to happen. Remember that one problem with the rotary switch was that when switching audio sources, you needed to pass through them and you heard them at the speakers momentarily. A solution with buttons which would select an audio source (or in our case with individual relays) would not present this problematic behaviour. Unfortunately, | ||
+ | |||
+ | - Try to avoid having multiple switches (or relays) pressed at the same time. Old systems provided a mechanical release when pressing a button, but this did not stop us from pressing multiple switches at a time | ||
+ | - If for any reason, multiple switches are pressed, no failure will occur both to the amplifier as well as the sources. | ||
+ | |||
+ | In our circuit, the software disables all relays before switching to an audio source. In addition, during the start-up of the Arduino, we should make sure that the ports which control the relays do not provide enough current when they are in the start-up phase or when they are in the high-Z state since the ports are configured by default as Inputs. So, the first mode is covered. Yet, any software modification should always take proper care to avoid having two relays on at the same time. Actually, it should provide sufficient time after the de-activation of one relay before activating another. | ||
+ | |||
+ | Regarding the second mode, the amplifier itself will not complain if its input receives a composite signal from several sources, provided that the aggregate voltage of the sources is within the specifications. In contrast, connecting the output of several sources means that the output stage of each source is somehow short-circuited to the output stage of another source. The lower the output impedance of each source, the bigger the problem. A solution would be to place a resistor in series with each source. In case two relays were active at the same time, the current from one source to the other would be limited by the sum of the two resistors. Actually the AU-X517R has made a provision for such resistors on the PCB, but unfortunately, | ||
+ | |||
+ | | ||
+ | ====== Conclusion ====== | ||
+ | |||
+ | This project gave additional life to an audio amplifier that in normal circumstances would have been recycled several years ago because of an inexpensive plastic gear. Sometimes, it is not the cost of the repaired equipment that is the driving force behind such an endevour. Imagine the case when your enclosed washing machine stops functioning because a simple plastic element in the mechanical timing sequencer has failed. There is no replacement part, so you need to buy a new washing machine. The new machine is a bit larger than the previous one, so you need to replace the entire enclosure, including the washing bin and the entire plumbing. The new bin does not match aesthetically with the old bathroom elements, including the tiles. Perhaps a renovation of the bathroom and subsequently the entire home is in order!!!! | ||
+ | |||
+ | Well, the above example, is not so far from reality and at some extent it has happened to real people I know. Imagine now that such an incident happens in an industrial line, where the chain of replacements that is activated by a simple inexpensive component may cost millions. Ingenious engineers should possess in their toolbox the knowledge to design and implement effective solutions to cope with such problems. | ||
+ | |||
+ | If not persuaded about the practical usage of such an application, | ||
+ | |||
+ | If you have any feedback, please contact me via [[https:// | ||
+ | |||
+ | ~~DISQUS~~ |