Throttle interface for sensitive high power setups

zombiess

10 MW
Joined
Jan 31, 2011
Messages
3,048
Location
Oklahoma City
So I've noticed that there are no really good throttles for ebikes that allow for easy enough control of a high power setup. They all seem to have a 80 degree rotation from off to WOT. Since I have a background in electronics and micro-controller programming I figured I'd build something to help the community out and hopefully make me a little profit to support my ebike habit. It's really pretty easy and I've got the hardest part done already, converting the 0-5V signal to digital, processing it, then converting it back to 0-5V, that took all of 2 hours and I haven't done any programming in 5 years so I had to relearn how to do SPI. Since I'm not currently doing an processing on it the sample rate is pretty high right now with 5700K samples/changes per second so no delay will be noticeable.

I want to know what you guys think would be some good features. It's probably going to have a removable LCD interface to program it so I can keep it small.

Some of the features I'm thinking of implementing are:
-programmable low voltage start point and high voltage end point to eliminate dead spots on all throttle types with resistors or any other tricks.
-Expanding the throttle range by using "paddle shifters", either one or two micro switches you could click to increase/decrease the throttle range for finer control. Letting off the throttle below a certain point would cut the voltage so you don't accidentally keep accelerating when you mean to stop.
-ability to set the number of steps each click increases the throttle range
-ability to set the throttle to linear or exponential for finer control at lower speeds
-ability to use just one switch for TPS step changes, 1 click step up a TPS range, 2 quick clicks step down a range
-holding the switch will bypass the settings so you can get full range/power if you need it in an emergency
-delayed ramp in mode, soft start to prevent jerking
-work with hall or resistive throttle
-Possible RC drive? I've worked with servos before so it's pretty easy to output the necessary pulses along with the voltage.
-could do a multitude of outputs/inputs if there is a want, analog or digital.

I can make this as simple (no LCD, just some potentiometers to set values) or as complex (menu driven settings) as I want. I hate how touchy my throttle is, even when using the 3 speed switch. I'd like to be able to run it in 110% mode all the time and just click a button to increase the TPS value instead of only having 3 switches, this will make riding at different speeds much easier and more relaxing since you can just hold WOT all the time.

Anyone have an interest in a device like this? It should work with both speed and current based setups since I'm only manipulating the TPS voltage.

I've developed some much more complex projects like my home made full featured menu driven vario which measured ascent/descent/altitude (within 5 ft) based on air pressure and used it for thermalling with my paraglider. When dealing with LCD's the hardest part is building a good menu system but I've already done several of them. This will be all character based LCD to keep cost and complexity down, no graphic LCD. I'm also using Microchip 18F series Pic processors.

I'm programming this all in Basic using Proton Plus which compiles to fast MPASM machine code (not slow tokenized crap been there done that) with full interrupt capabilities (I love interrupts).

I'm also open to other project ideas as long as there is interest from the community. I was going to do a programmable parallel cell monitor (really easy), but I don't know if there is much demand for that now that Methods is selling his boards.
 
This would be a very useful addition, I have just finished a throttle interface to my own spec but some people wanted additional features so it may pay you to have a quick look through this thread ( about halfway down the page ) to get some idea what people will want. http://endless-sphere.com/forums/viewtopic.php?f=2&t=31889&start=45
 
A good start would be getting more of the throttles I got from Knuckles a few years ago. They're the only one I've had with at least double the range of motion and engagement, and I have drastically less twitchiness with the one of those I have left compared to all of the other throttles I have with the short twist range.

Maybe we can come up with a simple hack just to increase the twist range, since even Magura's are short twist.

Of course, we still need the current control throttle that's been in process for years by some, which is the real answer...a proper throttle control to begin with.
 
Any Stealth Bomber owner will want one, the bike is a beast to start from a stop. The Magura's have been replaced by Stealth as they would surge in the mid range, replaced by "the throttle of death" we call it...lol The smallest touch and you wheelie and thats not good in city riding. I will want one and Stealth will want one for every bike sold if the price is right I'll bet.

