ElectricMotorcycleForum.com

  • March 29, 2024, 11:33:14 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Electric Motorcycle Forum is live!

Pages: [1]

Author Topic: Regen on the throttle, a software only solution  (Read 2287 times)

scrambler

  • Newbie
  • *
  • Posts: 5
    • View Profile
Regen on the throttle, a software only solution
« on: June 23, 2015, 12:42:35 AM »

Hi everyone,

I am new here, and do not own a Zero bike (yet  :)) ), but I do own a KTM Duke II and have been driving a Chevy Volt for the past two years. The Volt was an eye opener on the pleasure of driving an electric vehicle, making me consider to replace my duke by a Zero FX.
One of the pleasure I discovered with the Volt, was the way regen was mapped to the accelerator letting you do “One foot driving” most of the time.

As I started researching the Zero FX, I came across this excellent site where I was happy to find a number of threads on the subject, showing many of you wish to have regen implemented on the throttle. One thing that came up was the Vectrix throttle, which would be a great improvement over having all or nothing regen only. But with a closer look, I think it is not as convenient as the way regen is implemented on the accelerator of electric cars like the volt or the Tesla.

If I understood the Vectrix properly, if you are going 60mph and want to drop to 30mph using regen, you would have to release the throttle completely, twist it the other direction to use regen, then twist it back again to maintain the 30mph.

In Comparison, with the system found on electric cars, you would just untwist the throttle partially to the desired speed level, this would automatically applies an amount of regen proportional to the amount of throttle release until you reach that lower speed, at which point regen would taper off and the throttle be feeding the power necessary for 30mph.
Releasing the throttle a lot (like going from the 60mph position to the 30mph position), the regen would be large, if just going from the 60mph position to 50mph position, the regen would be small.

It seems to me this would be a more natural way of operation, and one that would not require a different throttle. All you would need is a piece of programmable electronic that would receive the throttle and speed signals and output the regen signal based on a simple program. I would assume the onboard computer already receives the throttle and speed information, and already outputs a regen signal, and so could be used to do this.

The basic logic of the Software would be: (more details at the end)

Assuming the throttle goes from 0 to 100 and regen from 0 to 100% (100% being a max regen value you can change as already possible)
• Read the Speed and the throttle position every few milliseconds.
• Compute the Speed to throttle ratio. Ie: If you are going 60mph with the throttle at 80, that ratio is 60/80 = 0.75
• If you turn the throttle back 30 points from the current position (from 80 down to 50).
   o SW generate a 30% regen signal
   o SW computes a target speed of 50x0.75 = 37.5mph
   o When approaching 37.5mph the SW tapers off the regen to zero, throttle is feeding the motor at the 50 level.

This means that by simply decelerating with the throttle, you control both how much regen is used, and how fast it is being applied.

If you turn the throttle back 10 points, only a 10% regen will be applied, if you turn it back 80 points 80% will be applied.
If you turn the throttle back slowly from 80 to 50, it will gradually increase the regen up to 30%. If you turn the throttle back fast the 30% regen will be applied quickly.

It seems to be the most natural way of doing regen on the throttle, and actually matches what happens on my Duke when I decelerate. If I release the throttle a lot I get a lot of engine brake, if I release it a little I only get a little. Benefit here is that you can decide how large or how small is your Max Regen in the base settings, then get on demand progressive regen up to that max by just controlling your throttle deceleration.

Because this is only Software, if the current onboard computer gets throttle and speed information and generates a regen level signal, then Zero could implement it as a software update. If not they would need to modify the current onboard computer connections in future models, but because it would be a software solution, they could make it an option, so that people would have the choice to use that mode or not.


If Zero would be unwilling to offer that option, then someone would have to figure out what kind of programmable piece of electronics could be used and program it. I am fairly sure it is possible, but electronics not being my strong suit, I would not know where to start  :)

I would be curious to hear what you guys think.

--------------------------------------------------------------------------
Below is a more detailed look at what the Software would have to do:
Read the Speed (S) and the Throttle Position (TP) every few milliseconds. Store the last two values of everything and execute the calculations below
• Compute the Throttle Increment (TI) by doing current TP minus last TP . If this number is positive you are accelerating, if negative you are decelerating.
• When TI changes from being positive to negative, Compute the Speed to throttle ratio (R = S/TP).
   Ie: If you are doing 60mph with the throttle at 80, that ratio is 60/80 = 0.75
