The Pre-Maker Faire Madness of Chibikart

Along with most of the rest of MITERS, I’ll be party vanning down to the New York Maker Faire on…. well, now. It’s this weekend.

Like last year, I’m hauling an immense pile of MITERS cargo in addition to a few hapless freshmen and sophmores (who I think count as cargo anyway?). Last time, I brought Landbearshark. This time, I’ll be bringing something about equal in mass but a little more fun: Double Chibis! Tagging along also because they fill space efficiently will be RazEr REV2 and Kitmotter Display Stand.

There go any chance of flying down the hillsides at the NY Hall of Science though.

The Chibikarts, unlike most of everything I build, have been working rather reliably. Chibikart 1 suffered 2 broken motors when MITERS used it for Orientation activities – I’m not really sure went on, but the front two motors were just totally unresponsibe – but the controllers were fine. However, Chibikart 1 still worked with the 2 rear motors, so that’s been its demo state for most of this month.

Last week I decided to crack them open in anticipation of repairs for the NYMF.

Well damn. It looks like my somewhat hastily-soldered phase star-point connections exploded. The solder joints became little balls of solder – indicative of a serious current overload or something. Either way, the damage to both of the motors was similar, so I just re-terminated them. I coated the windings in a thick layer of polyurethane varnish that the high-voltage crew at MITERS like to seal their Tesla Coil secondaries with.

A few days ago, Chibikart1 was involved in a…. “filming accident”.

While I was in the middle of the Poorly Coordinated Death Spiral, the right front motor lost power and started smelling real funny. Upon opening the motor again, I discovered that the windings were actually not burnt – but just shorted. As I unwound the stator,huge chunks of the magnet wire insulation were flaking off and coming apart. I was literally pulling lengths of bare wire from the stator.

My suspicion is that the urethane varnish damaged the insulation of the wire either by being too tenacious (typical cheap magnet wire with sub-300 celsius insulation rating are coated with polyurethane-based enamels) which caused the insulation to prefer the urethane coat instead of the wire, or the solvent was too strong and dissolved or damaged the insulation chemically.

Bottom line is, don’t seal your motor with urethane if it has wires made of urethane. On a similar note, titanium screws in titanium threads will degenerate into the slightly less useful case of a solid blob of titanium.

What was worse, actually, was that the urethane sealed the whole stator into a solid mass of wires. I could not hope to ever unwind this without baking or chemically destroying the urethane in some way. The magnet wire strands just broke off as I tried to pull on them.

I had to rewind both of the front motors, which didn’t take that long since I was used to it:

To give the wires one more layer of protection, this time I insulated the crossing strands with some Kapton layers.

Completed rewind. I decided to group the star point connections into one termination this time instead of attempting to solder a ring of wire around the outside of the windings. The whole mess was coated in epoxy (like I should have done to start with…), and Chibikart 1 is now kicking again.

Chibikart2/DPRC has received no mechanical mods or upgrades, but I did jump the shunt on the 350W Jasontrollers a bit to give it some more punch. Because of the ~25A constant current limit of the Jasontrollers, DPRC is actually a little anemic despite having higher potential power. To really use those motors, I’d need some sensor boards (hmm, I wonder where I could get some) and use higher-current Kelly controllers.

Come see Chibikart and DPRC (and RazEr & co.) at the MITERS display area in the Hackerspaces area (Zone B) at NYMF!

Oh yes, a preview of things to come:

 

Some more random boards: The sm00thsensor Project

In keeping with my promise of not building anything else huge and parking-requiring this semester, I’ve been investigating in more detail some other potentially useful electronics projects which have been the products of discussions with peers as well as my uncalibrated imagination. This is one idea that has been in on-and-off development for a while.

(Also, buy my stuff.)

One thing that we like to do around this neck o’ the silly vehicle woods is to append Hall Effect rotor sensors onto motors which don’t have them. The majority of industrial brushless motors have 3 Hall sensors embedded in the windings in order to pick up the position of the rotor magnets – this is so that the controller can switch the windings in the correct order, even at extremely low speeds. The sensors essentially become a 6-state absolute encoder. The positioning afforded by this is extremely coarse (for instance, the example 3-slot, 2 magnet pole motor in the link will only have 60 degree positioning clicks), so for high-precision applications like robot arms and CNC servos, this is usually backed up (or totally replaced) by a sinusoidal resolver or much finer optical absolute encoder.