Email John at Stealth and put me on your list. I don't need fancy, just a throttle that makes you feel like your in control and not wondering what the bike will do next.
 
John in CR said:
A good start would be getting more of the throttles I got from Knuckles a few years ago. They're the only one I've had with at least double the range of motion and engagement, and I have drastically less twitchiness with the one of those I have left compared to all of the other throttles I have with the short twist range.

Maybe we can come up with a simple hack just to increase the twist range, since even Magura's are short twist.

Of course, we still need the current control throttle that's been in process for years by some, which is the real answer...a proper throttle control to begin with.

I looked all around and didn't see any like this. Know of any suppliers?

gwhy! said:
This would be a very useful addition, I have just finished a throttle interface to my own spec but some people wanted additional features so it may pay you to have a quick look through this thread ( about halfway down the page ) to get some idea what people will want. http://endless-sphere.com/forums/viewtopic.php?f=2&t=31889&start=45

Thanks gwyh!, I didn't realize you did an external throttle interface. Just read more of your controller thread. After looking at the graphs between linear and log response just going log adds a lot more control in the low range. When riding my small bike which has a really touchy throttle I thought it would be nice to have a control to step the throttle ranges. I also hate having to be so careful about getting back on the throttle when apexing a corner, a little too much throttle and it upsets the bike or starts to wheely.

Paul_G said:
Any Stealth Bomber owner will want one, the bike is a beast to start from a stop. The Magura's have been replaced by Stealth as they would surge in the mid range, replaced by "the throttle of death" we call it...lol The smallest touch and you wheelie and thats not good in city riding. I will want one and Stealth will want one for every bike sold if the price is right I'll bet.

Email John at Stealth and put me on your list. I don't need fancy, just a throttle that makes you feel like your in control and not wondering what the bike will do next.

This is exactly the kind of problem I want to fix. Do you have a s/n or email for him? I'll send him an email asking what he would like.

I will admit I do get hung up in feature creep when I start projects so I'm trying to nail down the features first and then just stick to them. I'm not 100% on doing a LCD interface yet because simple is good and a couple of pots might be able to do the job instead of my "give 100% control" approach. Each has it's pluses and minuses. Good news is I can develop most of the features before deciding what I want to do since I can simulate everything in Proteus VSM.
 
John's email at Stealth is

info@stealthelectricbikes.com.au

And I would be happy to test one and offer feed back if you don't have a Bomber kicking around :)
 
zombiess said:
John in CR said:
Of course, we still need the current control throttle that's been in process for years by some, which is the real answer...a proper throttle control to begin with.

I looked all around and didn't see any like this. Know of any suppliers?

The Cycle Analyst (large screen) has a Current Control Throttle option. It works, but only about half as well as I would like it to (underdamped control). This is discussed here:
http://endless-sphere.com/forums/viewtopic.php?f=2&t=31518

The big challenge* is that BLDC controllers are effectively speed controllers - they interpret the throttle input as a commanded speed, and they will put out their rated power until you reach that speed. What we want is a torque controller, like an ICE throttle. This requires a control system in between the throttle and the BLDC controller. PID would be nice, but the CA only does PI, hence the oscillations.

Alternatively, if you could just make a better throttle, just a speed controller but with a log curve and more twist, maybe we will all just learn how to use them, and forget about ICE's.

*as I see it... I'm an ME, so controllers are just black boxes to me :)
 
I think it's a good idea. I've been thinking about something like this ever since I saw that video from LFP with that guy looping out after barely even looking at the throttle.

I like your MC approach...but I had been thinking about something much simpler..like an analog ramp circuit...but only ramp on the voltage rise. I'd use a pot to set the linear ramp.

In your MC approach...maybe have some control over ramp rates. Also, maybe tie in a accelerometer and throw in some anti-wheelie logic.
 
Code to scale output voltage by the throttle position 0-100% between two user selectable min and max output voltages is complete.

Just need to decide on how to let the user program everything now. I think I'm going to have to use an LCD to make setting this up easy for people. It should probably be removable to keep the size down once it's installed. I don't know of any other way to program many different options without getting cryptic.
 
