Reverse engineering software

Started by nickbungus, October 26, 2019, 08:06:40 PM

Previous topic - Next topic

nickbungus

After a lot of googling and begging I now have an arsenal of images of the foxx phaser v1.   Its a 10 stage fet phaser rather than that 6 stage of the version 2 with a depth control rather than a feedback/regen option.

Anyway,  can any software such as eagle allow me to layout the board then do a good job of automatically creating the schematic?

Or is this best done manually?
To the extreme, I rock a mic like a vandal.
Light up a stage and wax a chump like a candle.

Phoenix

The tool that you are looking for is called autorouting, and while it is a very useful tool for certain tasks, analog audio isn't usually considered one of them.
The issue is that the output is only as good as the input. You need to tell it exactly what you want it to do, specifying the design rules. For something repetitive like laying out memory in digital circuits this can be very useful, as you can give it the one set of instructions and it can repeat them ad-nauseam. But for something like an audio circuit that doesn't have many repeating blocks, it can take as much effort to tell it what to do as just laying out the circuit yourself. It can also be difficult to tell an autorouter certain things that are intuitive to a human operator, like avoiding routing certain signal traces next to each other to avoid positive feedback that can result in oscillation.
And in the end, even the best autorouter still needs human oversight and correction at the end, it's rare for the end result to ever be perfect without some final changes.

I'd recommend you try laying out a board yourself, and post your efforts here for comments and suggestions, you're likely to get far better results this way. Good luck!

DIY Bass

Cad software will pretty much do the opposite - you lay out the schematic (including pad sizes and dimensions of each of the components that you are going to use, and the software can then give you an automatic layout.  Having said that, the automatic layouts that I have seen are not very good, and you are better combining manual layout with some of the auto tools.

Rob Strand

#3
Imagine trying to draw a neat schematic from rats-nest of connections between parts.  Pretty difficult task even if you have all the pins-outs and sizes for the parts defined.   That's kind of what you are asking.

There are some PCB packages that scan in a PCB image and convert that to tracks.  Keep in mind you only have the tracks not holes for parts; not sure what happens to the pads.  After that you have to place the *PCB* library parts over the tracks which then makes the connections between parts.   From that you can create a netlist.   You don't get a schematic.

If the CAD package doesn't  have the facility to scan in the PCB and convert it to tracks another method is to scale and import the target PCB as an *image* then you effectively layout tracks over the top of the image in order to copy the existing layout.

For the schematic you would have to draw the schematic manually effectively tracing the board by hand but with the convenience that you can see all the connections on the PCB.   Ideally in the schematic you need to attach correct  PCB library parts.   Once the schematic is drawn you can export the net list.

You would then compare the netlists and then fix the schematic (or PCB) to correct any inconsistencies between the two.  That would take many iterations depending on how well you do the schematic tracing.

You are effectively approaching the problem from two sides with the aim of getting a schematic, a PCB which matches the original, and also a schematic which is consistent with that layout.

If you don't care about the existing layout then obviously tracing, creating an schematic, then making you own layout is the way to go.  The downside is if you don't get the schematic right there's no way to check it.  The method of approaching things from two sides as least has the existing layout as a way of checking  you got the schematic right.   You can use the two-side approach only to get an accurate schematic then start your own layout from scratch once the schematic (and libraries) is right.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

PRR

> automatically creating the schematic?

Phaser is phaser. Study others. There's a couple ways each stage can be arranged. You can stack that 2 4 even 10 long. You usually have an input buffer, and an output mixer. "Depth" could possibly be a novel feedback or just a good name for a feedback control. There's more variations in LFO than you can shake a stick at, but if you know how to gain and shift a wave they are all approximately equal.
  • SUPPORTER

R.G.

@OP:
You're getting good advice. Software is much better than it used to be for reverse engineering of PCBs, but no, it doesn't yet have the smarts to take images of a board and turn out a schematic, or to then turn that schematic into another PCB.

Starting with autorouting a PCB from a known schematic, this property of layout programs keeps getting better, but so far it's still not ready for prime time audio. I've used a whole series of layout automation programs over the decades, and periodically try the features out, seeing if it can (1) turn out a mostly complete layout and (2) not make so many disastrous decisions that the layout is just plain bad. None of the autorouters I've tried are usable. They can turn out complete layouts nowaways, but require so much intervention that I'm much faster doing it manually from the start. Not much surprise there - the human brain when trained for a task is much better at doing graphical stuff than a computer, so far. With the rise of "AI" and specialized graphics hardware, maybe, someday.

Then reversing pictures to a PCB. This is pretty easy to do if you take pictures from top and bottom, mirror the bottom and make the top transparent when overlaid on the bottom. A multi-layer layout tool does this easily enough; I have used Corel Draw for years for stuff like this. You can then literally draw the pads and traces on other layers, using the pictures as a reference. Once that is done, the schematic is easy enough to draw from the new "layout". A particular problem is that the person or machine doing the reverse engineering has to recognize each part for what it is, and probably go look up what the pins do for everything other than resistors and caps. Again, human vision and insight are needed to figure out what some fraction of those mystery parts might be.

And finally, there is the 'phasers is phasers' note from Paul. It's right. Perhaps the biggest help is having in your head a "library" of circuits that do certain things, like a phasing stage. Once you have that available, drawing a schematic becomes pretty simple.  Sadly, there isn't any simple way - or software - to do this circuit recognition for you.

The current state of the art is that a trained person is needed to do what you're asking. Maybe someday...
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

nickbungus

Thanks for the advice guys.   

What I've done before in laying out a circuit using cad software is start by making the schematic,  then laying out the board.   Perhaps my initial question wasn't clear.  I was hoping to layout the board with components and traces.  Then hope the cad software could have a go at drawing the schematic and I would tidy it up.

Being a software engineer myself,  I think, although not impossible,  to input a few images,  then have the software build the schematic would be miraculous. 
To the extreme, I rock a mic like a vandal.
Light up a stage and wax a chump like a candle.

GGBB

Quote from: nickbungus on October 27, 2019, 10:59:18 AM
Thanks for the advice guys.   

What I've done before in laying out a circuit using cad software is start by making the schematic,  then laying out the board.   Perhaps my initial question wasn't clear.  I was hoping to layout the board with components and traces.  Then hope the cad software could have a go at drawing the schematic and I would tidy it up.

Being a software engineer myself,  I think, although not impossible,  to input a few images,  then have the software build the schematic would be miraculous.

Your question was clear to me at least. I'm reasonably sure Eagle does that so I expect other tools will too.
  • SUPPORTER

vigilante397

I can't speak for Eagle, but I use Altium, which can absolutely do what you're asking. You have to link a blank schematic document to the PCB, then when you're done you "Update Schematic File" and it makes the schematic document reflect the PCB document. That being said, in order to make it work you need to make sure your libraries are set up right, and you have to make sure your nets are labelled.

I've never tried it because it's just as easy (if not easier) to trace a board and draw the schematic by hand, but in theory it can absolutely be done.
  • SUPPORTER
"Some people love music the way other people love chocolate. Some of us love music the way other people love oxygen."

www.sushiboxfx.com

PRR

> link a blank schematic document to the PCB, ... "Update Schematic File" and it makes the schematic document reflect the PCB document. .... I've never tried it....

Interesting. Do you have a handy PCB you can divorce from its schematic, "Update" it, and show us the raw result?

In my old-school mind, a schematic is drawn for easy understanding. Signal flows left to right, power flows top to bottom, circuit blocks are drawn in "conventional" style so you see at-a-glance what they are doing. But then when you move to Layout you try to pack the parts closely, except controls/jacks which must go elsewhere, put all the external connections on one edge for cheap assembly...

Example from older days. A tube amp wants its tubes on the outside for cooling, R/C inside for safety (and Fender put these on a strip), knobs out front or back. The attached is Fender's layout. I would *think* that if we fed this to an auto-recognizer program, it would just replace lumps with symbols and draw the lines. Why should it move parts around? Oh, we could give permission to split the twin-triode in two, and move the Vol pot down between them, a small help.

However the actual hand-drawn human-studied schematic is drawn with building blocks, left-right (however the plates wrap down to a B+ line at the bottom, which does leave space for the NFB line above). I can read this at a glance (even in reduced form); the layout is a mess to understand.

  • SUPPORTER

Rob Strand

QuoteYou have to link a blank schematic document to the PCB, then when you're done you "Update Schematic File" and it makes the schematic document reflect the PCB document.
I don't think it draws the schematic.  It might introduce new parts onto the schematic or mark-up connections as errors.

Altium has some means of making changes at the PCB level and inflicting those onto the schematic.    There was also a way of editing pins and back-annotating.   I never use those features since they promote errors and are really there for people who are too lazy to get their schematic and PCB libraries correct and consistent.    One example is when the PCB libraries are 2N3904 pinouts but the circuit uses a BC548.  The wrong pins get assigned at the PCB and people would edit those at the PCB.

Sorry if I'm a little unclear or wrong on the details.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

vigilante397

#11
Quote from: Rob Strand on October 27, 2019, 06:13:07 PM
I don't think it draws the schematic.  It might introduce new parts onto the schematic or mark-up connections as errors.

I could be wrong, I just always assumed it would work, again never tried it. I imagine if it did generate a schematic that it would look as elegant and legible as an auto-routed board, meaning it would be a mess.

But you know what, it doesn't cost anything to try it, and my computer is already on, I'll give it a shot :)



