Linear Regen Braking for On/Off Regen Controllers

Get all your technical information about electric bikes here.
Post Reply
User avatar
amberwolf   100 GW

100 GW
Posts: 25475
Joined: Aug 17 2009 6:43am
Location: Phoenix, AZ, USA, Earth, Sol, Local Bubble, Orion Arm, Milky Way, Local Group
Contact:

Linear Regen Braking for On/Off Regen Controllers

Post by amberwolf » Apr 09 2010 6:00pm

While I was responding to a thread over on DIYEC, I had a sudden thought about how to get linear (or at least analog) regen braking on controllers that only have on/off style regen braking control. It may have been thought of and tried before, but in a half hour-ish of searching I haven't found it here on ES, at least. Probably used the wrong keywords. :)

I'm sure it doesn't work with all controllers, and it might not work with any of them. I'll try it out once I have the time to do it, and get my Fusin motor's freewheel disabled correctly or receive the one from Dogman. I'll probably use the 2QD, since I already have it apart with it's power stage removed and setup as external to it's control board.


Basically, it just uses a PWM circuit controlled by the brake lever so that the harder you squeeze the lever the higher the dutycycle is. That PWM signal would be fed to the brake input of the controller. Then the brake would be pulsed and only regen as much as you like. The controller would be set for a max regen of whatever max you normally want to have, and left that way.

The device would basically be like a very small motor controller but with no power-output stage. You could in fact use a small brushed scooter controller for this, and simply remove it's power output stage, tapping directly onto the gate output signal from it's control chip to provide the braking output PWM. The brake lever's pot or hall would go to the throttle input of the scooter controller. Any of the zillion other types of DIY PWM controllers would also work, just leaving off any power stage, and using something to buffer the PWM output signal to ensure it is within the voltage range of the brake input on your motor controller.

The brake lever itself would need to have either a linear hall (like a throttle) or pot setup on it, since it seems most (perhaps all) of the pre-made ebrake levers have switching halls (like motors) from the factory. There are a few threads about doing this, including this one I found in my search today:
http://www.endless-sphere.com/forums/vi ... 50&start=0

It would not affect your mechanical brakes, which would still engage the same way they used to.

Just setup the hall or pot you use to control the amount of regen so that it engages regen before engaging the mechanical brakes, so most of your deceleration is always going into regen rather than wasted as heat in the discs/rims/pads, but when you slam the brakes on you'll still get full regen as well as full mechanical braking.

How well this would work depends on how well your controller can handle pulsing the brake line. If it has any kind of integration/ramping on it's brake input, this will probably not work, or at least not well.

User avatar
BrandonB   10 W

10 W
Posts: 72
Joined: Feb 19 2009 11:06pm
Location: Shelby, NC
Contact:

Re: Linear Regen Braking for On/Off Regen Controllers

Post by BrandonB » Apr 10 2010 12:42am

To make it even simpler, what would you think about doing this with another throttle handle instead of the brake lever, a la Vecrix scooter? A custom brake lever would have to be made or be made to work with a hall sensor, but you could simply mount a right handed full twist throttle on the left side for it to work Vectrix style, twisting forward on it according to how much braking you want. In a very crude sense, couldn't you also simply use the output of the motor controller to drive a solid state relay that connected the regen wires? The current that passes through the wires is minimal, so the solid state relay could be a very small and inexpensive one. Let me know what you think.

User avatar
amberwolf   100 GW

100 GW
Posts: 25475
Joined: Aug 17 2009 6:43am
Location: Phoenix, AZ, USA, Earth, Sol, Local Bubble, Orion Arm, Milky Way, Local Group
Contact:

Re: Linear Regen Braking for On/Off Regen Controllers

Post by amberwolf » Apr 10 2010 1:30am

There's no problem using whatever control device you wish for the PWM's control input. The only reason I would want it on a brake lever is that I want it to happen when I brake normally, without dealing with any other controls than what I am used to. :)

