Null Hypothesis: Finishing Up and Testing the Ragebridge v1

This it!

The post where my project gets stuck in motor controller hell. It happens to everything I try to build a motor controller for, so be prepared to read about exploding FETs and endless nondeterministic troubleshooting!

Well, the story is actually slightly happier than that. In the past few days,

  • The frame has been put together, all the wheels mounted, and battery pack made
  • The Ragebridge has been installed and the robot successfully tested and driven using it, seemingly exhibiting no adverse noise issues
  • The Ragebridge has been successfully detonated when a motor suddenly locked up.

Let’s start from the beginning.

With the wheels bored out, making hubs was the next step. I decided to make these more consistently on a Nice Thing with digital readouts, courtesy of the Edgerton Shop (They were also the nearest straight knurling tool, incidentally). The knurls will help the hubs not slip and strip out against the soft plastic bore of the McMasterbots wheels.

The hubs are installed with an arbor press.

Two wheels in. The hubs are very conventional “drill hubs” with a 3/8″-24 internal thread and internal shoulder that lets the reverse-threaded 5mm locking screw hold the hub in place against both threads. I’ve always found it funny how the ‘cheap drill’ converged solution ended up using an English and a Metric thread on the same part. The outer thread is not M10 or a metric thread, and the internal thread is definitely 5mm x .8 and not #10-32, which only fit down to a few threads. I’m mildly interested in how shady Chinese factories converge towards which design to copy and paste.

It’s starting to look like a robot now.

I temporarily secured the front wedge on with a few screws in preparation for a test drive.

Okay, robot’s done. Nothing more to see.

Using a spare 7S battery pack (from the long-retired Segfault) and the Botbuttz controllers I bought a while back, I threw together this test rig just to try out how the robot handles. Conclusion: It handles like a pushybot with a wide wheelbase and near-midpoint center of gravity! Unlike Clocker, which is back-heavy out of necessity and so oversteers very easily, this thing is extremely stable in turns. The braking effect of the BB controllers also contributes to snap turning response and smooth starting and stopping. These are all features I want to make sure Ragebridge can duplicate.

I spent a while scooting this around before moving onto the real challenge: the aforementioned Ragebridge.

I soldered up another board (the first one having been put into the Silly Media Lab Vehicle). There were no changes made to the board layout, only the modifications addressed in its first post which included moving the low-side gate drive bypass capacitors into the right place.

After verification of the hardware functionality, I spent the majority of 2 days hammering out an R/C input firmware for the board. I added features in the following order:

  • Radio signal-loss failsafes! I figured if I just wrote a dumb Servo-to-PWM program, it would stay that way forever. ESCs for robots need to have a way to shut off the motor outputs on recognition of signal loss, so the robot doesn’t just keep rolling. This part wasn’t difficult: every time a valid servo pulse is received in the pulse-reading interrupt, a flag is set to indicate the reading was good. A checking routine runs once per half-second to see if there were any channels which did not set their validity flags – if there are, then the gate drivers are shut off until all signals are good again.
  • Command ramping, meaning the ESC takes a small amount of time to slew from one direction to another. This is to prevent instantaneous “step reversing” which can cause huge current draws, up to twice the DC bus voltage to appear at your ESC’s power inputs, exploding motors, and other terrible things. I created quite an epicly named function, mapWithRampingAndDeadBand(); to perform this task.
  • Linear stick response. Directly mapping of the pulse widths to PWM output %, through the ramping limiter. This was just to get the robot driveable so I could add…
  • Invert mode, a feature which allows you to redesignate which end of the robot is forward. Useful for invertible bots like NH because otherwise your robot would drive backwards when upside down, as well as have swapped turning behavior. This is activated by the channel 5 toggle witch on my radio, and just swaps the left and right commands while adding a negative sign.
  • Exponential stick response. This makes the initial response ‘softer’ so the robot can be driven more precisely when moving slowly. It tends to reduce spin-out and oversteer tendencies. It is implemented as a simple lookup table – raw command goes in, expo command comes back.

I began to add a ‘stick calibration’ mode, but decided against it for now. Stick calibration is a luxury, because radios can generally be trimmed and have their endpoints modified to suit just about any desired pulsewidth range.

The current version of the RB firmware is here. It’s written in Arduino 1.0.1 (which finally got rid of the CTRL+SHIFT+M bug!). I generated two exponential response tables, one a little more expo than the other. I found the “more expo” one to be a little sluggish in responding without moving the sticks really far, but your experiences may vary.

