Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto generate wire harness based on hardware #1523

Open
jabdoa2 opened this issue Jun 24, 2020 · 21 comments
Open

Auto generate wire harness based on hardware #1523

jabdoa2 opened this issue Jun 24, 2020 · 21 comments

Comments

@jabdoa2
Copy link
Collaborator

jabdoa2 commented Jun 24, 2020

Generate wire harness documentation using WireViz (https://github.com/formatc1702/WireViz) based on the hardware definition in MPF (switches, coils, PSUs and specifics for each hardware).

@nmbaker2000
Copy link

Hey, I would love to help with this. Where should I create the files/code to generate the documentation? I wasn't sure if there was a specific space it should be done at

@jabdoa2
Copy link
Collaborator Author

jabdoa2 commented Sep 3, 2020

I guess this could become a separate command in MPF: https://github.com/missionpinball/mpf/tree/dev/mpf/commands. We can then later refactor code into other parts. Does that make sense?

@hyphz
Copy link
Contributor

hyphz commented Dec 26, 2020

This sounds fascinating but how would it work? Just give the pinouts for the headers on the board, or show the ins and outs of every part? That could be a very big diagram?

@jabdoa2
Copy link
Collaborator Author

jabdoa2 commented Dec 26, 2020

For certain hardware (i.e. FAST or Multimorphic) we show the headers for their node boards. Based on that we could generate wire harnesses. I guess we should start simple and then extend from there

@hyphz
Copy link
Contributor

hyphz commented Dec 27, 2020

So I manually produced this for FAST, how would this then work? Names of the connected switches/drivers shown in place of the ID numbers, or actual wiring shown? Would we need to know the physical locations of the parts on the playfield to get the sequence right?

fasttest

@jabdoa2
Copy link
Collaborator Author

jabdoa2 commented Dec 27, 2020

Yeah exactly. We would have to discover the type of node boards for FAST (code exists for that) and then store a mapping for connectors to inputs/outputs. Based on the defined switches and coils we could generate a wire harness description for wirewiz, excel or similar tools

@hyphz
Copy link
Contributor

hyphz commented Dec 27, 2020

Ok. I tried to work out the basics of fast PSU mapping and got this, but it seems it could run out of control kind of easily? Also a bunch of confusion trying to work out the mapping but that's probably just me not really knowing anything about this..
fasttest

@jabdoa2
Copy link
Collaborator Author

jabdoa2 commented Dec 27, 2020

Sweet. I guess we can think about separating exports later. This is better than what most makers got initially

@hyphz
Copy link
Contributor

hyphz commented Dec 28, 2020

I have no idea if it's right though, or what comparable would be for something like PROC. I sure as hell don't want to add something that generates a wiring diagram someone follows and electrocutes themselves.

@jabdoa2
Copy link
Collaborator Author

jabdoa2 commented Dec 28, 2020

We can add a warning. This should only be a starting point. In production machines you will probably also have some additional connectors and you would want to edit the wirewiz by hand anyway.

@hyphz
Copy link
Contributor

hyphz commented Dec 28, 2020

Fair. Should I try to autogenerate FAST or start from a different one? Is there a good example using FAST? I see that demo_man uses P_ROC/WPC which would make sense, but I don't know if generating these diagrams is a priority for WPC tables that have existing wiring harnesses?

@jabdoa2
Copy link
Collaborator Author

jabdoa2 commented Dec 28, 2020

Yeah FAST and P3-Roc make the most sense. Demo man is not optimal but it might be easy to modify it for those platforms. I mean just start the command and then we can create (or adjust) unittests in mpf.

@hyphz
Copy link
Contributor

hyphz commented Dec 28, 2020

Fair enough. Sorry, one other thing you mentioned above. You said that code exists for discovering node board types for FAST, I have found that code, but it applies only if the boards are already connected, is that the stage at which this would be used? Or would it be run before the boards are set up so they are not there to be tested yet?

@hyphz
Copy link
Contributor

hyphz commented Dec 30, 2020

I've been looking at this but there doesn't seem to be any way to populate the machine. values for lights, switches, coil, etc. without calling initialise_mpf() which will try to connect to actual hardware and halt if it fails (obviously there is no point in calculating wiring for the virtual platform!). It would seem wasteful to use an auxiliary parser to translate all the stuff just for wiring but possibly rather disruptive to divide initialization into two parts?

@hyphz
Copy link
Contributor

hyphz commented Dec 31, 2020

Ok, gotten this far. Wireviz doesn't like these huge images outputs though. It looks much better in SVG but I can't upload that.
wiretest

@hyphz
Copy link
Contributor

hyphz commented Jan 1, 2021

More complete now. Still becomes a huge file. FAST don't seem to have any data on their DMD-based or Servo controllers any more, is there documentation available somewhere?
wiretest

@jabdoa2
Copy link
Collaborator Author

jabdoa2 commented Jan 2, 2021

Sweet. Maybe we have to generate separate images for separate wire harnesses eventually?

I think I got a datasheet for the servo boards somewhere.

@hyphz
Copy link
Contributor

hyphz commented Jan 2, 2021

I'll tidy what I have to pass prospector for now.

@hyphz
Copy link
Contributor

hyphz commented Jan 9, 2021

Is there a good archive of test tables? I was only able to use one of the sample open source tables from the web page, since most of the tables are not open source, and many of the open source ones are for older versions or contain specification errors.

@jabdoa2
Copy link
Collaborator Author

jabdoa2 commented Jan 9, 2021

Have a look at: https://missionpinball.org/projects.html. In the bottom we got a list of machines with source.

@hyphz
Copy link
Contributor

hyphz commented Jan 9, 2021

Those are the ones I looked at, but as I said several are obsolete and some will not build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants