HO15 Sentry Droid with Autonomy

Well, its been a boring year with no droid outings, tho thanks to doing some live youtube events under the Droid Builders UK banner, we’ve managed to raise over £14k for CALM.

I know droid 2 isn’t finished yet (tho some slight progress has been made which I will blog about later) but I have decided to push my knowledge and skillset by building an autonomous droid. Nothing as big or heavy as an astromech, but a much smaller and lighter HO15 droid. These are a new one that was built by Oliver Steeples for The Force Awakens.

The droid is designed to be driven using omni or mecanum wheels which allow it to not only drive forward and turn, but also to strafe to the sides and generally move in any direction it wants. The type of drive system is called a holonomic drive.

Originally I was just going to build it with standard RC controls, but after seeing a few articles and presentations about ROS it got my ambitions up! ROS is Robot Operating System, and whilst it isn’t technically an operating system, it is a very mature platform for developing robots on. As well as driving the droid it can also do navigation, obstacle avoidance, and even 2d/3d mapping of its environment.

So, the idea is:

  • Styrene HO15 droid, as accurate as possible.
  • 4 omniwheels as the drive.
  • Multiple (8?) ultrasonic range sensors to detect obstacles.
  • Xbox Kinect camera/sensor to detect 3d space infront of the droid.
  • RPi cam for remote operation.
  • Autonomous random movement – I can leave it to wander and it will just meander about the place, avoiding objects.
  • Directed movement – Take control of it directly to drive it, but still avoid objects as a safety measure
  • And even full mapping and navigation, tho this is definitely a stretch goal!

Central control will of course be a Raspberry Pi running Ubuntu and the latest version of ROS2. The original ROS is being rewritten and will be retired in the next year or so, so I decided to push forward with version 2 from the start. Unfortunately, this causes complications as most tutorials and packages are still designed for version 1. But then, I like making life difficult for myself!

Big printers

I’ve just done a post over on my other blog (seeing as it wasn’t R2 related), but it is going to be used a lot for my droids over the next few months.

So head over to read about the upgrades I’ve done on my CR10-S5 printer

Two years of Omnis!

I’m just about to do my first event of the year, and realised that two years ago at the same event, the organiser posted this picture:

Setup time for Bolton Comic Con – NWCC

This picture filled me with a sense of dread. Why? Because up until this point I had been running a single castor setup in R2’s center foot and I knew that with that in place my droid may as well have been a static one on a carpeted floor like this.

However, I had recently updated to an Omniwheel setup, using wheels from Vex Robotics.

With fingers crossed, I went to the convention and was so happy to discover that the omni wheel handled it all with no issues. I could turn, reverse, even spin on the spot with out a single problem. I had a great event and put plenty of smiles on faces.

That was two years ago and they’re still going strong!

A little dirty, but still good!

These have been over lovely smooth gym style floors, deep pile carpet, hard concrete, cobble stones (that wasn’t fun!), asphalt, pretty much any hard surface. Even driven through snow! Dozens of events, with a heavy weight droid of 60kg, and a very cavalier attitude of where I drive. In fact, the majority of the time I prefer to unload at a carpark nearby and drive him to the event.

Since replacing these I am now onto my third set of drive wheels (latest set are hard Vex colson wheels) but haven’t had to do a single thing with the center foot apart from a little bit of fluff cleaning.

Are there any downsides? Not that I’ve found. You do get a rumble that is really noticeable on wooden floors like gyms or village halls, but I actually like that. Feels very solid.

By far, this is one of the best upgrades I’ve done to the droid since his first event outing in 2017. Since then his main drives have also been upgraded to Vex parts, with hex bore Colson wheels holding up a lot better than the previous ones I had.

Now to get the batteries charged and ready for the fun times on Saturday.

Uniting the Builders

Recently I’ve been involved in a new project to unite all the different droid building clubs in the UK under a common umbrella. Hopefully to help share ideas and also get more than just R2 units at events.

R Series astromechs always go down well, but it would be really good to get some BB8s or MSE droids there too.

To this end, we have launched a new site:

Droidbuilders UK

We recently had our first meet up under this banner in Camberley. You can read a write up about it here.

So, if you’re building any type of droid from the Star Wars universe, pop along and see the site, and also join our Facebook group for chats with other members.

