WireViz icon indicating copy to clipboard operation
WireViz copied to clipboard

Need the ability to go from connector to wire to wire to connector

Open Halfwalker opened this issue 3 years ago • 11 comments

Just discovered WireViz, and it looks awesome. I'm in the process of laying out a new wiring harness for my car, and this will be a great visual check for the wiring plan.

Being an automotive harness, there are several runs (+12V, GND, +5V, SignalGND) that are a long wire with crimp-splices off to various branches. That is, the wire bundle heads out from the ecu to a branch point, where several wires go to a connector along with a pair of spliced wires. For example a sensor that takes +12V, GND and signal.

I've come close to modeling this, but not quite. In the image below we have 5 wires from connector X1 going to X3. In the middle are two crimp-ferrules to branch off to X4 image The yaml to generate this is

connectors:
  X1: &template_con
    type: Molex KK 254
    subtype: female
    pinlabels: [GND, VCC, SCL, SDA, TMP]
  X2_1: &template_ferrule
    style: simple
    type: Crimp ferrule
    subtype: 20 AWG
  X2_2:
    <<: *template_ferrule
  X3:
    <<: *template_con
  X4:
    <<: *template_con
    pinlabels: [SCL, SDA]

cables:
  W1: &template_wire
    gauge: 0.25 mm2
    length: 0.2
    colors: [BNBK, RD, GNRD, VT, OGWH]
    category: bundle
    wirecount: 5
  W2:
    <<: *template_wire
  W3:
    <<: *template_wire
    colors: [GNRD, VT]
    wirecount: 2

connections:
  -
    - X1: [3-4]
    - W1: [3-4]
    - [X2_1, X2_2]
    - W2: [3-4]
    - X3: [3-4]
  -
    - X1: [1-2]
    - W1: [1-2]
    - X3: [1-2]
  -
    - X1: 5
    - W1: 5
    - X3: 5
  -
    - [X2_1, X2_2]
    - W3: [1-2]
    - X4: [1-2]

The problem is I can't get the GND, VCC and TMP wires to join the W2 wire bundle. The W1-crimps-W2 bundle represents the main harness, with the crimps branching wires out to another connector.

This can get somewhat complicated, as there are several branching points on a harness, each with anywhere from one to several branches heading off to connectors/sensors/etc. Sometimes a branch can itself have branching points. For example, a branch point that heads down to the transmission where it branches to reach the reverse-indicator switch and the speed sensor.

Essentially I need a way to connect W1 wires 1,2,5 directly to W2 wires 1,2,5 so they're not hanging out in space as in the image above. Even if we were to take the crimp-ferrules out of the picture and branch right out from the W1 wire bundle to connector X4, it would still need to be able to connect W1 to W2. That's because there can (will) be several branch points in the harness between connectors.

Visualize 4 large connectors inside the car at the ECU location, all interconnected. Then about 80 wires in a single bundle going through the firewall to the engine bay. That large wire bundle then loops around, branching off multiple times, until it reaches the furthest connector/sensor.

Here's an example ... Multiple connectors in lower right at ECU location, then two main bundles gong left on the table. You can just see the firewall grommet there by the plastic bags. Then heading up the table into the picture, branch after branch after branch, lots of connectors. Need to be able to model something like that :) image

Halfwalker avatar Feb 02 '22 15:02 Halfwalker

Thank you for sharing your challenging use case. Currently, WireViz does not support a wire to be part of more than one single bundle. You can try to insert virtual splices (not present in the physical harness) between the wire bundles, like this:

connectors:
  X1: &template_con
    type: Molex KK 254
    subtype: female
    pinlabels: [GND, VCC, SCL, SDA, TMP]
  X2_1: &template_ferrule
    style: simple
    type: Crimp ferrule
    subtype: 20 AWG
  X2_2:
    <<: *template_ferrule
  X3:
    <<: *template_con
  X4:
    <<: *template_con
    pinlabels: [SCL, SDA]
  # Virtual splice to enable wires going through more than one bundle:
  X:
    style: simple
    autogenerate: true
    type: " "
    ignore_in_bom: true

cables:
  W1: &template_wire
    gauge: 0.25 mm2
    length: 0.2 m
    colors: [BNBK, RD, GNRD, VT, OGWH]
    category: bundle
  W2:
    <<: *template_wire
  W3:
    <<: *template_wire
    colors: [GNRD, VT]

connections:
  -
    - X1: [1-5]
    - W1: [1-5]
    - [X, X, X2_1, X2_2, X]
    - W2: [1-5]
    - X3: [1-5]
  -
    - [X2_1, X2_2]
    - W3: [1-2]
    - X4: [1-2]

That will get you closer to what you want, I guess: issue270 Problems with this solution:

  • The virtual splices are shown as small boxes in the diagram.
  • The 0.4 m wires are all split in two parts with different designators (as if they were actually spliced).
  • The wire destination documentation of these wires in the two bundle boxes W1 and W2 are incomplete.

It should be possible to add a feature to hide such a virtual splice completely when needed, but the other problems above will still exist. The latter problem could be solved by referencing the next bundle (at the other side of the hidden splice) if that makes sense, but the problem with different designators is harder to solve without a major restructuring of how WireViz represents the wires internally.

kvid avatar Feb 02 '22 17:02 kvid