Ragebridge v1 installed in the robot on its little standoffs…

After testing the controller out on a power supply first (which has nice features such as non-infinite current output in case of a fault) I put the test battery right back in because I hadn’t gotten to making the actual robot pack yet, then made some test driving videos!

The “basic test” was done right after I finished the linear stick mapping, and the more advanced testing is with exponential.

I like Ragebridge’s functionality in those tests. While open-floor driving is not as strenuous as pushing another robot (trying to push you back), high-current transients like from reversal and stopping will be what causes noise-induced failures and latchups. I didn’t observe any of those issues during that test driving, which bodes well for more sustained heavier loads. Unfortunately I neglected to put a Wattmeter on the thing, so I don’t actually have power throughput figures. Typical drill motor drivetrains in this size robot will draw about 30-40A per motor accelerating or changing directions and about 15 amps spinning out the wheels.

With at least a slim prospect of the robot working properly, I started putting together the battery pack:

The voltage of this pack will be 8S2P in lithium iron phosphate, so 25.6V nominal and 28v peak. This high voltage was just to get the speed I wanted out of the motors, but it could prove to be the proverbial Achille’s Heel… or perhaps Achille’s A123 Cell for the robot.

Those yellow things are PTC thermal fuses. I usually just lay more busbraid across the cells to put them in parallel, but the PTCs add another layer of failsafing by limiting the rate at which the cells can differentially discharge. If one cell suddenly fails (or gets punctured) and becomes a short, then the very low resistance of the bus braid will let the other healthy cell short into it, potentially causing even more damage. The PTCs will at least limit this to a reasonable current.

I chopped up some spare 4S JST balance extension cables for the cell taps. Generally I make my own using JST-XH connector shells and pins (e.g. Digikey’s 455-2217-ND), but it takes longer (and most chargers don’t have slots for 8S pack taps anyway). One JST lead is the lower half of the pack and the other is the upper half.

The balance leads are insulated by some Kapton tape layers as I soldered them in. I didn’t want them laying directly on the cell tops any more, after this happened, but on this pack there’s no space to route the wires only down the sides of the cells (it will be laying flat in the robot).

Since this pack will be more enthusiastically jostled inside the robot, I’m giving it a layer of foamy armor.

And after Giant Heatshrinking! I gave the pack its initial balance-and-charge wakeup routine with my 1010B+ charger doohickey.

While the pack was slow-roasting to perfection, I took care of the last bits of electrical work on the robot itself.

This adorable ABS-printed connector holder houses a Deans connector and an XT-60 connector. The Deans is going to be the master switch via the “Georgia Tech Key” method. In order to prevent myself from being confused at which terminal to charge the battery from versus to bridge together (hint: bridging the battery is a bad thing), I just used a totally different connector for the charge plug. The connector housing is mounted to the bottom plate.

This is the “Georgia Tech Key”, so named because I’ve only seen it on random GT creations before. Technically it’s called a removable link.

I made this loop a little too long and it sticks out the top of the robot by a little, but some tape should keep it down. In the worst case I’ll just replace it with a directly shorted Deans connector.

Alright, here it is. That’s it. The robot’s done.

Now to hand it off to other people and drive it around until it blows up! The best way for me to find the weaknesses of any of my builds is to give it to other people. I subconsciously go easy on things I know may be unreliable (the so called Creator’s Mercy), but other people have no concept of, say, the drills being severely overvolted, or for instance in the case of the Chibikarts, that flooring the throttle from a standstill may not result in satisfactory behavior.

I wasn’t able to whip out the video camera in time to capture the magic moment, but what happened was this:

And this:

What triggered the failure was a MITERS member driving (very happily and enthusiastically) NH into a solid machine frame at pretty close to top speed. The robot stopped moving, and I instructed him to give a little throttle to see if the controller was still working. It’s actually very difficult to judge what people consider ‘a little throttle’ based on experience, so I can only assume that it was near full stick or something. A small explosion was seen inside the case.

The superficial damage was the blown ground trace and one very, very unhappy MOSFET. The actual damage, though, as I found out through subsequent hours of checking and debugging, was pretty much the whole thing. The Arduino Nano was fried (noted when I powered it back on and the ATMega started drawing half an amp…), as were all 4 FETs on the exploded side (gate-to-source shorted through), both of the IRS21844 gate drivers on that side, the gate-to-source protection zeners (which I’m sure did all the protection they could before exploding), as well as half of the 74LS08 quad AND gate that is involved in piping the PWM signal to the gate drivers.


