Regen torque at 0% throttle?

77 views
Skip to first unread message

John Arkless

unread,
Oct 6, 2020, 3:11:50 AM10/6/20
to GEVCU-Development
Hi folks
I've attempted to configure GEVCU 6 to apply a regenerative torque when the throttle pedal is fully released however have been unable to make that work. All attempts result in zero regen when the pedal is released. It would be nice to have the motor slow down when changing gear (in a manual transmission) so the synchronizer rings have an easier time matching gear speeds :-)
Is anyone able to confirm if this is possible?

Many thanks
John

Collin Kidder

unread,
Oct 6, 2020, 4:09:04 PM10/6/20
to gevcu-development
It's been a while since I dealt with throttle tuning in GEVCU but if I
remember correctly, I think the key is to set your point at which
regen is full to a bit over the actual value it idles at - so that it
gets there a tiny bit early. That way any fluctuation shouldn't affect
it.
> --
> You received this message because you are subscribed to the Google Groups "GEVCU-Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to gevcu-developm...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/gevcu-development/4fecc03e-657f-40fe-8190-574ca0e5b5a6n%40googlegroups.com.

John Arkless

unread,
Oct 12, 2020, 9:19:35 PM10/12/20
to gevcu-de...@googlegroups.com
Am I correct in assuming we're both talking about TRGNMAX ?
Setting this parameter at zero - for maximum regen torque at 0% throttle pedal position, results in no regen at all. If I set TRGNMAX to say 1% which seems to be what you indicated I should do, I have regen until just before I come off the throttle pedal at which point there is abruptly zero regen.



You received this message because you are subscribed to a topic in the Google Groups "GEVCU-Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gevcu-development/jXp3w_iqCVE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gevcu-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gevcu-development/CABBbThCfbWeA8EVtKDYkCeBoQaaoeSA%2BoAEiTpSxWUB%3DLrmQtA%40mail.gmail.com.

John Arkless

unread,
Oct 29, 2020, 2:53:23 AM10/29/20
to gevcu-de...@googlegroups.com
I'm guessing I'm on the wrong track.

Looking at the code (the 'Throttle' sketch) I see that below positionRegenMaximum the regen is simply set to zero which aligns with the driving experience. I'm confident enough to modify the code to set a non-zero value here (in fact there are some commented code that is part-way there already) so to that end, I attempted to build the code as downloaded from Github/Collin80/Gevcu6. I receive the following error message

C:\Users\OEM\Documents\Arduino\libraries\due_wire/due_wire.h:25:10: fatal error: include/twi.h: No such file or directory