The secret for success is going to be: make it cheap, simple, and reliable.
People aren't gonna pay $100 for a unit like this.

But it is really interesting and i'd like to see it pulled off.

As for a cell-level monitor, the competition in price is pretty steep.
What i'd really love is a low voltage monitor that looks at each cell and will beep at me.. one that i can turn on/off easily that won't drain a single cell or put a constant parasitic load on my pack 100% of the time.

As for anything else.. good luck competing with the ggoodrum / methods boards on the LVC front unless you can get stuff mass manufacturered.
 
I would vote for a few pots for adjustment if you can swing it, as this is really quick and easy for someone to adjust and try out the result, tweak again, and again etc. Once you go to menus it is a lot slower and makes the adjustment process a lot more time consuming. With pots (depending on the type) you could even adjust it while still riding the bike.

I have a tried two different menu systems for my throttle interface, one via a 16x2 or 8x2 LCD, the other via usb back to a terminal on the PC/MAC. Both work great, especially for settings you only need to set and forget (power limits, wheel size, battery capacity, etc). But for things where you need to iterate to find the right setting (eg. PID gains) it is a bit of a pain. It is also a lot more hassle to wire up a LCD, maybe mount it in an enclosure, make it removable.... Doesn't seem worth the effort, for something that will only typically be used a handful of times.

Really depends on the number of things you need to adjust, and how often you need to adjust them. So decide on the feature list first.

Just my 2 cents worth.

- Adrian
 
neptronix said:
The secret for success is going to be: make it cheap, simple, and reliable.
People aren't gonna pay $100 for a unit like this.

As for anything else.. good luck competing with the ggoodrum / methods boards on the LVC front unless you can get stuff mass manufacturered.

$100 would be cheap for a working throttle on a $10,000.00 bike.
Seems to me $150 would be more in the ball park and you could add options like the LCD for extra.
 
neptronix said:
As for a cell-level monitor, the competition in price is pretty steep.
What i'd really love is a low voltage monitor that looks at each cell and will beep at me.. one that i can turn on/off easily that won't drain a single cell or put a constant parasitic load on my pack 100% of the time.

As for anything else.. good luck competing with the ggoodrum / methods boards on the LVC front unless you can get stuff mass manufacturered.

Cell level monitoring isn't really necessarily for lower voltage battery voltages i.e < 50v, as long as its accurate ( I havent done the maths for higher voltage battery packs so even higher voltages may be ok) .
 
Paul_G said:
$100 would be cheap for a working throttle on a $10,000.00 bike.
Seems to me $150 would be more in the ball park and you could add options like the LCD for extra.

If you are just trying to change the throttle response, and adjust endpoints, an easy and cheap DIY method would be to buy a Arduino Nano for US$17
http://www.dealextreme.com/p/arduino-nano-v3-0-81877.

Then use a simple bit of code like this.

Code:
/*
----------------------------------------

    ES Simple Throttle Interface
    v1
    Author: adrian_sm 
    
    Notes:
    - simple throttle interface
    - takes hall or pot throttle in
    - gives an ESC PPM throttle out signal
    
----------------------------------------
*/

// Add required libraries
#include <Servo.h>              // Used for PPM out throttle signal
#include <stdlib.h>

// Definitions
#define MinThrottleIn 164            // 0.8v = 0.8/5.0*1024 = ~164
#define MaxThrottleIn 820           // 4.0v = 4.0/5.0*1024 = ~820
#define MinESCThrottleOut 1100         // typical min ESC throttle
#define MaxESCThrottleOut 2000         // typical max ESC throttle
#define MinThrottleOut 0.8
#define MaxThrottleOut 4.0

// Initialise Servo
Servo ESCthrottle;

// -------------------------------------
// Pin assignments
// ---------------
#define ThrottleInPin A2            // Connect Hall or Pot throttle input to pin A2 (10-bit)
#define ESCThrottleOutPin 6         // Connected to the ESC throttle output to pin 6
#define ThrottleOutPin 9         // Connect Hall or Pot throttle output to pin 9 (3,5,6,9,10,11 are the PWM pins) (8-bit)
// --------------------
unsigned int throttlePWM;                    // [ms] throttle PWM
unsigned int throttleInRaw;