This isn’t designed to replace the current forums/groups/sites for the various builder clubs, more as an attempt to unify them all.

Show your driving skills

At last years R2UK event, the driving course was introduced. Originally by Colin Barker and Lee Towersey, built out of wood with 3d printed bumpers it went down a storm. It got rolled out a few times over the course of the year and I added the times to the MOT site.

I’m not one to let things lie tho. Times were manually entered into a spreadsheet, with any penalties added in by hand.

Not only that, the course took quite a while to strip down and put up due to all the power cables needed for the bumpers and gates.

This was where I come in. I was sure that I could help streamline the process and it was a nice project to work on. Along with my work, Mark Leigh and his brother started working on rebuilding the course out of aluminium box section to make things a bit sturdier.

I at least wanted to remove the need for all the cables going to the sensors, as this was a big pain in the setup, and was a bit of a mess. Whilst I was at it I came up with the idea that we could easily make them wireless so that when they’re triggered it automatically reports back to a central hub.

From there the ideas expanded! I didn’t want to have to redesign and reprint all the parts so everything had to reuse the physical bits. A Raspberry Pi would be used as a central hub to keep track of the times.

In the end I used a Wemos D1 Mini for all the sensors, as they were cheap and had more than enough I/O pins for what was needed. Both the bumpers and the slalom gates have the same electronics in them. The timing gates that start/stop the clock were microswitches but had to be reset each run so I switched these for ultrasonic range finders.

Finally, the clock got a major upgrade. Initially it just sent a signal to the Pi to say that the clock had started, but I quickly ran into latency issues. Due to this, the main timer for everything is not the Pi but the big clock itself. The timing gates are hardwired in and when they are triggered the clock sends the time back to the Pi in its API call.

So the Pi is using the same Flask python module that r2_control is using, I was already fairly familiar with it and it made creating an API very easy. The Pi is responsible for displaying and storing all the details about the runs, with Pi Zeros being used to display the various pages on monitors around the course.

As a final touch, I went really fancy! To register what droid and driver are about to do the course, they can now swipe an RFID tag. I built a simple reader with screen so that once the droid is ready to start they just swipe their tag over the reader. At R2UK there were some issues with writing tags which have since been solved. Even better, the new Builders ID cards have RFID chips built in.

Video courtesy of Rob Howdle

It took a couple of hours to work out some bugs on the course, some my own fault and others hardware limitations (seems the Pi’s onboard wifi wouldn’t allow more than 10 clients) but I worked around them and after that the course seemed quite popular again. Just need to write some better documentation and program up everyone’s ID cards.

Next step is to add another type of sensor… a shock sensors. Some people started getting quite competitive and the course was starting to take a few knocks. So a couple of accelerometers will hopefully make it back into a driving accuracy course!

All code is in the Builder’s github repository:


Motor Movement!

Well, the connectors didn’t turn up on Saturday, but they did turn up today! So after a bit of crimping, and a bit of soldering (and a few mistakes, but we won’t go into that) I had a couple of cables made up to allow me to connect the Q85 motors to the ODrive.

Here is one of the sets of cables. They consist of the red wires in the back that go to an MT60 connector that carries the main signal to the motors, and then another bunch of wires that come from the hall effect sensor that is embedded in the motor. This tells the controller where the motor is in its cycle, so that it knows which coils to energise.

Also needed were some capacitors across the sensor terminals to cut down on some noise. Instructions for doing this are here: https://discourse.odriverobotics.com/t/encoder-error-error-illegal-hall-state/1047/7

With all that in place, I gingerly powered it all up and set about calibrating everything. I followed a guide on the main astromech forum, along with the odrive guide for hoverboards (same principal as driving an astromech it seems). It took a bit of trial and error, that I’m hoping to iron out into a proper tutorial at some point, but the motors were eventually running!

The mixing that I’d done in software all looks like its working as intended. I can also bump the speed up incrementally, as I can with R2, but with a lot more control and accuracy.

I do need to change the ramping settings on this, which I may even make changeable on the fly from the controller. Also the multiplier may need some tuning to set top speed, but that will require some testing in situ. I need to push my changes back into github, and make sure that R2 still works with the new code.