I could learn to operate a separate regen control, but what I myself want is something that if the regen fails for any reason (blown motor, controller, etc) I still can just squeeze harder and get mechanical braking, because if I'm in a hurry to stop, then by the time I can tell regen isn't slowing me and move my hand to the other control, it could be too late.

That might not be true of other pople, but I'm pretty slow-reacting. :)

So my plan is to simply first test using a throttle control, but later to replace an ebrake's switching hall with a linear one, and see if that will work or not. It should.


I am unsure of what you mean about the SSR connecting the regen wires. There are no regen wires to connect; all that is handled via the regular motor controller itself. Unless you mean using the SSR to perform the PWM of the regen input, using the motor controller's output as the PWM source.

If you mean using the regular motor controller for the bike's PWM output, that won't work, because you need to be able to control the PWM rate using the brake controller (lever/etc). Also, I'm guessing that most motor controllers actually stop PWM generation while brake input is active.


If you mean using the PWM output of a second controller to switch the SSR, you could, but I am not sure what reason there would be for investing that much in parts for it--even small SSRs cost more than small-signal optocouplers or transistors, which would work fine for this.

A small PWM circuit (like a TLC7555-based one) can be made to run off the power from a hall-based brake line, and toggle the input to that brake line with no other devices between them, most likely.

If desired, a completely separate PWM controller can be used, and an optocoupler or transistor used to switch the hall brake input. This is what I will probably use to test the theory, since I already have one with it's power section detached. I just have to get my motor able to do regen first.

User avatar
ZapPat   10 kW

10 kW
Posts: 968
Joined: Jun 28 2008 1:24pm
Location: Eastern Canada (Gaspésie)

Re: Linear Regen Braking for On/Off Regen Controllers

Post by ZapPat » Apr 10 2010 9:09am

Amberwolf - I've been thinking along these lines too for a while now, wanting *badly* to have good, variable (analog) braking controlled by a modified hall brake lever like you linked to above.

However I only have infinion/116 type controllers here and I'm pretty sure they have too much a reaction delay to be good for doing regen pulse modulation. Maybe others might be better, but I have a hunch that it might only be logic-chip based [oldschool] controllers that might work with your idea, as there would be no software delays/processing happening to slow reaction time down.

Instead I was thinking of using the infinion/116's programmable "regen throttle" (ie no coasting ie annoying) feature to possibly achieve this. For this to work, this feature has to be able to be turned on/off using a switch on one of the control pads like BK or EBS-, but I haven't tried it yet. If we can turn it on/off on the fly using one of these input pads and the right settings, we could then wire both hall throttle's ouputs in parallel using a diode/transistor/FET to disconnect the acceleration throttle line while the brake lever is used(so the two analog halls output's don't "fight" each other). Et voilà, a variable regen brake lever! That's if we *can* toggle the throttle regen feature via a switch... will check soon, but maybe someone knows already?

EDIT: As I finished writing this and re-read it, I found a problem with my own idea... the controller wouldn't coast while in throttle-regen mode (brake lever in use), and so the additional brake lever would not function correctly as it could still make the bike accelerate... :oops: Oh well... I tried!

User avatar
gwhy!   100 kW

100 kW
Posts: 1099
Joined: Jan 13 2009 8:32am
Location: UK, Bristol

Re: Linear Regen Braking for On/Off Regen Controllers

Post by gwhy! » Apr 10 2010 11:55am

ZapPat wrote:Amberwolf - I've been thinking along these lines too for a while now, wanting *badly* to have good, variable (analog) braking controlled by a modified hall brake lever like you linked to above.

However I only have infinion/116 type controllers here and I'm pretty sure they have too much a reaction delay to be good for doing regen pulse modulation. Maybe others might be better, but I have a hunch that it might only be logic-chip based [oldschool] controllers that might work with your idea, as there would be no software delays/processing happening to slow reaction time down.

