Tiny(melon)Troller?

In the spirit of eventually working towards running in-house developed equipment on all of my vehicles , I decided to man up and finally pitch Tinytroller at the final boss fight of scooter controllers: controlling the Turnigy C80/100 “melon” motor that runs melon-scooter.

Melon-scooter has been out of service for about a week and a half – the chopped Jasontroller worked extremely well until I let it out of my sight one Friday night at MITERS when a bunch of freshmen and new members were in attendance. When I attempted to leave later, I found that the motor was shorted through the controller and there was no response from it when powered on. And of course the froshlings had all quietly left by then, with nobody telling me that my scooter was behaving a little strangely and not like… going and stuff.

Hmph.

Anyways, I’ve found derpybike to be quite useful in the mean time. Since the failure was totally not under my control, I can’t quite tell what went wrong. When I opened the case of that controller, nothing appeared to be burnt or detonated, but some FETs are most definitely shorted through and the drive circuitry is dead. I’ll probably just order up another Jasontroller (or use one of those 500W bricks?).

The C80-100 is a pretty formidable control challenge for a homebrew motor driver because it has both very low resistance and very low inductance. I measured the line to line resistance to be around 20 milliohms – meaning any little twitch or fuckup by Tinytroller can send pulses of hundreds of amps through the system. The low inductance means the current through the stator cannot be modeled as approximately constant, especially at my relatively low (8khz) PWM frequency, wreaking havoc with non-robust current controllers. It’s built similarly to many other huge electric flight motors, so if I can control the Melon, I can probably take on other scarier airplane motors too.

Melon-scooter normally runs sensorless since I originally built it with a Hobbyking 100A airplane ESC, then subsequently a sensorless Jasontroller. To use it with Tinytroller (which is not yet sensorless), I had to append sensors in a similar fashion to Straight RazEr. It’s that red thing by the motor:

I bodged together Make-a-Bot’s heater one more time (last time, I swear!) and used the last 2 feet of my 3mm ABS filament to make this sensor mount. Unlike Straight RazEr’s mount, this is a two-piece since I needed to fit it into the very close gap between the motor and my frame.

Like so. Unfortunately I made this one a little too close – the ABS plastic actually rubs alot on the motor. It doesn’t seem to be affecting sensor operation, but it just makes an ugly scratchy sound. Oh well – it will have to do for now.

The first test was performed on 24 volts so I could (more) safely full throttle the motor in order to time the sensors properly. For a while, I was trying to find the absolute minimum point of phase current draw at no load, full speed, which corresponded to the point of optimal sensor timing. Wandering even a little outside this region caused the current to increase very quickly, some times up to 40+ amps no load… that’s 1000 watts dumping into the motor just spinning while sitting there. However, Tinytroller handled the mis-timed excessive current draw just fine – no fiery death like I expected.

I was able to get the motor current down to 7.5-8 amps no load, where it has generally been.

I did still have plenty of PLA plastic left, and I was going to print out a Nice Case for Tinytroller that enveloped the whole thing and had custom wire entrance and exit holes and whatnot, but decided PET film tape was enough for now. I made a little greenhouse (literally?) for Tinytroller which should keep most of the gunk out of it.

Plus, I figured it was going to explode anyway, so why waste time on a nice case?

All bundled up and connected.

I tried something a little different with this attempt at running melon-scooter. While Straight RazEr’s control scheme relied on a single throttle, with the bottom (released position) being a slight brake (negative current), neutral coast somewhere in the middle, and the top being full driving current, I put a handlebar throttle next to the thumb throttle on melon scooter and had Tinytroller read both.

The handlebar throttle controlled the amount of driving current and the thumb throttle controlled the variable regenerative braking. When neither was actuated, neutral coast (zero current) was commanded. Actuating one blocks out the reading of the other such that the readings don’t conflict and sum to a net zero, though that itself is a valid control scheme too.

After making sure it did indeed survive a no-load spin on the 12S battery pack, I threw the deck back on and went for a test ride. If it was going to explode, it might as well do it while the motor is running full bore on 40 volts. The no-load speed was measured to be 4330 RPM, a fair amount slower than even the Jasontroller’s 4700 RPMs. It could be attributed to sensored control with the sensors at the point of zero timing advance (sensorless will always tend to be faster) or it could be my battery being low after not being charged for a week.

