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

Added WireViz wiring harness diagrams #434

Merged
merged 6 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions electrical/wiring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be a good place to explain to the uninitiated what a wiring harness.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the feedback! Next commit will have a note on terminology that explains the wiring harness.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit db7e185


## 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 @@ -72,6 +74,8 @@ On the other side of the cable, you will attach 4 Dupont female crimps. You now

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.

![Encoder Extension Harness Diagram](images/encoder_extension.jpg)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the first wiring harness encountered, a link or sentence or two about what to look for in this harness would be useful.

The DuPont connector displayed in this image seems to have 10 positions while it should only have 4. Is that an easy fix?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did worry about the DuPont connector image. Unfortunately, I pulled that image from the datasheet, which just uses the 10-position connector as a default, and there doesn't seem to be a reference for just the 4-position. Would it be less confusing if I removed the image? After all, a DuPont connector isn't as direction-sensitive as a Molex or a JST connector.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either that or use a cropped version of something like the image here, which also happens to be a really nice wiring diagram. Do you happen to recognize what software they might use for this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is quite nice, I wish I knew what software they're using. It almost seems like it could also be a GraphViz derivative like WireViz, but I'm not sure.

I'm currently working on a fix to the JST and Molex connector diagrams, I might be able to do the DuPont as well while I'm at it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit db7e185


| ![DuPont 4pin connector](images/4p-DuPont.jpg) | ![JST 4pin connector](images/4p-JST.jpg) |
| ---------------------------------------------- | ------------------------------------------------- |
| Dupont 4p connector. From top to bottom: VCC/5V (white) → GND (yellow) → enA (blue) → enB (green) | female 4p JST connector. From top to bottom: enB → enA → GND → VCC/5V |
Expand All @@ -88,6 +92,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 +118,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.
37 changes: 37 additions & 0 deletions electrical/wiring/back_encoder.yml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest moving this and other WireViz files into a seperate folder wireviz so its clear what's part of the WireViz files.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit db7e185

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/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)
19 changes: 19 additions & 0 deletions electrical/wiring/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/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/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/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/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
Binary file added electrical/wiring/images/Bullet_Connector.jpg
Achllle marked this conversation as resolved.
Show resolved Hide resolved
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/JST-XH.png
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not entirely clear from this diagram which wire goes where. I don't see how numbers 1-4 correspond to the positions in the connector.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Number 1 corresponds to the side with the notch, so in this case the right. However, this image suffers from the same problem as the DuPont diagram in that it's a 5-pin instead of a 4-pin. I'll see if I can find a better diagram image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit db7e185

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much better, but it's still not entirely clear what side you're looking at.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the wire side, with the clip on the bottom. As with the JST, I'll see if I can find a better diagram

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit db7e185

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_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/dupont.png
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be a 4p connector and would also benefit from an indication of which pin is which.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit db7e185

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/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)
58 changes: 58 additions & 0 deletions electrical/wiring/templates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
templates:
Molex-to-PCB: &molex
type: Molex Mini-Fit Jr.
subtype: female
pinlabels: [M+, M-, G, 5V, EnA, EnB]
show_pincount: true
image:
src: ./images/Molex-Mini-Fit-Jr-6-pin.png
caption: Molex Pinout
width: 165
Motor-to-Molex: &bullet
type: Bullet
show_pincount: false
#image: images/Bullet_Connector.jpg
Male-DuPont-4pin: &maleDP4
type: DuPont
subtype: male
pinlabels: [5V, GND, EnA, EnB]
show_pincount: true
image:
src: ./images/dupont.png
caption: Dupont Pinout
width: 500
height: 200
Female-DuPont-4pin: &femDP4
type: DuPont
subtype: female
pinlabels: [5V, GND, EnA, EnB]
show_pincount: true
Male-DuPont-3pin: &maleDP3
type: DuPont
subtype: male
pinlabels: [PWM, +, GND]
show_pincount: true
Female-DuPont-3pin: &femDP3
type: DuPont
subtype: female
pinlabels: [PWM, +, GND]
show_pincount: true
JST-XH: &jst_xh4
type: JST-XH
subtype: female
pinlabels: [EnB, EnA, GND, 5V]
image:
src: ./images/JST-XH.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