TinyTroller: It’s Still Trolling!

Poor Tinytroller.

No, I haven’t killed it againyet. After completing and testing a third full board, I decided to proceed immediately to vehicle testing. This time, I included all the anti-noise hacks from the very beginning, and also increased the gate resistance to 40 ohms from 30. It means I should probably stop investing big money into 2 amp gate drivers, since they’re definitely not being used to capacity now (the alternative is, of course, to design a bigger power stage to match).

The vehicle of choice is the slightly neutered Straight RazEr.  Straight RazEr has sort of become a testbed for bad ideas; for a brief period, I converted its existing battery to 6S4P (from 12S2P) to try out the Hobbyking cartroller, and it was actually used day to day. Because the Cartrollers have no current limiting whatsoever, I replaced the stock “short melon” Turnigy C80/85 motor with a rewound one from the original Landbearshark drive pod. The rewound short melon has a torque constant roughly 3 times higher (correspondingly, a Kv 3 times less) due to being rewound with twice the turn count per tooth and re-terminated in Y instead of Delta. The increased core inductance and resistance made for a more friendly controller test platform.  It was still capable of pulling a few thousand watts, though. The problem was that the original sensors I installed turned out to be very poorly timed, probably from me just stuffing them recklessly into the slots. If I wanted to use Straight RazEr as a test platform, I needed to move the sensors outside the motor in a manner that I could adjust and optimize their timing.

Fortunately, Straight RazEr’s frame had a useful cutout section next to the motor that I could clip a set of sensors on. I designed a mount for 3 Hall sensors that would latch on to a .25″ thick frame member, and stared at Make-a-Bot long enough for it to finish:

 

It’s not a Fancy Routed Sensor Board, but it holds 3 of them in the correct mechanical alignment of 17.14 degrees for a 14-magnet, 3 phase motor.

It literally clips on to the circular cutout section part of the frame and is retained solely by friction, which is fine since it doesn’t weigh very much and there is indeed alot of friction. During the initial “run-in” test with this board, I was actually tapping on the mount with a hammer to get it to move along the frame.

For the first time, I elected to mount Tinytroller properly like it was designed to be. I lined the bottom of the power board in some 0.5mm silicone padding, and made a quick rectangle of 1/8″ aluminum to space the edges of the board up. The whole assembly was then screwed to the underside of the 1/8″ aluminum top plate. So there should be no heat problems if Tinytroller is working correctly!

The first run was on a power supply in case the sensors were so far out of tune that it would just try to draw All the Amps (up to IMAX, of course). The test was mostly conclusive, but it revealed a very strange problem that did not come up earlier. Occasionally, the motor would ‘latch up’ into one state, and any attempts to move it physically were met with opposing torque. The controller would also seemingly run the motor, but it ran very rockily and draw huge pulses of current. I figured it was one of the current sensors giving bad data (causing the state table sequenced current reading to be garbage). After replacing both current sensors (goodbye, $8!), the problem still did not go away. More investigation discovered that some times, phase C’s gate drive did not shut down when commanded – meaning phase C was always active, whether high or low. Hence, the motor “preferred” a state where phase C was low since the bootstrapped high sides would eventually turn off.

Even stranger was its tendency to disappear and reappear with power cycles, and even just letting go of the throttle and then commanding it again. I replaced the IR21844 on phase C, but the problem was still occasionally coming back – so now I’m thinking logic instability, or half-dead Arduino. This Arduino Nano has been through a whole lot.

Since I figured that Tinytroller would explode or require servicing very soon, I didn’t bother installing the bottom plate onto SR, and instead just duct taped everything in. New in this pile of wires is a 40 amp fuse and holder – with the maximum current dictated by the sensors to be 40 amps, it shouldn’t ever need more…. right? I also put the battery back together in series (42 volts) for this test.

The results were semi-conclusive. When Tinytroller wasn’t spasming due to phase C’s instability and latching up, its 15v switching regulator was doing so. For some reason, immediately after power on or after a “latchup”, the 15v regulator would start buzzing at audible frequencies and its output voltage would drop to under 7 volts. For a regulator that is supposed to switch at 150kHz, being able to hear it means something has gone horribly wrong. Because 7 volts is well under the IR21844’s cutoff voltage, the effect is that the controller just “turns off”. It seemed unable to reset itself from this condition, but some times after a power cycle the problem would disappear, only to spontaneously reappear.

