Throttle interface for sensitive high power setups

zombiess said:
Not married yet, but soon.

Don't do it. You're too young and us guys take about 17 years longer to grow up than girls....the ideal age difference, 40 and a mature 23yo is just about perfect. :mrgreen:
 
I'm already divorced once and said I wouldn't do it again. Only reason I am is because it feels so different this time, I'm also a lot older than before and have had many relationships so now I've got a pretty good idea of what not to do :lol:

This project will continue soon. Ill most likely be working on it this weekend. Got two new ideas to try out, both simpler than what I was doing before. Updates will continue and I will succeed.
 
Subscribed! That is an awesome idea. Its really hard to control at low speed. Especially near people and traffic, it can be a bit scary. Will follow this one closely! Thanks Zombiess!
 
I may tackle this when I get back from vacation. I'll have almost a month without the wife and kids. HK finally has the 4s hardpacks in stock again so I've just ordered a few more to make my 10ah 100v pack and I've got docbass dropouts, epoxy and two frames just waiting for me to come back...
 
Before I forget, I've already got a basic speed monitoring system coded up from my old motorcycle. That one used a hall effect sensor on the front sprocket, but I've got a bike computer that I've always hated that's just dying to let me rip the speed sensor off of it.

I think the really interesting design challenge to this is the simple fact that we (motorcycle riders) are used to the traditional increasing torque/hp curve that results from a throttle increase.
That curve makes it very controllable.

Since an electric motor has full torque at zero RPM (I need to read up on brushless torque curves, I'm using DC as my comparison) we just don't get that cushion.

It occurs to me that I can produce a translation table function - either logarithmic or polynomial to replicate this behavior. In addition, we can allow for some preset function slopes to create the appropriate experience for the rider.

For my motorcycle gauge adapter, I did almost exactly this to translate my hall effect sensor input into an appropriate output for my digital motorcycle gauges.
I think I can get away with making a few changes to my original code and get this built rather rapidly.

If anyone wants to play with the code base, it's published here:
http://biobug.org/code/
And the general description for the MotoKomp is here:
http://biobug.org/index.php/2010/04/30/motocomp-my-diy-speedohealermotorcycle-computer/
 
Ok, does anyone have a good reference for the output created by a twist throttle? I'm far away from my oscope and throttles.

I was using a frequency generator on the pwm output previously. This may or may not work well to simulate the throttle output.

I think I can simply use an analog output pin on the atmega/arduino. It's good for 1024 bits of resolution across 0-5vdc. Hopefully this is enough.
If not, I've got a nice digital potentiometer I can use for this...



Will
 
amberwolf said:
Throttles typically use ratiometric hall sensors, so you can just look up the specs for those to find the voltage range. ;)

You're my frickin' hero. I glanced at one sheet and it looks like a nice flat slope. Easy as pie to replicate and tune.
It looks like I can pretty much trash most of my original code and just rewrite this from scratch. However, I can re-use my translation methodology to allow for tuning.
 
I finally did a little more work on this project this past Friday. I haven't been exactly motivated since it's not like there is much money to be made off of these, it's more of a pet project that I'll make available to others. I've taken a whole new approach to it and it seems to be working well, just need to get it on my bike and test it out and then tweak it. Not exactly sure how soon I'll be doing that though, been in a big rut lately and haven't been doing much besides lots of paperwork for business and immigration.

Maybe I'll find the motivation to start up again after I get my business paperwork to my tax consultant so he can start working on figuring everything out.

I'm 90% of the way there on this, but there is one nice feature I'd like to add to help prevent the sudden jerkiness you get when you go off the throttle then get back on it few seconds later. I'm doing this all with timers instead of referencing a hall sensor to keep it simple. I'd like to build a really advanced version that is fully programmable and references a hall sensor, but right now I just want to get something out to help myself an anyone else.

Let's hope I find my motivation soon.
 
Well damn. I was ready to go ahead on this, after only finding a few threads on ES. Then, I managed to stumble into this thread. But actually I think you are implementing things how I intended to. So while it's encouraging (wooh! My plans were reasonably close to a more competent person's), it's also another case of its already being done on the internet. So slightly discouraging >.<.