Plain old sensors are well-suited for vehicle traction purposes, though, where the motion is generally in 1 direction and whose timescale of change is much greater than 1 motor electrical cycle – the motor usually has to apply a few seconds of effort to get the vehicle up to speed. Pretty much all e-bike hub motors combine Hall sensors and a very high tooth/magnet poles count to get super-smooth motion at low rotational speeds.

sensors on r/c motors

For indirect drives that use stock or modified R/C style outrunners, adding sensors needs some creativity. There’s usually two approaches: putting them inside the motor and mounting them externally.

I generally favor the inside approach, in part because I usually construct hub motors (with few exceptions, you can’t sense externally with a hub motor). However, fixing the sensors inside also has disadvantages.

  • You have to know how the windings are disposed. The sensors need to be in key locations between phases (putting them accidentally in between 2 teeth of the same phase means they are always mistimed by 30 electrical degrees) and this is only possible to find out if 1. you wound the motor, or 2. you have a sensitive enough magnetometer to check each phase to see which direction the teeth’s fields are pointing.So, it’s riskier than externally mounting them because you have to crack open the motor again in order to fix it if you got it wrong – plus, the motor will totally run like this if the right combination of phase and sensor wires are achieved, but it will sound terrible and draw much more current to produce the same torque, because some of the current is wasted on firing the windings at the wrong time.
  • There is no ability to fine tune the sensor location to account for timing errors caused by sensor hysteresis.

The sensor boards that I’ve been using and which are occasionally seen on this site are custom made with angular slots to allow easier “combo finding”, since I did not wind those outrunners and therefore their internal layout is a mystery. They were developed for “2.00EV“, which ran entirely off the principle of using R/C outrunners, and I judged sensored control to be the more reliable method.

The second issue is one which is concerning for vehicle traction that needs to be bidirectional (i.e. have a reverse). I’m not sure if it’s just not been noticed because most R/C motor modified vehicles don’t ever go backwards (e.g. bicycles) or what, but on vehicles like Landbearshark and tinykart the issue of hysteresis-induced timing error can be quite severe.

The majority of hall sensors employed on motors are “bipolar latches”, which means they have 2 states (outputing high/low, coresponding to ~5v and ~0v for the usual 5v system), and they flip between those states whenever the magnetic flux density sensed goes above or below internal thresholds:


from the Allegro A1250LUA datasheet

Above is the state diagram for the A1250, a common hall sensor. For this sensor, Bop is approximately 5 gauss – when the field strength exceeds this amount, the output will pop low. It will not return high again until the field reverses directions and exceeds -5 gauss. These are “typical” specs – the maximum band is +/- 25 gauss, which leads to a hysteresis band of 50 gauss.

With the sensors being on the outside of the motor and trying to sense the magnets through a steel can, every little bit of field counts. I’m lucky that R/C motors are made so cheaply that the rotor is not thick enough to fully contain the magnetic flux. The field from the motors looks vaguely like this:

…by the way, here’s an actual magnetic field simulation made using the FEMM software. You don’t see as much leakage in that one because the rotor is thick enough that pretty much the entirety of the field is contained. (I’ve also wondered how much more torque per amp you can get just by wrapping another layer of steel around the typical R/C motor, but that is an aside.)

The message that my sketch is meaning to convey is that at each point where you can measure the flux density (“strength of the field”), there is a tangential component and a radial component. The only thing that the Hall sensors detect is this radial component. This is where the hysteresis of the sensor can introduce timing errors.

Say that the radial field at the location of the arrow head is -25 Gauss, and is where the hall sensor switches states. For the sensor to switchback to its original state, it has to travel all the way across to where the radial field is +25G. In the above drawing, the mechanical distance (in degrees) between these 2 points is about 5-6 degrees. Not a big deal, right? But because most R/C motors are 14-pole “LRK” motors, the equivalent electrical degrees of that error is 5 * 7 (pole pairs) = 35 electrical degrees.

