Spend some time last week and this weekend reworking the PCB to upgrade the Version 1.0 board to a Version 2.0. As a recap, my original PCB did correctly decode the signals coming from the motors on the robot, however it was prone to glitches where the outputs would flicker on and off sporadically.
I did a lot of research and theorized that the issues were caused by small timing variations when bringing 3 parallel signals and sampling them into clocked memory chips (Flip-flops). Sometimes, a signal might transition a bit more slowly than the other 2 signals and would fail to get sampled into the memory until the next clock cycle. This would cause corrupted data to be presented to the circuit for one clock cycle and caused further issues in the signal decoding and output memory sections of the circuit.
My solution was to modify the input sampling circuitry by adding: (1) 4 Channel 2-Input XNOR gate, (1) 3 Channel 3-Input AND gate, and (1) 4 Channel 2:1 multiplexer. These chips work together to detect when an input has changed state and prevent that sample from entering the circuit. Only when 2 successive input readings agree can the outputs of the circuit be updated
While the plan is to create a Version 2.0 PCB with 3 additional SOIC (Small Outline Integrated Circuit) chips, I wanted to validate the design on the existing PCB. To do so, I bought extra of the new chips in DIP (Dual In-Line Package) packaging, a larger through hole variant of the component. These are the classic integrated circuits you see on old electronics. I soldered up a small breadboard with these components and various jumper wires to make the interconnections.
I then removed the motor side terminal blocks and the U2 chip from my functioning test board. I identified 3 traces on the Version 1 board that needed to be cut before patching in the new circuitry. The traces are 10 thou wide and 1.4 thou thick. I used a heavy duty X-acto knife to dig out the copper and make a decent sized air gap. You can see the cut traces between U2 pins 2 and 5, U2 pins 10 and 13, and U3 pins 2 and 5. When I was done, I soldered U2 back in place.
All I had on hand was some 24 Ga solid core hookup wire so I used that to solder to each IC pin that needed a splice connection. Care had to be taken to avoid lifting the leg of the IC from the pad on the PCB as the solder cooled. 12 wires were needed in total (+ 2 power connections)
The wires were secured to the board with Kapton tape to prevent strain on the connection, and the wires were labeled according to the schematic.
And the wires were terminated on the breadboard.
Wire by wire, the enitre first half of the circuit was checked, first against the schematic, and second against the simulation functional diagram (assuming the schematic was wrong). I didn't find a single short or missed connection!
I then set everything up on my bench by the robot and got to work bench testing the new circuit, just as I did with the original one. Scope channels A, B, and C measured the input channels A, B, and C, while the 4th probe "D" was used to test various locations on the PCB. The robot Z axis motor was hooked up to this board and power was jumpered to allow the board to be used without the servo drive attached.
Here is another shot of the work area.
And the results! First and foremost, the signals still come out of the board which is great news because my changes could have broken the entire thing. And second, since the addition of this circuitry, I have not seen a single glitch on the output! Everything looks very clean and I was able to verify that all channels output the correct waveform and transition at the appropriate times!
When I got done building this, I had perhaps 30% confidence that I had identified the root cause of the problems and corrected it. I am so thrilled that it worked out. My next steps are to install the reworked PCB on the drive and try to get the commutation corrected and a motor running. When that is done, I will order the new PCBs which have already been designed.
Two interesting things... With the glitches removed from the output signals, I can now successfully detect the index/marker signal (Z) when the board is connected to the servo drive. I had not been able to pass that test previously due to all the glitches triggering a premature completion of the test. The second is I observed a startup sequence on the encoder when it was first powered on. It didn't dawn on me what I was seeing so I didn't investigate further, but there was some brief signal on channels A, B, & C and the output S1 turned on (all without the motor moving). This is great news since it means the motor/custom PCB are able to transmit the correct data before the drive boots up. Then I don't have to worry about the halls state being invalid before the motor is moved. This also means the PCB must be powered on at the exact same time (or earlier) as the encoder. This forces me to power the logic circuit from the same external supply as the encoders (jumper on the PCB) or to install a time delay relay in front of the 5V external supply to delay it until the drives have powered on and are supplying 5V out to the encoder ports.
Still making progress! Thanks to everyone for hanging in there with me!
-Mike