The low speed terrible sound was still present – and boy was it ever noticeable on the melon. The “terrible sound” is a bug feature that has been with Tinytroller ever since I added the timer interrupt routine. It can be clearly heard as a clacking sound at very low speeds in the etek test video. I’m completely unsure as to where it comes from, and I can shift the Band of Terrible Sound up and down in the PWM output range if I add various length delays to the interrupt service routine & state changer. This just tells me my timers (1 and 2 on the ATmega) must be running into eachtoher somehow.

Regardless, Terrible Sound mode results in very high current draw for the duration of that “band”, and with the massive windings and rotor of the melon, it was felt as a very strong rumble or high frequency ripple torque. I can’t imagine it being too good for Tinytroller. As soon as the band of terrible sound is passed, the ride instant becomes smoother and more controllable, but transitioning back into the band results in the motor suddenly slowing and becoming rough. Considering that the Band of Terrible Sound occurs at a useful low cruising speed of about 4-5 mph, this is indeed quite a problem. I might have to dig deeper into the ATmega manual to find out what timer registers are being refreshed or reset when I dont’ expect them to be.

poor tinytroller

Melon-scooter managed to make it 90% of the way around the block before it suddenly flaked and shut off. I was able to cycle power and have it function again, but only for a very short while. After which it seemed that at least two low-side FETs were shorted, since the motor was reluctant to turn even with the power off.

Before that, during bench testing, I had noticed my big red key switch becoming flaky and occasionally shutting off or dithering on and off, power-cycling the controller many times. It very well could have been a flaky switch that shut off from vibration, and the sudden power kill would result in huge negative voltage spikes which could have destroyed components.

I’d hate to think that the only thing that took down Tinytroller this time was a flaky power switch, but the performance was fairly smooth and flawless once the Band of Terrible Sound was passed. Slowing down was difficult – re-entering the Band of Terrible Sound meant I  had to hold on to prevent the handlebar from punching me in the stomach as the motor suddenly acted like I had jammed a rock into it. Getting something reliably working is, in my opinion, 90% of the challenge of actually making a useful product or project, so I’ll just continue the Tragedy of the Tinytroller some time.

more 3d printers

I’ve also been sketching out some more designs for the Next 3D Printer. Adding a filament guide to the interior of the machine that had to be flexible enough to reach the far corners of the axes while folding up neatly and predictably has been a fun engineering exercise, and I now understand why commercial 3d plastic extrusion printers are so damn huge. I need alot of buffer space to run the set of wire and cable guides which hold the filament and the electric umbilical.

However, one thing I did decide on and finish designing was my new Z axis. In the first post about the new machine, I sketched out an idea for a combined chamber heater and build surface heater. Well, that idea has since been turned into reality Solidworks.

Hey, it’s like the exact same thing. The resistors are 10 watt types, currently spec’d to be 0.22 ohms each and to be run in series for a roughly 1.8 ohm string, which ought to net me about a hot 80 watts of heating power. The surface itself was made transparent for imaging purposes, and actually is supposed to be aluminum and not clear plastic or something.

I’m not a thermal systems engineer, so I just whipped up a radiator pattern for the resistors that kind of made sense in my head.

Some more design progress on the Z table. The parts here are “edge stitched” together in my usual style with tabs, slots, and interspersed t-nuts. Four LME12UU type linear bearings comprise the guide system, two on each side, held apart by spring washers. I’m reusing the central leadscrew nut from MaB because for some reason it cost $30 and I still have 5 more feet of the same leadscrew, and I’m not buying a whole new one. The structure is mostly 1/4″ aluminum beams and 1/8″ bracing plates – I’m trying to minimize the use of giant 1/4″ stock on this machine, but because the Z table is so big (250mm square build plate, with a total length of about 290mm front to back!) it was warranted here.

Did you know that they make PC case fans that are 250mm across? I didn’t know either until I accidentally found one on eBay while looking for real industrial 200-300mm class fans. In fact, they make case fans up to 360mm. Why the hell do you need a fan that big on your computer?

It turns out they don’t actually move much air at all – I ordered a sample one from xoxide for kicks, and it seems to be for case modders and PC builders who want to take the “large but slow moving air mass” school of case ventilation to the absurd limit.

But that’s actually exactly what I need – I’m not trying to build a hair dryer  or a heat gun, but something which will gently fan the sweat of my 8 power resistors onto the back of the build plate. Time will tell if they survive 60-70 celsius (I’m guessing not), but for now I have one designed in. More industrial grade fans are spec’d out if I need them, but if these fans do work out then more gaudy internal lighting for me. Maybe it’s time to start case modding your 3d printers.

