Step 1: Build - smellslikeml/LitterBug_donkey GitHub Wiki
This guide is a modification of the original donkeycar build docs to build a the larger rover body of the LitterBug rover.
- Raspberry Pi 3
- PCA9685 Servo Board
- Picam (Night cam or regular)
- RC car (more on that below)
- PS3 SixAxis controller
- 20KG servo
- RGB LED (1) plus 330 ohm resistors (3)
Solar Power (Optional):
Extra Sensors (Optional):
Materials:
- Plenty of breadboard cables, solder + soldering iron, machine screws (3mm and 2.5mm), and metal wire
- metal rod
- 3D printer
- One 12X12 acrylic panel (sturdier, more aesthetic) or cardboard clip board (cheaper, easier to drill)
- Drill, screwdriver
Donkeycars are usually built using 1/16 scale "ExceedRC" brand rc cars as described in the donkey car build docs. For this project, you'll want to use a larger, more powerful rc car. We recommend going for a 1/10 scale rc car, preferably a "crawler" type rc car with some clearance underneath. This will allow the LitterBug to crawl over rough uneven terrain like sand, dirt, etc.
Some rc cars you can buy:
- Exceed RC 1/10 scale off-road rc car (more affordable version)
- Everest Gen7 sport 1/10 scale crawler (more expensive but excellent throttle control)
The most important part to keep in mind is the car's ESC. Make sure it is a brushed ESC that takes the standard RC 3-pin control signal (RC PWM style). If you choose to go with a more affordable body, you can upgrade the ESC to a crawler ESC like this one to benefit from improved throttle control.
For acrylic panel: Cut the 12X12 panel into three pieces- one large piece in the center and two equal sized slivers on each end like shown in the picture below. The slivers will be used for side panels to protect the electronics from the environment. If you got the solar power extras, you can use the solar panel width to measure the width of the base panel. The exact dimensions of each piece should be:
- Base- width: 170 mm, height: 200 mm
- Side panels (2x)- width: 67.4 mm, height: 200 mm
These dimensions are assuming you are using a solar panel with dimensions of 170 X 200 X 3mm. The LitteBug roll cage has been designed with these dimensions in mind. If you choose to go with a solar panel of a different dimension, you can modify the roll cage file accordingly.
For cardboard panel: Using some nose pliers, remove the hardware on the clipboard. Shorten the height of the clipboard to accommodate the longest length of your rc car base. The width of a standard clipboard should be wide enough to fit the roll bar cage snuggly. If this is not the case, you can modify the roll cage file accordingly.
Remove the decorative top of your rc car. Usually this is secured by some pins - keep these around to secure the platform and electronics to the car later. Your car should have four pegs used to secure the decorative top. Trace the location of these pegs onto the large cardboard/ acrylic base for your car and drill appropriately sized holes.
Check to see if your base fits correctly onto the car. You can secure the board down later using the pins you saved earlier.
Identify your car's ESC- looks like a large heatsink with a switch and two cables (normally colored red, white, and black). Detach the two cables from the ESC and mark on your base the approximate location. Drill a hole large enough to pull these two cables through to the other side of the base- you'll connect these cables to the servo hat later to control the rc car.
Next, layout all the boards you'll want to mount on the base- the raspberry pi, servo hat, and extra sensors( solar controller, powerboost 500, and battery).
With a marker, map out where the screwholes should go and drill. We recommend placing the raspberry pi by the front of the car and the servo hat close to the larger hole with the cables so its easier to wire. Screw down each board with appropriately sized machine screws and nuts to secure them. We used a screw set like this. Use the 2.5mm screws for all the boards.
Secure your base with all the components screwed in place onto the rc car body's pegs with the hairpin like pins you removed earlier. To get all the components ready to wire, we glued on a tiny breadboard in a corner of the base.
The PCA9685 servo motor driver board is I2C controlled. Connect the VCC and GND to a ground pin and 5V pin on the pi. Connect the SDA and SCL pins to the corresponding SDA and SCL pins on the pi (GPIO Pin 2 and GPIO pin 3 respectively). Then take the two wires from the rc car and plug them into the servo board. You should use channels 0 and 1 (printed on the board). Sometimes the colors match exactly -follow that pattern if that's the case. Otherwise, the darkest color is typically the ground pin which should be matched up to the darkest color on the servo board. Plug in the 20 Kg servo into channel 2 in the same manner.
As shown above, throttle servo gets plugged to channel 0, steering servo plugged to channel 1, and scoop servo to change 2.
If you've included the extra sensors, follow this wiring diagram to plug them all together.
Also, if you've decided to go solar for the pi, follow this diagram for solar power wiring.
Go to the cadfiles directory of this repo and download the roll bar cage stl files (front and back) to print. They should take ~3-4 hours for the front piece, 2-3 hours for the back so we recommend printing overnight. We also recommend printing with supports for the front piece, skip it for the back piece. PETG is a good choice for the filament as it can take a beating.
You'll notice that there are some slits on the sides and tops of the roll bars. You can squeeze the solar panel and acrylic panels in these slits if you've chosen to go with these components. To secure the components even more, you can squeeze some silicone in the slits. You should now have a body that looks like this:
and like this:
If you've skipped those pieces, you can simply bolt down each leg of the roll bars to the acrylic/cardboard base.
Line up the roll bars, mark the screw holes, drill, and screw in place using 3mm size screws.
You'll notice the front roll bar has some mounting holes. Screw your picam of choice to the front. If your camera has lights to each side, those can be covered by the LitterBug's "eyebrows". The hole at the top is for the motion sensor if you added it. Pass the sensor underneath the roll bar and push through until the white half dome protrudes from the top. We recommend the pins of the motion sensor are facing the back roll bar so that the cables can reach your pi and breadboard a little better.
Next, print all the components for the scoop, which are the rest of the files in the cadfiles directory. The scoop file takes the longest, so save that one for overnight! Print the bumper and arms with supports. You can clean off the extra material with pliers or chisel it away with a Dremel tool.
Note: regarding the bumper, you may have to modify the pegs that screw onto the body to fit your car.
Remove your car's bumper and replace it with the print, using the same screws.
Note, you may have to modify the pegs that screw onto the body to fit your car. This bumper was designed for the Everest Gen 7 sports 1/10 scale car and may not be the same for other rc cars. The 20 Kg servo will be placed in the gap between the bumper and the body's frame as shown below:
Each arm has a hole the size of the tabs on the hinges of the bumper. Insert the tabs and align the holes together. Screw each respective arm to its corresponding hinge tab on the bumper as shown below.
Make sure that the gaps on the elbow of each arm are facing inward toward each other - this is where you'll attach the metal rod in a moment. Screw the scoop to the ends of each arm.
Now that there is some tension between each arm, cut the rod to the appropriate length (around x mm) and place it between the dips in the elbows of the arm. Tie the servo to the rod like in the image below:
Your end result should look something like this:
Congrats! You've successfully built a LitterBug! Follow the next Drive it instructions to configure the software to drive your rover.