After replacing most of the semiconductors (and the Nano) failed to make the controller work consistently again, I decided to just scrap this board. Some times, enormous transients damage components in ways that are unexpected

And that’s the motor after I took it apart.

I think a combination of being oversped (18v overvolted to 28v) and sudden impact (running into the solid object) must have blown off the commutator segment. These motors are not really what I would call “well made” since the whole drill they come in costs $20. Running 28 volts is certainly up for compromise. But, I enjoy the speed of the bot on such a voltage.

Good thing I have a small forest of these drills!

So the final version of the story is, NH was finished and blown up, and is now unfinished. Putting together a new controller (with some mods I will discuss below) and pitching the bot  back together should not take long.

ragebridge mods

Now that I’ve gotten to know Ragebridge a little better, I have in mind a list of issues and changes I’d like to make when it’s time for version 2. Since V1 actually seems to work fairly well, this is not an immediate task.

First issue to take note of is of course the misplacement of the gate drive bypass caps. This is what led to the very first board not working at all until I changed it. Clearly this is a routing matter and the second version of the board has to address it, but for now it is easy to hack by hanging the little capacitor off the pins of the 21844 chip.

Second, the row of input headers at the top of the board are not in a very useful order. Two of them were designed for “servo” style connectors which are terminated signal-power-ground, and two for ‘potentiometer’ style inputs, terminated power-signal-ground. Well, I got the servo input order wrong anyway – those two headers actually are connected signal-ground-power. So I had to make two different styles of deceptively incompatible servo cables to suit the board because I needed 3 channels of input. I’d just line them all up signal-power-ground in the future, even the “analog” inputs, for better consistency.

Next, and an issue I can hack around for now, is the way that the power traces narrow awkwardly and haphazardly:

Those yellow highlights is where the trace width drops significantly from the average. The ones at the left and right bug me in particular – I was definitely trying to keep the controller within a reasonable width, but the heavy power traces around them are easily double the width and very short too. I was intending to reinforce those with braid or wire, I think, but didn’t actually do it for this board.

The circle near left center is a really obvious design derp. Most of the power stage of the board is basically rotated 180 degrees from eachother, except that current sensor placement. The right side of the board has no corresponding narrowing – current flows down through the vias on the right center two FETs for MA2, and the right side’s current sense path is a straight shot.

Given that these traces are all made in 1 oz copper, they’re exceptionally prone to sudden current overloads, such as a near doubly-overvolted drill motor suddenly slamming to a halt. The current sense path on the left is a little more difficult to reinforce since it’s under that FET, but as long as I’m not using the current sensor on these boards yet, I could hard-jump it with a piece of wire.

Overall, I’m satisfied with how Ragebridge has been behaving (short of being inductively crowbarred by an unhappy drill motor), and I’m going to be building more of them to test on other bots soon…and of course fixing this one.


Null Hypothesis Grand Update: From Zero to Something, I’m Not Sure What

What do you mean Robot Battles at Dragon*Con is in 3.5 weeks?!

Again? I swear they move the thing up one week every year just to surprise me. Actually, it’s more like 2 and a half weeks before I get to Epic Road Trip once again from Boston to Atlanta (ideally not through The Sprawl) and temporarily set up base camp at the Invention Studio. So maybe it’s time to start on a robot or something.

Luckily, I’ve actually been working on Null Hypothesis on and off for about a week. As explained in its introductory post, I was needing to separate a large 8 x 48″ panel of 1″ thick UHMW into slightly funny-shaped bars with the waterjet. I test cut one of the less important frame pieces to check for quality of finish, and determined that only cutting on the highest quality was going to even have a hope of getting through the material. UHMW is notoriously hard to do anything abrasive to since it resists abrasion really well.

One mistake I made but only realized later is that I was testing that piece on a setting meant for polypropylene plastic, which machines much easier – one of the most machinable plastics.. Every material is assigned a “machinability” value in the OMAX software, and this is one factor in controlling how fast the jet moves – and cut quality is pretty much a function of slow. Even “generic” plastic and acrylic-specific settings have machining speeds around half of polypropylene. Therefore, I elected to just throw the panel on the machine and hope for the best using the highest quality finish.