void setup() {
  pinMode(ThrottleInPin, INPUT);
  pinMode(ESCThrottleOutPin, OUTPUT);
  pinMode(ThrottleOutPin, OUTPUT);
  
  ESCthrottle.attach(ESCThrottleOutPin);
  ESCthrottle.writeMicroseconds(MinESCThrottleOut);
  // zero variables
  throttlePWM = MinESCThrottleOut;
}

void loop() {
  float throttlePercentage;
  throttleInRaw = analogRead(ThrottleInPin);  // Read button throttle

  // Calculate throttle "percentate" 0.0 -> 1.0
  throttlePercentage = (throttleInRaw-MinThrottleIn)/(MaxThrottleIn-MinThrottleIn);

  // Linear throttle response code
  // - replace with custom throttle response code
  throttlePWM = MinESCThrottleOut + throttlePercentage*(MaxESCThrottleOut-MinESCThrottleOut);
  analogWrite (ThrottleOutPin, 256/5*MinThrottleOut+throttlePercentage*(MaxThrottleOut-MinThrottleOut));

  // log throttle response
  // - uncomment as required
  // throttlePWM = MinESCThrottleOut + log10((throttlePercentage*9)+1)*(MaxESCThrottleOut-MinESCThrottleOut);
  // analogWrite (ThrottleOutPin, 256/5* MinThrottleOut+log10((throttlePercentage*9)+1)*(MaxThrottleOut-MinThrottleOut));

  // Write out the new throttle PWM
  ESCthrottle.writeMicroseconds(throttlePWM);  
  
}
Once wired up it will power up from your throttle 5v, take a hall or pot throttle in, and output a signal for both an ebike or RC ESC type controller.

I have included linear and log throttle curves, but you could easily put in what ever code you want.
It is programable via free software, compatible with PC or MAC, via USB.

And it has a lot of headroom left to do a whole lot more if you like to tinker. Like temp sensors, SD data logging, LCD displays, battery voltage/current, PID control loops whatever.

- Adrian

P.S. I haven't tested this code, I just hacked it together from other code I had laying around.

[EDIT] Fixed 5v Throttle out code, and added schematic showing how it just go inline with the throttle wires (shown with RC ESC output pin connected)
 

Attachments

  • ES_Simple_Throttle_Interface_v1.png
    ES_Simple_Throttle_Interface_v1.png
    11.4 KB · Views: 8,357
neptronix said:
The secret for success is going to be: make it cheap, simple, and reliable.
People aren't gonna pay $100 for a unit like this.

Same goals I'm after myself, I'm trying to avoid doing any kind of LCD and menus for cost/complexity reasons, but there are a several variables that need to be set by the end user. The only other solution I can think of is to have the end user use a volt meter for setup. I can then send to to someone with some safe default settings and then they can adjust them if they want or need to. This will of course come with some good directions.

I'm not thinking of anywhere near a $100 price, but I need to nail down a parts list, pcb cost (should be cheap based on things I've done in the past) and assembly time (I want to keep this low since I hate doing monotonous work).
 

I'm a bit confused by this thread, since some here use Lyen controllers which include a 3 selector switch.

I programmed my Lyen controller for my 132V x5304 to have a speed selection of 40%/95%/120% throttle for each switch setting. At a 40% selection the throttle can be adjusted so fine at the low end that I can put it cruise control at a walking pace where it won't even register above 0 MPH on the CA (The wheel RPM is approx 30RPM, which is slow). At 120%, my WOT is about 57 MPH on the road. If I have it at 120% at a stop and try to give it a little throttle, it starts a burnout. So, I start of in the 40% switch mode and switch to higher switch settings as I need to.

Perhaps that's too complex for commuting, but the switch is right there next to the throttle, so it's easy to get used to.

Also, I realize that a lot of people do not have the 3 speed switch option, so a solution as described in prior posts seem reasonable.
 
