User Tools

Site Tools


arduino:sansui-repair

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
arduino:sansui-repair [2019/04/18 09:58]
Ilias Iliopoulos Update with the internals of the ALPS switch
arduino:sansui-repair [2024/02/02 21:46] (current)
Ilias Iliopoulos Added DISQUS
Line 1: Line 1:
 ====== Repair and bring back to life a 27-year old Sansui AU-X517R audio amplifier with Arduino ====== ====== Repair and bring back to life a 27-year old Sansui AU-X517R audio amplifier with Arduino ======
 +
 +{{htmlmetatags>​metatag-keywords=(arduino,​ sansui, repair, audio, amplifier, au-x517R, au-517) ​
 +metatag-description=(Repair an old Sansui audio amplifier with Arduino)
 +}}
  
 ===== Introduction ===== ===== Introduction =====
Line 128: Line 132:
 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 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.+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 ''​D10''​ and ''​D11''​.
  
 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. 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.
Line 164: Line 168:
 ===== Software ===== ===== Software =====
  
-Writing the code was an experience. Since I do not know the exact code programmed in the TMP47C440AN,​ I have found sometimes that this code was competing to the Arduino code. My first version was a very elegant masterpiece which rotated the motor very well in the back and forth direction. Unfortunately,​ it worked only when the audio source selection knob was moved one position at a time. If the user moved the knob two or more positions in one blow, several rotations ​were required ​to reach the proper positions+Writing the code was an experience. Since I did not know the exact code programmed in the TMP47C440AN,​ I have found sometimes that this code was competing to the Arduino code. My first version was a very elegant masterpiece which rotated the motor very well in the back and forth direction. Unfortunately,​ it worked only when the audio source selection knob was moved one position at a time. If the user moved the knob two or more positions in one blow, the internal Sansui code tried to locate the shortest path to the new location in a way that I could not replicate, resulting in several ​"rotations" around the full perimeter before reaching stability ​to the final position
  
-**I finally realized that in order to mimic a "​stupid"​ behaviour, you need to be smart enough to copy every single detail of "​stupidity",​ in every single time interval!** To cut a long story short, the position control switch **cannot** be modelled as something that only provides six distinct connections. To achieve the functionality duplication that the software designers of the nineties had to cope with, the rotary switch must be modelled as something that "​makes"​ connection at several points in time and "​breaks"​ at other points in time, rolling smoothly from each state to the other. Probably the Sansui engineers utilized the transient from one condition to the other as a synchronization signal. **Kudos to the Sansui designers who managed to squeeze a highly effective code into this 4-bit micro-controller.**+**I finally realized that in order to mimic a "​stupid"​ behaviour, you need to be smart enough to copy every single detail of "​stupidity",​ in every single time interval!** To cut a long story short, the position control switch **cannot** be modelled as something that only provides six distinct connections. To achieve the functionality duplication that the software designers of the nineties had to cope with, the rotary switch must be modelled as something that "​makes"​ connection at several points in time and "​breaks"​ at other points in time, rolling smoothly ​and in a predicted manner ​from each state to the other. Probably the Sansui engineers ​have utilized the transient from one condition to the other as a synchronization signal. **Kudos to the Sansui designers who managed to squeeze a highly effective code into this 4-bit micro-controller.**
  
-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.+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 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:+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   - The circle is divided in 6 segments, each of 60 degrees, from 0 to 59
Line 183: Line 187:
 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. 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 and have a deeper look on the contacts. The two pictures below show the stator and rotor of the switch.+**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:​sansui_alps_stator.jpg?​200}} {{arduino:​sansui_alps_stator.jpg?​200}}
 {{arduino:​sansui_alps_rotor.jpg?​200}} {{arduino:​sansui_alps_rotor.jpg?​200}}
  
-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 model was mostly accurate, including the "​feeling"​ that the rotation from an active pin 12 to an active pin 2 takes a bit more time. This happens because the common contact is connected to itself during part of the rotation. In addition, the stator part of the common contact is a bit wider than the other contacts. **Although the code works well at its current version, in order to be absolutely precise, I must set the output voltage of the resistor ladder to 0V instead of high-Z, when the rotor passes through the common contact, i.e from circle position 352 to 7 which is the last half of the last segment and the first half of the first segment. In addition, I could set the width of the "​gap"​ sections a bit larger than the width of the contacts, as shown in the stator photo.** ​+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 "​feeling"​ that the rotation from an active pin 12 to an active pin 2 takes a bit more time. This happens because the common contact is connected to itself during part of the rotation. In addition, the stator part of the common contact is a bit wider than the other contacts. **Although the code works well at its current version, in order to be absolutely precise, I must set the output voltage of the resistor ladder to 0V instead of high-Z, when the rotor passes through the common contact, i.e from circle position 352 to 7 which is the last half of the last segment and the first half of the first segment. In addition, I could set the width of the "​gap"​ sections a bit larger than the width of the contacts, as shown in the stator photo.** ​ 
 + 
 +**END OF UPDATE** 
  
     ​     ​
-The model moves though ​each of the 360 positions, one at a time. The delay between each step can be programmed so that a full rotation is achieved in about two seconds, as the physical motion of the original motor allowed. The ROTATION_SPEED constant is set to 5 milliseconds,​ leading to a full rotation in 5*360=1.8 seconds. ​+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,​ leading to a full rotation in 5*360=1.8 seconds. ​
  
 The code is documented well enough to present what happens in every step [[arduino:​sansui-repair-code|and can be found and downloaded here]]. The code is documented well enough to present what happens in every step [[arduino:​sansui-repair-code|and can be found and downloaded here]].
Line 245: Line 252:
 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. 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,​ simply consider that we do it, first because we can, and second because we have fun doing it!     ​+If not persuaded about the practical usage of such an application,​ simply consider that we do it, first because we can, and second because we have fun doing it!    
 + 
 +If you have any feedback, please contact me via [[https://​www.fryktoria.com/​wiki-contact.html|this contact form]] ​  
 + 
 +~~DISQUS~~
arduino/sansui-repair.1555570693.txt.gz · Last modified: 2019/04/18 09:58 by Ilias Iliopoulos