By the way, cutting a mushy plastic like UHMW – or any plastic, really – causes a disgusting film of plastic goo to cover the surface of the pool, because the particles both float and stick together. I was skimming handfuls of plastic snot out of the tank as the job progressed.

The job took an hour and a half, which I can’t really say is much faster than me cutting off a bunch of barstock like I would have done Back In The Day. I had bought enough UHMW barstock in the correct size (1″ thick, 2.5″ wide) to make most of the frame anyway because I was uncertain that the huge panel would have been useful. But, with the combination of very high quality cut (slooooow) and actually selecting the correct material properties, the frame pieces came out very smooth and square. I was otherwise prepared to redesign the frame a little to get rid of those hard internal square corners and slots to relieve me of the extra machining.

Also on deck in the same session was the front and rear steel parts, the top and bottom polycarbonate covers, and the internal electronics mounting structure. Above are the front wedge and eventual rear bumper thing. Both are made from annealed 4130 plate steel purchased from McMaster.

While I don’t really have facilities big enough to heat treat these plates short of throwing it on top of a gas fired barbeque grill for an hour, buying a plate of generic mild steel was actually more expensive – a 6 x 36″ plate of 4130 in 1/8″ thickness costs $36, whereas generic 1018 steel in the same dimensions is more like $50. Strange, given how much more versatile 4130 can be –  not only is it stronger even in annealed form than mild steel, but I could harden it to the high Rockwell C40s.

I attribute it to McMaster knowing what people buy most frequently and giving those product some… extra markup.

Here’s the pile of structural parts. The top and bottom plates are 1/8″ polycarb, and the supplementary electronics armor is 3/8″.

I’ve pre-bent the rear bumper because it took me a few tries to get it right. First, the extra-strength 4130 defeated my attempts to bend it using the largest metal brake I could find – a 10 gauge rated, 50″ box-and-pan brake. The cold 4130 plate, a foot wide and at the limit of the machine’s capacity, would not bend.

Next, I tried heating it up with a torch, but I don’t think I got the part nearly hot enough (that or my torch was too small, another possibility). While the hot plate did bend, I didn’t tighten the finger clamps enough or something similarly bad happened, so my bend line slipped about 1/4″ back on one side. Whoops, asymmetric part…

I gave up and recut the plate out of some scavenged 1018 mild steel plate – this bent just fine. Honestly, for Robot Battles I could well make this plate from jello and it would still be enough.

UHMW is almost always manufactured oversize and to rather loose tolerances because its primary industrial application seems to be skid pads and wear plates. For that, precision is not necessary. My 1″ UHMW plate was more like 1.03″ (not 0.003, 0.03), so some of the rectangular slotwork in the top plate didn’t fit. I plowed off the extra thickness in the region of the slots using tinymilll, our super adorable LittleMachineShop mini mill.

The frame standoffs are stock from McMaster. Now, these things come threaded, but I actually just need spacers (unthreaded, pass-through), so I drilled them out.

It turns out that large standoffs only cost about $1 in quantity. McMaster must have found a cheap supplier for standoffs recently, because I definitely remember almost all of the small ones like 4-40s and 6-32s also costing $1 each or so. But now they seem to hover around 30-40 cents.

This is great, because it means it’s actually far cheaper for me to buy a bag of them as “stock” than to machine them myself. Previously, if I needed a bunch of odd standoffs, I’d machine all of them, which takes alot of time, and I’m sure an industrial manufacturing process can produce more consistent parts than I ever care to.

Because I was able to keep the slots and cutouts, the frame acted as its own machining fixture very well. I clamped the parts to the table and drilled where needed. It was pretty much assembled in situ. All of the fasteners are 3/8″-16 button head cap screws. On the top and bottom, I’m going to have 1/4″-20s because larger screws have impractically large heads to countersink into 1/8″ thick material.

The back plate was clamped in place on the bot first, then the mounting holes drilled and tapped in-place. The steel was very slightly too acute of an angle, but the screw pressure was enough to keep it fully flush with the beveled surfaces. I like how this back plate came out.

One advantage of keeping with the strict waterjetting diet is that I was able to easily make these ‘form fitting’ mounts for the drills. Granted, 3 holes and a big center bored hole would have gotten me the same.

Because the material is so thick, the entirety of the gearbox is well supported. The motor is actually fixtured from movement on the outside of the frame rails…