• If TI is negative (decelerating) Compute the Total Throttle differential (TD) by following the logic below.
   o If the last differential (TD) was already negative, add the new negative increment to it. TD = previous TD + TI
   o If the last differential was positive TD = TI
      Ie: at the first deceleration of the throttle by 3 points, TI = -3 and TD =-3,  keep releasing the throttle another 2 points , TI = -2  & TD = -3-2=-5
• Generate a regen signal corresponding to the TD value.
   Ie: TD=-5  > regen =5%. You would want to ramp up the regen increase.
   As long as you keep turning the throttle back, negative TD will increase and so will the regen
• If TI becomes positive (acceleration) or null (pause), then Compute the Target Speed with TS = TP x R
   Ie: if throttle is stopped at position 50, target speed is 50x0.75 = 37.5mph
• When the Speed gets within a few mile of the target like 35mph, taper regen down to zero
« Last Edit: June 23, 2015, 02:32:54 AM by scrambler »
Logged

evtricity

  • Sr. Member
  • ****
  • Posts: 346
    • View Profile
    • EVTRICITY
Re: Regen on the throttle, a software only solution
« Reply #1 on: June 23, 2015, 03:21:24 AM »

Sounds overly complicated, and confusing to riders. In effect it sounds like you want the throttle to work like a cruise control in an electric car - set it to 20kph slower and the bike will regen until it hits that speed.

Unfortunately you will run out of throttle positions if you want to keep decelerating in 20kph blocks.

The Vectrix throttle allows the rider to control the rate of deceleration and acceleration based on throttle position and is very intuitive. It has a neutral position which the throttle returns to to affect coasting.

Something similar can be done on the Zero throttle by having the first third of the throttle for regen a small flat spot for neutral and the remainder for acceleration. This would require a very smooth transition from acceleration to regen on the controller or a neutral area on the throttle (where the throttle spring still wants to go to regen). This is what electric cars have. This approach limits the degree of regen versus the Vectrix approach because if you released pressure on the standard throttle with a high regen rate (capable of locking the rear wheel in the wet) the bike would be dangerous if you took your hand off the throttle. Not so with the Vectrix throttle whereby if you took your hand off the throttle it would just go to neutral.

For road riding where there tends to be  more coasting the Vectrix throttle works well. For spirited riding or the track where you rarely coast then the latter approach if you can make it smooth would be better.

The Vectrix throttle is heavy, over engineered and finicky to set up and uses a PWM signal which can't be easily read by the Sevcon.

I have been trying to get one working on my Zero for some time but I am, like everyone else it seems just going to give up as it's not worth the effort. It is ok for casual riding but makes it impossible to be on full regen (reverse throttle twist) and pull the right hand brake lever so therefore unsafe with the right brake lever going to the front wheel.

On my Vectrix I actually switched my front brake to the left (which I was used to from bicycle racing) and it was the ideal setup to support full regen and hard front wheel braking, rear wheel braking on full battery and no foot brake. Unfortunately motorcycle riders are used to front brake on the right so there's no chance that my setup would ever go mainstream.

The other alternative is the left hand regen lever which is far superior to the Zero rear brake. Unfortunately the motor can't take the excess heat on the track so I ditched it but for the road it really is very good and much more precise than the on/off regen approach   Zero uses when you first touch the front brake or on neutral throttle. But Zero's approach is simple and works well enough foremost people.

Wow, think I've almost matched the length of your original post!
Logged
2015 Mitsubishi Outlander PHEV
2013 Nissan Leaf

scrambler

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Regen on the throttle, a software only solution
« Reply #2 on: June 23, 2015, 03:53:49 AM »

"Unfortunately you will run out of throttle positions if you want to keep decelerating in 20kph blocks. "

I think I was not clear enough then, or more likely I confused the issue by trying to provide the logic of the SW that would be needed.

All I was saying is that regen would be triggered as soon as you turn back the throttle, proportionally to how much your turn it back and then taper off when you reach the speed of the new throttle position.

