The Machine Spirit Awakens!Oct 23, 2020
While we're not quite ready to reveal the projects we've been spending a lot of the fall of 2020 on, Riley has been doing something with an in-development robot architecture in his spare time. This is a Land Raider model from Warhammer 40000, by Games Workshop, fitted up with lights, sounds, a camera, and working FPV drive!
While it's not finished yet, it runs and drives, so here's a video and an in-depth look on how he built it.
Check out the video; afterward, we’ve put together a bit of a build log, so that if you'd like to make one yourself, you'll be able to! The electronics were a bit fiddly, but by Q1 2021, Robots Everywhere will be releasing a fairly similar board as a kit. While it’s not designed to, Riley hope the final product will still fit in a Land Raider.
If it isn’t obvious, we don’t own 40k and didn’t design the model. Warhammer 40000, the Land Raider, Space Marines, etc, are all trademarks of Games Workshop.
Drive System and Tracks
The drive system actually came from an early attempt to build an RC land raider all the way back in 2008. Two servos converted for continuous rotation were set into the floor of the land raider. The servo spindle rode too high without removing some material, so the rear of the floor was thinned out with a mix of a dremel sander and a chisel, before the servos were set in place with epoxy. Tamiya tread kit wheels were then epoxied to the + pattern servo horn, setting the stage to put the tracks on. Free wheeling guide wheels were set in using Apoxie Sculpt at the corners and bottom of the tread; the tread was then routed betRileyen the inner wall and outer wall of the side assembly, and this process repeated for the other side. Sorry about the lack of good pictures - he did this part 12 years ago, and none of the original photos or video survived.
Note that the tracks had to be trimmed for width to fit on the Land Raider, and they still impacted the fitting of the Land Raider parts together; the back of the tank is slightly wider than stock. This will be masked by details in the final model assembly, and not be noticeable.
Lascannons and Heavy Bolters
The land raider was assembled as a standard pattern land raider, so Riley wanted that oh so satisfying FREEM and some lights when they fired. Obviously, this meant the heavy bolters needed servicing too, so Riley drilled all the guns out, and threaded 3mm LEDs into them. This was trickier than it looked, moreso because the only thin wire lying around was found to be very, very springy after soldering. They would be run by two I/O pins on the ESP32 board; originally Riley wanted three (with each side firing separately), but it’s a long story that goes on below.
Servos and FIRE!
Riley originally wanted to put the side sponsons and the bolter turret on small 4g servos, which would allow them to turn and be controlled by the remote. Mounts were made for these, and you can even see them on the model in some of the photos. The problem happened during testing, and due to the stiffness of the mounts, the springiness of the wire, and the Rileyakness of the servos, they were running extremely close to stall current. After the second one caught fire, it was realized this wasn’t in fact a fluke, and Riley decided in favour of safety and saving time, to scrap the servos. It was a good idea that Riley did, too; once all the assembly was finalized, the bolter servo no longer had room to fit anyway. This is the reason we only have two LED pins - the pins were originally allocated for the servos.
For anyone trying to reproduce the project and wanting fire-free servos: use HIGH quality sub micro servos; you can see how Riley inserted them between the lascannons and mounted them to the top of the sponson; Apoxie Sculpt was again used to make a pivot on the bottom of the servo.
To drive the robot we used the AI-Thinker version of the ESP32Cam. The ESP32Cam is a low-cost camera module with a built-in ESP32 microcontroller, which is a dual-core proprietary-architecture chip designed by espressif. Robots Everywhere is curerently working on industrializing it, as an alternative to our Robots Anywhere system for lighter weight, lower processing applications that can’t afford to use an Android phone. Riley figured this was a good use case for a prototype. The whole system was able to run off of a 1S lithium battery (4.2V peak 3.7V nominal) since the ESP32Cam runs on 3.3.
Designing the board was a bit tricky, as the board layout had to precisely position the ESP32Cam in front of the searchlight opening on the right front of the Land Raider, so that it could see outward. The opening was expanded slightly to allow more light into the camera aperture. The board was finally affixed to the Land Raider’s top turret assembly part, using yet more Apoxie Sculpt and 4 neodymium magnets. These magnets allowed the board to be removed and replaced, making development and fitting much easier. After final assembly of the tank, it will still not be possible to remove the board without major surgery, but the design choice made everything easier to put together as it went along.
The speaker needed a small amplifier, which is just a single transistor amp soemthing like this.
We chose to use the Arduino programming interface for the ESP32Cam; some configuration instructions can be found here. This could be reproduced using any of the ESP32Cam’s programming interfaces, but a previous project left Riley with a bunch of Arduino code for the camera and the servos already. After that, it was a matter of writing some code to run a speaker. This was, again, a solved problem, and just required converting some generic gun and laser wav sound effects into 8-bit PCM using Audacity, exporting that PCM to an array using vim’s “xxd” command, and playing it using Arduino’s PCM Library. This just required a small edit to the PCM library, to make it take a different pin as a variable, and to remove dependencies that prevented it from beign compiled for the ESP32.
After that, it was just a matter of writing some HTML for a web interface, which was, as described above, already in development for Robots Everywhere’s commercial plans for this system.
Some notes on the ESP32Cam that caused problems along the way, that are not documented by Espressif:
- Any significant induction can fry the camera module; use a beefy flyback diode if you’re driving any speakers off the same power circuit as the ESP32Cam. They are VERY sensitive.
- Pin GPIO16 is in fact input only.
- Pin GPIO0 should not be used for anything except flash-mode selection.
- The default serial debugging blocks the UART pins it has reserved; all debugging must be turned off to use these pins for PWM (you won’t get “ASCII soup” you get nothing).
- Pin 4 is the flashlight, and it is extremly difficult to desolder; using this as a PWM pin will make a blinding mess of flashing lights unless you cover the LED with putty.
We hope you enjoyed this tutorial; check back in a few weeks, and hopefully it will have some paint on it, good priming weather permitting.