Skip to content

Commit

Permalink
Merge pull request #434 from abust005/wireviz-harness
Browse files Browse the repository at this point in the history
Added WireViz wiring harness diagrams
  • Loading branch information
Achllle authored Nov 7, 2023
2 parents cabb09b + db7e185 commit 8f1b426
Show file tree
Hide file tree
Showing 20 changed files with 280 additions and 1 deletion.
25 changes: 24 additions & 1 deletion electrical/wiring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ The wiring is what connects each of the 10 motors to the motor board carrying po
![wiring diagram](images/wiring_diagram.png)
Wiring diagram for one side of the rover. The other side is identical.

Harness diagrams further below were generated with [WireViz](https://github.com/wireviz/WireViz/) and can be re-generated with the *generateHarness.bat/.sh* scripts.

>**Some notes on terminology:**
>***Wiring harness*** *(also called **cable harness** or **wire assembly**)*: the collective term for all the wiring and cables that are run through a system to connect power sources, sensors, data lines, etc. In the case of the rover, this means the cables that feed power to the motors, the control signals to the servos, and the encoder data back to the control boards.
>***Cable***: A group of wires/conductors, usually with an outer sheath.
>***Wire***: A single conductor, solid or stranded core, of any gauge.
## Overview

We will be building several cables, all visualized in the above diagram. Make sure you have all wire types and connectors and understand the routing of the cabling as it will save you time down the line.
Expand Down Expand Up @@ -34,6 +44,8 @@ We will be building several cables, all visualized in the above diagram. Make su

In total: 24 JST female crimps, 6 JST female connectors, 36 female DuPont crimps, 6 MH-FC PCI-E connectors, 28 male DuPont crimps, 16 female DuPont crimps, 4 3pin DuPont connectors, 8 4pin DuPont connectors, and 12x bullet connectors+crimps.

The harness diagrams in this README also contain an integrated bill-of-materials (BOM) for each cable so you can organize the parts appropriately.

> **Tip**: Rather than crimp each wire yourself, you can buy premade connectors, cut the wires, and then solder them to the other side. For soldering using a heat gun, you could get something like the following: [heat gun solder seal wire](https://www.amazon.com/Amliber-Connectors-Solderstick-Waterproof-Electrical/dp/B0BXKHBDFB/ref=sr_1_3?keywords=heat%2Bgun%2Bsolder%2Bseal%2Bwire&qid=1690233825&s=industrial&sprefix=heat%2Bgun%2Bsolder%2Cindustrial%2C159&sr=1-3&th=1). This depends on your preferences. When using premade connectors, be extra careful of the pinouts so you connect the correct wire ends together.
> **Tip**: For the thinner (AWG20 and AWG22) wiring we strongly recommend using ribbon cable (where each wire strand is attached to the next) to keep wires clean and strong. Alternatively you can twist the wires which also helps reduce interference from electrical noise.
Expand Down Expand Up @@ -70,7 +82,11 @@ Use the 4 pieces of 36cm *encoder wire*. Separate the wire ends from the ribbon
On the other side of the cable, you will attach 4 Dupont female crimps. You now have one of 4 crimped wires, so repeat the process for the 3 other wires.

Now we'll insert each crimped cable into the appropriate connectors. Start by writing the pinout on each of the connectors for easy troubleshooting using a sharpie: B, A, G, 5 for channel B, channel A, ground, and +5V respectively. Copy over the annotations from the images below to your connectors, paying close attention to the orientation of each connector.
Now we'll insert each crimped cable into the appropriate connectors. Start by writing the pinout on each of the connectors for easy troubleshooting using a sharpie: B, A, G, 5 for channel B, channel A, ground, and +5V respectively. Copy over the annotations from the images below to your connectors, paying close attention to the orientation of each connector. Use the harness diagram below as a guide to make sure that each connector is in the right position in its housing.

> **Tip**: On single row connectors like the JST-XH and the DuPont, there is usually a mark on the connector housing (like a triangle or a cutout) that indicates position 1. These are more visible in the harness diagrams.
![Encoder Extension Harness Diagram](images/encoder_extension.jpg)

| ![DuPont 4pin connector](images/4p-DuPont.jpg) | ![JST 4pin connector](images/4p-JST.jpg) |
| ---------------------------------------------- | ------------------------------------------------- |
Expand All @@ -88,6 +104,10 @@ This process is very similar to the steps we did in (1), except we'll use male D
Grab the 2 pieces of **encoder wire** of 53cm and 2 pieces of 46cm and prepare the wire ends for crimping. Attach the crimps to each wire and repeat for each set of wires.
As before, mark the connectors as in the images below, then insert the wires into the connectors.

![Front Encoder Harness Diagram](images/front_encoder.jpg)
![Middle Encoder Harness Diagram](images/middle_encoder.jpg)
![Back Encoder Harness Diagram](images/back_encoder.jpg)

| ![Molex PCI-E connector top](images/pcie-top.jpg) | ![Molex PCI-E connector bottom](images/pcie-bottom.jpg) |
| ------------------------------------------------- | ------------------------------------------------------- |
| Top of PCI-E connector. 5V → enA → enB | bottom of PCI-E connector. M+/A → Mi/B → GND |
Expand All @@ -110,6 +130,9 @@ You now how all the wiring completed for the drive motors!

## Step (5) 4x: Dupont male 3pin ↔ DuPont female 3pin connectors

![Front Servo Harness](images/front_servo.jpg)
![Back Servo Harness](images/back_servo.jpg)

All that's left are the servo ribbon cables. The red and black wires are (+) and (-) voltage to the motor and the white cable carries the PWM signal to command the on-board controller to command the motor to the desired angle, using the built-in absolute encoder. The PCB header pins for the servo motors are wired in the same order (PWM, (+), (-)) so we're essentially building an extension cord in this step. One one side you'll be using male DuPont crimps while on the other you'll use female DuPont crimps. The connectors for both sides are identical.

You should now have 12 finished cable assemblies. Congratulations! Don't forget to make sure each connection is solid and tested before moving on.
Binary file added electrical/wiring/images/back_encoder.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added electrical/wiring/images/back_servo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added electrical/wiring/images/encoder_extension.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added electrical/wiring/images/front_encoder.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added electrical/wiring/images/front_servo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added electrical/wiring/images/middle_encoder.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions electrical/wiring/wireviz/back_encoder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
connectors:
Molex-to-PCB:
<<: *molex
M+-to-Molex:
<<: *bullet
pinlabels: [M+]
M--to-Molex:
<<: *bullet
pinlabels: [M-]
Encoder-to-Molex:
<<: *jst_xh4

cables:
W1:
<<: *motor
length: 41 cm

W2:
<<: *enc
length: 46 cm

connections:
-
- Molex-to-PCB: [1]
- W1: [1]
- M+-to-Molex: [1]
-
- Molex-to-PCB: [2]
- W1: [2]
- M--to-Molex: [1]
-
- Molex-to-PCB: [4, 3, 5, 6]
- W2: [1-4]
- Encoder-to-Molex: [4, 3, 2, 1]

metadata:
title: Back Encoder Cable (x2)
19 changes: 19 additions & 0 deletions electrical/wiring/wireviz/back_servo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
connectors:
Dupont-to-Board:
<<: *femDP3
Dupont-to-Servo:
<<: *maleDP3

cables:
W1:
<<: *servo
length: 54 cm

connections:
-
- Dupont-to-Board: [1-3]
- W1: [1-3]
- Dupont-to-Servo: [1-3]

metadata:
title: Back Servo Cable (x2)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions electrical/wiring/wireviz/encoder_extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
connectors:
DuPont:
<<: *maleDP4
Encoder-JST:
<<: *jst_xh4

cables:
W1:
<<: *enc
length: 36 cm

connections:
-
- DuPont: [1-4]
- W1: [1-4]
- Encoder-JST: [4-1]

metadata:
title: Corner Encoder Extension Cable (x4)
37 changes: 37 additions & 0 deletions electrical/wiring/wireviz/front_encoder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
connectors:
Molex-to-PCB:
<<: *molex
M+-to-Molex:
<<: *bullet
pinlabels: [M+]
M--to-Molex:
<<: *bullet
pinlabels: [M-]
Encoder-to-Molex:
<<: *jst_xh4

cables:
W1:
<<: *motor
length: 54 cm

W2:
<<: *enc
length: 53 cm

connections:
-
- Molex-to-PCB: [1]
- W1: [1]
- M+-to-Molex: [1]
-
- Molex-to-PCB: [2]
- W1: [2]
- M--to-Molex: [1]
-
- Molex-to-PCB: [4, 3, 5, 6]
- W2: [1-4]
- Encoder-to-Molex: [4, 3, 2, 1]

metadata:
title: Front Encoder Cable (x2)
19 changes: 19 additions & 0 deletions electrical/wiring/wireviz/front_servo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
connectors:
Dupont-to-Board:
<<: *femDP3
Dupont-to-Servo:
<<: *maleDP3

cables:
W1:
<<: *servo
length: 41 cm

connections:
-
- Dupont-to-Board: [1-3]
- W1: [1-3]
- Dupont-to-Servo: [1-3]

metadata:
title: Front Servo Cable (x2)
8 changes: 8 additions & 0 deletions electrical/wiring/wireviz/generateHarness.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
wireviz front_servo.yml --prepend-file templates.yml
wireviz back_servo.yml --prepend-file templates.yml
wireviz front_encoder.yml --prepend-file templates.yml
wireviz middle_encoder.yml --prepend-file templates.yml
wireviz back_encoder.yml --prepend-file templates.yml
wireviz encoder_extension.yml --prepend-file templates.yml
del *.svg, *.tsv, *.gv
move *.jpg ../images
8 changes: 8 additions & 0 deletions electrical/wiring/wireviz/generateHarness.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
wireviz front_servo.yml --prepend-file templates.yml
wireviz back_servo.yml --prepend-file templates.yml
wireviz front_encoder.yml --prepend-file templates.yml
wireviz middle_encoder.yml --prepend-file templates.yml
wireviz back_encoder.yml --prepend-file templates.yml
wireviz encoder_extension.yml --prepend-file templates.yml
rm *.svg *.tsv *.gv
mv *.jpg ../images
37 changes: 37 additions & 0 deletions electrical/wiring/wireviz/middle_encoder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
connectors:
Molex-to-PCB:
<<: *molex
M+-to-Molex:
<<: *bullet
pinlabels: [M+]
M--to-Molex:
<<: *bullet
pinlabels: [M-]
Encoder-to-Molex:
<<: *jst_xh4

cables:
W1:
<<: *motor
length: 3 cm

W2:
<<: *enc
length: 44 cm

connections:
-
- Molex-to-PCB: [1]
- W1: [1]
- M+-to-Molex: [1]
-
- Molex-to-PCB: [2]
- W1: [2]
- M--to-Molex: [1]
-
- Molex-to-PCB: [4, 3, 5, 6]
- W2: [1-4]
- Encoder-to-Molex: [4, 3, 2, 1]

metadata:
title: Middle Encoder Cable (x2)
72 changes: 72 additions & 0 deletions electrical/wiring/wireviz/templates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
templates:
Molex-to-PCB: &molex
type: Molex Mini-Fit Jr.
subtype: female
pinlabels: [M+, M-, G, 5V, EnA, EnB]
show_pincount: true
image:
src: ./connector_images/Molex-Mini-Fit-Jr-6.png
caption: Molex Pinout
width: 165
Motor-to-Molex: &bullet
type: Bullet
show_pincount: false
Male-DuPont-4pin: &maleDP4
type: DuPont
subtype: male
pinlabels: [5V, GND, EnA, EnB]
show_pincount: true
image:
src: ./connector_images/DuPont-4.png
caption: Dupont Pinout
width: 300
height: 200
Female-DuPont-4pin: &femDP4
type: DuPont
subtype: female
pinlabels: [5V, GND, EnA, EnB]
show_pincount: true
image:
src: ./connector_images/DuPont-4.png
caption: Dupont Pinout
width: 300
height: 200
Male-DuPont-3pin: &maleDP3
type: DuPont
subtype: male
pinlabels: [PWM, +, GND]
show_pincount: true
image:
src: ./connector_images/DuPont-3.png
caption: Dupont Pinout
width: 300
height: 200
Female-DuPont-3pin: &femDP3
type: DuPont
subtype: female
pinlabels: [PWM, +, GND]
show_pincount: true
image:
src: ./connector_images/DuPont-3.png
caption: Dupont Pinout
width: 300
height: 200
JST-XH: &jst_xh4
type: JST-XH
subtype: female
pinlabels: [EnB, EnA, GND, 5V]
image:
src: ./connector_images/JST-XH4.png
caption: JST-XH Pinout
width: 231
height: 202
Encoder: &enc
colors: [RD, BK, BU, WH]
gauge: 22 awg
Servo: &servo
colors: [WH, RD, BK]
gauge: 20 awg
Motor: &motor
colors: [RD, BK]
gauge: 18 awg

0 comments on commit 8f1b426

Please sign in to comment.