This is what actually happens on a regular bike when you turn the throttle back.

On a regular bike, If I am cruising on flat with the throttle fully open, If I suddenly turn it back half way, the bike will slow down by itself to the speed corresponding to the new throttle position (because of the engine brake).

If you do the same on an electric bike without regen on the throttle, it will coast and only slow down by air resistance unless you apply the brakes

With regen applied the way it is with the Zeros, You would need to untwist the throttle completely so regen kicks in, then reapply 50% throttle when you have reached your speed (more work)

So what I was trying to describe was just a way to apply regen that would match the behavior of a bike with engine brake.

And it is feasible as it works really well on electric cars with regen on the accelerator pedal
« Last Edit: June 23, 2015, 04:16:32 AM by scrambler »
Logged

Justin Andrews

  • Hero Member
  • *****
  • Posts: 1032
    • View Profile
Re: Regen on the throttle, a software only solution
« Reply #3 on: June 23, 2015, 01:03:22 PM »

To pull this off the way you want to do it, I suspect you'd need to reprogram both the MBB and the Sevcon.
The MBB looks like its written in c++ (or c) as I've spotted the occasional debug line appearing in the logs coming from a macro which lists the source file, these files are all *.c
However obviously the source is at Zero, and I strongly suspect they won't share it with anyone.
As a result I don't think anyone has really hacked the MBB much yet.

The Sevcon is a *bit* easier to program, being "just" a configuration file. Just programming the sevcon, and hooking up a pot to some unused inputs on the controller you can sort of achieve what you want to do. Its been done before, using a lever/potentiometer to feed the regen level into the Sevcon. The throttle itself wires into the MBB and then the MBB communicates throttle position to the Sevcon.

Of course in programming the Sevcon there remains a wrinkle, you need a fairly expensive bit of kit to do so.

If you search the forums you'll find people discussing how they added variable regen to their Zero, and also how to go about reprogramming your Sevcon.
Your throttle idea is a new one, and if you can pull it off I'd be interested to see how you did it.
Logged
Zero 2015 SR (+PT);
Yamaha Diversion 900

scrambler

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Regen on the throttle, a software only solution
« Reply #4 on: June 23, 2015, 10:25:43 PM »

Thanks,
My hope is that at one point Zero will realize that all modern electric cars have implemented this way of doing regen on the accelerator for a reason, which is that it is the most natural way to maximize its use.
EV car drivers have discovered the wonderful benefits of being able to modulate the car speed with one foot using this type of regen, and it so happens Bike riders, especially the ones riding big singles bikes with a lot of engine brake have been enjoying it forever :)

So being a SW solution that could be optional and require no specific Hardware, it would seem like a low hanging fruit for an Electric bike company willing to offer the best possible features on something as important as regen.

As for attempting it myself, I would first need to have a Zero :) , but even then, I am afraid it is beyond my reach. Attempting to mess with the existing MBB and code also seems quite risky. For a homemade solution to be reasonably accessible and safe, I would hope there would be a way to build an external system independent from the MBB, that would just tap into the bike to get throttle and speed info, and generate the regen signal.

Time will tell :)
Logged

togo

  • It's like flying. But with more traction.
  • Hero Member
  • *****
  • Posts: 1638
    • View Profile
Re: Regen on the throttle, a software only solution
« Reply #5 on: May 07, 2016, 01:17:13 AM »



Um, I have custom mode on my 2014 Zero SR, programmed for throttle-off to do "50%" regen and brake-light programmed for "100%" regen.  It's not proportional, but it behaves enough like the engine-braking and shift-down braking to do the job pretty well and I do most of my riding with very little friction braking.

As others have pointed out, "100%" in the app maps to 10% on the Sevcon, and the brake-lever control is way more sophisticated and proportional and like you say there would be other ways of doing it in software, but it does actually work pretty well.

Logged
our knowledge about Zeros collects here: https://zeromanual.com/

Kocho

  • Hero Member
  • *****
  • Posts: 552
    • View Profile
Re: Regen on the throttle, a software only solution
« Reply #6 on: May 07, 2016, 01:24:13 AM »