…like so. I’m really hoping these 3D printed ABS hub-things stand up to physical abuse. They’re 100% solid, but ABS is still a pretty soft plastic, especially when laid down in noodle form using the Lab Replicator (because we live in the future now). This let me build the double-D shape of the drill output exactly.

I didn’t actually get to mount the motors permanently – the frame wasn’t done with hole drilling, and I was also missing the correct screws to secure the flange to the frame and those giant set screw things for the motors.

Most of the frame is now completed. The top and bottom plates were also drilled and tapped in-place using the holes in the polycarbonate plates as a template. Afterwards, they were clearance-drilled and countersunk appropriately.

Frame fully assembled now, but without the front wedge holes drilled yet. I was waiting on the correct length 1/4″-20 screws to show up before I mount everything.

In the mean time, I started dissecting drills. I have, in total, 8 dril….err, drive motors for this thing, and hopefully I don’t go through all of them. These are all Harbor Freight p/n 68239, the latest model of shady 18v drill HF offers. They have a verified 24:1 gearbox, though with a plastic first stage (not necessarily bad, in my opinion).

Even 24:1 is a little high ratiowise for the speeds I want to get to with this thing. The bot will hit about 15mph on 26 volts (8S A123s, 3.2 volts each), which is a little on the slow side for my tastes despite Clocker never hitting over 10-11mph. It is, after all, a 100% drivetrain bot. I’m also uncertain that the drill motors will like such drastic overvolting. That question will be answered concretely once I put this thing on the ground and push some things around.

The drills’ torque clutches were hacked in the classical fashion. I used to know many guides on to hack these things, but they were from years ago and many have gone offline as builders retired. Basically, the hole is the perfect size to tap for #10-24 or #10-32. Short set screws are used to entrap the dog clutch element that is the main component of the adjustable torque limiter – without these, the ring gear would just spin freely and no torque can be transmitted to the wheel. Dale has another method of locking the torque clutch which is a bit more compliant.

I decided later to proceed with drilling the wedge mounting holes, since I had a bad idea coming up for the plate itself. The wedge was clamped directly to the frame, aligned horizontally, and the holes drilled and tapped in situ.

The process I’ve been using is first drilling a dimple using a pilot drill of the template hole diameter (in this case, using an F size drill because I designed those holes to clear 1/4″-20 scrws), such that the dimple is reasonably well centered. Next, I switched to the tap drill diameter and let it settle in the dimple, then just freehanded it. Not all the holes are dead square, but that’s just a consequence of free drilling and only practice and experience can get them close.

Alright, so this is the bad idea. Not shown in the robot’s 3D model, but in the works all along, is turning the wedge holes into slots. This would have been a trivial operation if I were actually just slotting, but because bolts protuding from the surface of your wedge is a glaring sign of n00b, I had to make countersunk slots.

It involved a 6-flute metalcutting countersink (no, do not try this with a cheap hardware store 1-flute wood & drywall countersink), lots of cutting oil, and going very slowly. The whole machine would occasionally rumble and generate a small local earthquake every time I began cutting. In the end, countersunk slots!

And they fit!

Well, most of them – there’s at least 2 which I felt were “oversunk” and wouldn’t be as strong as one of proper depth. That’s why there are 16 screws up front, right?

it’s also being screwed into uhmw.

The ride height of the wedge is adjustable from essentially floor-scraping to about 5/16″ up. The D*C arena/stage/combat surface is not guaranteed to be flat anyhow, so this lets me calibrate the height to the stage as needed.

The last operation of the night is coring out the wheels. These are McMaster’s p/n 2243T41, or “McMasterbots” wheels as I call them, 40A durometer donuts of rubber overmolded onto polypropylene hubs.

As shown in the design previously, these are supposed to partially envelop the motor mounts and use them as a rudimentary secondary bearing. Hopefully, this will make the drivetrain nearly indestructable (from axial and radial impacts like being dropped or flipped) because the majority of shock loads will not be transmitted through the gearbox nose.

The machine of choice for this job is hueglathe, the 19″ LeBlond Regal, because its chuck can effortlessly grab the entire wheel.

Four wheels cored out to the appropriate depth. Can you guess for which one I forgot to tighten down the chuck before plunging the boring bar into it?

This is how it will go together.

Still to come: Making the wheel hubs, permanently mounting the motor and wheels, and then…


That’s about it. This is a pushybot, after all.