In this episode of Beyond Unboxing, I study and mess with something I’ve wanted for a very long time: a sensorless brushless motor controller that isn’t horrible. I didn’t even know if they could exist – after all, I’ve only associated sensorless with horrible screeching, cogging, and stuttering at any speed that wasn’t “fast”. I’ve always assumed that you just cannot get an EV to start from standstill using sensorless commutation – sensors were absolutely required for low speed performance of any kind.
I am glad to say that I am wrong – very, very wrong, and the little bits I have learned about sensorless PM motor control in the past few days, coupled with the discovery that sensors are in fact terrible things, has made me a convert to sensorless control. But only if the controller is designed for an inertial load – something I will explain the distinction of, and something which airplane controllers are totally not.
The Shady Chinese Sensorless e-Bike Controller (let’s call it Sensorless Jasontroller for now) actually has a reasonably long history behind it. Its sensored cousin, the Shady Chinese e-Bike Controller (or Jasontroller), is commonly available on eBay directly shipped from China in what I can assume is straight off the assembly room. The controllers come in a few general types and board layouts, but the architecture is almost always the same. Entire communities and bibles (example) exist around the modification and hacking of these controllers because they are very inexpensive, use common parts, and were designed to support multiple voltages and current levels on the board, with component selection determining what controller you end up getting. They form a staple of the Endless Sphere EV community, and a few members of that community have made businesses out of importing, selling, modifying, or otherwise having something to do with them.
Did I mention that they’re cheap? Generally, prices start in the $30-60 range, but overseas shipping is a signficant overhead cost, bringing the total cost to $100 or so for a high powered (72 volt, 1500W) type, or as low as $50 shipped for the fairly common 300-500W ones. I have one of them running Kitmotter, admittedly not a very strenuous task, and recently purchased another on-the-spot in Singapore because RazEr’s melontroller was damaged. The one running Kitmotter was originally purchased out of curiosity.
While making my rounds through the Shady Chinese e-Bike Store on eBay recently, I discovered (or rather, noticed – I’m sure they’ve been around for a while) that some were labeled with “Without Hall”, or “Sensorless”. I had known for a while that some people on Endless Sphere had modified their Jasontrollers with a comparator-based Hall sensor faking circuit – one that relied on comparing the back EMF of each phase with the midpoint of the voltage bus (Vdd/2) and output a 3 bit wavetrain in the manner of a set of sensors – such that they may run motors with damaged or destroyed sensors. A long time ago, I planned to do the same on Face Vector Modulation.
It was too cheap to not try to see how well it lived up to the claim. I bought a 36v unit fully expecting that it would have no startup capability whatsoever, since being an e-bike controller, it is 100% acceptable to assume that the rider has started pedalling with some forward speed. But hey, $50 sensorless controller that is supposedly sold for vehicle use and runs on 36 volts – why not?
This is what came. No box, no manual, no explanations, nothing. I love Chinese things so much.
Fortunately, the listing at least came with an image explaining what the connectors did.
There’s also the very helpful Chinese sticker in tiny, aliased and downsampled print. I guess this is really only helpful if you can read Chinese.
But as long as I know where to connect the throttle, battery, and motor, it’s all good. No-load testing with RazEr rEvolution as a dummy motor showed that yes, what I had received is indeed a motor controller and not, say, two nuts and a flash drive. By the way, the “manufacturer website” appears to be nothing more than an eBay picture dump. Convenient way to do business, really.
Once functionality had been established, I went ahead and knocked it apart. These controllers tend to be built similarly – extruded aluminum case and two endplates, one with a custom rubber bushing through which wires are routed.
A forest of wires obscures the main PCB. Because these controllers have many auxiliary functions that are relevant to small e-vehicles, the boards are very dense and have lots of other circuitry which may or may not interact with the motor control workhorse parts. The usual examples include a key switch (which directly powers the logic regulator), a speed setting switch (which seems to just divide down the maximum throttle input), brake inputs which cut off motor power, etc. These controllers generally don’t have regenerative braking or even dynamic braking – the brake switch inputs are only to cut off the power to the motor for brake levers equipped with a microswitch.
I spent a while trying to find the manufacturer of this chip (as did Shane Colton), but as far as I can tell this is an ASIC produced by Xichen Microelectronic that is specifically for motor controllers. Often, Jasontrollers have an Infineon XC846 or a ST Micro ST8MC chipset, running stock application note brushless control code (according to the spheres, anyway). For all I know, this could just be a knockoff rebranding of one or the other.
The board is otherwise typical of Jasontrollers. A series-resistor-input LM317 regulator supplies 12 volts for gate drive voltage to the circuit, from which 5v for the logic is derived (on this board using a small HT7550 type regulator). A low-side return shunt measuring 4.0 milliohms and made of what I swear is chain link fence wire feeds the current limiting circuit, which is a hardware PWM cycle-by-cycle limiting kind. This shunt is often hacked to be a lower resistance in order to up the punch of the controller.
Past that, it’s nothing magnificent. The FETs themselves are some really shady ST Micro 80NF70 types, potentially knockoffs too. 8 milliohms isn’t bad, but who knows what they actually are.
Jasontrollers always have a 100% discrete gate drive circuit. No fancy ICs like my IR21844s, since they actually cost money, but it’s small bipolar transistors all the way. Through some Googlework and following of traces and schematic sketching, I determined that the high side gate drive circuit is essentially circuit 3 on this page. But unlike the example values given, the resistors on this circuit are all very low. Their R7 and R11 are only 220 ohms, and the equivalent R10 is 500 ohms. There is no gate protection Zener diode, but there is a 100 ohm gate resistor. The power supply (“VGH”) is a bootstrapped arrangement, but unlike my circuitry which has maybe 1uF of bootstrap capacitance using a single ceramic cap, this thing has a cool 47+uF provided by an electrolytic cap in parallel with a faster low value ceramic cap.
There is also no gate-to-source pulldown resistor for failsafe shutdowns…
The gate drive transistors are all 40v PNP SOT-23 Shady Chinese parts, which is what led me to find the above circuit. I’m under the impression that not much more can be done to speed up the switching because the R values are already fairly low, and somehow those 40V parts are being used in a system which can regularly exceed 40-45 volts (for a well-charged 36v battery set plus or minus power surges). The resistors alone are probably saving it from exploding.
Time to strap it to RazEr for real and take a spin around. I actually rode it for a few days like this, and I must say overall I am very pleased. The startup is extremely sensitive and forceful, first of all; it defeated all my expectations. Considering that the sense circuit is only made of a LM339 quad comparator, this came as a big surprise.
It is capable of launching me on RazEr from a dead standstill – some times the motor wiggles backwards first, but once it has obtained a back-EMF zero crossing to any degree, the pickup is rapid.
I can even roll RazEr backwards and hit the throttle, and it will quickly punch the motor forwards. Acceleration is solid with no pole-slipping or cogging.
In the startup mode, it clearly ramps the motor frequency slowly (though by this I mean on the order of 1 second). In the typical R/C airplane controller, the startup tries to force the motor to a constant, dead-reckoned frequency instantly, which works for a mostly non-inertial propeller, but no so much for a vehicle, especially if that frequency is something like 50 or 60 Hz. This would already dictate a minimum vehicle speed of several mph, which is commonly observed for R/C controller vehicles.
It seems that control logic which assumes inertia and ramps the commutation frequency instead of letting it follow the input blindly or just assuming a steady value makes a world of difference in how well a sensorless controller drives a vehicle. The startup current also determines the initial torque, which of course translates into the “jiggle magnitude” – R/C controllers generally drive the motor very lightly to obtain position information, which can easily be overpowered by your ass mass.
In other words, the magic isn’t nice hardware (a LM339 and precision resistors is actually not very nice in the grand scheme of mixed signal circuits), but more software. I’m stopping this and moving on to something else… it’s just another software problem at this point.
haxxing the sensorless jasontroller
One thing that is done frequently by users of the Shady Chinese e-Bike Controller is replacing the FETs with something more substantial so as to reduce the conduction losses while operating, or increasing the current capacity of the controller. I’ve always been a bit skeptical of FET-replacement Therapy, especially those recommended by forum users which invariably contain just as much myth and Cargo Culting as actual substance, though my experience with this has been on robot forums, not vehicle ones.
Usually, the FET driver circuitry is built to minimize cost while reaching a target switching time with a certain FET, and dropping a modern power MOSFET with gate charges in the hundreds of nC onto a cheap driver could mean the trading of conduction (on-state) losses for switching losses instead, as the FETs take forever to turn on and off.
I wanted to answer 2 questions for myself after cracking the Sensorless Jasontroller open:
- What does the switching time on the stock 80NF70 FETs look like, and what happens when I drop a nice FET (say the IRFB3207) on it? The 3207 has almost twice the gate charge of the 80NF70, but less than half the on-resistance.
- How many amps can I shove through this thing if FET-replacement Therapy is successful?
For $50 of controller and a few more bucks in power semiconductors, if I can get myself in the end a current-controlled, sensorless, vehicle-optimized, 36 volt, 50-60+ amp controller with really nice startup capability, then I will be more than satisfied. For vehicles, current control (no matter how much I hate potentially having to write the software for it) is a nice thing, since your command is essentially setting acceleration and not desired speed (which results in wildly varying acceleration and newbie riders getting thrown off and/or you launching face first into a bus)
I was on a mission to scope the gate drive circuitry at the FET itself. I elected to use RazEr again as the physical plant, since the DNIR is a pretty normal brushless motor by all accounts and the wheel & rotor add some inertia.
Because the high side driver uses a bootstrapped supply, it must be the one which is switched at PWM frequency. This is the case for pretty much all BLDC controllers I’ve seen – the low side switches are held on for that portion of the commutation cycle and the high side is actually PWM’d at some thousands of Hz. The above picture is me attaching scope utensils to a high side FET – there’s no good places to grab a ground reference, so I had to solder a small jumper wire. This whole rig was run off RazEr’s own battery so it was isolated and the scope ground could float freely.
Xzibit 1: Switching time of 80NF70 to the end of the Miller plateau, which is about 0.9 microseconds. At the end of the Miller plateau, enough charge has accumulated on the gate such that the MOSFET can be considered to be on and conducting (and not in a linear or triode region). For switching circuits, you want to get out of this region as fast as possible. However, the FET’s on-resistance will keep decreasing the higher the gate voltage gets. Because most power FETs are specified at 10V drive voltage, I also consider the time-to-10V important. In this case, it’s something like 3.2uS.
Wow, and here I thought that my sub-100ns switching time was kind of lame. That actually could be a problem plaguing Tinytroller: dV/dt induced voltage spikes from switching way too fast. One of my upcoming debugging ideas actually is to try increasing my rise time to near 500ns or even 1us.
Experiment 1: Putting a 3207 in parallel with the existing 80NF70 just to see how it impacts the switching time. I literally just soldered a 3207 by the pins to the rest of the circuit here, making sure the pin orientation was correct.
Huh? The Miller time only increased to 1.2us or so – I figured it should have been much longer, like closer to 2uS, since the circuit is now driving what amounts to 3 80NF70s together in parallel (the 3207 having roughly twice the gate charge). The time-to-10v increased to 5uS, which is a significant gain but not really 2 times or anything.
I’m not really sure why this turned out to be the case. After all, it’s adding capacitors in parallel. One explanation could be that the rise time seen in the lone-80NF70 test is really set by the gate drive circuit’s inherent rise time, since it uses bipolar transistors in switching, and not really by the gate charge load, but that changed with the addition of the 3207’s dumptruck-load of gate charge.
Experiment 2: Complete replacement of the 80NF70 in 1 phase leg with 3207s.
Result: Not bad at all. The switching time only increased from 0.86us to 1.1 us. The time-to-10v for this one was 3.8us, not much worse than the original, and both are still relatively small fractions of the total on-time in a PWM period – at 16000 Hz, a typical Jasontroller PWM frequency, the time-to-10v occupies about 6% of the total on-time (62.5us switching period, 4us of that spent turning full-on).
In this case, the forum advice isn’t crazy at all – the halved conduction losses win over increase switching loss.
What I found interesting is that above a certain throttle value, about 90%, the high side stopped PWM’ing and instead was on solid. At full speed, this means practically no switching losses at all, so there is significant benefit to lowering conduction loss. I also didn’t know a bootstrapped high side drive could stay on solid, but given the huge bootstrap reserve capacitor and lack of gate-discharging pulldowns, in the timespan of 1 commutation cycle I could see locking the high side on being possible.
I went ahead and swapped the entire bank of FETs for IRFB3207 parts. To complement the higher current capability, I also halved the shunt resistance from 4.0 mohms to something like 1.9 mohms with Selective Solder-Glob Sintering™.
I really need a motor-flywheel-brake kind of rig to abuse test a controller in … controlled … conditions, but the next best thing is just throwing it in a vehicle, in which my fat is like the flywheel and it usually has brakes. Luckily for me, Melonscooter was recently taken out of service following the discovery of severe battery damage. In another post, I’ll report back on how the chopped Sensorless Jasontroller performs in it (after I make a new battery pack…)
So far, though, the Sensorless Jasontroller looks good.
- Sensorless! No more dicking around with Hall sensors, positioning them just right (and timing them just right).
- Nice sensorless! Not like a model airplane controller which assumes you want to wheelie 100% of the time, or needs custom ramp-up code, or depends on you having a very sensitive throttle finger, which the majority of people do not.
- Real Cheap! The average price for a “350W” unit which seems to put out more like 500-600W is $28, shipping another $20-25, for a total of $50 or so.
- Current limited (or controlled). Can’t really tell, since if I’m plugging it at the limit the whole time it might as well be current controlled. But the bottom like is “Motor will not draw infinite amps to produce infinite torque because you step-commanded the throttle input”. The wattage rating divided by the voltage rating yields an estimate of the battery current it will draw.
- Other random widgets that are useful on a vehicle, since it is a vehicle controller. This particular one has a cruise control switch, which I have yet to work up the courage to try.
- Huge. The use of through-hole, common, cheap components and discrete gate drive, coupled with the auxiliary features, means this thing isn’t very power dense. Chopping the FETs and replacing them could improve it, but right now, the size cannot be justified for vehicles like RazEr. Which is why I’m pressing on with Tinytroller anyway.
- Really huge.
- No regenerative or even dynamic braking input. The Kelly Controllers still win in this case, since they are fully programmable and variable and isn’t afraid of anything.
- Limited power-hacking because of physical board limits. There are long traces on the board, and you can only reinforce them with solder to a point. Adding copper wire to the solder-thickened traces could help, but at some point (like around 70-80 amps) the TO-220 package itself becomes the limit. The shunt trace is very narrow, and the shunt itself is just a wire, forcing current to be focused in that one region. I might replace the wire shunt with some large SMT shunt resistors as a result.
By the way, Jason is the proprietor of a certain electric bicycle shop in Singapore, and for whatever reason, I’m going to name all shady Chinese controllers after him because he sells them.