Possible to have acceleration control on typical Controller?

cell_man

100 kW
Joined
Dec 16, 2009
Messages
1,043
Location
Shanghai, China
Guys,

I've been thinking about the problems that often seem to occur with geared hub motors. Generally it is the gears that are the weak point and as far as i know the biggest killers of gears is shock loadings rather than outright power. Obviously heat is also an issue but we can come to that later.

What I'm thinking is that if there was some kind of algorithm in the controller that only allowed a certain level of acceleration of the motor it would maybe, along with a soft start, help to reduce the strain on the gears. Would anyone know if the MCU could do something like this and if it can, how difficult would it be to implement?
 
The MCU can do anything you program it to, in theory. THe catch is that unless you have the source code to rewrite it to do this, you'd have to write the entire controller program from scratch. ;) For me, that would be impossible. For a good programmer, it would be possible, perhaps even easy, if they have experience writing BLDC motor control code.

Unless you have a controller designed to be parameter-settable *and* it already has parameters to do what you want, that just aren't yet set to the values you need.

That said, a ramping accelleration is easily achievable in hardware, with an RC constant on the throttle input. So you could just add that if your controller doesn't have one already, and it would never throttle up faster than you've set it to.
 
some people have experimented with "Fechters Current Based Throttle" http://www.endless-sphere.com/forums/viewtopic.php?f=2&t=78&start=0&hilit=current+based+throttle

this is an add on circuit that fits between the throttle and the controller. the throttle controlls the amount of current available to the motor and becomes a torque control. definitetly a serious DIY project. no off the shelf pre-built circuits here. this is stricly "roll your own"

personally i like the feel of a current based throttle. it feels and responds much more like a motorcycle throttle.

rick
 
My idea wasn't for this to be DIY, maybe something that could be added to an existing controller on a bigger order. My idea is to basically monitor the speed very closely and have some kind of algorithm that would basically prevent the motor from spinning up when it is unloaded, so as soon as the next hall sensor pulse came in faster than is possible in a loaded situation, it would immediately take action to prevent the motor from spinning up, to prevent shocking the gears when the wheel hits the road again.

I suppose it could even be done externally by monitoring the hall sensor frequency and battery current to control the throttle signal. Maybe 1 day but I've got enough things piled up in front of me to keep me busy for a while without getting too involved in this.
 
This should be fairly straightforward to do in the controller firmware, but the first issue to sort out is "what sort of control characteristic is best?". These controllers come as standard with speed control, the throttle position directly controls the motor rpm. Current, or torque, control is a close approximation to the way the throttle on an ICE works, with motor speed being a combination of throttle setting and load. I suspect that electric motor current control really is a very close analogy to an ICE throttle, because on an ICE the throttle directly controls the volume of fuel/air entering the cylinders on each stroke and the engine torque is directly proportional to the volume of fuel air burned per stroke (well, actually the pressure in the cylinder, but this is proportional to fuel/air volume).

However, just because we're used to torque-controlling throttles on ICE powered vehicles doesn't mean that they are the best; they're just commonplace because it was an easy way to control an ICE. My guess is that something that melds the characteristics of speed control and a torque control might actually give the best ride-ability. I also think that adding any sort of delay to throttle response, as some programmable controllers allow, is just a bodge to get around the low speed start problems that speed control can have, so delays or ramps should be avoided.

The Xiechang controller already measures motor rpm, throttle voltage and supply current, so there doesn't seem to be a hardware reason for not incorporating some form of combined speed/torque control. The best way to find out what feels best would be to build an add-on, programmable, throttle interface to experiment with and get the best algorithm, then ask the programmers to build this in to the controller firmware. If it were me doing it, then I'd just knock up a PIC board with voltage inputs from the throttle and current shunt (with an amp to boost the tiny shunt voltage), a feed from one of the motor Hall wires to give a speed signal and a voltage output to the controller throttle voltage input. It'd then be a matter of playing with various control algorithms to see what felt best. I think I'd first look at using pure torque control for low speed starting, then switch to speed control gradually as the motor speeds up. My gut feeling is that this might give the best overall feel.

