Blog

One droid is never enough

The time has come….

R2 needs a friend.

I’ve actually started collecting bits to make my next droid. I’ll be picking up the bulk of the droid in a couple of weeks at R2UK. I’ve already got the motors, speed controller, Pi, and a few other little bits. Most of the other electronics are on order too.

Not 100% certain on what type of dome the droid will have, nor the colour scheme that I’ll use. That can all come later.

What I do know:

  • Brushless Q85 motors (e-bike hub motors).
  • ODrive controller for the motors (a lot cheaper than the Roboteq most people use).
  • Will use r2_control (of course), but be able to swap out to standard RC quickly.
  • Same battery as R2, so I’ll have two identical ones.
  • All electronics will be on a removable board so that I can pull them out to work on outside of the droid.
  • Dome will be wireless with its own (small) battery.
  • Cheaper than R2 (much cheaper!)

I’ll probably also use steel feet to keep the center of gravity nice and low for stability.

So, it will mean a fair bit to do. I’ve never really worked with styrene before and with using both wireless comms for the dome and an ODrive there will be a fair amount of coding work to do on r2_control.

I’m going to try and keep a better build log for this one, with more work in progress pictures.

r2_control Shopping List

A few people have expressed an interest in my r2_control system, so I thought I’d do a post about how it works, and what it needs.

At the core is a Raspberry Pi 3B+. This runs the main code, and also any programs to interface controls (PS3, Web, Instant Messenger). It also acts as a wifi hotspot.

From this Pi you can add a Sabertooth 2×32 and Syren 10 via USBSerial to allow control of those using packet serial communications. A python library for which I have written to make things easier.

Recently, a GPIO option has been added to the core code so that you can trigger relays and other switched items directly from pins on the Pi. I use this to trigger the relays that break the connections to the foot motors and dome motor.

Lastly, an i2c connection is available for communicating with various other boards such as the Adafruit 16 Channel PWM controllers, RSeries lights, ReelTwo system, etc.

A basic system to have simple control over a droid with no opening panels and no triggering of dome light sequences can be had with just:

  • 1 x Raspberry Pi 3B+
  • 1 x Sabertooth 2×32
  • 1 x Syren 10
  • 1 x USB FTDI (For USB interface to Syren 10)
  • 1 x PS3 controller (Or PSMove)
  • Whatever dome lights you wish, eg TeeCees.
  • Battery
  • Power distribution (Fuses, power switch, etc.)
  • 2 x Drive motors (eg. 100W Scooter)
  • 1 x Dome motor (eg. pittman)

You can run the Pi from the BEC built into the Sabertooth if you wish, but I do recommend at least a 2A buck converter on its own fuse.

If you want to run any servos, you can add the Adafruit PWM controllers onto the i2c bus, up to 6 can be added by configuring the address jumpers. One in the body and one in the dome is usually enough.

This system can of course be added to. Relay control over the motors, light sequence triggers, and other gadgets such as smoke machines.

R2 PSI using off the shelf parts

Introduction

The current state of PSI displays from the club are either simple TeeCees ones, or the VADER boards. I’ve had a couple of the VADER boards in R2 for a while, but recently I’ve had issues with some of the LEDs failing. Unfortunately, as these are WS2812 addressable LEDs which means when one fails then you can’t communicate with any further down the line. They are also all surface mounted, so not exactly easy to replace, especially as they are so closely spaced. On top of this, they are not open source so I have been unable to do any fun stuff with i2c triggers.

I wanted to build some PSIs from off the shelf parts and allow it to do some more interesting effects. After a lot of hunting, I finally found some i2c addressable 8×8 RGB Matrix displays from Seeed Studios. Couple one of these with an Arduino Pro Mini, and you have a relatively cheap PSI using standard components.

The Seeed Studio RGB Matrix

Build

Bill of Materials

  • RGB Matrix (https://coolcomponents.co.uk/products/grove-rgb-led-matrix-w-driver)
  • Arduino Pro Mini (https://coolcomponents.co.uk/products/arduino-pro-mini-328-5v-16mhz)
  • Header pins for the arduino (not necessary)

Circuit

Not really much to the circuit, just using the pro mini i2c pins to talk to the rest of R2’s i2c bus, and then software i2c on another couple of pins to talk to the display. This has to be done as the displays have a fixed i2c address of 0x65, so only one can be on the bus at once. This also allows the rendering of the display to be offloaded onto the arduino.

The display comes with a short cable which you can cut the end off and solder directly to the pro mini if you wish.

The current code can be found at:

https://github.com/dpoulson/r2_control/blob/Repackaging/firmware/PSI_Matrix/PSI_Matrix.ino

Usage

Currently, when powered on the display will just do the standard left/right swipe of two colours (all configured in the arduino code). Also, two functions have been added to either pulse a heart or do a random pattern to simulate a malfunction. Others may be added at a later date, feel free to suggest ideas!

The heart doesn’t really show up too well through the diffuser, but it still looks like a pulsing pattern, so I’m happy with that.

The random malfunction will take an integer number of cycles and randomly turn pixels on to a random colour on each cycle. The number of pixels that are on will slowly reduce to zero. Ten cycles is about 1 second

To trigger these effects, you send an i2c command to the address defined in the arduino code (typically 0x06 or 0x07) with either H or M as the first character, and then a number of cycles (1-255).

I have implemented this into my r2_control software, which allows me to script actions together. The plan is to do something like trigger the malfunction sound, set the PSIs to malfunction mode for enough cycles to cover the sound, and also flap all the panels in a pseudo random way.

Installation

I have a set of Ultimate PSI Housings from IA-Parts, which hold both the standard teecees boards, and the vader ones. To fit the square peg (rgb matrix) into a round hole, I knocked up a very simple 3d print.

This clips in nicely to the PSI housings, however you may have to do your own system.

Summary

I’m actually quite pleased with these. Its really hard to find a densely packed RGB matrix as an off the shelf product. After much searching this was only one I could find. Its by no means as nice as the custom VADER boards (and I know others in the community are working on their own), but it does work and looks a lot better than the TeeCees ones (IMHO).

Not only that, its cheap too at about £25 per PSI (not including any costs for making the mount, but in my case that was a few pence for a 3d print)

Next step is to figure out some more fancy things I can do with it, and maybe add a selector jumper so that you don’t need to change the code between the front and rear PSIs. I may also do a custom board to connect it all together in a neater form factor.