Having seen this issue once before, Shane immediately deduced that inrush current (from dumping the 40 volt battery onto the controller instantly, as SR has no precharge circuitry) could be causing the LM2594 to freak out. It’s probably reasonable to expect that a sudden step in voltage from 0 to 40 volts, with its associated ringing and overshoot, could put the regulator in an unknown state. Given that the “ON/OFF” pin is just shunted to be on at all times, I suppose it’s also not unreasonable for it to not be able to correct itself. Corroborating this explanation was that two successive fast power cycles usually solved the problem.

I decided to give the logic power a little bit of “rise time” on its input by inserting a resistor in series with the diode feeding the input capacitor. The resistor is 68 ohms, a value that I bought thinking I might need it one day for gate drive. With the 100uF input capacitor, the 10-90% rise time is about 10 milliseconds. The average DC current draw of the 15v side is low enough to keep the power dissipation reasonable, and I only lose about 3 volts to the resistor.

Gee, putting resistors in series with my regulators. It’s like I’m being forced back into the days of chained-resistor-linear-regulators like the Melontrollers or something. Afterwards, Straight RazEr was taken up and down the Halls of MITERS a few times, and I even tried a few full throttle launches to try and induce more failures, but to no avail.

I have yet to observe a single 15v regulator latchup since adding the resistor in, so I might make it a permanent feature of the board design… or search for proper inrush limiters in a compatible package, as it’s rather unsustainable to keep a fixed value resistor there in case I ever add more things to the 15v bus. I only saw the phase C latchup weirdness once during bench testing after adding the resistor, but never during on-the-ground testing.  It literally could be a flaky ATMega pin on the Arduino board causing the Phase C problem. The only question left for me is to find out whether or not any of these problems carry over to the revised board. I’m fine with the only board hack on this design being “add a resistor to the regulator input”, but I think I’ll hold off on adjusting other parameters until I have a version of the new board together.

There is another thing I will change, however. Tinytroller has an interesting nonlinearity, dubbed “turbo lag”, which causes the current command to rise quickly as motor speed increases. This was amusing to see on Straight RazEr since it produced what felt like quadratic throttle. The reason for this is that my current sensor filters, both hardware (input to the Arduino) and software (the I_RC variable and associated code) are very slow. I designed them originally to filter the PWM frequency, which was 4kHz when most of the circuit schematic was drawn, and I merely copied and pasted it over. The hardware filters were designed with a 400 Hz break frequency in mind, one decade under (or 1/10ths) the PWM frequency.

Well, first off, I’m using 8kHz PWM, but the real problem is that I did the EE n00b thing where I was designing towards 400Hz as if it were 400 rad/s. So my actual current sensor bandwidth is something like 80Hz, a number easily reached by even the modified Melon at low speed: 80 electrical Hz = about 11 mechanical Hz, or something like 660 RPM. Near and beyond this speed, the magnitude of the current reading drops off quickly, which leads to the sudden increase in command in order to “keep up”. Luckily, 1/10ths of 8kHz in rad/s is about 5000, so I just need to change my filter resistors from 10K to 1K. We’ll see if that results in some more linearity.

On the other hand, I kind of like the turbo lag effect.

Hub Motors on Everything, Part IV: Crap, Now I Really Mean Everything

I did something bad.

About a month and some ago, I made an account on mfg.com out of late night curiosity into the world of sourcing fabricated parts out to random people you have never met or talked to beforehand. For a while now, at least a year, I’ve occasionally gotten suggestions from people around the MITs to try putting some of my parts on there to be made in volume, or at least in quantities above what I cared making by myself. From those impressions, I figured mfg.com was like some kind of dating website for factory foremen, shop heads, and engineers. I now think that assessment is pretty spot on. It really is like a dating website. You make a profile and create a Request for Quotation, which filled out like one of those personal quiz things that abound on the Internet, except about your part…..as in, the part you want fabricated: what materials, processes, distance from you, and oh yeah include a picture and/or 3d model. The RFQ remains open for quote for a time period you determine, and you also set things like anticipated delivery date and payment and logistics terms (such as “T/T Ex Works”, which I took to mean “Paypal only, and Fedex it or something”).

