• Howdy! we're looking for donations to finish custom knowledgebase software for this forum. Please see our Funding drive thread

Making a UK/EU legal RC build - a cheap option

bobc said:
A cheap RC ESC doesn't come controlled to any amps. This system will work with a 12$ controller (ESC) on a $30 motor. Controlling a higher current controller's battery amps gives you constant power operation over a wide speed range without gears. The term "12A controller" suggests it's controlling motor amps. That gives constant torque operation, I'm looking for constant power.
I hope. We'll see. It's the cost of the bits that's so attractive.
I've beeen running a $30 motor and $12 ESC on my bike for a couple of years. It's cheap & works, but not strictly legal and hard to ride (throttle control is twitchy to say the least) I hope this system will solve all those problems.


Cheap RC controllers not only don't see motor current, they don't have a way to measure it, and they certainly don't have any mechanisms to limit it. For RC ESC's, if they write 12A on it, it generally means it will burn up at 5A continuously, and if everything is setup perfectly it can survive bursts of 12A and greater for short periods.

You do not have constant torque with a cheap RC controller. Only a handful of types even offer the ability to know motor current. A number have the ability to observe battery incoming current.
 
Luke - what brings you to the 250W ebike arena - looking for POWER handling tips eh?
Damn right about the cheap RC ESCs - they really are made down to a cost. With luck I'll be doing system tests before too long... & see if & how battery current control really works... I bought a couple of ESCs at $16 (oooh the expense...) because they had a BEC in. The OPTO ESCs are much cheaper but they would require another, inconvenient, connection to the board (battery +)
 
All the RC ESC are typically only designed to run at significant loads when close to full speed and full throttle. So the designer had no burning need to make them any good at low speed high load that a bike will put on them. This is where the back emf is low, so the effective voltage across the phases are high, and it lets the phase current get crazy quickly. Since the phase currents are not monitored and kept in check, the currents can either generate a lot of heat and cause the thermal destruction of the FETs at a whole package level, or exceed the current limit of the FETs and cause failure at the junction level. The next concern is the performance at partial throttle, most RC ESCs (or ebike controllers for that matter) do not do synchronous rectification. So you get the FET diode losses for residual currents when at partial throttle, instead of using the FETs to controll the current flow. This causes significantly more heat, when not at full throttle. i.e. at partial throttle or when you circuit is pulling the throttle low to try and keep current levels below a limit.

Here are a couple of graphs of how nasty things happen at slower speeds on an RC ESC. This is a plot of the temperature rise of the ESC against RPM for different PWM frequencies.

This ESC in particular is a good one with synchronous rectification so switching losses are not too bad at partial throttle, but you can see that as the RPMs drop, the PWM is too slow to clamp the phase current. Going to a higher PWM rate helps, but it is still an issue as the RPM goes lower again.
Source: http://endless-sphere.com/forums/viewtopic.php?f=30&t=46210&start=125#p705058
file.php


And here are some plots for ESC and motor heat for the exact same conditions, but with and without synchronous rectification active.
Note the difference in gradient of the red curves, which shows the significant difference in heat being generated by the ESC.
Source: http://endless-sphere.com/forums/viewtopic.php?f=30&t=46210&start=75#p699220

file.php


And finally here is a graph comparing the thermal performance of three different controllers, under the same load conditions.
The controllers were:
- Castle Creations ICE 100Amp
- Typical 6fet ebike controller, EB306 with IRFB3006 fets.
- Hobbyking YEP 150Amp ESC (the one with synchronous rectification)

Check out the gradient of the curves at the 50% line. This is where I reduced the throttle to ~50%. So back EMF is half, and switching losses are significant.
The CC ICE 100 temperature is going through the roof, the EB306 (which starts at this load condition) is rising in temperature very quickly, but the YEP-150 (with synchronous rectification) is looking like it will stablise to the lowest temperature of all the controllers.
Source: http://endless-sphere.com/forums/viewtopic.php?f=30&t=46210&start=50#p695528
file.php


So your cheap ESCs may be able to handle the power at close to full speed, but things get nasty if you rely on them at low speeds. Cheap ebike controllers just use thermal mass to soak up the energy during these short accelerations up to speed, but the RC ESC have bugger all thermal mass so can't handle it as well. So going with an ESC that has synchronous rectification can at least keep switching losses to a minimum. But ultimately if you are lugging it up a steep hill, and the controller is not monitoring the phase currents directly, just maintaining a battery current limit, then yu are going to have a lot more waste heat in the controller to get rid of.

If the graphs don't make sense, follow the links as there is more description of each there.

Hope this helps.

Adrian.
 