I have spent some time attempting to resolve this issue, trying to locate the missing file (I'm presuming this is the cause). I kinda expected the code to compile as downloaded.

Anyone able to help out here?

Thanks

Charles Galpin

unread,
Oct 29, 2020, 9:15:26 AM10/29/20
to gevcu-de...@googlegroups.com
Hi John

See the readme for the full info, but you need to install some additional libraries to build the code, and in this case it’s complaining about due_wire



It’s a bit terse, but the jist of it is

You will need the following to have any hope of compiling and running the firmware:

  • A GEVCU board. Versions from 2 and up are supported.
  • Arduino IDE 1.5.4 - Do not use newer versions of the IDE
  • due_can library - There is a repo for this under Collin80
  • due_rtc library - Also under Collin80
  • due_wire library - once again
  • DueTimer library - and again

All libraries belong in %USERPROFILE%\Documents\Arduino\libraries (Windows) or ~/Arduino/libraries (Linux/Mac). You will need to remove -master or any other postfixes. Your library folders should be named as above.

due_wire can be found here: https://github.com/collin80/due_wire

hth,
charles
p.s. Sorry for not helping out with the actual throttle issue. I don't have a working setup at the moment, and would not wanrt to give advice without trying it first.

Collin Kidder

unread,
Oct 29, 2020, 9:50:19 AM10/29/20
to gevcu-development
Make sure you are compiling for the Arduino Due (Native Port). That
error looks like you're trying to compile for a different processor.
> To view this discussion on the web visit https://groups.google.com/d/msgid/gevcu-development/CAJPY04BGdiUUXi16%2BdQ7bci_bPxoGTEXXTGqscjnaUPeaDeMZQ%40mail.gmail.com.

John Arkless

unread,
Nov 3, 2020, 8:22:28 PM11/3/20
to gevcu-de...@googlegroups.com
Success!
Well, I managed to compile it.
Thanks to both of you for the helpful info.
I guess there may be more questions when I modify the throttle code, we'll see :-)


Michael Neuweiler

unread,
Nov 8, 2020, 2:21:11 PM11/8/20
to gevcu-de...@googlegroups.com

Sorry to join in so late. While you still had the problem, did you check the log output? In case your throttle settings were wrong, it could cause a fault in the PotThrottle / Throttle class. If the reported values are to far out of the specified range, the throttle goes into "fault" mode which likely causes 0 torque.

John Arkless

unread,
Nov 9, 2020, 2:56:14 PM11/9/20
to gevcu-de...@googlegroups.com
Thanks Michael, I don't believe this was the case although I did not check the log output at the time. Looking at the code, the regen torque is set to zero when the throttle position is below positionRegenMaximum
My next step is to modify this code to apply a fixed regen level when the throttle level is below  positionRegenMaximum. This is to assist the synchro's match speeds when I'm changing gear in my manual gearbox. I may even condition it on the clutch pedal being pressed but... baby steps for me.

Michael Neuweiler

unread,
Nov 10, 2020, 1:37:47 PM11/10/20
to gevcu-de...@googlegroups.com

Ah ok, that was another safety feature then.

When you want to shift gears and use only the synchros to adapt the motor speed, it's better to have 0 torque.

I modified the motor controller on my branch so that if I press a switch on the clutch, it gives me 0 torque for 750ms, then adjusts the motor speed to 2500rpm with 15% throttle for 500ms and then gives again 0 torque to allow the synchros to do the rest. 2500rpm is a reasonable speed which usually works fine. Check out https://github.com/neuweiler/GEVCU/blob/master/MotorController.cpp from line 175 and line 264).

My plans are to use the car speed to determine which gear we were in and then adjust the motor speed perfectly. If the pedal was >0%, it means we want to accelerate and thus shift to the next higher gear (e.g. from 4th to 5th) and if the pedal is in idle, we switch to the next lower gear (e.g. from 3rd to 2nd).

Michael Neuweiler

unread,
Nov 10, 2020, 1:44:05 PM11/10/20
to gevcu-de...@googlegroups.com

Forgot to mention the reason for the 0 / 15% / 0 torque cycle: the first one is so that you can shift to neutral, the second is to adjust to 2500rpm which is usually near to a desired motor speed, then the last phase with 0 torque is so that you can use the syncros to adjust the motor speed. You likely wont be able to shift to neutral or another gear while the motor applies any force - even regen.

John Arkless

unread,
Nov 12, 2020, 1:16:40 AM11/12/20
to gevcu-de...@googlegroups.com
That's given me something to think about.
I now have a good understanding how a synchromesh gearbox works 😀
From your description, and reading the code, it sounds like you are changing gear without fully depressing the clutch or using a gear stick button? 
In my case, I intend to use the clutch as normal however I like the idea of matching the gearset speeds to achieve a clean shift.
So I think it should work if I use the clutch and decelerate the motor under regen just like an ICE. Or am I missing something?
Ultimately, a semi-automated gearchange would be fantastic which is where you're headed I believe...

John Arkless

unread,
Dec 6, 2020, 1:06:49 AM12/6/20
to gevcu-de...@googlegroups.com
So this is working now, I simply set a throttleLevel of -200 when the pedalPosition is less than the regen maximum position which provides a nice braking action, almost one pedal driving. Gear change is still somewhat hit and miss but better than without motor regen. 

Seth Miers

unread,
Feb 18, 2021, 10:50:01 PM2/18/21
to GEVCU-Development
Michael,

Did you ever get the smooth transition working for a manual transmission?
I'm just starting to explore the GEVCU code and could use some help, but I'm very curious what you've managed to complete.

I would love your operation where the motor speed is adjusted perfectly.
Reply all
Reply to author
Forward
0 new messages