Jeremy
 
It's not a bad idea to come up with something to cushion the shock loads from the gears.

Make sure it doesn't end up like the infinion soft-start setup though... Those things were awful to use. Hit the throttle, have a delay of a second or so, then it takes off... It made it pretty much impossible to do any techincal riding, and made even inching forward at a stoplight or something into a dangerous activity.

You roll on the throttle a bit, nothing happens, roll on a bit more, then shoot out into the intersection the moment the soft-start delay is over...

IMO, any delay is an instant failure in a controller, BUT, something that acts instantly with the throttle position to send current to the motor, but maybe only sends half the current for the first half second or so would be ok, and should provide a lot of gearing shock protection over full current instantly.

The way they did the infinion soft-start is absolutely something to avoid like the plague though. The delay in throttle response made you wonder for a moment what came un-plugged on your bike everytime you went to hit the throttle, then jerked forward and took off.
 
Luke,

I think they put that delay in as a crude bodge to get around the inherent "jerkiness" that a pure speed control throttle (without decent soft current limiting) can have when pulling off. Other controllers, typically the programmable brushed motor controllers used on golf carts, also have soft-start delay ramps, to get around this problem. The problem isn't really there for a low power controller/motor set up, as the controller will just current limit and hold the torque down. The issue only really arises when we're looking for high performance, with loads of current available on tap. Here's my take on what I think happens with pure speed control:

1. From a stand still, the instant the throttle signal is applied (and irrespective of how much throttle is applied) the controller tries to get the motor up to the throttle set speed as quickly as it can.

2. To do this, it will apply whatever current the motor wants, which, in the case of a low Rm motor and a controller with a high current limit, will be loads of amps.

3. The consequence is that the motor near-instantly produces maximum torque, with the rider often having to turn the throttle back down again pretty quickly in order to try and pull away smoothly.

4. Once up to speed things are pretty much OK, as speed control is probably what you want when just cruising.

What I think we need to get around the "instant max torque" problem is a throttle that will limit current at low speed, with that limit being set by throttle position. This would be particularly good for low speed controllability, as it'd be possible to apply precisely the right amount of toque to the wheel needed for the conditions. You could, for example, hold a wheelie by just keeping enough torque on the wheel to balance the bike. Should be a lot easier than trying to do the same with just speed control.

Jeremy
 
The way I would see a system like this working is similar to a fly by wire system that might be used to control an ECU to control an ICE. Rather than just use a direct link from throttle to the output circuit of the controller it would instead pass through some tests. Most of the time the controller would just obey the commands of the throttle but when pulling away from a standstill it would apply a pre-determined ramp up if the power demanded from the throttle requested power beyond what the motor could safely/smoothly deliver. Another circumstance that would be beneficial is a check to control the current supplied to the motor that would not allow it to accelerate at a rate greater than it could achieve if loaded in a typical situation. Basically what Jeremy is describing but also a check to ensure that the motor doesn't spin up if it becomes unloaded.

For example we are going along at 25mph pulling 1KW and we hop off a curb or hit a really nasty hole in the road. The motor is unloaded for a short time, the current will drop, the wheel will quickly spin up, it then hits ground again and the motor and wheel is quickly decelerated before being hit with drive again as the motor is loaded. If off road this would happen even more. Anything with a gear will be put under a lot of strain in these circumstances so that includes RC setups as well as geared hub motors. Granted a belt driven RC system would have some cushion to reduce the worst of the shocks, but still.

The hall sensors give a very high resolution speed signal, if they could be used to instantly remove or reduce the drive to the motor that could reduce the worst of the shocks that the gears have have to deal with. The only problem I could see with the idea is when would the controller know when to re apply the power to resume normal operations. Maybe high resolution speed sensors on the undriven wheel would also be required??
 
