Lab 6 - Pupper Assembly

Lab instructions

Step 1. Leg Assembly

  • Make 1 more left leg and 1 more right leg using instructions in lab 2, however, do not attach the “base” motor

Step 2. Bulkhead assembly


  1. Detach your robot arms from the base

  2. Attach 2 motors, one into each side of motor bulkhead, with 3 M3x6 phillips head screws each

  3. Attach left and right legs to the shafts of the motors you just installed and screw in shoulder bolt tightly

  4. Thread the wrapped cables through slots

  5. Zip tie the cables to keep them in place

  6. Clip motor controllers into place

  7. Connect motor and encoder cables to motor controllers

  8. Repeat this process so you have two motor bulkheads with four legs total

CHECK. Ensure Motor IDs are correct

Use this diagram to ensure you have the correct IDs set on your motor controllers. For each bulkhead you should have:

Right left/right motion hip motor: 1

Right forward/back motion hip motor: 2

Right knee motor: 3

Left left/right motion hip motor: 4

Left forward/back motion hip motor: 5

Left knee motor: 6

../_images/motor_ids.png

Motor ID diagram

Step 3. Body assembly


  1. Place front motor bulkhead

  2. Connect motor controller power cables (yellow XT30) and CAN connectors (small white JST GH) to bottom PCB

  3. Place back motor bulkhead and connect cables

  4. Flip robot and fasten bulkheads to bottom PCB with 4x M3x6 button head screws

  5. Tighten these screws well and/or add loctite

Step 4. Electronics bulkhead assembly


  1. Screw RPi into electronics bulkhead with M2.5x5 socket head screws such that the Pi is oriented like in the video.

  2. Connect USB C extension cable to Rpi

  3. Connect RPi camera flex cable into RPi. There’s a little grey flap that flips up on the connector that lets you slide the cable in. Flip the flap down to lock the cable in.

  4. Connect RPi to power by using 2-pin cable. Connect one end into 5V, GND pins near the Teensy and other side into RPi. Quadruple-check that the 5V and GND pins are going the right places. See diagram.

  5. Connect RPi to Teensy using USB A to USB micro cable

  6. Connect RC receiver to RPi with usb extension cable.

Step 5. Top panel assembly


  1. Insert the XT60 female side (conductor is a circular slot) of XT60 splitter cable into 3D printed power hub.

  2. Insert JST-XH extender balance cable into 3D printed power hub.

  3. Attach the 3D printed power hub to the top PCB with 2 M3x6 button head screws.

  4. Take the large nut off the power switch and then mount the power switch to the top PCB panel. Then secure the switch by threading on the nut from the bottom of the top panel.

  5. Screw the USB-C connector to the top PCB with 2 M3x6 button head screws

  6. Connect other female XT60 into the bottom PCB

../_images/rpi-pinout.png

RPi pinout.

../_images/IMG_0880.jpg

Bulkhead wiring.

../_images/IMG_0881.jpg

Zip-tie close up.

../_images/IMG_0882.jpg

Leg assembly.

../_images/IMG_0883.jpg

Electronics assembly.

../_images/IMG_0884.jpg

Bottom view of top PCB.

../_images/IMG_0885.jpg

Top view of top PCB.

Step 6. Attach front panel

  1. Attach the Pi Camera to the front Pupper panel with M2x4 socket head cap screws

  2. Attach the front Pupper panel with 2 M3x6 button head screws to the bottom PCB

Step 7. Bind RC receiver

  1. Get a FRSKY USB receiver and a BetaFPV Transmitter

  2. While holding the button on the USB receiver down, insert it into your computer. It should show a flashing red light.

  3. Then turn on the transmitter: Press and hold the power button for about 5 seconds until twice vibration. The LED will be green first. Wiggle the left stick until the LED turns blue. Then the LiteRadio is powered on.

  4. Press the BIND button from the back of the transmitter. The transmitter will enter the binding mode and last about 10 seconds, indicated by blue and red LED flash alternately.

  5. Once bound, the receiver should then show a solid (not blinking) green color.

  6. Unplug and re-plug the receiver into your computer and restart the transmitter. Then go to https://gamepad-tester.com/ in CHROME (no other browsers will work) to test that the receiver is receiving messages from the transmitter.

  7. Refer to the transmitter manual for more info if needed https://support.betafpv.com/hc/en-us/articles/900003583046-Manual-for-LiteRadio-2.

  8. Refer to the receiver manual for more info if needed https://www.frsky-rc.com/wp-content/uploads/Downloads/Manual/XSR-SIM/XSR-SIM-%20manual.pdf