Thanks Adrian,
I was working on 2 assumptions -
1) any current limiting is better than no current limiting
2) if my ESC gets hot or fries, it means I need to use a bigger one
As you say, I have been mostly running full throttle on my existing bike, so I may not have seen the worst heating: but TBH it's never got warm in the slightest - that's a 60A ESC with a bike speed limited by gearing at 20mph & I have to be careful with the throttle or it loses synch. On the new system (thread subject) the PWM demand will be mostly proportional to the detected speed so there is potential to operate for long periods at less than 100% modulation. If this makes a (say) 50A ESC get too hot (12A battery operation), then I'll simply use a bigger one.
 
Update - the adapter from usbasp to TPI has been slightly altered to make it work reliably in high voltage mode.
The picture is now correct, I added an emitter follower to beef up the 12V reset pulse. Previously this worked fine until you disabled reset (fuse RESDISBL) & then it didn't any more (making it a bit pointless) The circuit now operates correctly when reset is disabled - a bit necessary for this project... I was a bit worried about this - there were lots of horror stories about disabling the reset in an AVR!

While I was on a roll I thought I'd calibrate the internal oscillator. No dice. Ah well - you can't win 'em all...

I also bought an RC servo - I realised I can plug one of these straight into the ESC port & put an indicator needle on its arm to tell me what the program is up to. A bit more convenient than wiring up an oscilloscope every time - and incredibly cheap too!
 
Here is full information needed to build the AVR TPI interface adapter board including gerbers BOM schematic and user data.
You'll need one of these to be able to use the miraculous ATtiny10.......
Here is the system together:
Dsc01496_zps81e0c29b.jpg

At the top is this adapter board,
in the middle is a commercial USB AVR programmer (they cost about £2)
at the bottom is the "legaliser" board ready to be programmed/read/verified (whatever)
 

Attachments

  • avrTPIprog.zip
    32.5 KB · Views: 23
progress:- analog inputs working. ESC control pulse output working. Can now use hall effect throttle to position an RC servo (whoopee).
Next timer interrupt, then speedo interrupt etc etc. Also still waiting for some supplies from hobbyking.....
 
Damn it bob you will have it all done before I get back from London next week. awesome work though
 
Struggling tonight - trying to get the speed measurement working using a "pin change interrupt" on port PB0.
Naturally the "pin change interrupt" works on every other blessed pin but not, for some reason, that one.
Aside from that I have the basics all there ;^)
Fixed now - it didn't work with the programmer left plugged in - I need to make another 'thing' to disconnect the programmer (plugging & unplugging all the time is a bit of a chore)
EDit - Now evening of 27th & I have a pretty nice speed variable (magic number divided by duration between wheel turns). I made it work by taking all the "debounce" stuff out, which is mostly OK, I just get very occasional daft readings (so I'm going to have to put at least a bit back in......) My home-made divider is working a treat (you can't use the 'C' divider in a tiny10 - uses FAR too much RAM....)
Why use pin change interrupt instead of (what I want) normal external interrupt on falling edge? Well, I naively assumed INT0 was on port 0. No - it's on port 2. Plan B is not too bad though.....
 
Thinking about this, if this were a commercial product, it would probably need a "kill switch" input, say from an ebike brake lever.
This is a short when the brakes are on.
I could do 2 things with this:
1) clamp the analog throttle into the system to deck.
2) clamp the PWM out to the RC ESC to deck
[1] is easier, but is it sufficiently "safe"? If the wee computer on there crashes it might leave its timer hardware running and asking for full beans....
[2] is therefore safer, but what does an RC ESC do when control pulses disappear? Do they all stop the motor & then restart it again if the pulses come back? Unless they do, [2] is a non- starter
 
Don't do [2].

It will cause a lost throttle signal. Which different ESCs recover from in different ways. But you may not be able to immediately get back on the throttle.
 
Oh. And it may not actually turn the motor off either. It may try and maintain the current throttle prior to loss of throttle signal.
 
I have a couple of ESCs, I'll check 'em out.
There is also the issue of the 5Vsupply, BEC ESC's are significantly costlier than OPTO so it might be useful to include a V reg.
Actually, for all these considerations, all the relevant signals appear on the programming connector so it's easiest to connect in there with a couple of options: that would only require an output resistor on the ESC control line to allow that option.
Regarding the ESCs, they are designed for aero model props, I would expect them to stop when the control pulses disappear (any alternative fault condition would see your model plane disappear over the horizon....) and (hopefully) similarly restart when pulses came back - maybe requiring a "throttle on off" sequence to restart. I'll check out what I've got ;^)
Speed determination now working properly too ;^)
Ready for my new (recently ordered, not yet here) ESC & FIA switch & I should be mobile.....!!
 