When I program my controller for my switches the SL speed is normally limited to about 20mph on my setup when i progam it to 40-60...depending on what voltage. But one thing i also notice that the instant power available "amps" is reduced by half. It takes some serious loading for it to get a decent peak. And its no where near the maximum peak of the controller. But this is only scaling down or limiting the throttle range. You will have limited top speed until you switch to another mode. But the controller does have sense enough to decide since its in a limited throttle range i dont need all my avaliable power and it then rations off and limits portion of current. Even when the motor becomes bogged down and increased the PWM to allow more current it doesnt peak to the full output that the controller can do. Like when im riding in default mode my controller can put out almost 3000w but in sl mode I may peak at 1200-1500 even when heavily bogged down.
 
A pure current mode throttle does have a nice 'feel' to it. A blended mode (part current, part speed) is not bad too. Since all the hardware is there in a typical Chinese controller, the only thing lacking is proper software. My add-on unit is just a hack to get around crappy software. I think someday they will figure it out.

I agree that any kind of delay is unacceptable. If you have a current mode along with a ramp up on the control, you can avoid the delay and still have a gentle start. To avoid spin up when the wheel comes off the ground might be a bit more challenging, but if the rate of change of rpm was limited, it would help there.

I recently designed an add on unit for large (Alltrax) controllers. This one uses an inductive hall current sensor (torroidal type) and also interfaces a standard hall effect throttle into the 0 to 5k input of the Alltrax. Apparently the failure rate on 5k Magura throttles is almost 100% over enough time, so using a hall throttle avoids the wear out factor.
 
fechter said:
I recently designed an add on unit for large (Alltrax) controllers.
You got my interest now Richard. I'd really like to hear more about this as it's the one thing I dislike about the Alltrax controller. Low-speed throttle control on my motorbike leaves a lot to be desired. I'd not heard about the high failure rate on the Magura throttle either, so I'm all ears :)
 
I think there needs to be a slip clutch in the mechanism.

A soft start won't help.

I killed my gears, and so did Johnrobholmes, going DOWN a bump. The wheel is suddenly slowed, this forces the gears back against the freewheel, which is locked, and the gears strip.


To save the gears during acceleration, we need a speed related current control - not a bad idea. But it's not the answer.


Matt put a slipper clutch in his recumbent build.
 
Cell-man: With an aggressive rider, preventing shock loading is difficult w/o changing rider behaviour. It is not just coming off a jump, but also coming out of a spin on loose ground, or a controlled rear wheel spin in a power turn. Then the tire will suddenly grip again and chock load the gears. I tend to ride my 9C like this on the gravel lanes behind my house. Luckily it has no gears.

Jeremy: Wasn't sure if I understood your post correctly. Did you find a controller where the throttle controls rpm (meaning as an rpm setpoint)? In my controllers the throttle sets PWM duty cycle. So with a light load then high rpm and heavy load low rpm for the same duty cycle. This might be the root of the problem when jumping and unloading the tire that cellman mentions: rpm spins up, motor rotational inertia is up. wheel hits ground and the spinning motor is immediately braked through the gears.
 
to set up a "current mode" control the firmware in the controller must be modified. this is a lot more detailed than setting a couple of parameters unless one ot those parameters just happens to be "CURRENT MODE THROTTLE". does anyone know of an inexpensive chinese controller that allows that setting? i know you can get a KELLY and set it to torque control mode. that is the off the shelf simple method of doing this. buy a kelly or similar controller.

otherwise, this would require a rewite of the software. the control loop would have to be modified to reflect the current instead of voltage. as far as i know no one has complete access to the firmware source code of any of the popular controllers. also the MPU's used have software protection features that make it very difficult if not impossible to reverse engineer the code. since it is unlikely that a knowledgeable individual will somehow get their hands on an accidentaly unprotected MPU that leaves 2 choices. build your own controller, write and debug your own software for it from scratch. or build an add on circuit that performs the current control for you. Fechter did that very nicely with his add on circuit.

rick
 
rkosiorek said:
to set up a "current mode" control the firmware in the controller must be modified. this is a lot more detailed than setting a couple of parameters unless one ot those parameters just happens to be "CURRENT MODE THROTTLE". does anyone know of an inexpensive chinese controller that allows that setting? i know you can get a KELLY and set it to torque control mode. that is the off the shelf simple method of doing this. buy a kelly or similar controller.