Thanks for the fast reply, and with a solution ! That image looks totally fine. It will be nice to hide the virtual splices, but that's pretty damn good as it sits.

Does it matter that the wires are split into two parts internally ? The BOM lists the correct length needed for each one. I think it's probably OK tha tthe W1/W2 destination info isn't there. Leads to treating them as a continuation of the wire.

Halfwalker avatar Feb 02 '22 18:02 Halfwalker

Thanks for the fast reply, and with a solution ! That image looks totally fine.

I'm glad you can use my suggestion.

It will be nice to hide the virtual splices, but that's pretty damn good as it sits.

I guess one major advantage with reducing the small box to an invisible point, is to avoid bending adjacent wires around the small box.

It might be possible to just hide all empty connectors, or maybe a show: false attribute is better?

Does it matter that the wires are split into two parts internally ? The BOM lists the correct length needed for each one.

As long as the wires at both sides of the virtual splice are equal, then the BOM should join the entries correctly, but the user gets no warning if there is a small difference between the two wires, or if it's a cable at one side and a bundle at the other side.

Maybe a general feature to warn about differences between wires that are connected together could be useful? It must of course be possible to turn this off where differences are intended.

I think it's probably OK tha tthe W1/W2 destination info isn't there. Leads to treating them as a continuation of the wire.

In a more complicated harness with a lot of crossing wires and many wires with the same color, the wire destination documentation is very important to easily see where all the wires go.

kvid avatar Feb 03 '22 16:02 kvid

It will be nice to hide the virtual splices, but that's pretty damn good as it sits.

I guess one major advantage with reducing the small box to an invisible point, is to avoid bending adjacent wires around the small box.

That would definitely be nice ... I think the highest-use case would be to have them invisible (show: false) so perhaps have that as the default, but with the ability to show them if required.

Does it matter that the wires are split into two parts internally ? The BOM lists the correct length needed for each one.

As long as the wires at both sides of the virtual splice are equal, then the BOM should join the entries correctly, but the user gets no warning if there is a small difference between the two wires, or if it's a cable at one side and a bundle at the other side.

Seems to be OK. I added a length: 1.3 to the W2 wire, and it renders fine. The BOM lists the wire length correctly as a single entry. image

Id Description Qty Unit Designators
1 Connector, Crimp ferrule, 20 AWG 2   X2_1, X2_2
2 Connector, Molex KK 254, female, 2 pins 1   X4
3 Connector, Molex KK 254, female, 5 pins 2   X1, X3
4 Wire, 0.25 mm², BNBK 1.5 m W1, W2
5 Wire, 0.25 mm², GNRD 1.7 m W1, W2, W3
6 Wire, 0.25 mm², OGWH 1.5 m W1, W2
7 Wire, 0.25 mm², RD 1.5 m W1, W2
8 Wire, 0.25 mm², VT 1.7 m W1, W2, W3

How about possibly a grouping-object that could be assigned to other objects. Kind of like a wire-bundle. That would draw a grouping box around the objects to indicate that they belong together and should be rendered close together. In this case the grouping-object would be attached to the two Crimp ferrules and the three virtual splices.

Halfwalker avatar Feb 03 '22 16:02 Halfwalker

Does it matter that the wires are split into two parts internally ? The BOM lists the correct length needed for each one.

As long as the wires at both sides of the virtual splice are equal, then the BOM should join the entries correctly, but the user gets no warning if there is a small difference between the two wires, or if it's a cable at one side and a bundle at the other side.

Seems to be OK. I added a length: 1.3 to the W2 wire, and it renders fine. The BOM lists the wire length correctly as a single entry.

I'm sorry for being unclear. These columns of BOM entries must be equal to be joined: ('description', 'unit', 'pn', 'manufacturer', 'mpn', 'supplier', 'spn') and in a joined entry, the qty column is the sum from entries joined, and the designators column is the union of designator sets from entries joined.

How about possibly a grouping-object that could be assigned to other objects. Kind of like a wire-bundle. That would draw a grouping box around the objects to indicate that they belong together and should be rendered close together. In this case the grouping-object would be attached to the two Crimp ferrules and the three virtual splices.

Yes, this has been discussed earlier as well, e.g. in #174. The tweak work-around suggested in https://github.com/formatc1702/WireViz/issues/174#issuecomment-707372543 was added in v0.3 and you can try it out by appending the following to my YAML suggestion above:

tweak:
  override:
    # Note that these autogenerated designators might be generated
    # differently in future versions of WireViz. Define each splice
    # manually with unique designators to be safer.
    _X_1:
      shape: point
    _X_2:
      shape: point
    _X_3:
      shape: point
  append: |-
    // Tweaking splice nodes to keep close to each other
    subgraph cluster1 {
      color=white // Same as background to hide the surrounding frame
      _X_1
      _X_2
      _X_3
    }

The lower part above enclose the virtual splices in a cluster to keep them close to each other. As a bonus, I also included a dirty way to hide the virtual splices by overriding their shape. This should then be the result, and might be what you aimed for when asking for a grouping-object: issue270 Note that I reference autogenerated designators in my quick and dirty tweak section above. That is not recommended, so please use user defined unique designators instead (like X2_1 and X2_2). This might get simplified in future versions of WireViz.

kvid avatar Feb 04 '22 00:02 kvid