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