I think this brings the electronics to a good resting place for now. Just going to tidy up some of the cabling and add a volt/current meter. Its time to concentrate on making the actual droid. So this weekend it will be time to don the breathing mask and start glueing everything together.

Software mixing

Currently, my PS3 controller code uses the channel mixing built into the Sabertooth speed controller. This means that I send it speed and turn commands, and the speed controller mixes these to drive R2 in a tank style, where you vary the speed in the feet to go forward/back or turn.

The problem with this is that not many speed controllers do this, so I am very much tied into using the Sabertooth with my code and the Sabertooth doesn’t support brushless motors. Droid 2 is going to use an ODrive, which has no mixing built in.

Well, until now!

I’ve abstracted out the speed controller portion of the code and added a function that takes the two axis from the drive stick and then outputs the required motor speeds. In this video you can see when I push the stick forward, the top number changes to show the position of the axis, and motor 1 is set a signal of 1, or full speed forward and motor 2 gets -1, or full reverse. (Remember, the motors are flipped)

I got the bulk of the code from here:


which uses cartesian to polar (and back) transformations.

I still need to hook up the motors, I’m waiting for some connectors to turn up, to check that it actually works and to do the code changes to send the correct signals, but this is a good step forward.

The other benefit to this change is that now I’m not limited to dual motor controllers, and can look at buying cheaper single controllers with a lot less smart technology built in.

Preston Comic Con tomorrow, so R2 and I are out all day, but if the connectors turn up that I’ve ordered, sunday will be a day of connecting and testing the motors.

She Speaks!

Minimal wiring is done now, enough to get everything powered up and r2_control installed.

A quick flash of an SD card, some tweaks to the install instructions, a few small tweaks to the code to make first boot a little smoother, and shes alive!

Only got audio working for now, but it meant I could test the base code and web interface. I need to get a remote working next I think, and then I can start working on interfacing with the Odrive and Q85 motors. Theres already a python module for that, so that saves a lot of work. Unlike the Sabertooth, which required me to write a python module to interface using serial.

Also, the documentation is now up to date for the latest version of Raspbian, and the code now auto creates basic configs correctly so it will work on first start without having to pre write any configuration files. It should also be easy enough to write a setup script to install required packages and python modules.

And of course, seeing as the Pi is powered up I can now remotely access it to do coding from the comfort of my office.

Inside Out

Most people start by building their droid, then doing the electronics. I’m pretty much doing it all in reverse.

Here you can see all the electronics for R2. The left hand board has all the main power, and the right hand board is the actual electronics. Both boards have edging around them, and will happily sit back to back, making the whole system easily removable. It also means that once removed, it can be opened up as shown to be worked on.

Wiring is nearly complete for the core parts (Pi, Odrive, and Amp), I just need to get an XT60 soldered on to accept a battery. Now, I know I’ve a load of XT60 connectors somewhere in my office, but so far they have eluded me. They must be somewhere *really* safe!

Also, at the top of the pictures you can see the stripped down Q85 motors, getting modified to freeze the clutch system.

Next step it to get power to the Pi at least so that I can start installing the brain. It will also be an opportunity to get the documentation improved, and initial config sorted, incase anyone else wants to use my code.

Oh, and I think I’ve decided on a name for my droid.

R0-S3, or Rose to her friends!

Droid number 2 on its way

I’m going to have to give it a work in progress name, but its a bit difficult without even knowing what dome I’m doing!

But anyway, I picked up the CNC’d styrene kit at R2UK this weekend, and decided to get a picture of everything I’ve gathered so far:

So here you can see:

  • Styrene kit, which includes:
    • Frame
    • Skins
    • Shoulders
    • Legs
    • Ankles
    • Skirt
  • Motors (Q85), tyres, and Speed Controller (ODrive)
  • Power distribution (fuses, wires, switches, relays)
  • Amp and speakers
  • Raspberry Pi
  • DC-DC power convertors.

I’ve also bought cells for another battery, which will be identical (a little more capacity) to R2’s current one. That way they can be switched.

Hopefully I’ll be able to make a start on something this weekend. My first main jobs will be:

  • Motor conversion – The Q85s have to have their clutch frozen and rims turned down
  • Electronics mount – I want all the electronics to be removable for ease of maintenance
  • Frame – Actually put the frame together

So, watch this space for which I decide to do.