Step 8. Finish hardware assembly

  1. Put velcro or dual-lock onto the bottom PCB where it says “battery”. For now we’ll use the power supply to run the robot so you don’t have to install the actual battery.

  2. Attach the top PCB panel with M3x6 button head screws.

  3. Check again with instructors.

  4. Marvel at your work!

Step 9. Flash code onto the Teensy

  1. Go to https://github.com/Nate711/DJIPupperTests/blob/master/README.md for instructions on how to download and set up the Teensy firmware

  2. Use VSCode PlatformIO to open the DJIPupperTests folder as a project and then upload the code to the Teensy. (Same thing as in labs 1-4).

Step 10. Flash software image onto Raspberry Pi

  1. Download our image

  2. Install Balena etcher

  3. Flash the image onto the micro SD card using Balena etcher.

  4. Insert the micro sd card into the Pi’s micro sd card slot (on bottom side of board)

Step 11. Enable the heuristic controller

  1. Connect the robot to your computer via the top USB-C port on the robot.

  2. SSH into the robot with ssh pi@raspberrypi.local. The password is raspberry. Ask for help if this doesn’t work.

  3. Run sudo systemctl enable --now robot to turn on the heuristic controller.

  4. Run sudo systemctl status robot to check that the service is running ok (should be green).

  5. Reboot with sudo reboot 0

Step 11.5. (Optional, Stanford only) Get Stanford Wifi access

  1. Once ssh’d into the robot, run ifconfig and record the wlan0 MAC address. This is the MAC address for the WIFI chip. It should be a series of hex characters like f0:2f:4b:07:ee:ea.

  2. Go to iprequest.stanford.edu on your computer, and make a new registration for the Pi. Select other device -> other wired. Enter the Wireless MAC address you got in step 1.

  3. Restart the Pi and SSH back in

  4. Run sudo raspi-config, go to System options -> Wireless LAN.

  5. Enter Stanford as the network name and leave password empty

  6. You might have to restart the Pi a few times, and use raspi-config to set the desired network a few times for it to work.

  7. To test if the Pi now has internet access, run ping www.google.com. It should say you’re getting bytes back from Google.

  8. If it doesn’t work, wait 20 minutes, restart the Pi, and try again!

  9. Make sure you change the password after connecting to Wifi or it will get hacked. We highly recommend physically labeling the robot with the new password.

Step 12. Take your robot on a walk

  1. Unplug the Pi from USB C.

  2. Place your robot on a flat, level surface. Position the legs as shown in the picture below.

  3. Power on the robot by hooking up the power supply to the bottom PCB (like you’ve done in labs).

  4. Connect the Pi with USB C to your computer.

  5. Wait for the robot to complete the calibration sequence. During the calibration sequence, the hips should turn inwards until they hit the stops, then back down. Then the thigh pieces should rotate upward until they hit their stops and then back down. TODO Add calibration video

  6. Flip all switches on the back RC transmitter down so they’re away from you.

  7. Turn on the RC transmitter by pressing the middle power button and moving the left joystick up and down until the light turns blue.

  8. Wait ~30s for the RPi to boot (the green light should stop blinking).

  9. Flip the lower left switch on the controller up to enable the robot. It’ll move!

  10. Flip the lower right switch on the controller up to start the robot trotting.

  11. Enjoy your hard work and play with Pupper!

  • The top right switch flips between trotting and walking.

  • Left/right on the left joystick controls turning.

  • Up/down on the right joystick controls forward/back.

  • Left/right on the right joystick controls strafing left/right.

../_images/startup-position.png

Startup position.

Resources

Wiring diagram

../_images/wiring-diagram.png

Wiring diagram.