EDIT: Just tried it, and it looks like Rob was right, I was wrong. It will report what differences there are between the PCB and the schematic, but it won't update the schematic from zero to 100% automatically. I even tried adding the components in and giving them the right designators, just leaving them unconnected to see if it would connect the nets, and it wouldn't do it.

So to reiterate, if you have enough details about the PCB to copy the layout, you're going to have to just trace it and draw the schematic. I promise it's not that hard ;D
  • SUPPORTER
"Some people love music the way other people love chocolate. Some of us love music the way other people love oxygen."

www.sushiboxfx.com

nickbungus

My cad of choice is designspark.  I found eagle a bit cumbersome but design spark wasn't working for me in this scenario.  Hence the question.

Being quite a big board,  a 10 stage phaser,  I'm worried about a small mistake creeping in so I'm trying to make the process as slick as possible.  I've got an 8 hour flight tomorrow from Florida back to the UK.  So I'm trying to get all the tools in place before my flight.

So I think I'm going to reverse,  reverse engineer it.  Use the pcb layout to create the schematic,  then with software,  try and recreate the layout. If I've got something wrong,  this approach should highlight it.

To the extreme, I rock a mic like a vandal.
Light up a stage and wax a chump like a candle.

Rob Strand

QuoteJust tried it
Thanks, so it  looks like it hasn't changed.    It occurred to me altium also had something for reading in gerbers and converting those to PCBs.  A guy at my work used it to check versions of a PCB or set of files once, at the time we were working with a third-party company. 

Here's an example of determination,
https://www.instructables.com/id/How-to-reverse-engineer-a-schematic-from-a-circuit/
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.