Instead I was thinking of using the infinion/116's programmable "regen throttle" (ie no coasting ie annoying) feature to possibly achieve this. For this to work, this feature has to be able to be turned on/off using a switch on one of the control pads like BK or EBS-, but I haven't tried it yet. If we can turn it on/off on the fly using one of these input pads and the right settings, we could then wire both hall throttle's ouputs in parallel using a diode/transistor/FET to disconnect the acceleration throttle line while the brake lever is used(so the two analog halls output's don't "fight" each other). Et voilà, a variable regen brake lever! That's if we *can* toggle the throttle regen feature via a switch... will check soon, but maybe someone knows already?

EDIT: As I finished writing this and re-read it, I found a problem with my own idea... the controller wouldn't coast while in throttle-regen mode (brake lever in use), and so the additional brake lever would not function correctly as it could still make the bike accelerate... :oops: Oh well... I tried!
This is the way i was thinking of, it should not really be a problem with just a little bit of additional circuitry.

User avatar
ZapPat   10 kW

10 kW
Posts: 968
Joined: Jun 28 2008 1:24pm
Location: Eastern Canada (Gaspésie)

Re: Linear Regen Braking for On/Off Regen Controllers

Post by ZapPat » Apr 11 2010 8:49am

gwhy! wrote:
ZapPat wrote:Amberwolf - I've been thinking along these lines too for a while now, wanting *badly* to have good, variable (analog) braking controlled by a modified hall brake lever like you linked to above.

However I only have infinion/116 type controllers here and I'm pretty sure they have too much a reaction delay to be good for doing regen pulse modulation. Maybe others might be better, but I have a hunch that it might only be logic-chip based [oldschool] controllers that might work with your idea, as there would be no software delays/processing happening to slow reaction time down.

Instead I was thinking of using the infinion/116's programmable "regen throttle" (ie no coasting ie annoying) feature to possibly achieve this. For this to work, this feature has to be able to be turned on/off using a switch on one of the control pads like BK or EBS-, but I haven't tried it yet. If we can turn it on/off on the fly using one of these input pads and the right settings, we could then wire both hall throttle's ouputs in parallel using a diode/transistor/FET to disconnect the acceleration throttle line while the brake lever is used(so the two analog halls output's don't "fight" each other). Et voilà, a variable regen brake lever! That's if we *can* toggle the throttle regen feature via a switch... will check soon, but maybe someone knows already?

EDIT: As I finished writing this and re-read it, I found a problem with my own idea... the controller wouldn't coast while in throttle-regen mode (brake lever in use), and so the additional brake lever would not function correctly as it could still make the bike accelerate... :oops: Oh well... I tried!
This is the way i was thinking of, it should not really be a problem with just a little bit of additional circuitry.
Hummm... what kind of circuitry were you thinking about, gwhy? I can't see what kind of circuitry that could easily turn the controller's regen-on-throttle mode into a regen-only mode (while using the brake lever).

If we had access to the firmware, we could just change the FET's switching scheme while in throttle-regen mode to turn it into a regen-only mode (it would then not act as an accelerator anymore in this mode, which is the problem). Just change the synchronous switching scheme used in this mode into a regular single-FET switching scheme would achieve this (switching only the low side FETs instead of the high side FETs as during drive mode).

User avatar
gwhy!   100 kW

100 kW
Posts: 1099
Joined: Jan 13 2009 8:32am
Location: UK, Bristol

Re: Linear Regen Braking for On/Off Regen Controllers

Post by gwhy! » Apr 11 2010 11:59am

I was thinking along the lines of the hall lever also having the switch to enable disable the throt regen, and the addition of some (OR) logic . I still haven't played with any plug/re-gen braking on any of these controllers yet, So I may be well off ( I usually am until I really start delving around in stuff :D ).

heathyoung   1 MW

1 MW
Posts: 1542
Joined: May 27 2009 2:01am
Location: Newcastle, Australia

Re: Linear Regen Braking for On/Off Regen Controllers

Post by heathyoung » Apr 13 2010 7:30pm

An option to consider - that I tried and worked well - was to use a PIC microcontroller as a 'progressive regen / braking controller'.