The Plight of Melonscooter and Pushing the Limits of the Sensorless Jasontroller

Poor Melonscooter.

About 2 weeks ago, a major storm system rolled through Boston as they tend to do during fall. With my new anti-wet-pants device, I was fearless in flying through the rain with melonscooter. However, what I didn’t keep in mind was that the anti-wet-pants device only deflected water from going upwards. With that path blocked, there was no place for it to go… except over the top of the motor and straight into the rain gutter that is the back of the frame. You know, where one of the battery packs was. I didn’t think  much of it – after all, water evaporates, right?. What I didn’t realize was just how much water got into the frame this way.

Shortly afterwards, I noticed Melonscooter regularly flaking out and and losing power. The final straw came when, on a full charge, it couldn’t even make it down the long stretch of Vassar Street that is my daily “commute”. The power would start out fine, but get progressively weaker until the power system went into undervoltage shutdown. This only happened at voltages under 30 volts. So, I immediately figured that the batteries were very, very unhappy. It must have been declining progressively before, but I only really noticed it when the effective range got under a mile or so.

The first sign that something was wrong was when I pressed on the clear plastic wrapping of the \m/etalpaxXx and saw air bubbles moving around. Water had totally infiltrated the rubber foam padding. So, I tore all of that off, and…


AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

It’s like operating on a cancer patient only to discover more cancer. The packs have been through alot, but it looks like a week or two in contact with water finally did them in. Significant copper corrosion was visible and most of the cells had vented. The cells were so waterlogged that the blue ink stripe had run and bled through the paper. This pack was pretty much utterly trashed, with even the mighty Cell Log refusing to read it.

Melonscooter has 2 of these packs, left over from Fankart. The front battery was dirty, but otherwise had regular voltage levels on all cells.

Oops.

Shortly after the rain let up, I had actually added a “mud flap” in front of the rear wheel, under the stern deck, such that water was deflected back downwards and not onto the motor. Unfortunately by that time it was too late.

It was time to break out the box of nice things and start over. Melonscooter was built from found parts, and the batteries came from Fankart, with associated bullet connector incompatibility and a mix of Deans and everything. Starting from scratch was therefore a chance to clean up the electrical system significantly. I decided to build the new pack to the same capacity and voltage specs (12S4P), but make them mechanically one “brick” to save space in the frame.

Because the cells had leaked electrolyte and water had been sitting stagnant in the frame, the bottom was also covered in rust. I thoroughly cleaned it out with steel wool and various potentially carcinogenic cleaners, and gave the frame interior several layers of spray-on clear primer. This was when I discovered that the original black paint was just sprayed straight onto the metal – there was no sticking whatsoever, and I could blow huge chunks of paint off with a compressed air nozzle.

There was, however, one very important reason to consolidate the two batteries into one. When I did that, a Jasontroller fit perfectly into the leftover volume. I mean perfectly as in so close I had to make sure my wires exited the pack correctly. It’s like this was the application that Robot Jesus commanded me to use a Jasontroller for.

So I’m going to do exactly that. I had already modified this Jasontroller with IRFB3207 power FETs and shunted its current sense shunt to half its previous value, so part of my goal was to see how far I could push this thing in terms of wattage.

Okay, I know everyone has seen me make battery packs like this before. Sadly, even the biggest of my big heat shrink did not fit over 4 parallel cells. Not wanting to empty out two 3-liter bottles of disgusting cheap soda again, I elected to just Giant Kapton the pack with rubber foam padding.  The balance leads exit from the side of the battery, a lesson learned from LandSharkBearGrylls’ epic battery flameout. Here is the finished pack getting a first charge-balance.

Before I installed the Sensorless Jasontroller, I decided to give it a haircut. All the functions I really didn’t care about were desoldered or cut off, leaving only throttle, motor, and power.  This made for a much smaller bundle of wire to hide.

the jasontroller experiment

I had already dropped the shunt resistance of the controller from 4 milliohms to approximate 2 milliohms. The idea is to keep dropping it incrementally until I am satisfied or something detonates. First, though, I tested the controller as-is with the 2 milliohm shunt. If all goes right, I should see about 700 watts through the system, making a current draw at 40v of about 18 amps or so on the battery side, at full speed.