What that means is if I moved the sensors to trigger exactly on-time for one direction of rotation, it will be 35 degrees too late for the other direction. It’s pretty much ‘magnetic backlash’ to use a mechanical analogy. The ideal hysteresis-free sensor would switch exactly as it crosses the midplane between the two magnets with no delay. This can actually be a pretty big deal. A few degrees of timing error might just result in a lowered top speed and more current draw, but 35+ degrees might make your motor just straight up not reverse or have issues starting. 25 gauss is also really goodfor a Hall sensor latch – the ATS177 type I typically use actually have triggering thresholds of +/- 70G with some specifications having +/- 100G.

Shane did a very thorough investigation using a strobe tachometer of this phenomenon when it is applied to externally-sensed r/c outrunners in traction applications if you want to see how bad it can get on video.

how fix

One idea I thought of which would fix this would be to use hysteresis-less sensors.

Yeah.

Smart, huh? It’s what I went to MIT for, duh.

Well, the real explanation is slightly more complicated. Instead of using digital latches with their own hysteresis bands built-in, I would instead use analog (linear) hall sensors which output a varying voltage, typically 1 to 2 millivolts per gauss centered around half of the logic supply voltage (VCC/2).

However, just using them by themselves is not necessarily enough, because the logic that is reading the sensors usually has digital hysteresis by itself. For instance, the ATMega328 microcontroller’s input thresholds are 0.3*Vcc for low-going transitions and 0.6*Vcc for high-going. Not only is this not symmetric around 0.5*Vcc, but the band of 0.3 Vccs is 1.5 entire volts for a 5v system. If my linear hall sensors are 1mv/gauss, then that’s a hysteresis band of 1500 gauss. That ruins the point. I’m fairly certain that is actually way worse than using digital sensors. The asymmetry would mean that the Halls are not “on” or “off” equally, so the motor will prefer several states over others.

The solution I settled upon was to pass the linear hall sensor outputs through a fast, low-hysteresis comparator which checks the input voltage against a Vcc/2 resistor divider made of 0.1% ultra-tight tolerance resistors.

The comparator I chose for this task was the MAX9034 4-channel comparator, which was selected mostly by stochastic Digikey-ing (I have no particular attachment to this part number), and the hall sensors are Honeywell SS49E linear types. I had to go with a TSSOP chip, which will be bitchy to solder but was the only size that could really fit on the board.

The idea is that the comparator’s internal hysteresis is the only discontinuous element in the system, and that is almost vanishingly small. For the 9034, it is 4 millivolts, which translates to 4 gauss or less depending on the actual sensitivity of the Halls. The output of the comparator will be a fast-edged square wave feeding into the logic and skipping over its hysteresis band.

Here’s a picture of the board. I’m starting with 63mm motors since tinykart is an excellent plant for validation of the idea, and it uses the 63mm class outrunners formerly retailed by Hobbyking (now retailed by Leader Hobby).

It uses the same adjustable slots as the current generation of sensor boards so it should be a drop-in replacement in most cases.

I sent the board to MyroPCB about 2 weeks ago and had them panelize it:

And last week, they arrived!

Sweet, that means I can get to testing them, right?

I wish. Alot of this design and thinking was performed several months ago, and I ordered all the parts then, but not the boards. Problem is, I’ve since lost the Hall sensors! That was like 50 bucks in sensors…

I had to reorder them, but they did’t get here in time for the weekend. Ideally I’ll have the sensors in-hand tomrrow and can get to populating these boards. Then, testing to see if I am bullshitting myself.

other sensor boards

Besides these super special ones, I’ve also updated the designs of the 2.00EV boards. Not only am I going to make another run of these boards for next semester’s 2.00gokart where everybody will need them, but I fully intend on selling these on this site too. These are just plain digital latch boards, suitable for one directional movement. I’m also working on some mounting rings that fit the 59-80mm common outrunners for the complete value-added package.

f