otherwise, this would require a rewite of the software. the control loop would have to be modified to reflect the current instead of voltage. as far as i know no one has complete access to the firmware source code of any of the popular controllers. also the MPU's used have software protection features that make it very difficult if not impossible to reverse engineer the code. since it is unlikely that a knowledgeable individual will somehow get their hands on an accidentaly unprotected MPU that leaves 2 choices. build your own controller, write and debug your own software for it from scratch. or build an add on circuit that performs the current control for you. Fechter did that very nicely with his add on circuit.

rick

I do current control using CA. There were several posts on how to introduce this second input in the new CA version about 6 month ago. Same idea as Jeremy's of using an external microcontroller, but in the CA Justin has already done the programming. Just solder in the wires for the secondary signal and set up the current limiting on the setup screen. Most people use this to get a variable current limit, but it could also be used as a current throttle by setting the PWM (regular throttle) to max and adjusting current instead. Might need to fiddle a little with feedback loop parameters (accessible from the advanced setup screen) though on my bike (9C @72V, 2000W) the control loop is stable (if a bit slow) with default settings. Riding with current control gives a very "soft" feeling on the throttle (as I think others already remarked). Personally I don't like it.

Now I don;t think the current control will solve cellman's problem as stated in the beginning of this thread. With current control on an unloaded wheel (e.g. during a jump) it could spin up to a very high speed. (Limited only by the max battery voltage and kV). In this sense current control is worse than PWM control. At startup from stopped current control (as usually done ont he primary input circuit) will be a bit softer than PWM. However the best would be limiting current in the secondary (phase circuit). This secondary current measurement is AFAIK not easily accessible in any controllers. The Ezee controller limits phase current, so may be a bit softer in that regard. Others don't and phase currents at stall will only be limited by losses in controller and motor. Hence in that respect "crappy" high Rds-on FETs are (somewhat) gentler with the motor on startup.
 
Malcolm said:
fechter said:
I recently designed an add on unit for large (Alltrax) controllers.
You got my interest now Richard. I'd really like to hear more about this as it's the one thing I dislike about the Alltrax controller. Low-speed throttle control on my motorbike leaves a lot to be desired. I'd not heard about the high failure rate on the Magura throttle either, so I'm all ears :)


I'll start a separate thread for that one.


Yes, I suppose no matter how smart the controller is, you can't prevent all shock loading to the gears electronically, so some kind of mechanical buffer would still be needed. The typical rubber block setup found between the sprocket and rear hub in a motorcycle does just that. The springs in the pressure plate of a car clutch do the same thing. Without them, the gears can easily break (I've done it).

In a geared hub motor, the spring action would be best between the magnet rotor and the sun gear. This wouldn't be too awful hard to do if it was part of the original design. Adding it to an existing motor would be very difficult.
 
older euro cars like alfas and bmws have a rubber damper in the drive shaft too. I think a current mode throttle would make BMC gears last a year instead of 1 month.
Going back to euro cars there have been plenty of vehicles with weak points but nobody cared because if it was easy to fix. If it only takes 30 minutes to change the clutch and gears in a motor and the part is under $100 it would be pretty acceptable to do it once a year. These high powered geared hub motors are definitely not the honda civic of the ebike world, more like the ferrari and lamborgini of the e bike world. I bet a sporting goods store currie bike would last longer in the hands of an inexperienced rider than my $3000 + BMC bike would
 
mr.electric said:
older euro cars like alfas and bmws have a rubber damper in the drive shaft too. I think a current mode throttle would make BMC gears last a year instead of 1 month.
Going back to euro cars there have been plenty of vehicles with weak points but nobody cared because if it was easy to fix. If it only takes 30 minutes to change the clutch and gears in a motor and the part is under $100 it would be pretty acceptable to do it once a year. These high powered geared hub motors are definitely not the honda civic of the ebike world, more like the ferrari and lamborgini of the e bike world. I bet a sporting goods store currie bike would last longer in the hands of an inexperienced rider than my $3000 + BMC bike would