Its basically an overcomplicated brushed motor controller - It takes a progressive brake input (hall throttle), turns off the main throttle (using the brake line) - and drives a mosfet bank that shorts the rectified 3 phase from the hub motor. Also wont allow regen over a certain amount if the battery voltage or regen current is too high (avoids overcharging).
GNG offroad build on Craftworks DHR with 12S2P lipo. Light, balanced, powerful, able to climb a tree.
Project Vectrii (2) - status - Finished. Nope. 38S Leaf cells are next. Now have 2 of them - Averages 50Wh/Klm

User avatar
ZapPat   10 kW

10 kW
Posts: 968
Joined: Jun 28 2008 1:24pm
Location: Eastern Canada (Gaspésie)

Re: Linear Regen Braking for On/Off Regen Controllers

Post by ZapPat » Apr 14 2010 7:14am

heathyoung wrote:An option to consider - that I tried and worked well - was to use a PIC microcontroller as a 'progressive regen / braking controller'.

Its basically an overcomplicated brushed motor controller - It takes a progressive brake input (hall throttle), turns off the main throttle (using the brake line) - and drives a mosfet bank that shorts the rectified 3 phase from the hub motor. Also wont allow regen over a certain amount if the battery voltage or regen current is too high (avoids overcharging).
So your brake lever controls the duty cycle of the MOSFET bank, which is in parallel to your normal controller? And I guess your PICmicro samples the voltage of the battery to decide whether it's safe or not to allow regen braking.

But how do you regulate the regen current (PID loop?), or does it just cut off the regen brake if the battery current goes over a certain amount?

heathyoung   1 MW

1 MW
Posts: 1542
Joined: May 27 2009 2:01am
Location: Newcastle, Australia

Re: Linear Regen Braking for On/Off Regen Controllers

Post by heathyoung » Apr 15 2010 7:02pm

Yep - samples into an ADC for battery voltage, and ADC input into a PID loop for regen current. Regen current wasn't a major issue, I just wasn't sure how much there would be at 'full lock' into the batteries.
GNG offroad build on Craftworks DHR with 12S2P lipo. Light, balanced, powerful, able to climb a tree.
Project Vectrii (2) - status - Finished. Nope. 38S Leaf cells are next. Now have 2 of them - Averages 50Wh/Klm

User avatar
ZapPat   10 kW

10 kW
Posts: 968
Joined: Jun 28 2008 1:24pm
Location: Eastern Canada (Gaspésie)

Re: Linear Regen Braking for On/Off Regen Controllers

Post by ZapPat » Apr 16 2010 11:25am

heathyoung wrote:Yep - samples into an ADC for battery voltage, and ADC input into a PID loop for regen current. Regen current wasn't a major issue, I just wasn't sure how much there would be at 'full lock' into the batteries.
That's a pretty sounding cool piece of programing work, heathyoung!

I'm curious - What's the speed of your ADC sampling and PID loop? And is your current sample taken from the motor side or the battery side of your boost converter? I guess you are switching only the low side FET to get regen-only from your added module, right? If you have any online info about your project, I'd be curious to see it!

Pat

User avatar
amberwolf   100 GW

100 GW
Posts: 25475
Joined: Aug 17 2009 6:43am
Location: Phoenix, AZ, USA, Earth, Sol, Local Bubble, Orion Arm, Milky Way, Local Group
Contact:

Re: Linear Regen Braking for On/Off Regen Controllers

Post by amberwolf » May 03 2010 5:51am


User avatar
spinningmagnets   100 GW

100 GW
Posts: 10731
Joined: Dec 21 2007 10:27pm
Location: Ft Riley, NE Kansas

Re: Linear Regen Braking for On/Off Regen Controllers

Post by spinningmagnets » Sep 22 2015 9:39pm

Cross-posting a helpful link in this thread subject:

"linear hall sensor for brake lever - really easy"
https://endless-sphere.com/forums/viewt ... 50&start=0

Post Reply