Floont said:

I'm a bit confused by this thread, since some here use Lyen controllers which include a 3 selector switch.

I programmed my Lyen controller for my 132V x5304 to have a speed selection of 40%/95%/120% throttle for each switch setting. At a 40% selection the throttle can be adjusted so fine at the low end that I can put it cruise control at a walking pace where it won't even register above 0 MPH on the CA (The wheel RPM is approx 30RPM, which is slow). At 120%, my WOT is about 57 MPH on the road. If I have it at 120% at a stop and try to give it a little throttle, it starts a burnout. So, I start of in the 40% switch mode and switch to higher switch settings as I need to.

Perhaps that's too complex for commuting, but the switch is right there next to the throttle, so it's easy to get used to.

Also, I realize that a lot of people do not have the 3 speed switch option, so a solution as described in prior posts seem reasonable.

This is what I have been using upto now but I found it to be still very on/off and no good for technical riding, and my bike is only geared for 25mph, its fine for normal road riding but no good for very good throttle control. When my bike was geared for around 40mph then yes there was no need for these options ( for me anyway ).
 
zombiess said:
neptronix said:
The secret for success is going to be: make it cheap, simple, and reliable.
People aren't gonna pay $100 for a unit like this.

Same goals I'm after myself, I'm trying to avoid doing any kind of LCD and menus for cost/complexity reasons, but there are a several variables that need to be set by the end user. The only other solution I can think of is to have the end user use a volt meter for setup. I can then send to to someone with some safe default settings and then they can adjust them if they want or need to. This will of course come with some good directions.

I'm not thinking of anywhere near a $100 price, but I need to nail down a parts list, pcb cost (should be cheap based on things I've done in the past) and assembly time (I want to keep this low since I hate doing monotonous work).

What if you used (5) 10-turn pots that corresponeded to the throttle output at 20%, 40%, 60%, 80%, and 100%, and just did linear interpolation between those? It would require a lot of tinkering to tune, but it would get you what you're after.
 
gwhy! said:
neptronix said:
As for a cell-level monitor, the competition in price is pretty steep.
What i'd really love is a low voltage monitor that looks at each cell and will beep at me.. one that i can turn on/off easily that won't drain a single cell or put a constant parasitic load on my pack 100% of the time.

As for anything else.. good luck competing with the ggoodrum / methods boards on the LVC front unless you can get stuff mass manufacturered.

Cell level monitoring isn't really necessarily for lower voltage battery voltages i.e < 50v, as long as its accurate ( I havent done the maths for higher voltage battery packs so even higher voltages may be ok) .

Erm.... what? you can overdischarge lithium cells no matter what the cell count is..
 
neptronix said:
gwhy! said:
neptronix said:
As for a cell-level monitor, the competition in price is pretty steep.
What i'd really love is a low voltage monitor that looks at each cell and will beep at me.. one that i can turn on/off easily that won't drain a single cell or put a constant parasitic load on my pack 100% of the time.

As for anything else.. good luck competing with the ggoodrum / methods boards on the LVC front unless you can get stuff mass manufacturered.

Cell level monitoring isn't really necessarily for lower voltage battery voltages i.e < 50v, as long as its accurate ( I havent done the maths for higher voltage battery packs so even higher voltages may be ok) .

Erm.... what? you can overdischarge lithium cells no matter what the cell count is..

What I'm saying is at upto around 12s even if only 1 cell is is lower than it should be (not hot off the charger but in use, I always check the voltage of my battery pack before I use them anyway ) the lvc will cut off to save the rest of the cells ( I know paralleled cells may suffer but the chances of even a bms saving individual cells are slim ). I am referring to my battery monitoring setup on my throttle interface.
 
adrian_sm said:
If you are just trying to change the throttle response, and adjust endpoints, an easy and cheap DIY method would be to buy a Arduino Nano for US$17
http://www.dealextreme.com/p/arduino-nano-v3-0-81877.