There are restrictions on how much regeneration the bike's electronics and batteries can handle. I would agree that a little more aggressive maximum regeneration option would be desirable and probably doable with software only. But much more than that would require much beefier electronics and a battery that can handle high currents in excess of what it can handle today (by adding a super capacitor or some new battery chemistry or on the fly series to parallel reconfiguration - all of these seem unreasonable to expect to happen any time soon on a relatively low-cost motorcycle)...
Logged
'15 Zero SR

DPsSRnSD

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: Regen on the throttle, a software only solution
« Reply #7 on: May 07, 2016, 01:37:05 AM »

Maybe I don't understand what's desired here, but I saw the phrase "one foot driving". ECO mode is very much like this. I almost don't use the brakes when I'm in ECO mode, which is why I like it for the rain. If I have good traction, in ECO mode the bike, in fact, nearly comes to a full stop too far away from where I want to stop, and I have to give it a little throttle to coast up. For the dry, I use a CUSTOM setting of about 40 or 45% of throttle regen because more makes it difficult to keep a desired speed as I try to rest my wrist or go over bumps in the road.
« Last Edit: May 07, 2016, 02:04:29 AM by DPsSRnSD »
Logged
2020 Zero SR/S
Previously: 2016 Zero SR

Kocho

  • Hero Member
  • *****
  • Posts: 552
    • View Profile
Re: Regen on the throttle, a software only solution
« Reply #8 on: May 07, 2016, 01:49:21 AM »

Also, the regenerative braking on the Zeros seems to let go around 10-12mph, so I still have to use the friction brakes to come to a complete stop. In contrast, on a Vectrix I could stop completely with regen braking alone - it would continue to decelerate strongly even at low speed down to a complete stop. Of course, once stopped, there is no regen, so I still have to hold the brake if I am on an incline.

For my SR I have so far selected about half-power regen when I let go off the throttle and full regen with the brake lever. Seems to work best for me.

Also, for those who select 0 regen in custom mode on the throttle, does the bike coast for you? For me it seems to quite noticeably decelerate this way. Slower than when I have some regeneration selected, but definitely not just coasting freely. No regen bars show in this situation on the display...
Logged
'15 Zero SR

BrianTRice@gmail.com

  • Unofficial Zero Manual Editor
  • Hero Member
  • *****
  • Posts: 4014
  • Nerdy Adventurer
    • View Profile
    • Personal site
Re: Regen on the throttle, a software only solution
« Reply #9 on: May 07, 2016, 02:35:17 AM »

Also, the regenerative braking on the Zeros seems to let go around 10-12mph, so I still have to use the friction brakes to come to a complete stop. In contrast, on a Vectrix I could stop completely with regen braking alone - it would continue to decelerate strongly even at low speed down to a complete stop. Of course, once stopped, there is no regen, so I still have to hold the brake if I am on an incline.


The manufacturer disables regen below ~15 mph for various reasons (slight efficiency hit and probably some potential misbehavior is possible), but I've used an OBD port plugin to change that setting and it works fine for me on a 13DS and now 16DSR.
Logged
Current: 2020 DSR, 2012 Suzuki V-Strom
Former: 2016 DSR, 2013 DS

scrambler

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Regen on the throttle, a software only solution
« Reply #10 on: May 07, 2016, 06:19:49 AM »

Maybe I don't understand what's desired here, but I saw the phrase "one foot driving". ECO mode is very much like this. I almost don't use the brakes when I'm in ECO mode, which is why I like it for the rain. If I have good traction, in ECO mode the bike, in fact, nearly comes to a full stop too far away from where I want to stop, and I have to give it a little throttle to coast up. For the dry, I use a CUSTOM setting of about 40 or 45% of throttle regen because more makes it difficult to keep a desired speed as I try to rest my wrist or go over bumps in the road.

The true translation of the one pedal driving like available on the Volt, would be for regen to be activated as soon as you untwist the throttle (in a progressive and proportional fashion). If you are doing 100 miles per hour with the throttle twisted all the way, if you would be to untwist it only half way to drop to 50mph, regen would kick in to slow the bike down to that speed and taper as you get there.

This is what truly happens with engine brake, as soon as you turn back some of the throttle, you get some engine brake.
Logged
Pages: [1]