Have you had any problems with the key that stops the freewheel clutch rotating, and keyway in the axle? That seems to be the next point of failure.

(Sorry for the OT).
 
There's lots of really useful info there guys. I didn't realise the CA could control the throttle in such a way as previously mentioned. I'm sure that the CA could probably do all of the throttle and traction control that I was thinking of. I'm not so sure that an electronic control system is enough on it's own to save the gears but I'd be surprised if it didn't help significantly. It's all good food for thought.
 
On the typical geared hub motor it would be possible to introduce a spring damping, though a bit tedious. Basically the rotor and magnets need to be mechanically decoupled from the wheel. Easiest route may be putting a spring plate on the sun gear and couple this spring plate to the motor housing. Tedious, but doable.

Now most people who are into high power and active riding would probably rather put their money and time into an non-hub motor build. Here one can intentionally (or unintentionally) build in some give in the system because of the various drive components and the flex in their mounting.

Here's a question for the belt experts: How about a belt drive system with a small toothed pulley on the motor side and a big, smooth pulley on the wheel. Belt tension should be set so that there is no slip up to max motor torque, but the belt will slip on brutal jerks such as a touchdown from a jump. Do you think this work? Can I get a long enough 13mm wide timing belt to go from my motor location (near the BB) to a really big (16") smooth rear pulley? What to use for rear pulley? A narrow 16" bike rim? (if 13mm wide 16" bike rims exist?)
 
jag said:
On the typical geared hub motor it would be possible to introduce a spring damping, though a bit tedious. Basically the rotor and magnets need to be mechanically decoupled from the wheel. Easiest route may be putting a spring plate on the sun gear and couple this spring plate to the motor housing. Tedious, but doable.

I think you are on the right track.


The other place to put it is inside the freewheel/gear assembly. That is removable and seems to have spare space around the outside periphery.
 
Mark_A_W said:
jag said:
On the typical geared hub motor it would be possible to introduce a spring damping, though a bit tedious. Basically the rotor and magnets need to be mechanically decoupled from the wheel. Easiest route may be putting a spring plate on the sun gear and couple this spring plate to the motor housing. Tedious, but doable.

I think you are on the right track.


The other place to put it is inside the freewheel/gear assembly. That is removable and seems to have spare space around the outside periphery.

Here's a more pictorial description (pictures borrowed from a car forum and Ilia). Basic idea is to have two discs overlaid on each other. Cut outs are made for springs.

Now I don't have a BMC myself yet (but a new one should be in the mail as soon as my paypal echeck clears.) Using Ilia's picture here is an illustration of where the spring plate could go.
1. The sun gear has to be decoupled from the motor rotor (It is probably press fit, hopefully it can be undone)
2. Then the sun gear is drilled out a bit so it can rotate on the shaft.
3. A disc is attached to the sun gear
4. space is milled out for springs in both the disc and the rotor.
5. sun gear is put back and and the springs put between the rotor and sun gear as I suggested above.

Here's a drawing. Excuse the quality. Done with Xfig. Anyone still uses such classic freeware?:
BMCclutch.jpg


Rotating one disk with respect to the other compresses the springs. This can take up shocks in the transmission. The idea is illustrated in this car clutch:
clutch%202.JPG

Mark suggested an alternative: to integrate it into the planetary gears. (Since I don;t have the motor I don;t know exactly how the planetary assembly is done. Maybe Mark can describe his idea in more detail.)
 
Yes, I sent a similar picture of a car clutch to Jack, the engineer at MAC.


Personally I think that the springs should be as close as possible to the gears, and there is also a big bearing in that space for the rotor.

But what you suggest would work just fine I think.

What we are trying to do is protect the gears from the rotary inertia of the rotor, getting jammed up against the locked freewheel.
 
This is one of the reasons I'm trying to use treadmill parts. Treadmill controllers have good acceleration control built in...they kind of have to. The big drawback is that treadmill controllers require AC and will only work for 90v+ brush motors.
 
I guess an ideal hub motor would have a shock load dampening set up and an internal transmission for the pedal gears.
 
Back
Top