Then use a simple bit of code like this.
[...]
Once wired up it will power up from your throttle 5v, take a hall or pot throttle in, and output a signal for both an ebike or RC ESC type controller.

I have included linear and log throttle curves, but you could easily put in what ever code you want.
It is programable via free software, compatible with PC or MAC, via USB.

And it has a lot of headroom left to do a whole lot more if you like to tinker. Like temp sensors, SD data logging, LCD displays, battery voltage/current, PID control loops whatever.

- Adrian

P.S. I haven't tested this code, I just hacked it together from other code I had laying around.

[EDIT] Fixed 5v Throttle out code, and added schematic showing how it just go inline with the throttle wires (shown with RC ESC output pin connected)

zombiess and adrian_sm, thanks, it's so funny this thread came up just now, I just thinking this weekend of doing the exact same thing -- a little microcontroller between the throttle and the controller to re-adjust the scale and range. I'm using a similar board based on ATmega32u4 called "Teensy." It's even smaller than the Arduino Nano and uses less power, it also costs under $20 and can run a subset of Arduino code (teensyduino). About the size of a quarter, in the simplest configuration (like your schematic Adrian), it might be possible to attach the board directly to the throttle connector and shrink wrap it- wouldn't even know it was there.

For the input/output formula my thought was to use an exponential curve something like this

T_out = C + ( (D-C) * ( ((T_in-A) / (B-A)) ^ 2) )

... where A=input min voltage, B=input max voltage, C=output min voltage, D=output max voltage.

That way it would increase really slowly at the lower end of the range, and ramp up much faster at the higher end of the range -- in other words more sensitive at slow speeds which is what I think I want (without having tried it yet). 1/2 throttle becomes 1/4 throttle, but full throttle is still full throttle.

Could also just incorporate a static 128 byte map from T_in -> T_out, so you could manually draw out the input-to-output curve any shape you want.

Of course once you have the microcontroller, there are a bunch of extra pins as you note, and we can add other features... Like you, I was thinking with a couple of extra wires it would be a great way to implement:
* temp sensors, data logging, LCD display etc as you mentioned
* cruise control
* control or disable the CA's amp/speed limiter and the speed controller's 3-speed-switch
* maybe control them automatically, based on throttle position and bike speed?
* blink control for lights/signals, brake light
* etc?

The Teensy needs ~15 ma. I do have some 5V voltage converters I could use, but was thinking/hoping I could just pull ~15ma from the motor controller's 5V throttle power line, maybe? What do you think? I can't steal power from the CycleAnalyst 5V pad, because it can only provide ~5 ma. I guess I ought to open up my motor controller and see what the specs are on whatever 5V regulator it is using...

Also assuming I can drive the throttle input on the controller directly from a PWM output pin. But maybe a little capacitor and/or pull-down resistor would also be needed... adrian_sm do you have any experience with this?
 
I have implemented temp sensor, SD data logging, LCD, cruise control, power limitting, but for a button throttle & RC ESC, not an ebike controller. And yes it is powered off the ESC BEC 5v. I was also thinking it would be easy to wire in one of the "3-speed" switches (which I believe is just a voltage divider), this could be an easy way to give on the fly selection of different throttle mappings.

- Adrian

P.S. If the OP thinks this is off-topic let us know and we can move this stuff off to a different thread.
 
The micro controller stuff you guys are doing is really cool, but I see the real problem as the limited physical range of the twist. I vaguely recall a hack to lengthen it cutting a bit of plastic and adding an extra magnet or something, but more recently I couldn't find anything.
 
John in CR said:
The micro controller stuff you guys are doing is really cool, but I see the real problem as the limited physical range of the twist. I vaguely recall a hack to lengthen it cutting a bit of plastic and adding an extra magnet or something, but more recently I couldn't find anything.

If there was a way to do this, I'd probably drop this idea because this is the root cause of the problem. I'm much prefer a throttle with more physical range.

I just rode my 26" bike with an 8x8. It has no problems with any surge or being too sensitive at any power setting. The throttle being too touchy is most likely only a problem on high power small diameter wheels. There is a huge difference in the way they behave.
 
Back
Top