diff --git a/electrical/wiring/README.md b/electrical/wiring/README.md index b84c4b19..9ffffc46 100644 --- a/electrical/wiring/README.md +++ b/electrical/wiring/README.md @@ -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. @@ -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. @@ -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) | | ---------------------------------------------- | ------------------------------------------------- | @@ -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 | @@ -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. diff --git a/electrical/wiring/images/back_encoder.jpg b/electrical/wiring/images/back_encoder.jpg new file mode 100644 index 00000000..e60c7806 Binary files /dev/null and b/electrical/wiring/images/back_encoder.jpg differ diff --git a/electrical/wiring/images/back_servo.jpg b/electrical/wiring/images/back_servo.jpg new file mode 100644 index 00000000..4047017c Binary files /dev/null and b/electrical/wiring/images/back_servo.jpg differ diff --git a/electrical/wiring/images/encoder_extension.jpg b/electrical/wiring/images/encoder_extension.jpg new file mode 100644 index 00000000..0f385f57 Binary files /dev/null and b/electrical/wiring/images/encoder_extension.jpg differ diff --git a/electrical/wiring/images/front_encoder.jpg b/electrical/wiring/images/front_encoder.jpg new file mode 100644 index 00000000..5dc9706f Binary files /dev/null and b/electrical/wiring/images/front_encoder.jpg differ diff --git a/electrical/wiring/images/front_servo.jpg b/electrical/wiring/images/front_servo.jpg new file mode 100644 index 00000000..585e993e Binary files /dev/null and b/electrical/wiring/images/front_servo.jpg differ diff --git a/electrical/wiring/images/middle_encoder.jpg b/electrical/wiring/images/middle_encoder.jpg new file mode 100644 index 00000000..0bdb9eb2 Binary files /dev/null and b/electrical/wiring/images/middle_encoder.jpg differ diff --git a/electrical/wiring/wireviz/back_encoder.yml b/electrical/wiring/wireviz/back_encoder.yml new file mode 100644 index 00000000..c95e99c8 --- /dev/null +++ b/electrical/wiring/wireviz/back_encoder.yml @@ -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) \ No newline at end of file diff --git a/electrical/wiring/wireviz/back_servo.yml b/electrical/wiring/wireviz/back_servo.yml new file mode 100644 index 00000000..dfd79c6c --- /dev/null +++ b/electrical/wiring/wireviz/back_servo.yml @@ -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) \ No newline at end of file diff --git a/electrical/wiring/wireviz/connector_images/DuPont-3.png b/electrical/wiring/wireviz/connector_images/DuPont-3.png new file mode 100644 index 00000000..5f9f0469 Binary files /dev/null and b/electrical/wiring/wireviz/connector_images/DuPont-3.png differ diff --git a/electrical/wiring/wireviz/connector_images/DuPont-4.png b/electrical/wiring/wireviz/connector_images/DuPont-4.png new file mode 100644 index 00000000..07d07edf Binary files /dev/null and b/electrical/wiring/wireviz/connector_images/DuPont-4.png differ diff --git a/electrical/wiring/wireviz/connector_images/JST-XH4.png b/electrical/wiring/wireviz/connector_images/JST-XH4.png new file mode 100644 index 00000000..30220c28 Binary files /dev/null and b/electrical/wiring/wireviz/connector_images/JST-XH4.png differ diff --git a/electrical/wiring/wireviz/connector_images/Molex-Mini-Fit-Jr-6.png b/electrical/wiring/wireviz/connector_images/Molex-Mini-Fit-Jr-6.png new file mode 100644 index 00000000..9c94f61e Binary files /dev/null and b/electrical/wiring/wireviz/connector_images/Molex-Mini-Fit-Jr-6.png differ diff --git a/electrical/wiring/wireviz/encoder_extension.yml b/electrical/wiring/wireviz/encoder_extension.yml new file mode 100644 index 00000000..34607c5b --- /dev/null +++ b/electrical/wiring/wireviz/encoder_extension.yml @@ -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) \ No newline at end of file diff --git a/electrical/wiring/wireviz/front_encoder.yml b/electrical/wiring/wireviz/front_encoder.yml new file mode 100644 index 00000000..949b33df --- /dev/null +++ b/electrical/wiring/wireviz/front_encoder.yml @@ -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) \ No newline at end of file diff --git a/electrical/wiring/wireviz/front_servo.yml b/electrical/wiring/wireviz/front_servo.yml new file mode 100644 index 00000000..96c14b09 --- /dev/null +++ b/electrical/wiring/wireviz/front_servo.yml @@ -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) \ No newline at end of file diff --git a/electrical/wiring/wireviz/generateHarness.bat b/electrical/wiring/wireviz/generateHarness.bat new file mode 100644 index 00000000..3c192f31 --- /dev/null +++ b/electrical/wiring/wireviz/generateHarness.bat @@ -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 \ No newline at end of file diff --git a/electrical/wiring/wireviz/generateHarness.sh b/electrical/wiring/wireviz/generateHarness.sh new file mode 100644 index 00000000..9b78e719 --- /dev/null +++ b/electrical/wiring/wireviz/generateHarness.sh @@ -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 \ No newline at end of file diff --git a/electrical/wiring/wireviz/middle_encoder.yml b/electrical/wiring/wireviz/middle_encoder.yml new file mode 100644 index 00000000..d43c0aca --- /dev/null +++ b/electrical/wiring/wireviz/middle_encoder.yml @@ -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) \ No newline at end of file diff --git a/electrical/wiring/wireviz/templates.yml b/electrical/wiring/wireviz/templates.yml new file mode 100644 index 00000000..b6668d22 --- /dev/null +++ b/electrical/wiring/wireviz/templates.yml @@ -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 +