Reading the "bad design - no kill switch" thread; some interesting posts on there. Even though I'm only working on low power, I'm going to add a "throttle shorted to 5V line" detect/safety - that is EASY, half a line of 'C' in the program!. If I do another board I will add a couple of resistors; a high value pull down on the throttle input, and a lowish value in series on the ESC control line so I can deck that without frying the tiny10's output buffer; it all makes the circuit more flexible and safer (for the cost of 2 resistors) and the safety connections utilise the otherwise redundant programming socket. Excellent!
I should be able to "crash proof" the program to some extent by enabling the on chip watchdog system - eventually.......
 
Progress: first electric ride on my trike last night with this little board doing the business. Went OK, up to about 10mph on the close where I live, but the speed & current limits were falling over each other so a fair amount of development is on the cards.... The basic board, micro, speed sensor all operated very well with the RC ESC. The BEC in the ESC seems to output in excess of 6V instead of the 5V I want but the board and the throttle survived it; I'd better put a big bright LED on there to soak up some juice - the BEC is designed for supplying 5A, not the 2mA I'm actually drawing.... When I redesign I'll put a small linear Vreg on the board... that way I can use cheaper/easier to get "OPTO" ESCs. The whole installation needs some sorting out, I'm not really happy with the battery mounting & the chainline is clearly not quite perfect.
 
Hey bob, great to hear progress. I have made some of my own. Bought a dahon cadenza solo folding racing bike. Absolutely perfect for a small left hand drive rc motor. Love riding it already and when on a 90 minute ride all along the penine trail near chorlton to urmston, stretford etc. will arrange another visit soon. Best bit it packs into the back of my insight.
 
Cool Andy,
you know I got a spare motor & ESC so you just have to find & make the rest of the hardware. (just - mwahahaha.....) I can get some laser cutting done if you want; - let's see how you want to proceed ;^)
C U
Bob
 
I quite like the idea of a belt drive lhs. Ill being the bike next time I'm over. The bottom bracket needs replacing but aside from that its soooo much fun. also I think all the ebike riding on my heavy Scott ransom has given me some pretty good sprint acceleration. This single speed stuff is easy.
 
First failure yesterday, it just stopped. I initially assumed the ESC had let out the magic smoke, but a tiny bit of multimeter work revealed that the big shunt on my little board had suddenly become infinite instead of 10milliohms. It is just a shunt I found in the cupboard at work so I'm not sure what its current ratings are, from the size of it it should be good for a couple of watts & that would be 14Arms. Now my current control scheme should limit the mean current to 12A, but to be frank the rms could be anything over that. So I need to get hold of some proper shunts..... meanwhile carrying on carefully with another one ;^)
Chainline is now better, & I find I need a slightly bigger cog on the layshaft (was 14 teeth, should go up to 16 or 17 I guess - my max speed was just 14mph). I'd also managed to get the belt far too tight, it was actually getting heated up running with the wheel in the air & taking 4A; proper tension & I'm down to 2A. And I need to replace the rear disc I removed with some rim brakes - bit more engineering to do....
 
Been a while..... busy I'm afraid: I replaced the shunt with a beefier one on my hardware & have replaced the 14tooth cog with a 16tooth. I'll try to put in some quality time during the week - I must say, even before I've made it work right, this is looking like an excellent way of taming the power delivery of a RC setup. Having the servo PWM signal controlled by "speed + throttle" actually makes the throttle feel progressive and more like a torque demand. OK it's a mite clunky at low speed because you only get a speed update once per wheel rev, but that's something that can be easily improved if you want (more magnets on spokes), & you don't have to put the speed & power limits on.....
 
Bit more progress tonight; I got the speed dependent part of the servo control signal dialled in nicely now. The current control was starting to work but it was borderline unstable with big over and undershoots. I'll have to bung in some derivative action to calm it down. Unfortunately the overshoots made my new (beefier) shunt expire, I'll have to get one of the metal ones from rohm, these thickfilm things from the disties cannae take it.... Should be OK once the current's under control mind you. It actually worked for 10 minutes or so tonight, the power was underwhelming (as you might expect) but the control, with the speed feedback dialled in, was really very impressive; felt like a genuine torque control and there were no synch loss issues.
I'll keep plugging away....
Bob
 
that has something of our project. maybe we should have started that simple ;) Two points I found not as straight forward as the rest: Why not use a 6fet sensorless, it's cheap? Why use an Attiny5 and op-amp? The tiny 85 come with built in 20x op amp? That's what we use to measure battery current: http://64.64.13.141/forums/viewtopic.php?f=2&t=47124&start=25#p765293

EDIT: I'm sorry, you already posted in my thread and I dropped you out :( Your project is very nice, great that you started your own thread now! Will help you if I can ;) The Tiny85 also comes with differential ADC channel pairs that seem to produce quite more accurate readings when used for current readings. The Tiny5 does not support this.
 
Thanks CB. To be honest this project was all about "what is the most squalid solution to make an RC system legal & usable". If I were sensible I would have done the debugging on something a little more user friendly, for sure ;^)
 
Back
Top