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:

https://electronics.stackexchange.com/questions/19669/algorithm-for-mixing-2-axis-analog-input-to-control-a-differential-motor-drive

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.

R2UK 2019

Back home now after R2UK 2019, and it was such an amazing weekend.

Three days of astromech fun, from talks about their use in the films, to weathering techniques. Driving accuracy course, to mini egg droid wacky races.

Was a bit anxious on the build up to the event, as I’d taken on the task of upgrading all the electronics in the driving course to make scoring automatic, along with registration via RFID. Thankfully however, once I’d done a little tweaking it all seemed to work fairly smoothly.

R2 not to scale! 😉 This is the DeAgostini scale model, done out in R2-KT colours by Paul Whitrow of TRamp

Lots of improvements to be made to it, and repairs after some droids didn’t seem to be avoiding the sensors that they *shouldn’t* be hitting! The actual metalwork took quite a bashing too as some droids thought it was more like a pinball machine.

This weekend is the must do event of the year for me. Its such great fun to hang around with a fantastic group of people. Everyone has something to contribute, and everyone will listen. Lots of advice was both given and received over the weekend, and I dare say motivation for building droids is at an all time high in the UK.

If you want to learn more about the driving course and the automated system I’ve done for it, its all in the git hub repository.

Power Tracking

One of the things I’m quite interested in keeping an eye on (and wish I’d started making notes a lot earlier) is how much battery power I consume at an event.

R2 is quite a heavy droid, with lots of gadgets, and is generally very active at events. I like to drive round and entertain rather than staying in one place. I also may have gone overkill on the battery, tho that being said by never fully depleting the cells I’ll probably get a lot more life out of the packs.

So, I have started a spreadsheet to keep track of how much actual power I use in a given event, to hopefully get some meaningful stats for my droid(s).

Besides standard stuff like the event name and date, I’ll be logging the amount of power put back into the droid after the event, as measured by the charger I’m using. I’ll also log approximate hours the droid was powered up, along with how much of that time he was actually active and moving around.

The spreadsheet will be public, as it may help other builders:

https://docs.google.com/spreadsheets/d/1nrjr1D3ImDR60H5FOuAsUtE8fBIQ3wupA-TJVFXjUx0/edit?usp=sharing

I just have to remember to keep it updated now! 😀

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.