But musing about the website is besides the point. I elected to at least try the system out, and spent a few minutes thinking about what part I found really bitchy to make that either took a long time or required precision operations, or both. The answer I arrived upon in my early morning stupor was motor cans. Specifically, I uploaded a CAD file of the skatemotor can, and to avoid the potentially really expensive one-off sample pricing, I said I wanted 10; they were to be made of whatever steel you found on the floor (though I specificied low carbon such as 1012-1018 or equivalent), I am the end user of the parts and do not really expect to need more of them (answers to such questions as “Anticipated Usage Per Year”) and I whipped up a basic 3-view drawing with labeled tolerances and finish requirements. Then I closed the window and let the magic happen.

The problem is it did.

I received in the neighborhood of 20 quotes, since I opened the floor up to all and besides the host of shady Chinese backwater shops (all privately messaging you information about how shady and backwater they are and linking you to their own websites, just like a dating website but with engineers), there were also plenty of local American houses and even a Croatian one. From my experience in mechanical engineering and machining & fab, the U.S. quotes were essentially what I had guessed they would be (mfg.com lets you set a target price, which is not visible to the bidder). In other words, I can’t afford it – sure as I am that “graduate student” is not the most highly paid of engineering positions, I’m neither a company nor have seed funding nor a rich uncle. And so American manufacturing slips yet another small delta: I elected to concentrate on Chinese quotes, which fell into three very distinct bands: they ranged from not much less than local Yankee-made parts, to reasonable considering the RMB to USD exchange rate and material costs, to… seriously, are you kidding me?

At the close of the quoting round, I was totally ready to ditch a nontrivial (for me) amount of money to see if getting my 10 cans machined at the seriously? rate was even a legitimate physical phenomenon. I was both intensely curious at how inexpensively outsourced parts could be, as well as a little scared at the realization that maybe the complacent U.S. manufacturing industry was deservedly upset about Chinese manufacturing.

Three weeks later,

It’s a real thing. I actually got updates as the parts were finished in rounds, and received an inspection report for 5 of them along with the order. A little cross checking with calipers found that at least one of them is closer to my specifications than I ever cared to hold.

They’re steel. Q235 type steel was the selection, material to be provided by supplier. Q235 is a Chinese standard roughly equivalent to type 1012 low carbon steel, so it was what I would have used anyway.

They’re shiny. Definitely a separate lathe and 4th axis/rotary indexing job, since I could see the faintest of grip marks on the inside of the very well finished cans – a 4-axis combo machine would have been able to do this in one setup. I designed this generation of motor to be made on such combo machines if it came to be the case.

They’re actually threaded very consistently and with great finish.

I actually got 12 of them – either 2 somewhere did not meet the inspection standard or they decided that just making 2 more to fill the damn box correctly was worth it, but hey, free cans. For the total price quoted, I was really not going to be disappointed if I got a chunk of cast scrap iron that was vaguely motor can shaped. My expectations have been well-exceeded.

The problem that I now must confront is, what now? I have 12 motor cans and no end plates, stators, shafts, and only one set of magnets to match.


and like, one spare tire.

next steps

While having metal shaped to my liking is nice, there are other very hard to find and/or bitchy parts involved in making one of these motors that I am actually curious about bypassing through the magic of sourcing.

1. Wheels. I’ve had to machine out wheels to fit over the rotors, and if I can get a “ring of polyurethane” kind of part molded, then that makes everything much better and more convenient.

2. The stator. Wound. Finished. Maybe not pre-terminated and with pigtail cables, but winding the motor takes forever. I know this is the kind of work that gets farmed out to marginally-paid migrant workers in Hobbyking Southern China somewhere, but if I can get wound stators for a reasonable price, that is actually the make-or-break for me regarding whether or not I will pursue this as a serious endeavour.

2a. Raw stators. Having a dependable source of stators that isn’t “this random-ass laser printer I pulled off the loading dock” is a start.

This might end poorly.