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)
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.
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.
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.
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.
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:
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.
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.