Without much else to say, my plan was to use some aatiny's on a simple single sided board. The extent of transfer from semi-linear hall curve to exponential curve would be set by shorting a pin to "program mode" which cycles through a few different values for the curve (which are expressed as a voltage indicating which you selected.) Unshorting the pin saves the value you're on [I'm sure there are some other simple ways to offer user adjustment this was just a curious one I thought might be good.] Also, the board would have proper 4 pinouts so you could reupload the code yourself (with tweaked parameters) through something easy like arduino ide. And it would take cellog alarm output as a throttle-down signal, as a simple but quality addition. Accounting for $1.5 for the chip, $3 for the pcb board, $1 for cap/resistor, and $4.50 for my thoughtless-ness of other costs, I think the whole thing could be made for $10.


Let me know if you totally dropped this. I am still slightly curious to see this materialize, but not really as a marketable product (I agree there's not much to be had, but in isolated cases it might be useful.) It's just that I was encouraged by the fact it lines up as easy enough for my recent noob forays into MCUs, code, and making a few PCBs on Kicad.
 
Finally found the motivation I needed and made a complete change to the algorithm. Just went for a ride on my 4KW 9C 2808 26" setup and made a few adjustments to the throttle interface until I found a happy medium and I'm pretty sure I could make it even better.

The new algorithm works off timers and averages the throttle signal just like my previous trials, but this time I added in function that controls acceleration based on how much throttle is commanded vs the current position. It has a timer for controlling a the delay of the averager and 4 steps of acceleration available. This way the further you twist the throttle from it's current location the more acceleration you will get. Make very slow throttle adjustments and you accelerate very slowly. The acceleration steps are 1X, 2X, 3X, 4X and the spacing in between is set by the end user. With this setup I get starts so gentle there is no need to use my 3 speed switch, high speed only, but if I need sudden acceleration to pop the front wheel up I can achieve that as as well by going full throttle.

The averager completely eliminates throttle jitter from riding over bumps. I rode around in high power at around 15mph (40mph top speed) and quickly rotated the throttle between full speed and zero and my speed never changed. Small throttle jitter has zero effect.

Setup is accomplished through 4 trimmer pots.
1. Min throttle volts
2. Acceleration spacing
3. Averaging filter speed
4. Max throttle volts

I started off with a 96V charge and stopped playing around at 91V. At this point I bypassed the throttle interface to compare how it felt. I forgot to switch the speed switch back to 1 from 3, HUGE difference in starting off, jerky start and the smallest throttle movements were felt. Overall throttle feel with the interface is now more similar to an ICE throttle, more throttle more acceleration, hold position speed stays the same on level ground. It's nice to be able to start off from a stop very gently or gun it hard.

Next I need to try this out on my 10KW Cromotor bike and see how it behaves when running in kill mode. It's very hard to start off in switch position 3 on that bike.
 
Oi, dude.

I am happy!

But, lol, I was planning on doing something of a copy over this weekend. So it's good you just popped up to say you might be reviving this project.
 
Kin said:
Oi, dude.

I am happy!

But, lol, I was planning on doing something of a copy over this weekend. So it's good you just popped up to say you might be reviving this project.

Let me tell you that what sounds easy on paper ends up being much harder in the real world. This is my 3rd or 4th algorithm I'm using to get the throttle to behave well. It sounds so simple and looks great even in simulations, but once you actually try to use the signal you have modified reality can hit hard. A throttle ramp/delay is one of the things that looks feasible on paper until you try it in real life and figure out it sucks.

This is why I decided to go for a signal processing route over an analog circuit design. Without being able to modify the output signal on the fly differentially and or delayed from the input I just don't see an easy way to get decent control. I keep thinking about adding in a hall sensor input and making it speed sensitive but that makes user setup more complicated and I'm after a plug n play solution.

If you do want to try giving a go at your own interface I strongly encourage it as it is an excellent exercise, I've learned a lot from this even though financially these aren't worth much, but as stated previously it's more of a pet project for me. I will be making a run of some to sell after I have someone else test one out. Should have prototype boards designed this weekend.
 
Glad to hear you've made significant progress. Since a lot of us are using infineon controllers still, i think that this will eventually be something that is absolutely required for standard-wheelbase mountain bikes that make up the whole of what people are using here.. much like how torque plates are needed too.
 
Hi Zombies!

Just to clarify, when I casually said I planned to do one over the weekend I was keeping in mind
(1) I was planning out the code and writing some protofunctions for several weeks/months on the side whenever it popped into my head. Component things like learning how timers work so that I could get a high frequency signal took dozens of hours over past weekends, on different projects.
(2) I would be TRYING to do that [churning one out], not necessarily succeeding, haha, as you say it's likely to be harder than I think (though I'm not even going to think about using analog- I just really can only get anywhere by the grace of digital systems.)
(3) I expected, though I wanted to do it this weekend, I might not actually get too far.


I appreciate your openness to encourage me to give it a shot anyway. As I'm studying for my controls class right now, I was just thinking that maybe in addition to adjusting the curve, I could model it as some sort of basic mass/spring/dashpot system to get more interesting responses to how fast the throttle is applied and adjusted (the throttle input would be a forcing function). As you say, it's to a large extent about the learning experience.


Actually, while I'm here, can you point me in the direction to understanding what you meant by signal processing route over analog circuit design? I am still just a mechanical engineering student so I haven't heard the phrase 'signal processing route' used in the context that would make it immediately clear what you mean.

P.S, Some things that I'm hoping a throttle curve system could be easily modded to include would be response to a thermocouple reading, and less easily, maybe even interaction with an MPU6050 accelerometer for complex functions like wheelie-control, or less complicated functions like brake-light switching. But this is just a bit of expressing; not to derail the main focus.
 
Analog meaning capacitors, resistors, op amps, etc to process.

I'm converting from analog to digital, processing in digital then converting back to analog.
 
Gotchu, then it means what I would expect it means. Thanks.
 
Just wanted to post an update on how the throttle feels when riding.

I drive a Turbo car with an automatic transmission and the feel of my ebike throttle interface matches the way the throttle in my car works very closely. In my car if I am at a given speed and give a little throttle the car slowly get's to that speed and then holds. If I make a large throttle change, the turbo spools up and I accelerate faster and the acceleration start to slow as start to reach the speed that throttle amount will take me. A non turbo car does not usually get this sudden boost of acceleration so the throttle feel is different. I happened to notice this when I was driving this week.

I have the board design almost finished and will be sending them off for a small prototype run soon.
 
Got all the parts in to make a small prototype/beta run except for the PCB's which will be here this week.
After riding around with this and feeling how it has removed all the jitter in the throttle I figured I'd take advantage of that and use it to add a feature, a user programmable launch control.

I just finished the code to enable the launch control mode by making 3 quick blips of the throttle off it's zero point in less than 1 second. This won't move the bike at all because of the way I'm averaging throttle jitter out. I then have the throttle send 3 quick low throttle blips to the controller to let the user know they are in launch mode.

Launch mode is exited as soon as the throttle is moved off the zero point to prevent accidental use and the ability to easily disable it if you decide you don't want to use it. I need to code the programming functions of it next. This mode will have an alternate one shot throttle ramp rate the user sets to allow maximum acceleration. I'm hoping this will allow me to setup my bike for really hard starts without thinking, just mash and go.

It's not really a needed feature, but I have some time to play with this so I figured it would be fun to try out.

Another feature I added was dual buffered throttle outputs so that you can run two controllers off one throttle without if you so desired.
 
All parts are now in for a build of 9 PCB's this weekend. These beta units will be priced at $25 and if there is a positive response and people want a final version the cost will be $35 shipped.
 
im in for one if there are some still available SiR?

KiM
 
Farfle said:
Will they fit inside a controller? Might be a good value added mod.

Depends on the size of the controller, but that's the plan :)

I will reserve them for those who have posted in here and contact you by PM with more info after I have them ready to go. This initial version is not going to have the launch mode, but it does have a replaceable micro in a socket, so I can always send you and update for cheap if you want to try out any new features I'm going to attempted to add. I don't want feature creep to distract from the main purpose of this project.

I am open to suggestions on ways to improve it, add more options. I did look into using an accelerometer for wheelie/launch control, but I'm not sure if it's really worth the additional cost to a production unit. Won't stop me from playing around with it if I want to. I'm trying to keep the costs down as this is not a high ticket item, but I'm going to try and put in some more features.
 
Back
Top