Full speed measurement is essential since these controllers limit average phase output current due to the arrangement of the shunt. Because of the properties of a buck converter, which all motor controllers are to some degree, phase current is multiplied at partial throttle – a 10A battery current at 25% throttle could mean 40 motor phase amps. Only at 100% PWM do the amps match. Incidentally, maximum “power” will occur at this point to if the load is sufficient – Melonscooter certainly does not pull 1000 watts just freely running on flat ground, so the max power point will still come at some point in the launch cycle.

The test took place on the small back street bordering MITERS, State Street, which is long enough to get up to full speed and still well-paved since this is only its second winter. It was also short enough that it forced me to slow down turn around at each end, which let me test how each level of hackery handles launching transients.

The instrumentation of choice is the Turnigy Power Meter, which keeps track of peak power, peak amps, minimum volts, running volts and amps, watt hours consumed, and all that nice stuff.

Result of test #1, 2.0 milliohms:

Hey, that’s like… double of 350!

I neglected to actually measure the temperature of the controller case, unfortunately, but nothing made unhappy noises or smelled bad. By the time I was able to open the controller up again, the FETs were cold.

Clearly it was time to turn it up (or…. down?). I added more solder globs to get the shunt resistance down to 1.5 milliohms, for an expected wattage of 930 or so.

While I neglected to take a picture of this run, the wattage attained was 895W, which is slightly lower than anticipated but likely within reason since my measurement resolution at such low ohms (with a crappy multimeter and power supply of dubious accuracy) is lacking.

I next tried the magic 1.0 milliohms (which is really more like 0.8 to 1.2 milliohms, I’m guessing). This should be a cool 4 times the power throughput of the stock controller. Beyond this, the theoretical power is going to rise asymptotically, so this was probably my last good data point:

A cool 1300 watts – close enough to 1400. I was definitely feeling some unhappiness during this run – the controller would some times cut out for a fraction of a second during the launch.

There was something else which concerned me enough after this run to address before continuing. After the first two, what was hot wasn’t the FETs, but the input capacitors. These things could see many amps of ripple current, especially if the battery input wires are long and skinny or cheap and Chinese. Or fucking both.

The stock buscaps on the Sensorless Jasontroller is two 470uF, 63 volt electrolytics, and they were hot. While they are rated to “105 degrees C”, hot capacitors is a sign that the ripple current is too high or beyond their rating. One way of reducing ripple current is to add more buscap.

I elected to use the cleared wire forest space to install 1000uF more capacitance in the form of a cap ripped from an old switching power supply. It could only fit laying down, so short and fat wire leads were used to connect it to the battery input terminal. I figure the resistance of this length of wire isn’t any worse than thin copper foil traces.

Here’s the fix. The cap itself is retained with a dab of Goop.

After this hack, I was fairly confident in moving forward with dropping the shunt to 0.5 milliohms – or thereabouts. I was really working on the edge of measurement accuracy here, so judging by the result I either didn’t come close to 0.5 milliohms or something else has become the limiting factor:

Still, holy crap. 1800 watts through this thing is about as much as I’m comfortable with for now. After all, I *did* want Melonscooter to work. The good news is that the additional input capacitance has eliminated the stuttering on launch I experienced before the addition, and acceleration is now smooth and constant from startup.

It was decided to lock in this shunt value (which looks be about 0.75 millohms, since given constant battery voltage, 1800w is about 5.25 times 350 watts, so the shunt should be about 4/5.25 milliohms.) An unknown amount of power is probably being lost to wiring resistance and trace resistance at this point, too, since the controller’s long power traces are probably contributing several mohms to the thing.

So there you have it. How long will the Jasontroller last at these power levels? My guess is probably until everything melts again in the spring. The ambient air temperature right now is around 40 degrees F (5 C), which is great if you’re a motor controller being overdriven 5 times, and will only get colder for several months. Once the ambient temps get up to, say, Singapore levels during summer, I expect to encounter thermal death. Melonscooter is very open-air (partially a curse, given the weather around here), so the controller gets plenty of air-over cooling, especially at top speed. I might have to add forced air cooling if I am to try and sustain these power levels.

Because the shunt is now like 50% solder, it probably has a nontrivial thermal resistivity coefficient. Ideally, I’d open it up and replace it with a known 0.75 milliohm shunt resistor. As the whole board heats up, the blob of solder’s resistivity will increase. To a degree, this probably a good thing.

Meanwhile, Melonscooter has successfully made the run back to west campus, full throttle all the way down Vassar Street. Can it do it again!?